-
-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
451: Implement feature request: To detect duplicate defined environment variables r=zegl a=ryo-yamaoka score/container: To detect duplicate defined environment variables. Fixes #448 ### behaviour ``` $ ./kube-score score ~/test.yaml apps/v1/Deployment sample-deployment 💥 [CRITICAL] Environment Variable Key Duplication · sampleA -> Environment Variable Key Duplication Container environment variable key 'SAMPLE_ENV_VAR' duplicated · sampleB -> Environment Variable Key Duplication Container environment variable key 'SAMPLE_ENV_VAR1' duplicated · sampleB -> Environment Variable Key Duplication Container environment variable key 'SAMPLE_ENV_VAR2' duplicated ``` ```yaml apiVersion: apps/v1 kind: Deployment metadata: name: sample-deployment labels: app: sample annotations: kube-score/ignore: pod-networkpolicy,container-resources,container-image-pull-policy,container-security-context-privileged,container-security-context-user-group-id,container-security-context-readonlyrootfilesystem,container-ephemeral-storage-request-and-limit,container-image-tag spec: replicas: 1 selector: matchLabels: app: sample template: metadata: labels: app: sample spec: containers: - name: sampleA image: sample:latest ports: - containerPort: 80 env: - name: SAMPLE_ENV_VAR value: sample1 - name: SAMPLE_ENV_VAR value: sample1 - name: sampleB image: sample:latest ports: - containerPort: 80 env: - name: SAMPLE_ENV_VAR1 value: sample1 - name: SAMPLE_ENV_VAR1 value: sample1 - name: SAMPLE_ENV_VAR2 value: sample2 - name: SAMPLE_ENV_VAR2 value: sample2 ``` Co-authored-by: ryo-yamaoka <20574684+ryo-yamaoka@users.noreply.github.com>
- Loading branch information
Showing
7 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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 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 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 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,19 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod-test-1 | ||
spec: | ||
containers: | ||
- name: foobar | ||
image: foo/bar:latest | ||
env: | ||
- name: foo | ||
value: foo | ||
- name: bar | ||
value: bar | ||
- name: bar | ||
value: bar | ||
- name: baz | ||
value: baz | ||
- name: baz | ||
value: baz |
This file contains 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,13 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod-test-1 | ||
spec: | ||
containers: | ||
- name: foobar | ||
image: foo/bar:latest | ||
env: | ||
- name: foo | ||
value: foo | ||
- name: bar | ||
value: bar |