-
Notifications
You must be signed in to change notification settings - Fork 135
feat(cluster-scanner): added configuration for docker registry mirrors #1372
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
4 commits
Select commit
Hold shift + click to select a range
f69ad64
feat(cluster-scanner): added configuration for docker registry mirrors
michele-mangili 973bbb2
fix(cluster-scanner): bumped minor cluster-scanner and sysdig-deploy …
michele-mangili 876435c
fix(cluster-scanner): corrected the syntax of mirrors configuration a…
michele-mangili f7f09b2
chore(cluster-scanner): mirrors shall always be an object
michele-mangili 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 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
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,15 @@ | ||
| {{- if .Values.imageSbomExtractor.mirrors -}} | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ include "cluster-scanner.fullname" . }}-registry-mirrors | ||
| namespace: {{ include "cluster-scanner.namespace" . }} | ||
| labels: | ||
| {{- include "cluster-scanner.labels" . | nindent 4 }} | ||
| data: | ||
| daemon.json: |- | ||
| { | ||
| "registry-mirrors": {{ .Values.imageSbomExtractor.mirrors.registryMirrors | default list | toJson }}, | ||
| "insecure-registries": {{ .Values.imageSbomExtractor.mirrors.insecureRegistries | default list | toJson }} | ||
| } | ||
| {{- end -}} |
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,120 @@ | ||
| suite: registrymirror | ||
| templates: | ||
| - ../templates/registrymirror.yaml | ||
| values: | ||
| - ../values.yaml | ||
| release: | ||
| name: test-release | ||
| namespace: test-ns | ||
|
|
||
| tests: | ||
| - it: "does not have mirrors, if they are not provided" | ||
| set: | ||
| imageSbomExtractor.mirrors: {} | ||
| asserts: | ||
| - hasDocuments: | ||
| count: 0 | ||
|
|
||
| - it: "has mirrors ConfigMap, when mirrors are set" | ||
| set: | ||
| imageSbomExtractor.mirrors: | ||
| registryMirrors: | ||
| - "insecure.mirror.acme.com" | ||
| - "secure.mirror.acme.com" | ||
| insecureRegistries: | ||
| - "insecure.mirror.acme.com" | ||
| asserts: | ||
| - hasDocuments: | ||
| count: 1 | ||
| - containsDocument: | ||
| kind: ConfigMap | ||
| apiVersion: v1 | ||
| name: test-release-cluster-scanner-registry-mirrors | ||
| namespace: test-ns | ||
| - equal: | ||
| path: data["daemon.json"] | ||
| value: |- | ||
| { | ||
| "registry-mirrors": ["insecure.mirror.acme.com","secure.mirror.acme.com"], | ||
| "insecure-registries": ["insecure.mirror.acme.com"] | ||
| } | ||
|
|
||
| - it: "has correct empty registry mirrors" | ||
| set: | ||
| imageSbomExtractor.mirrors: | ||
| insecureRegistries: | ||
| - "insecure.mirror.acme.com" | ||
| asserts: | ||
| - hasDocuments: | ||
| count: 1 | ||
| - containsDocument: | ||
| kind: ConfigMap | ||
| apiVersion: v1 | ||
| name: test-release-cluster-scanner-registry-mirrors | ||
| namespace: test-ns | ||
| - equal: | ||
| path: data["daemon.json"] | ||
| value: |- | ||
| { | ||
| "registry-mirrors": [], | ||
| "insecure-registries": ["insecure.mirror.acme.com"] | ||
| } | ||
|
|
||
| - it: "has correct empty insecure registries mirrors" | ||
| set: | ||
| imageSbomExtractor.mirrors: | ||
| registryMirrors: | ||
| - "insecure.mirror.acme.com" | ||
| - "secure.mirror.acme.com" | ||
| - "one more mirror" | ||
| asserts: | ||
| - hasDocuments: | ||
| count: 1 | ||
| - containsDocument: | ||
| kind: ConfigMap | ||
| apiVersion: v1 | ||
| name: test-release-cluster-scanner-registry-mirrors | ||
| namespace: test-ns | ||
| - equal: | ||
| path: data["daemon.json"] | ||
| value: |- | ||
| { | ||
| "registry-mirrors": ["insecure.mirror.acme.com","secure.mirror.acme.com","one more mirror"], | ||
| "insecure-registries": [] | ||
| } | ||
|
|
||
| - it: "fails if format of registry mirrors is wrong" | ||
| set: | ||
| imageSbomExtractor.mirrors: | ||
| registryMirrors: | ||
| nested: "object" | ||
| asserts: | ||
| - failedTemplate: | ||
| errorMessage: "values don't meet the specifications of the schema(s) in the following chart(s):\ncluster-scanner:\n- imageSbomExtractor.mirrors.registryMirrors: Invalid type. Expected: array, given: object\n" | ||
|
|
||
| - it: "fails if format of insecure registries is wrong" | ||
| set: | ||
| imageSbomExtractor.mirrors: | ||
| insecureRegistries: 18 | ||
| asserts: | ||
| - failedTemplate: | ||
| errorMessage: "values don't meet the specifications of the schema(s) in the following chart(s):\ncluster-scanner:\n- imageSbomExtractor.mirrors.insecureRegistries: Invalid type. Expected: array, given: integer\n" | ||
|
|
||
| - it: "fails if format of mirrors is wrong" | ||
| set: | ||
| imageSbomExtractor.mirrors: 18 | ||
| asserts: | ||
| - failedTemplate: | ||
| errorMessage: "values don't meet the specifications of the schema(s) in the following chart(s):\ncluster-scanner:\n- imageSbomExtractor.mirrors: Invalid type. Expected: object, given: integer\n" | ||
|
|
||
| - it: "fails if mirrors contains unexpeceted property" | ||
| set: | ||
| imageSbomExtractor.mirrors: | ||
| gigi: | ||
| - "insecure.mirror.acme.com" | ||
| - "secure.mirror.acme.com" | ||
| insecureRegistries: | ||
| - "insecure.mirror.acme.com" | ||
| asserts: | ||
| - failedTemplate: | ||
| errorMessage: "values don't meet the specifications of the schema(s) in the following chart(s):\ncluster-scanner:\n- imageSbomExtractor.mirrors: Additional property gigi is not allowed\n" |
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
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.