-
Notifications
You must be signed in to change notification settings - Fork 117
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
[yaml/v2] Support for resource ordering (implicit and explicit) #2894
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
06649d8
to
f4f1b40
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2894 +/- ##
==========================================
+ Coverage 26.97% 27.19% +0.22%
==========================================
Files 53 53
Lines 7748 7780 +32
==========================================
+ Hits 2090 2116 +26
- Misses 5483 5486 +3
- Partials 175 178 +3 ☔ View full report in Codecov by Sentry. |
723d457
to
5e046a3
Compare
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.
Looks reasonable - just some small comments/questions.
@@ -130,6 +137,41 @@ func yamlDecode(text string, _ *clients.DynamicClientSet) ([]unstructured.Unstru | |||
return resources, nil | |||
} | |||
|
|||
func Expand(objs []unstructured.Unstructured) ([]unstructured.Unstructured, error) { |
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.
func Expand(objs []unstructured.Unstructured) ([]unstructured.Unstructured, error) { | |
func expand(objs []unstructured.Unstructured) ([]unstructured.Unstructured, error) { |
Or is there a reason this is public?
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.
I made it public for symmetry with Parse
and Register
, all of which are useful when implementing a component resource. It so happens that ConfigGroup
and ConfigFile
are in the same package, but Chart
wouldn't be. That said, I don't anticipate any actual usages.
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.
BTW, I plan to rename Expand
to Normalize
in this follow-up PR and perform a couple of other fixups.
#2897
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.
LGTM
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@pulumi/kubernetes](https://pulumi.com) ([source](https://togithub.com/pulumi/pulumi-kubernetes)) | dependencies | minor | [`4.9.1` -> `4.10.0`](https://renovatebot.com/diffs/npm/@pulumi%2fkubernetes/4.9.1/4.10.0) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>pulumi/pulumi-kubernetes (@​pulumi/kubernetes)</summary> ### [`v4.10.0`](https://togithub.com/pulumi/pulumi-kubernetes/blob/HEAD/CHANGELOG.md#4100-April-11-2024) [Compare Source](https://togithub.com/pulumi/pulumi-kubernetes/compare/v4.9.1...v4.10.0) - ConfigGroup V2 ([https://github.com/pulumi/pulumi-kubernetes/pull/2844](https://togithub.com/pulumi/pulumi-kubernetes/pull/2844)) - ConfigFile V2 ([https://github.com/pulumi/pulumi-kubernetes/pull/2862](https://togithub.com/pulumi/pulumi-kubernetes/pull/2862)) - Bugfix for ambiguous kinds ([https://github.com/pulumi/pulumi-kubernetes/pull/2889](https://togithub.com/pulumi/pulumi-kubernetes/pull/2889)) - \[yaml/v2] Support for resource ordering [https://github.com/pulumi/pulumi-kubernetes/pull/2894](https://togithub.com/pulumi/pulumi-kubernetes/pull/2894)4) - Bugfix for deployment await logic not referencing the correct deployment status ([https://github.com/pulumi/pulumi-kubernetes/pull/2943](https://togithub.com/pulumi/pulumi-kubernetes/pull/2943)) ##### New Features A new MLC-based implementation of `ConfigGroup` and of `ConfigFile` is now available in the "yaml/v2" package. These resources are usable in all Pulumi languages, including Pulumi YAML and in the Java Pulumi SDK. Note that transformations aren't supported in this release (see [https://github.com/pulumi/pulumi/issues/12996](https://togithub.com/pulumi/pulumi/issues/12996)). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yODcuMSIsInVwZGF0ZWRJblZlciI6IjM3LjI4Ny4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9ucG0iLCJ0eXBlL21pbm9yIl19--> Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
Proposed changes
This PR adds support for resource ordering within a
ConfigGroup
orConfigFile
. Two approaches are supported (and work in combination):config.kubernetes.io/depends-on
annotation to explicitly declare a dependency on a given resource.The implementation is based on kubernetes-sigs/cli-utils and its support for resource ordering (documentation).
To be clear, ordering across
ConfigGroup
resources is supported already, simply using thedependsOn
option. This PR adds a more granular ordering within the group.Testing
New test cases were added to verify the new behavior. Many tests rely on a common manifest file, and it is updated to include a CRD and a namespace.
Manual testing was performed with the following well-known manifests:
Example
Here's an example that installs cert-manager then provisions a certificate issuer and a TLS certificate. An explicit dependency is drawn between the
Certificate
andIssuer
.Within the stack state, one sees dependencies, e.g. on the
Certificate
resource.Related issues (optional)
Closes #2881