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: provide nameNormalized param for local cluster in ApplicationSet cluster generator (#9727) #9728

Merged

Conversation

lacarvalho91
Copy link
Contributor

@lacarvalho91 lacarvalho91 commented Jun 21, 2022

Closes #9727

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).

I don't believe this requires documentation updates.

Signed-off-by: Lawrence Carvalho <lawrence.carvalho@sky.uk>
@lacarvalho91 lacarvalho91 force-pushed the 9727-in-cluster-name-normalized branch from d17b062 to 3aab82d Compare June 21, 2022 09:30
@codecov
Copy link

codecov bot commented Jun 21, 2022

Codecov Report

Merging #9728 (497fcab) into master (a041bf8) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #9728   +/-   ##
=======================================
  Coverage   45.79%   45.79%           
=======================================
  Files         227      227           
  Lines       26920    26921    +1     
=======================================
+ Hits        12327    12328    +1     
  Misses      12911    12911           
  Partials     1682     1682           
Impacted Files Coverage Δ
applicationset/generators/cluster.go 74.07% <100.00%> (+0.32%) ⬆️
util/settings/settings.go 48.16% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a041bf8...497fcab. Read the comment docs.

@crenshaw-dev crenshaw-dev changed the title Provides nameNormalized param for local cluster in ApplicationSet cluster generator. (#9727) feat: provide nameNormalized param for local cluster in ApplicationSet cluster generator (#9727) Jun 23, 2022
@lacarvalho91 lacarvalho91 force-pushed the 9727-in-cluster-name-normalized branch from bbafc21 to 497fcab Compare June 27, 2022 16:01
@lacarvalho91
Copy link
Contributor Author

lacarvalho91 commented Jun 28, 2022

@crenshaw-dev any idea when someone will be able to review this? i resolved a conflict yesterday, so would be good to get it in soon!

@rishabh625
Copy link
Contributor

rishabh625 commented Jun 28, 2022

Hi @lacarvalho91 , Thanks for PR,

but this PR doesn't looks good to me

  1. even if u add that normalized param it will not be normalized as it doesn't get appended in secretsFound so sanitize method is not called
  2. you will need to add label argocd.argoproj.io/secret-type: cluster as described here https://argocd-applicationset.readthedocs.io/en/stable/Generators-Cluster/#deploying-to-the-local-cluster for it to get appended in secretsFound

imho, this changes looks redundant

@lacarvalho91
Copy link
Contributor Author

lacarvalho91 commented Jun 28, 2022

@rishabh625 the description in the linked issue should properly explain the motivation but this is simply to provide nameNormalized as a template variable when using local cluster. I don't think I should need to do what is documented on https://argocd-applicationset.readthedocs.io/en/stable/Generators-Cluster/#deploying-to-the-local-cluster just to be able to do that. The sanitize method doesn't need to be called as we know the local cluster always has the same name, but I can easily change this to call sanitize method.

@rishabh625
Copy link
Contributor

I got you @lacarvalho91 , that's my worry u just need a nameNormalized param which contains value similar to name.

I feel let's include that param but atleast populate normalised value in it.

@crenshaw-dev what's your opinion?

@crenshaw-dev crenshaw-dev changed the title feat: provide nameNormalized param for local cluster in ApplicationSet cluster generator (#9727) fix: provide nameNormalized param for local cluster in ApplicationSet cluster generator (#9727) Jun 28, 2022
@crenshaw-dev crenshaw-dev added the cherry-pick/2.4 Candidate for cherry picking into the 2.4 release branch label Jun 28, 2022
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.

@rishabh625 thanks for the ping! lgtm. I'm gonna treat this as a bugfix so we can get it into 2.4.x.

@crenshaw-dev crenshaw-dev merged commit 202001a into argoproj:master Jun 28, 2022
@rishabh625
Copy link
Contributor

rishabh625 commented Jun 28, 2022

Ok @crenshaw-dev , if u feel PR is fine then good , but I still feel to add a Normalised name as value instead of just name

Thanks for merging

@lacarvalho91 lacarvalho91 deleted the 9727-in-cluster-name-normalized branch June 29, 2022 08:24
@crenshaw-dev
Copy link
Collaborator

@rishabh625 I think @lacarvalho91 is correct that the name is already normalized by definition because it is always in-cluster.

@rishabh625
Copy link
Contributor

@rishabh625 I think @lacarvalho91 is correct that the name is already normalized by definition because it is always in-cluster.

Ohh, i thought if we change the name of in-cluster, it still picks the local cluster as local one , it distinguishs local and remote by label and not name.

@crenshaw-dev
Copy link
Collaborator

@rishabh625 I don't think the local cluster name comes from a secret at all. I think it comes from here:

Name: "in-cluster",

Is it possible to configure the local cluster via secret? I admit, I'm not super familiar with this area of the code. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick/2.4 Candidate for cherry picking into the 2.4 release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ApplicationSet Cluster Generator: nameNormalized is not provided for local cluster
3 participants