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 for Cannot view newly created flux 2 package from UX #4173 #4204

Merged

Conversation

gfichtenholt
Copy link
Contributor

No description provided.

@gfichtenholt gfichtenholt self-assigned this Feb 1, 2022
@gfichtenholt gfichtenholt added this to In progress in Kubeapps via automation Feb 1, 2022
@gfichtenholt gfichtenholt linked an issue Feb 1, 2022 that may be closed by this pull request
Copy link
Contributor

@absoludity absoludity left a comment

Choose a reason for hiding this comment

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

Excellent, Greg, thanks for the quick fix!

// '[TargetNamespace-]Name'.
if helmReleaseName == "" {
targetNamespace := rel.Spec.TargetNamespace
// according to docs targetNamespace is optional and defaults to the namespace of the HelmRelease
Copy link
Contributor

Choose a reason for hiding this comment

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

Just noting, not necessary for this fix, but for the related #4189, that the behaviour flux shows is slightly different to below (see my notes from updating the flux CR on #4172, or your notes on #4189) but still consistent with the comment above: the namespace targeted by the HelmRelease defaults to the namespace of the HelmRelease, but flux doesn't set the targetNamespace field with that value, it remains empty as specified. And when the targetNamespace is empty/unset, the helm release name is just the HelmRelease.metadata.name (ie. not prefixed by the namespace at all, and so different to below). This is why I was unsure why we were explicitly setting the targetNamespace given flux's default behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just noting, not necessary for this fix, but for the related #4189, that the behaviour flux shows is slightly different to below (see my notes from updating the flux CR on #4172, or your notes on #4189) but still consistent with the comment above: the namespace targeted by the HelmRelease defaults to the namespace of the HelmRelease, but flux doesn't set the targetNamespace field with that value, it remains empty as specified. And when the targetNamespace is empty/unset, the helm release name is just the HelmRelease.metadata.name (ie. not prefixed by the namespace at all, and so different to below). This is why I was unsure why we were explicitly setting the targetNamespace given flux's default behaviour.

noted

Comment on lines +677 to +680
if targetNamespace == "" {
targetNamespace = key.Namespace
}
helmReleaseName = fmt.Sprintf("%s-%s", targetNamespace, key.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just leaving this here so I can refer to it on your related issue #4189, not suggesting the change for this PR

Suggested change
if targetNamespace == "" {
targetNamespace = key.Namespace
}
helmReleaseName = fmt.Sprintf("%s-%s", targetNamespace, key.Name)
helmReleaseName = key.Name
if targetNamespace != "" {
helmReleaseName = fmt.Sprintf("%s-%s", targetNamespace, key.Name)
}

which would match the behaviour that I saw by default from flux, I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, sounds good

@gfichtenholt gfichtenholt merged commit 5b4de19 into vmware-tanzu:main Feb 2, 2022
Kubeapps automation moved this from In progress to Done Feb 2, 2022
@gfichtenholt gfichtenholt deleted the further-fluxv2-plugin-features-22 branch February 2, 2022 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Kubeapps
  
Done
Development

Successfully merging this pull request may close these issues.

Cannot view newly created flux 2 package from UX
2 participants