-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Feature: Automatic Creation of 'vars:' and 'varReferences:' sections #1217
Conversation
00c60f5
to
7eb747a
Compare
/assign @monopole |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jbrette The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
06b009a
to
7fbabd8
Compare
Can you give us an example. The autovar feature works across namespaces. |
Yes of course! We spoke about this a few months back. A minimal test case of the failure is here: For more context, I have one file that contains all environment specific identifiers that is generated at the time the cluster is created (by Terraform). Here is a sample:
Sibling to this file I have the following:
...every single kustomization file in my configuration references this common base.
If I apply these individually everything is fine. However, I do have one master kustomization.yml I'd like to be able to apply that I cannot (due to the failure shared in the link above).
It makes sense to me that references to |
63e1b6f
to
9125aae
Compare
a6a6d4c
to
89a50b7
Compare
34cba32
to
762bd6d
Compare
- Makefile needs to be updated after change in kustomize organization - Remove mdrip, blackfriday from kustomize dependencies
- Improve resmapscanner.go - Update unit tests associated with feature. - Harden variable pattern detection - Sort FieldSpec using Path instead of Gvk. - Adapt to new VarSet structure - Adapt to v3 code AutoVar: Add Test demonstrating Mixin and Autovar AutoVar: Add AbsorbRefVarName to optimize lookup of variable during MergeVars AutoVar: Various cleanup around the autovar feature AutoVar: Manual vs Automatic Variables conflict detection still needs improvments NameValue: Allow name=value to look for specific var field
This PR was only doing automatically what user have to painfully do by hand. Since it was specified in will never be merged, closing it and keeping private. |
This is a really disappointing outcome. |
So much work and energy had been put into this, that's really sad. |
The code is not lost for our project and will stay in our fork. The design of this PR is to create whatever complex structure kustomize uses at the time. (currently varRef and var). Once the Replacement PR is merged, we will only have to adapt the autovar feature. Indeed that Replacement PR still forces the user to manually create complex fieldspecs in the kustomization.yaml. Actually from a selfish point of view, it means that our project does not have to keep the PR small anymore or rebase to allow easier merging. With the four true features PR (diamond, inline, autovar and transformers), we unfortunatly end up with a fork of kustomize, but a least that fork gets everything much more simplier for our users (and still uses the same kustomization.yaml as the official kustomize). The real game changer in the fork/nofork debat was the handling of SMP instead JMP for CRD by kustomize (CRD are everywhere in the new applications: Istio, Argo, Prometheus, OpenShift, Cluster-API,.) . Still fork is able to address 90% of the issues raised, some of them having been opened more than a year check here |
@jbrette what is the "Replacement PR" you refer to? |
The description of the goal for this PR is available at: issue
The main idea is to scan the ResMap
in order to create the varand varreference
Those var and varrefence get then merge into the accumulator as if a user had written those my hand in the kustomization.yaml and kustomizeconfig.yaml: merge