Skip to content
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

Fix deployCrds template rewrite in generated CRD #832

Merged
merged 1 commit into from
Jan 19, 2022

Conversation

somaritane
Copy link
Contributor

  • Fixed the auto-removal of deployCrds logic from CRD manifest by
    controller-gen, the manifest is wrapped with template after generation
  • Added extra helper messages to affected make targets and functions

Signed-off-by: Timofey Ilinykh [email protected]

- Fixed the auto-removal of deployCrds logic from CRD manifest by
  controller-gen, the manifest is wrapped with template after generation
- Added extra helper messages to affected make targets and functions

Signed-off-by: Timofey Ilinykh <[email protected]>
Copy link
Member

@jkremser jkremser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I missed that in #818

@echo -e "\n$(YELLOW)Generating the CRD manifests$(NC)"
@echo -n "{{- if .Values.k8gb.deployCrds }}" > $(GSLB_CRD_YAML)
$(GOBIN)/controller-gen crd:crdVersions=v1 paths="./..." output:crd:stdout >> $(GSLB_CRD_YAML)
@echo "{{- end }}" >> $(GSLB_CRD_YAML)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like it will tamper the git status?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ytsarev not sure I'm following

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@somaritane i've meant from the PoV that it will affect git status after regeneration but it is actually valid in case of API changes. And if there are no API changes in the working tree the GSLB_CRD_YAML file will stay intact. So all good, approving

@echo -e "\n$(YELLOW)Generating the CRD manifests$(NC)"
@echo -n "{{- if .Values.k8gb.deployCrds }}" > $(GSLB_CRD_YAML)
$(GOBIN)/controller-gen crd:crdVersions=v1 paths="./..." output:crd:stdout >> $(GSLB_CRD_YAML)
@echo "{{- end }}" >> $(GSLB_CRD_YAML)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@somaritane i've meant from the PoV that it will affect git status after regeneration but it is actually valid in case of API changes. And if there are no API changes in the working tree the GSLB_CRD_YAML file will stay intact. So all good, approving

@somaritane somaritane merged commit 12771f4 into master Jan 19, 2022
@somaritane somaritane deleted the fix-crd-manifest-generation branch January 19, 2022 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants