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: add applicationset to crds generated by gen-crd-spec #10833

Conversation

richardjennings
Copy link
Contributor

@richardjennings richardjennings commented Oct 6, 2022

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

Signed-off-by: Richard Jennings <richardjennings@gmail.com>
@richardjennings richardjennings force-pushed the gen-crd-spec-missing-applicationset branch from 065166f to 3a039b3 Compare October 6, 2022 18:22
@richardjennings richardjennings changed the title bugfix: add applicationset to crds generated by gen-crd fix: add applicationset to crds generated by gen-crd Oct 6, 2022
@richardjennings richardjennings changed the title fix: add applicationset to crds generated by gen-crd fix: add applicationset to crds generated by gen-crd-spec Oct 6, 2022
@richardjennings richardjennings marked this pull request as ready for review October 6, 2022 18:25
Signed-off-by: Richard Jennings <richardjennings@gmail.com>
@crenshaw-dev
Copy link
Collaborator

Ishita had previously consolidated the Application and ApplicationSet CRD codegen logic. In doing so, we lost the maxDescLen=0 flag on controller-gen.

-func getCustomResourceDefinitions() map[string]*extensionsobj.CustomResourceDefinition {
+func getCRDApplicationset() map[string]*extensionsobj.CustomResourceDefinition {
 	crdYamlBytes, err := exec.Command(
 		"controller-gen",
-		"paths=./pkg/apis/application/...",
-		"crd:trivialVersions=true",
-		"crd:crdVersions=v1",
+		"paths=./pkg/apis/applicationset/...",
+		"crd:crdVersions=v1,maxDescLen=0",
 		"output:crd:stdout",
 	).Output()
 	checkErr(err)

I'm not sure what the proper fix is. We're currently using this one controller-gen command to generate all the CRDs, since they're all located in the same directory.

I wonder if controller-gen takes a glob for the paths param. If so, we could maybe use one controller-gen command (with maxDescLen set) for the ApplicationSet CRD and another invocation for the rest.

Alternatively, we could add a post-processing step to strip the description fields from the AppliationSet CRD.

@codecov
Copy link

codecov bot commented Oct 6, 2022

Codecov Report

Base: 45.67% // Head: 45.67% // No change to project coverage 👍

Coverage data is based on head (a31eb52) compared to base (d8cb04e).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10833   +/-   ##
=======================================
  Coverage   45.67%   45.67%           
=======================================
  Files         236      236           
  Lines       28697    28697           
=======================================
  Hits        13106    13106           
  Misses      13799    13799           
  Partials     1792     1792           
Impacted Files Coverage Δ
util/settings/settings.go 51.25% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@richardjennings richardjennings force-pushed the gen-crd-spec-missing-applicationset branch from 0cd2cf6 to 8a15bb0 Compare October 6, 2022 20:31
Signed-off-by: Richard Jennings <richardjennings@gmail.com>
Copy link
Collaborator

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

Nicely done, thanks @richardjennings!

@crenshaw-dev crenshaw-dev added cherry-pick/2.4 Candidate for cherry picking into the 2.4 release branch cherry-pick/2.5 labels Oct 7, 2022
@crenshaw-dev crenshaw-dev merged commit 2fc7c7d into argoproj:master Oct 7, 2022
crenshaw-dev pushed a commit that referenced this pull request Oct 7, 2022
* add applicationset to crds generated

Signed-off-by: Richard Jennings <richardjennings@gmail.com>

* update applicationset crd

Signed-off-by: Richard Jennings <richardjennings@gmail.com>

* remove description from applicationset crd

Signed-off-by: Richard Jennings <richardjennings@gmail.com>

Signed-off-by: Richard Jennings <richardjennings@gmail.com>
crenshaw-dev pushed a commit that referenced this pull request Oct 7, 2022
* add applicationset to crds generated

Signed-off-by: Richard Jennings <richardjennings@gmail.com>

* update applicationset crd

Signed-off-by: Richard Jennings <richardjennings@gmail.com>

* remove description from applicationset crd

Signed-off-by: Richard Jennings <richardjennings@gmail.com>

Signed-off-by: Richard Jennings <richardjennings@gmail.com>
@crenshaw-dev
Copy link
Collaborator

Cherry-picked onto release-2.4 for 2.4.15 and release-2.5 for 2.5.0-rc1.

ashutosh16 pushed a commit to ashutosh16/argo-cd that referenced this pull request Oct 7, 2022
…0833)

* add applicationset to crds generated

Signed-off-by: Richard Jennings <richardjennings@gmail.com>

* update applicationset crd

Signed-off-by: Richard Jennings <richardjennings@gmail.com>

* remove description from applicationset crd

Signed-off-by: Richard Jennings <richardjennings@gmail.com>

Signed-off-by: Richard Jennings <richardjennings@gmail.com>
crenshaw-dev added a commit that referenced this pull request Oct 8, 2022
…0833)"

This reverts commit 5cf1a67.

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@crenshaw-dev
Copy link
Collaborator

Reverted cherry-pick onto 2.4. Doesn't make sense for it to be there, because the CRD generation changes didn't happen until 2.5. :-)

@crenshaw-dev crenshaw-dev removed the cherry-pick/2.4 Candidate for cherry picking into the 2.4 release branch label Oct 8, 2022
@richardjennings richardjennings deleted the gen-crd-spec-missing-applicationset branch October 8, 2022 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants