Repository navigation
Conversation
|
Did you ever get any feedback on this? It seems like a pretty good idea to me. I wonder why the DCO check hasn't passed on this. IMHO this PR seems preferable to #7431 should that one be closed in favor of this? |
| // resource updates, creations, and deletions that were attempted. These can be | ||
| // used for cleanup or other logging purposes. | ||
| func (c *Client) Update(original, target ResourceList, force bool) (*Result, error) { | ||
| func (c *Client) Update(original, target ResourceList, force bool, timeout time.Duration) (*Result, error) { |
There was a problem hiding this comment.
As you said, this is a breaking change as written. You can work around that by doing something like this:
| func (c *Client) Update(original, target ResourceList, force bool, timeout time.Duration) (*Result, error) { | |
| func (c *Client) Update(original, target ResourceList, force bool) (*Result, error) { | |
| return UpdateWithTimeout(original, target, force, time.Duration(0)) | |
| } | |
| func (c *Client) UpdateWithTimeout(original, target ResourceList, force bool, timeout time.Duration) (*Result, error) { |
Where if timeout is 0 you revert to the original behavior.
There was a problem hiding this comment.
@joejulian thanks for the suggestion. I noticed that there was a similar issue in the meantime which lead to:
type InterfaceExt interface {
// WaitForDelete wait up to the given timeout for the specified resources to be deleted.
WaitForDelete(resources ResourceList, timeout time.Duration) error
}
So I will follow that pattern and remove the breaking change by introducing a trait like additional interface.
There was a problem hiding this comment.
@joejulian PR is cleaned up and all breaking changes have been removed as suggested. Looking forward to your feedback.
|
Same question: |
3f64f63 to
1994290
Compare
d5442ec to
0ac28fc
Compare
Add annotation handling of new annotation helm.sh/update-policy with values recreate-on-conflict and recreate-on-invalid values to better deal with the following cases. The server responds with 'invalid' e.g. if a certain resource contains an immutable field, which cannot be patched or updated by a PUT. In theses cases it can be helpful to delete the resource and recreate it. Examples for theses cases are: * roleRef in RoleBinding * spec.clusterIP in Service * parameters in StorageClass If a chart developer has made sure that recreating a resource is safe, the annotation can be added to a resource template. Alternatively a user may add the annotation manually to an existing resource to allow Helm to recreate a certain resource. Adding the new annotation in general by default or changing the default behaviour of Helm is not a good idea, since deletion and recreation of certain resources can lead to an unwanted or undefined state as described in detail in helm#7431 (comment): "[...] selectively deleting/re-creating volume-backed resources (Secrets, Services, ConfigMaps, PVCs) without touching the Deployment. If a Persistent Volume Claim is deleted and re-created, there is a risk that an application (Deployment) consuming that Persistent Volume Claim will not receive the new volume's mount point. The same can be said for Secrets, Configmaps, Services, and other resources which are deployed and relied upon by another resource. Environment variables populated in a Deployment from a Service won't be updated until the Pods are destroyed." Closes helm#7082. Signed-off-by: Daniel Strobusch <[email protected]>
0ac28fc to
0b58239
Compare
|
@joejulian could you unlock #7082 to be able to comment on in again, since I am not able to comment on this issue anymore? |
I unlocked that issue |
|
This pull request has been marked as stale because it has been open for 90 days with no activity. This pull request will be automatically closed in 30 days if no further activity occurs. |
|
remove stale |
|
This pull request has been marked as stale because it has been open for 90 days with no activity. This pull request will be automatically closed in 30 days if no further activity occurs. |
|
/nostale |
|
I’d like to ask about the current status of this feature and when it is expected to be merged. |
|
Are there any further updates on this feature? I’ve noticed that the current |
|
There are a lot of issues with this PR and then there are conflicts as well. |
|
This PR is pretty old, unless the maintainers show interest in the proposal #7082 I dont think it makes sense to spend time on this PR (rebasing, ...). |
|
@TerryHowe Is there enough interest from the Helm maintainers/community to accept this feature? |
|
Are there any other features that can address this issue? We can't expect users to uninstall the entire chart before proceeding, can we? |
|
Thanks for this, and for keeping it alive as long as you did. The need is real: some resources have immutable fields, and a normal update or apply cannot get past them. Helm 4 now covers both cases this PR set out to handle, as operator-invoked flags rather than a chart annotation:
To be precise about server-side apply: no apply strategy can mutate a truly immutable field, so this is not SSA quietly solving it. It is that the delete-and-recreate path now has a first-class flag ( The one real difference from this PR is that those are flags the person running the upgrade sets, not an annotation the chart author sets, and that is deliberate. Recreating a resource is destructive and cluster-state-dependent, and whether it is safe to delete and recreate a given object (a PVC, or anything holding state) is something the operator knows at upgrade time and the chart author usually does not. Keeping that decision with the operator rather than baking it into the chart is the separation we hold elsewhere, so the flag form is the shape we want. Given that, plus the conflicts against the Helm 4 update path (rewritten for server-side apply) and the related #7431 already being closed, I am going to close this as superseded. I genuinely appreciate the work, and it surfaced a real need that Helm 4 ended up filling. If you think there is still a case for a targeted, per-resource, only-on-invalid recreate beyond these flags, that would be a Helm Improvement Proposal conversation rather than a reopen, since it changes the chart contract. |
Add annotation handling of new annotation helm.sh/update-policy with values recreate-on-conflict and recreate-on-invalid values to better deal with the following cases.
The server responds with 'invalid' e.g. if a certain resource contains an immutable field, which cannot be patched or updated by a PUT. In theses cases it can be helpful to delete the resource and recreate it. Examples for theses cases are:
If a chart developer has made sure that recreating a resource is safe, the annotation can be added to a resource template. Alternatively a user may add the annotation manually to an existing resource to allow Helm to recreate a certain resource.
Adding the new annotation in general by default or changing the default behaviour of Helm is not a good idea, since deletion and recreation of certain resources can lead to an unwanted or undefined state as described in detail in #7431 (comment):
"[...] selectively deleting/re-creating volume-backed resources (Secrets, Services, ConfigMaps, PVCs) without touching the Deployment. If a Persistent Volume Claim is deleted and re-created, there is a risk that an application (Deployment) consuming that Persistent Volume Claim will not receive the new volume's mount point. The same can be said for Secrets, Configmaps, Services, and other resources which are deployed and relied upon by another resource. Environment variables populated in a Deployment from a Service won't be updated until the Pods are destroyed."
Closes #7082.
Signed-off-by: Daniel Strobusch [email protected]
Special notes for your reviewer:
This is an alternative approach to #7431 as proposed in #7082 (comment).
There is a new timeout parameter introduced to
Updatein a backwards compatible way asUpdateWithTimeoutas suggested in #9174 (comment). In Helm 4 this should be cleaned up as stated in the comments.The
update-policyand its possible values is a proposal related to thedelete-policyof hooks and could be changed to something different.If applicable: