-
Notifications
You must be signed in to change notification settings - Fork 56
Conversation
@@ -275,6 +341,47 @@ func (addon Addon) Images(imageTag string) []string { | |||
return images | |||
} | |||
|
|||
func (addon Addon) listPatches() ([]string, error) { | |||
result := []string{} | |||
sourcePatches, err := filepath.Glob(filepath.Join(addon.patchResourcesDir(addon.addonDir()), "*.yaml")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking: what if the user has files ending with ".yml" (it's a valid yaml extension)? Something like "*.y?ml" should work, right?
I don't have the opportunity (time) to propose an alternative approach, so I think this one would do. It's an improvement over what we do. I will vote positively on this approach, just for this. I discussed this with Rafa, and we have a different view :) Reasons:
This also marks a path forward where the source of truth is in the cluster, as the source of truth (the cluster definition folder) would simply be uploaded in the cluster (changing what an eventual "prepare" new command would do behind the scenes). TL:DR; I have the impression my alternative is easier to maintain, and would be more user friendly (because users would see the base manifests). |
As said above, I would +1 assuming this is out of its current WIP state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 from me, looks good. Some nits here and there but seems like we could iterate on those later. Having this in seems more important so we can start building on top.
Hi! |
hey, should we get people from the field tell us what they think of this here? |
Field input is always welcome. This is implementing the RFC described above and since it got merged I'd try to not deviate too much from it, we can always evolve if the field thinks this as is is not enough.
This has been sitting for a while on WIP, mainly because I wasn't sure if using templating was the best approach, as opposed to using the Kustomize API directly. However, I think we can move forward with this, and improve later (maybe removing some templating in favour of using Kustomize API if it's something we want). I'll rebase and update this PR tomorrow so we can continue working on this, and finally get rid of the WIP. We also will have to document on how to migrate a "cluster definition folder" to the new one (will be a set of |
That's correct, but field didn't really get the chance to review the rfc.
I think templating is fine. I would have preferred if this was less obscure to the deployers, because here the files are actively in a temp space which can then be removed. But again, this is an implementation of the rfc.
Ok, if you tackle it, I will help on something else. |
This will need documentation to migrate from the current cluster definition to the new one. |
With kustomize, we can evolve our base manifests, applying the user provided changes (patches) on top of them.
I think we can get this one merged, and evolve over this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Submitted for early feedback. Still WIP.
Why is this PR needed?
With kustomize, we can evolve our base manifests, applying the user
provided changes (patches) on top of them.
Implements: https://github.com/SUSE/caasp-rfc/pull/46
Fixes: https://github.com/SUSE/avant-garde/issues/941
What does this PR do?
This PR creates a new directory structure as defined by the linked RFC, so it's possible for users to provide their kustomize patches for every addon.
This allows us to respect user customizations when running
skuba addon upgrade apply
, because user patches will always be placed on top of our base manifests (that can freely evolve). If any of the user kustomize patch is outdated enough to not cleanly apply,skuba
will report that error to the user.Info for QA
It's needed to check different things:
You can add your own
kustomize
patches afterskuba cluster init
in the given directories, and these patches are respected when applied to the cluster, when doingskuba node bootstrap
.When you have patches, when running
skuba addon upgrade apply
, the user patches will be applied along with our evolved base to the cluster, so user customizations are kept at all times.If you have incompatible patches (e.g. the resource you are patching was renamed in the base manifests, and what you are trying to patch no longer exists), then
skuba
will write an error message stating the error.Docs
Documentation needs to be written, because a user action is required. They have to evolve the cluster definition folder from:
Old cluster definition folder
to
New cluster definition folder
Merge restrictions
(Please do not edit this)
We are in v4-maintenance phase, so we will restrict what can be merged to prevent unexpected surprises: