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 generation of already present resources #892

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

davidcassany
Copy link
Contributor

Fixes #881

@davidcassany davidcassany self-assigned this Dec 9, 2024
@davidcassany davidcassany requested a review from a team as a code owner December 9, 2024 12:11
{{ if and (eq (index $channel.metadata.labels "app.kubernetes.io/managed-by") "Helm") (ne $channel.metadata.name $defChannelName) }}
{{ range $_, $channel := (lookup "elemental.cattle.io/v1beta1" "ManagedOSVersionChannel" "fleet-default" "").items }}
{{ if and (eq (index $channel.metadata.labels "app.kubernetes.io/managed-by") "Helm") (not (hasKey $includedChannels $channel.metadata.name)) }}
{{ if and (ne $channel.metadata.name "unstable-testing-channel") (ne $channel.metadata.name $defChannelName) }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sure none of the generated here is already listed as default channel or testing channel

Signed-off-by: David Cassany <[email protected]>
Copy link
Contributor

@anmazzotti anmazzotti left a comment

Choose a reason for hiding this comment

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

Nice fix.
I wonder if it would be simpler at this point to deprecate the .channel chart value, since we have the default channels now. If users want to add a custom channel they could simply create their own ManagedOSVersionChannel resource and be done with it, without us having to manage the lifecycle with Helm.

Still this should work, nicely done!

@davidcassany
Copy link
Contributor Author

I wonder if it would be simpler at this point to deprecate the .channel chart value, since we have the default channels now. If users want to add a custom channel they could simply create their own ManagedOSVersionChannel resource and be done with it, without us having to manage the lifecycle with Helm.

I agree, this is something we could get rid of. I'd just leave it for the next release though.

@davidcassany davidcassany merged commit f4d7b6f into rancher:main Dec 9, 2024
8 checks passed
@davidcassany davidcassany deleted the fix_chart branch December 9, 2024 14:53
davidcassany added a commit to davidcassany/elemental-operator that referenced this pull request Dec 9, 2024
* Fix generation of already present resources

Signed-off-by: David Cassany <[email protected]>

* Fix legacy name

Signed-off-by: David Cassany <[email protected]>

---------

Signed-off-by: David Cassany <[email protected]>
davidcassany added a commit that referenced this pull request Dec 10, 2024
* Fix generation of already present resources



* Fix legacy name



---------

Signed-off-by: David Cassany <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Cannot reinstall/upgrade elemental-operator after a Rancher Manager migration
2 participants