Skip to content

Commit

Permalink
chore(cluster-scanner): mirrors shall always be an object
Browse files Browse the repository at this point in the history
  • Loading branch information
michele-mangili committed Oct 5, 2023
1 parent 876435c commit f7f09b2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/cluster-scanner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ The following table lists the configurable parameters of the `cluster-scanner` c
| imageSbomExtractor.cache.local.maxSizeBytes | The maximum size in bytes of the local cache. By default it is set to 35MB | <code>"36700160"</code> |
| imageSbomExtractor.cache.local.maxElementSizeBytes | When using `local` as cache type, restrict the maximum size of elements to be cached. By default it is set to 100KB | <code>"102400"</code> |
| imageSbomExtractor.cache.local.ttl | The TTL for items in the local cache. By default it is set to 7 days. | <code>"168h"</code> |
| imageSbomExtractor.mirrors | Provide optional registry mirrors configuration to be used by Image SBOM Extractor to pull images. [Only Docker HUB images](https://docs.docker.com/registry/recipes/mirror/#gotcha) are going to be pulled from the provided mirrors. The configuration is similar to the one currently supported by the docker-daemon where multiple mirrors (potentially insecure), can be specified. See https://docs.docker.com/registry/recipes/mirror/#configure-the-docker-daemon and https://docs.docker.com/registry/insecure/ . <br> Example: <br> `mirrors:` <br> `registryMirrors:` <br> `- insecure.mirror.acme.com` <br> `- secure.mirror.acme.com` <br> `insecureRegistries:` <br> `- insecure.mirror.acme.com` | <code></code> |
| imageSbomExtractor.mirrors | Provide optional registry mirrors configuration to be used by Image SBOM Extractor to pull images. [Only Docker HUB images](https://docs.docker.com/registry/recipes/mirror/#gotcha) are going to be pulled from the provided mirrors. The configuration is similar to the one currently supported by the docker-daemon where multiple mirrors (potentially insecure), can be specified. See https://docs.docker.com/registry/recipes/mirror/#configure-the-docker-daemon and https://docs.docker.com/registry/insecure/ . <br> Example: <br> `mirrors:` <br> `registryMirrors:` <br> `- insecure.mirror.acme.com` <br> `- secure.mirror.acme.com` <br> `insecureRegistries:` <br> `- insecure.mirror.acme.com` | <code>{}</code> |
| nameOverride | Chart name override | <code>""</code> |
| fullnameOverride | Chart full name override | <code>""</code> |
| serviceAccount.create | Specifies whether a service account should be created | <code>true</code> |
Expand Down
4 changes: 2 additions & 2 deletions charts/cluster-scanner/tests/registrymirror_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ release:
tests:
- it: "does not have mirrors, if they are not provided"
set:
imageSbomExtractor.mirrors:
imageSbomExtractor.mirrors: {}
asserts:
- hasDocuments:
count: 0
Expand Down Expand Up @@ -105,7 +105,7 @@ tests:
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,null], given: integer\n"
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:
Expand Down
2 changes: 1 addition & 1 deletion charts/cluster-scanner/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"type": "object",
"properties": {
"mirrors": {
"type": ["object", "null"],
"type": "object",
"additionalProperties": false,
"properties": {
"registryMirrors": {
Expand Down
2 changes: 1 addition & 1 deletion charts/cluster-scanner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ imageSbomExtractor:
# - secure.mirror.acme.com
# insecureRegistries:
# - insecure.mirror.acme.com
mirrors:
mirrors: {}

# Chart name override
nameOverride: ""
Expand Down

0 comments on commit f7f09b2

Please sign in to comment.