-
Notifications
You must be signed in to change notification settings - Fork 54
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
Porch: PackageVariant should set a readinessgate #615
Comments
Triage Comments:
The current implementation sets the package as ready after step 1. To be considered in rearchitecture. |
- PackageVariant controller now uses a readiness gate to allow a PackageRevision to complete its mutation pipeline before it is allowed to be proposed/approved - refactored conversion of Kptfiles to YAML since readiness condition information is stored in the package Kptfile - unified all cases to the same kyaml/yaml-based method (KptFile.ToYamlString() and ToYamlString(*fn.KubeObject)) - this ensures consistency in the YAML (indentation, field order etc.) - and reduces the chances of Git conflicts when setting and updating readiness conditions - added more info to error message in case of Git conflict when applying a patch nephio-project/nephio#615
- previous solution broke existing functionality to copy comments between Kptfile objects - resulting in failing unit tests - fix for that brought back the Git conflicts caused by indentation, field order etc. - re-refactored conversion of Kptfiles to YAML - KubeObject-related conversion methods (KubeObject/YAML and YAML/KubeObject) now live out in the util package as they aren't Kptfile-specific any more nephio-project/nephio#615
- PackageVariant controller now uses a readiness gate to allow a PackageRevision to complete its mutation pipeline before it is allowed to be proposed/approved - refactored conversion of Kptfiles to YAML since readiness condition information is stored in the package Kptfile - unified all cases to the same kyaml/yaml-based method (KptFile.ToYamlString() and ToYamlString(*fn.KubeObject)) - this ensures consistency in the YAML (indentation, field order etc.) - and reduces the chances of Git conflicts when setting and updating readiness conditions - added more info to error message in case of Git conflict when applying a patch nephio-project/nephio#615
- previous solution broke existing functionality to copy comments between Kptfile objects - resulting in failing unit tests - fix for that brought back the Git conflicts caused by indentation, field order etc. - re-refactored conversion of Kptfiles to YAML - KubeObject-related conversion methods (KubeObject/YAML and YAML/KubeObject) now live out in the util package as they aren't Kptfile-specific any more nephio-project/nephio#615
- PackageVariant controller now uses a readiness gate to allow a PackageRevision to complete its mutation pipeline before it is allowed to be proposed/approved - refactored conversion of Kptfiles to YAML since readiness condition information is stored in the package Kptfile - unified all cases to the same kyaml/yaml-based method (KptFile.ToYamlString() and ToYamlString(*fn.KubeObject)) - this ensures consistency in the YAML (indentation, field order etc.) - and reduces the chances of Git conflicts when setting and updating readiness conditions - added more info to error message in case of Git conflict when applying a patch nephio-project/nephio#615
- previous solution broke existing functionality to copy comments between Kptfile objects - resulting in failing unit tests - fix for that brought back the Git conflicts caused by indentation, field order etc. - re-refactored conversion of Kptfiles to YAML - KubeObject-related conversion methods (KubeObject/YAML and YAML/KubeObject) now live out in the util package as they aren't Kptfile-specific any more nephio-project/nephio#615
… pipeline-passed condition - review comments to increase applicability of pipeline-passed readiness condition - to enable this: if an incoming PackageRevision update changes only that readiness condition, detect that, skip the pipeline/rendering/etc., and only update the Kptfile with the readiness condition update - other tidy-up/wording comments nephio-project/nephio#615
Original issue URL: kptdev/kpt#3979
Original issue user: https://github.com/johnbelamaric
Original issue created at: 2023-06-01T01:36:52Z
Original issue last updated at: 2023-07-06T21:56:34Z
Original issue body: ### Expected behavior
If PackageVariant fails to inject or otherwise properly mutate the Draft it creates, we need to prevent the package from being approved. This could be done by adding a False condition and readinessGate immediately after cloning (or better yet, implementing a porch server feature that allows that to be done atomically).
Actual behavior
Because we cannot atomically "clone and apply PV mutations", the actual package revision process happens in two independent stages: clone, then apply mutations. If applying the mutations fails, the newly cloned Draft is still there, and unless you check the PV conditions, it looks fine and can be merged (in fact the auto-approval controller we built for Nephio goes ahead and approves it, since it only inspect the package revision, and doesn't know where it came from).
Original issue comments:
Comment user: https://github.com/johnbelamaric
Comment created at: 2023-07-06T21:56:34Z
Comment last updated at: 2023-07-06T21:56:34Z
Comment body: As a workaround for this, the approval controller now checks the PV readiness status, and so do some of our other controllers. But that wouldn't help a human user.
The text was updated successfully, but these errors were encountered: