-
Notifications
You must be signed in to change notification settings - Fork 103
CLOUDP-349340: transient build for generated manifests #2764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
1919b69
generate CRDs transiently
s-urbaniak 61797f5
generate RBAC transiently
s-urbaniak 98147af
remove non-transient entries from config/manifests CSV template
s-urbaniak 90e719d
remove unused RBAC rules
s-urbaniak 5f6427e
add transient files to clean target
s-urbaniak 82caa9d
remove deploy directory
s-urbaniak b37dfa1
remove bundle directory
s-urbaniak d46b28a
add test/e2e/data/ to clean
s-urbaniak fb8fc18
use gen-install-scripts for bundle generation
s-urbaniak ea4ea3d
move transient config files
s-urbaniak d4b855c
removed deprecated and unused controller mgr config
s-urbaniak 9ada13d
depend helm-charts sync on bundle
s-urbaniak c6dbc98
fix crdoc generation
s-urbaniak 6448a46
fix e2e2
roothorp cef0365
fix int and e2e
roothorp f656509
checkout tags in GHA
roothorp b9315db
unshallow fetch
roothorp 092e096
fix int and e2e again
roothorp 2e22e7e
fix e2e2 and helm e2e
roothorp cf2bd4c
deep checkout in helm e2e tests
roothorp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,17 +122,17 @@ jobs: | |
- uses: actions/checkout@v5 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
fetch-depth: '0' | ||
|
||
- name: Install devbox | ||
uses: jetify-com/[email protected] | ||
with: | ||
enable-cache: 'true' | ||
|
||
- name: Generate kustomized all-in-one install configs | ||
uses: ./.github/actions/gen-install-scripts | ||
with: | ||
ENV: dev | ||
VERSION: dev | ||
run: | | ||
devbox run -- make bundle | ||
|
||
|
||
- name: Extract k8s version/platform | ||
id: extract | ||
|
@@ -154,7 +154,7 @@ jobs: | |
run: devbox run -- kubectl version | ||
|
||
- name: Apply CRDs | ||
run: devbox run -- kubectl apply -f deploy/crds | ||
run: devbox run -- make install-crds | ||
|
||
- name: Run CI E2E tests | ||
run: devbox run -- ./scripts/launch-ci-e2e.sh | ||
|
@@ -191,18 +191,18 @@ jobs: | |
- uses: actions/checkout@v5 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
fetch-depth: '0' | ||
|
||
- name: Install devbox | ||
uses: jetify-com/[email protected] | ||
with: | ||
enable-cache: 'true' | ||
|
||
- name: Generate kustomized all-in-one install configs with helm-based image | ||
uses: ./.github/actions/gen-install-scripts | ||
with: | ||
ENV: dev | ||
VERSION: dev | ||
- name: Generate kustomized all-in-one install configs | ||
env: | ||
IMAGE_URL: ${{ needs.prepare-e2e-image.outputs.image_url }} | ||
run: | | ||
devbox run -- make bundle | ||
|
||
- name: Extract k8s version/platform | ||
id: extract | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,10 +191,10 @@ unit-test: manifests | |
go test -race -cover $(GO_UNIT_TEST_FOLDERS) $(GO_TEST_FLAGS) | ||
|
||
## Run integration tests. Sample with labels: `make test/int GINKGO_FILTER_LABEL=AtlasProject` | ||
test/int: envtest | ||
test/int: envtest manifests | ||
AKO_INT_TEST=1 KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) $(GINKGO) | ||
|
||
test/int/clusterwide: envtest | ||
test/int/clusterwide: envtest manifests | ||
AKO_INT_TEST=1 KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) $(GINKGO) | ||
|
||
envtest: envtest-assets | ||
|
@@ -248,8 +248,10 @@ deploy: generate manifests run-kind ## Deploy controller in the configured Kuber | |
.PHONY: manifests | ||
# Produce CRDs that work back to Kubernetes 1.16 (so 'apiVersion: apiextensions.k8s.io/v1') | ||
manifests: CRD_OPTIONS ?= "crd:crdVersions=v1,ignoreUnexportedFields=true" | ||
manifests: fmt ## Generate manifests e.g. CRD, RBAC etc. | ||
manifests: ## Generate manifests e.g. CRD, RBAC etc. | ||
controller-gen $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./api/..." paths="./internal/controller/..." output:crd:artifacts:config=config/crd/bases | ||
touch config/crd/bases/kustomization.yaml | ||
sh -c 'cd config/crd/bases; $(KUSTOMIZE) edit add resource *.yaml kustomization.yaml' | ||
@./scripts/split_roles_yaml.sh | ||
ifdef EXPERIMENTAL | ||
@if [ -d internal/next-crds ] && find internal/next-crds -maxdepth 1 -name '*.yaml' | grep -q .; then \ | ||
|
@@ -305,7 +307,7 @@ validate-manifests: generate manifests | |
$(MAKE) check-missing-files | ||
|
||
.PHONE: sync-crds-chart | ||
sync-crds-chart: | ||
sync-crds-chart: bundle | ||
@cp -r bundle/manifests/atlas.mongodb.com_* helm-charts/atlas-operator-crds/templates/ | ||
|
||
.PHONY: validate-crds-chart | ||
|
@@ -323,11 +325,7 @@ validate-crds-chart: ## Validate the CRDs in the Helm chart | |
|
||
.PHONY: bundle | ||
bundle: manifests ## Generate bundle manifests and metadata, then validate generated files. | ||
@echo "Building bundle $(VERSION)" | ||
operator-sdk generate $(KUSTOMIZE) manifests -q --apis-dir=api | ||
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG) | ||
$(KUSTOMIZE) build --load-restrictor LoadRestrictionsNone config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS) | ||
operator-sdk bundle validate ./bundle | ||
INPUT_VERSION=$(VERSION) INPUT_ENV=prod INPUT_IMAGE_URL=$(IMG) sh ./.github/actions/gen-install-scripts/entrypoint.sh | ||
|
||
.PHONY: image | ||
image: ## Build an operator image for local development | ||
|
@@ -430,6 +428,15 @@ x509-cert: ## Create X.509 cert at path tmp/x509/ (see docs/x509-user.md) | |
|
||
clean: ## Clean built binaries | ||
rm -rf bin/* | ||
rm -rf config/manifests/bases/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit or follow up: make rule |
||
rm -f config/crd/bases/*.yaml | ||
rm -f config/rbac/clusterwide/role.yaml | ||
rm -f config/rbac/namespaced/role.yaml | ||
rm -f config/rbac/role.yaml | ||
rm -rf deploy/ | ||
rm -rf bundle/ | ||
rm -f bundle.Dockerfile | ||
rm -rf test/e2e/data/ | ||
|
||
.PHONY: all-platforms | ||
all-platforms: | ||
|
@@ -548,7 +555,7 @@ clear-e2e-leftovers: ## Clear the e2e test leftovers quickly | |
git submodule update helm-charts | ||
|
||
.PHONY: install-crds | ||
install-crds: ## Install CRDs in Kubernetes | ||
install-crds: manifests ## Install CRDs in Kubernetes | ||
kubectl apply -k config/crd | ||
ifdef EXPERIMENTAL | ||
@if [ -d internal/next-crds ] && find internal/next-crds -maxdepth 1 -name '*.yaml' | grep -q .; then \ | ||
|
@@ -667,7 +674,7 @@ bump-version-file: | |
@cat $(VERSION_FILE) | ||
|
||
.PHONY: api-docs | ||
api-docs: | ||
api-docs: manifests | ||
go tool -modfile=tools/toolbox/go.mod crdoc --resources config/crd/bases --output docs/api-docs.md | ||
|
||
.PHONY: validate-api-docs | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we always want
INPUT_ENV
to be prod?gen-install-scripts
has a check if this is dev. If we always want this to be prod then why set it at all?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script requires that arg. I would leave it as is for now, otherwise you also need to fix that script, and this change is big enough already.