You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✨ (GoodPracticesValidator) : new check to warning that authors should not create an operator to manage another operator by looking for RBAC permissions to create CRDs (openshift#241)
Upstream-repository: api
Upstream-commit: 05acd7a906c4819f1ad08203524e14b8a8ea4094
// - The channel names seems are not following the convention https://olm.operatorframework.io/docs/best-practices/channel-naming/
23
24
//
24
25
// - CRDs defined in the bundle have empty descriptions
26
+
//
27
+
// - Check if the CSV has permissions to create CRDs. Note that:
28
+
// a) "Operators should own a CRD and only one Operator should control a CRD on a cluster. Two Operators managing the same CRD is not a recommended best practice. In the case where an API exists but with multiple implementations, this is typically an example of a no-op Operator because it doesn't have any deployment or reconciliation loop to define the shared API and other Operators depend on this Operator to provide one implementation of the API, e.g. similar to PVCs or Ingress."
29
+
//
30
+
// b) "An Operator shouldn't deploy or manage other operators (such patterns are known as meta or super operators or include CRDs in its Operands). It's the Operator Lifecycle Manager's job to manage the deployment and lifecycle of operators. For further information check Dependency Resolution: https://olm.operatorframework.io/docs/concepts/olm-architecture/dependency-resolution/"
31
+
//
32
+
// WARNING: if you create CRD's via the reconciliations or via the Operands then, OLM cannot handle CRDs migration and update, validation.
name: "should not return warning when has no permissions",
195
+
args: args{
196
+
bundleCSV: bundle.CSV,
197
+
},
198
+
wantWarn: false,
199
+
},
200
+
{
201
+
name: "should return warning when has permissions for all verbs and resources kind of the apiGroup",
202
+
args: args{
203
+
bundleCSV: bundleWithPermissions.CSV,
204
+
},
205
+
wantWarn: true,
206
+
warnStrings: []string{"CSV contains permissions to create CRD. An Operator shouldn't deploy or manage other operators (such patterns are known as meta or super operators or include CRDs in its Operands). It's the Operator Lifecycle Manager's job to manage the deployment and lifecycle of operators. Please, review the design of your solution and if you should not be using Dependency Resolution from OLM instead. More info: https://sdk.operatorframework.io/docs/best-practices/common-recommendation/"},
207
+
},
208
+
{
209
+
name: "should return warning when has permissions for all verbs with the resource specified",
210
+
args: args{
211
+
bundleCSV: bundleWithPermissionsResource.CSV,
212
+
},
213
+
wantWarn: true,
214
+
warnStrings: []string{"CSV contains permissions to create CRD. An Operator shouldn't deploy or manage other operators (such patterns are known as meta or super operators or include CRDs in its Operands). It's the Operator Lifecycle Manager's job to manage the deployment and lifecycle of operators. Please, review the design of your solution and if you should not be using Dependency Resolution from OLM instead. More info: https://sdk.operatorframework.io/docs/best-practices/common-recommendation/"},
215
+
},
216
+
{
217
+
name: "should return warning when has permissions to create a CRD",
warnStrings: []string{"CSV contains permissions to create CRD. An Operator shouldn't deploy or manage other operators (such patterns are known as meta or super operators or include CRDs in its Operands). It's the Operator Lifecycle Manager's job to manage the deployment and lifecycle of operators. Please, review the design of your solution and if you should not be using Dependency Resolution from OLM instead. More info: https://sdk.operatorframework.io/docs/best-practices/common-recommendation/"},
223
+
},
224
+
{
225
+
name: "should return warning when has permissions to create a Patch a CRD",
warnStrings: []string{"CSV contains permissions to create CRD. An Operator shouldn't deploy or manage other operators (such patterns are known as meta or super operators or include CRDs in its Operands). It's the Operator Lifecycle Manager's job to manage the deployment and lifecycle of operators. Please, review the design of your solution and if you should not be using Dependency Resolution from OLM instead. More info: https://sdk.operatorframework.io/docs/best-practices/common-recommendation/"},
0 commit comments