kustomize
kustomize copied to clipboard
Add support for extra fieldspecs in configurations for Labels
worked on #4816
I added the support for Labels
so that users can specify extra fieldspecs
as well as commonLabels
.
Here is the example kustomization.yaml.
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- pairs:
someName: someValue
resources:
# resources.yaml contains a Gorilla and a AnimalPark
- resources.yaml
configurations:
- labels.yaml
resources.yaml
apiVersion: animal/v1
kind: Gorilla
metadata:
name: gg
---
apiVersion: animal/v1
kind: AnimalPark
metadata:
name: ap
spec:
gorillaRef:
name: gg
kind: Gorilla
apiVersion: animal/v1
labels.yaml
labels:
- path: spec/gorillaRef/metadata/labels
kind: AnimalPark
create: true
The output of kustomize build
is as follows
apiVersion: animal/v1
kind: AnimalPark
metadata:
labels:
someName: someValue
name: ap
spec:
gorillaRef:
apiVersion: animal/v1
kind: Gorilla
metadata:
labels:
someName: someValue
name: gg
template:
name: template
Also, I added an example about this support in examples/transformerconfigs/README.md
I'm not very sure where I can add the test case for this support.
I would be grateful if we can discuss this.
This PR has multiple commits, and the default merge method is: merge. You can request commits to be squashed using the label: tide/merge-method-squash
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: yutaroyamanaka / name: Taro (b909aeac5315ccd1b1228fa8f05bf07de234c354, a5d7ffbeb76e947abc1a29f778142a96af167bfa, 2f5f8ec9880cd83b9ece379e45bd06b49289e19d, d1c50ef503a7c4771a20a0b921c4184c28b75351)
Welcome @yutaroyamanaka!
It looks like this is your first PR to kubernetes-sigs/kustomize 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes-sigs/kustomize has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
Hi @yutaroyamanaka. Thanks for your PR.
I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test
on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test
label.
I understand the commands that are listed here.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/triage accepted /kind feature /priority backlog
Thanks for the PR! Please add some tests for this new feature. For example, api/internal/plugins/builtinconfig/transformerconfig_test.go
has TestMerge
that could be enhanced to cover the labels merge, and api/krusty/customconfig_test.go
would be a good place for an integration test.
@KnVerey Thanks you for providing that information.
- added a unit test to
TestMerge
inapi/internal/plugins/builtinconfig/transformerconfig_test.go
- added an integration test called
TestCustomConfigLabelsMerge
inapi/krusty/customconfig_test.go
- fix a typo in
TestMerge
< https://github.com/kubernetes-sigs/kustomize/blob/master/api/internal/plugins/builtinconfig/transformerconfig_test.go#L137
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale
- Close this PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
/ok-to-test
@yutaroyamanaka Thanks for your contribution! Katrina is still very busy. I'll check your PR instead.
/retest
/lgtm Please wait for the review by the maintainers.
/cc @natasha41575 @annasong20
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale
- Close this PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: yutaroyamanaka Once this PR has been reviewed and has the lgtm label, please ask for approval from koba1t. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
Hi @yutaroyamanaka This PR almost looks good to me. I plan to merge it because I got merge to master permission now.
Looks like this PR contains a few lint failures. Could you check and fix it?
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle rotten
- Close this PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
/remove-lifecycle rotten
Superseded by #5556
/close
@stormqueen1990: Closed this PR.
In response to this:
Superseded by #5556
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
PR needs rebase.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.