-
Notifications
You must be signed in to change notification settings - Fork 74
Add set-labels e2e tests and readme
#886
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
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
bdc4993
add more e2e tests; change readme to get rid of additional label fields
zyy98 9beb52c
update generated docs
zyy98 c19446c
add license make rule
zyy98 440fd79
change directory for make rule
zyy98 632d8f4
defer update license to next PR
zyy98 52f0772
fix tests bugs, add reply message for empty resource
zyy98 7a5fa4b
add good examples and fix old example readme
zyy98 010c76c
update metadata file
zyy98 9adb808
fix minor formatting
zyy98 183b011
minor rename and doc
zyy98 c59a4aa
doc rename
zyy98 2922e8a
doc rename
zyy98 25d7422
doc rename
zyy98 945bf4e
fix previous error logic in test files. Update set-labels to handle a…
zyy98 0462c90
handle local config
zyy98 c4dd0dc
update go module, add full coverage test, fix minor logic bug in set-…
zyy98 b256a6a
update unit test
zyy98 3819a29
delete unnecessary examples, all covered by full coverage
zyy98 c2132d2
readme wording
zyy98 634ad0e
seperated check local config into another PR
zyy98 5ebe543
update same local config, otherwise cannot pass tests
zyy98 da7375c
revert local config, actual change in another PR
zyy98 2e1d14c
merge from master
zyy98 6f585c9
delete selector from Kptfile
zyy98 fe31cc7
add more label path in common.go, add FieldPath "spec.template.spec.a…
zyy98 29d4f81
change to hard code resources; fix resource error in yaml
zyy98 c3ef4a0
delete unused comments
zyy98 b6bedec
doc string and rename
zyy98 2cc6104
a bit rename and refactor
zyy98 4d71f3b
refactor
zyy98 8535172
modify testvalue into different test value
zyy98 e9eb89d
delete comments in yaml
zyy98 da94748
merge with master; split PR to contain only tests
zyy98 f705e19
no resource exit with 0 instead of 1
zyy98 161f5cc
change error message
zyy98 90bbd91
delete unnecessary diff
zyy98 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,256 @@ | ||
| diff --git a/resources.yaml b/resources.yaml | ||
| index 6a06662..62df835 100644 | ||
| --- a/resources.yaml | ||
| +++ b/resources.yaml | ||
| @@ -2,56 +2,84 @@ apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: my-service | ||
| + labels: | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| selector: | ||
| - app: MyApp | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ReplicationController | ||
| metadata: | ||
| name: nginx | ||
| + labels: | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| replicas: 3 | ||
| selector: | ||
| - app: nginx | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| template: | ||
| metadata: | ||
| name: nginx | ||
| labels: | ||
| - app: nginx | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: nginx-deployment | ||
| labels: | ||
| - app: nginx | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| replicas: 3 | ||
| selector: | ||
| matchLabels: | ||
| - app: nginx | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| template: | ||
| metadata: | ||
| labels: | ||
| - app: nginx | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: ReplicaSet | ||
| metadata: | ||
| name: frontend | ||
| labels: | ||
| - app: guestbook | ||
| + app: new | ||
| tier: frontend | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| replicas: 3 | ||
| selector: | ||
| matchLabels: | ||
| tier: frontend | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| template: | ||
| metadata: | ||
| labels: | ||
| tier: frontend | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: DaemonSet | ||
| @@ -60,23 +88,38 @@ metadata: | ||
| namespace: kube-system | ||
| labels: | ||
| k8s-app: fluentd-logging | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| name: fluentd-elasticsearch | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| template: | ||
| metadata: | ||
| labels: | ||
| name: fluentd-elasticsearch | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: web | ||
| + labels: | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| - app: nginx | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| serviceName: "nginx" | ||
| replicas: 3 | ||
| minReadySeconds: 10 | ||
| @@ -85,6 +128,9 @@ spec: | ||
| name: www | ||
| labels: | ||
| key: www | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| accessModes: ["ReadWriteOnce"] | ||
| storageClassName: "my-storage-class" | ||
| @@ -95,6 +141,9 @@ spec: | ||
| name: xxx | ||
| labels: | ||
| key: xxx | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| accessModes: ["ReadWrite"] | ||
| storageClassName: "my-storage-class" | ||
| @@ -104,12 +153,18 @@ spec: | ||
| template: | ||
| metadata: | ||
| labels: | ||
| - app: nginx | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| --- | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: pi | ||
| + labels: | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| @@ -117,12 +172,14 @@ spec: | ||
| template: | ||
| metadata: | ||
| labels: | ||
| - color: pi | ||
| + color: orange | ||
| + app: new | ||
| + fruit: apple | ||
| spec: | ||
| containers: | ||
| - name: pi | ||
| image: perl:5.34 | ||
| - command: ["perl", "-Mbignum=bpi", "-wle", "'print bpi(2000)'"] | ||
| + command: ["perl", "-Mbignum=bpi", "-wle", "'print bpi(2000)'"] | ||
| restartPolicy: Never | ||
| backoffLimit: 4 | ||
| --- | ||
| @@ -130,12 +187,19 @@ apiVersion: batch/v1 | ||
| kind: CronJob | ||
| metadata: | ||
| name: hello | ||
| + labels: | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| schedule: "* * * * *" | ||
| jobTemplate: | ||
| metadata: | ||
| labels: | ||
| env: dev | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| @@ -144,6 +208,9 @@ spec: | ||
| metadata: | ||
| labels: | ||
| testkey: testvalue | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| containers: | ||
| - name: hello | ||
| @@ -159,6 +226,10 @@ apiVersion: policy/v1 | ||
| kind: PodDisruptionBudget | ||
| metadata: | ||
| name: hello | ||
| + labels: | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| @@ -169,6 +240,10 @@ kind: NetworkPolicy | ||
| metadata: | ||
| name: test-network-policy | ||
| namespace: default | ||
| + labels: | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| podSelector: | ||
| matchLabels: | ||
| @@ -179,6 +254,10 @@ kind: MyResource | ||
| metadata: | ||
| name: the-service | ||
| namespace: the-namespace | ||
| + labels: | ||
| + app: new | ||
| + color: orange | ||
| + fruit: apple | ||
| spec: | ||
| selector: | ||
| labels: |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| apiVersion: fn.kpt.dev/v1alpha1 | ||
| kind: SetLabels | ||
| metadata: | ||
| name: my-config | ||
| annotations: | ||
| config.kubernetes.io/local-config: "true" | ||
| labels: | ||
| color: orange | ||
| fruit: apple | ||
| app: new | ||
|
zyy98 marked this conversation as resolved.
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.