Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,21 @@ parent-proto-generate: ## Make sure ../generated directory has up-to-date conten
[[ $${ROX_OPERATOR_SKIP_PROTO_GENERATED_SRCS:-false} = true ]] || $(MAKE) -C .. proto-generated-srcs

.PHONY: manifests
manifests: parent-proto-generate controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
manifests: parent-proto-generate controller-gen go-mod-download ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases

.PHONY: generate
generate: parent-proto-generate controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
generate: parent-proto-generate controller-gen go-mod-download ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
# The generated source files might not comply with the current go formatting, so format them explicitly.
go fmt ./api/...

.PHONY: go-mod-download
go-mod-download: ## Download modules we depend on, with retries.
# Warm up go module cache so that transient network failures do not abort controller-gen.
# Once downloaded, this command is very quick (~200 ms).
go mod download || go mod download || go mod download

.PHONY: fmt
fmt: ## Run go fmt against code.
go fmt ./...
Expand Down
3 changes: 3 additions & 0 deletions operator/hack/generate-and-install-chart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ echo >&2 "Deploying operator version ${version} from a temporary checkout at ${d
git worktree add "${dir}" "${version}"
trap 'git worktree remove --force "${dir}"' EXIT

# Warm up go module cache so that transient network failures do not abort controller-gen.
# TODO: this command can be removed once the version we upgrade from runs go-mod-download internally.
(cd "${dir}"; go mod download || go mod download || go mod download)
make -C "${dir}/operator" chart deploy-via-chart VERSION="${version}"
Loading