Skip to content

Commit 28c8415

Browse files
add multiarch optional validator (#5908)
Bump of the API + add the new validator
1 parent eb430f0 commit 28c8415

File tree

6 files changed

+46
-5
lines changed

6 files changed

+46
-5
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# entries is a list of entries to include in
2+
# release notes and/or the migration guide
3+
entries:
4+
- description: >
5+
(Alpha) New optional validator to help verify if a bundle matches criteria for multiple architecture support. More info: https://olm.operatorframework.io/docs/advanced-tasks/ship-operator-supporting-multiarch/.
6+
You can test it out by running `$ operator-sdk bundle validate ./bundle --select-optional name=multiarch`
7+
kind: "addition"
8+
breaking: false
9+
- description: >
10+
Moved bundle name validation check to the good-practices validator.
11+
You can test it out by running `$ operator-sdk bundle validate ./bundle --select-optional name=good-practices`
12+
kind: "addition"
13+
breaking: false

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2
1414
github.com/onsi/ginkgo v1.16.5
1515
github.com/onsi/gomega v1.18.1
16-
github.com/operator-framework/api v0.15.0
16+
github.com/operator-framework/api v0.15.1-0.20220624132056-decf74800a17
1717
github.com/operator-framework/helm-operator-plugins v0.0.12-0.20220616200420-1a695cb9f6a1
1818
github.com/operator-framework/java-operator-plugins v0.5.1
1919
github.com/operator-framework/operator-lib v0.11.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,8 +865,8 @@ github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.m
865865
github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8=
866866
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
867867
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
868-
github.com/operator-framework/api v0.15.0 h1:4f9i0drtqHj7ykLoHxv92GR43S7MmQHhmFQkfm5YaGI=
869-
github.com/operator-framework/api v0.15.0/go.mod h1:scnY9xqSeCsOdtJtNoHIXd7OtHZ14gj1hkDA4+DlgLY=
868+
github.com/operator-framework/api v0.15.1-0.20220624132056-decf74800a17 h1:05SuHwvLPituTsGnzoapFtJT+HVD+9noxCQBkmfWScw=
869+
github.com/operator-framework/api v0.15.1-0.20220624132056-decf74800a17/go.mod h1:scnY9xqSeCsOdtJtNoHIXd7OtHZ14gj1hkDA4+DlgLY=
870870
github.com/operator-framework/helm-operator-plugins v0.0.12-0.20220616200420-1a695cb9f6a1 h1:ulX/0zkiQIg2JkVuAtC329ygfXHg9Sb578vQ7kdNVkY=
871871
github.com/operator-framework/helm-operator-plugins v0.0.12-0.20220616200420-1a695cb9f6a1/go.mod h1:D7zPPwmIFBqHtWigU2iJiLuZ0v7hOJOb1/VC+/UuBAQ=
872872
github.com/operator-framework/java-operator-plugins v0.5.1 h1:HmiTocc61d/uqVPY/7EUR6ZTHDVeZ5/fgy7uo1QIBFc=

internal/cmd/operator-sdk/bundle/validate/cmd.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,17 @@ To validate a bundle against the (alpha) validator for Deprecated APIs specifica
100100
To validate a bundle against an external validator, in addition to required bundle validators:
101101
102102
$ operator-sdk bundle validate ./bundle --alpha-select-external /path/to/external-validator[:/path/to/optional-second-validator]
103-
`
103+
104+
To validate a bundle against the (alpha) validator for Multiple Architectures bundle validation, in addition to required bundle validators:
105+
106+
IMPORTANT: To use this option it is required to have access to pull the images defined on the CSV.
107+
108+
$ operator-sdk bundle validate ./bundle --select-optional name=multiarch
109+
110+
NOTE: The --optional-values can be used to inform the container-tools that should be used i.e. "--optional-values=container-tools=docker".
111+
The valid values for the container-tools optional value are [docker, podman, none]. If no value is supplied then the command will default to using docker to inspect the images.
112+
More info: https://github.com/operator-framework/api/blob/master/pkg/validation/internal/multiarch.go
113+
`
104114
)
105115

106116
// NewCmd returns a command that will validate an operator bundle.

internal/cmd/operator-sdk/bundle/validate/optional.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ var optionalValidators = validators{
7070
},
7171
desc: "Good Practices bundle validation. This validator validates the bundle against criteria and suggestions defined as good practices for bundles under the operator-framework solutions. More info: https://sdk.operatorframework.io/docs/best-practices/.",
7272
},
73+
{
74+
Validator: apivalidation.MultipleArchitecturesValidator,
75+
name: "multiarch",
76+
labels: map[string]string{
77+
nameKey: "multiarch",
78+
},
79+
desc: "(Alpha) Multiple Architectures bundle validation. This validator validates the bundle against criteria defined to configure the support for multiple architectures. More info: https://olm.operatorframework.io/docs/advanced-tasks/ship-operator-supporting-multiarch/.",
80+
},
7381
}
7482

7583
// runOptionalValidators runs optional validators selected by sel on bundle.

website/content/en/docs/cli/operator-sdk_bundle_validate.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,17 @@ To validate a bundle against the (alpha) validator for Deprecated APIs specifica
8686
To validate a bundle against an external validator, in addition to required bundle validators:
8787
8888
$ operator-sdk bundle validate ./bundle --alpha-select-external /path/to/external-validator[:/path/to/optional-second-validator]
89-
89+
90+
To validate a bundle against the (alpha) validator for Multiple Architectures bundle validation, in addition to required bundle validators:
91+
92+
IMPORTANT: To use this option it is required to have access to pull the images defined on the CSV.
93+
94+
$ operator-sdk bundle validate ./bundle --select-optional name=multiarch
95+
96+
NOTE: The --optional-values can be used to inform the container-tools that should be used i.e. "--optional-values=container-tools=docker".
97+
The valid values for the container-tools optional value are [docker, podman, none]. If no value is supplied then the command will default to using docker to inspect the images.
98+
More info: https://github.com/operator-framework/api/blob/master/pkg/validation/internal/multiarch.go
99+
90100
```
91101

92102
### Options

0 commit comments

Comments
 (0)