Skip to content

Commit ff6b5eb

Browse files
validator/good practices: Improve message (#206)
1 parent 7f43803 commit ff6b5eb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/validation/internal/good_practices.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ func validateResourceRequests(csv *operatorsv1alpha1.ClusterServiceVersion) (err
6565
for _, dSpec := range deploymentSpec {
6666
for _, c := range dSpec.Spec.Template.Spec.Containers {
6767
if c.Resources.Requests == nil || !(len(c.Resources.Requests.Cpu().String()) != 0 && len(c.Resources.Requests.Memory().String()) != 0) {
68-
msg := fmt.Errorf("unable to find the resource requests for the container %s. It is recommended "+
68+
msg := fmt.Errorf("unable to find the resource requests for the container: (%s). It is recommended "+
6969
"to ensure the resource request for CPU and Memory. Be aware that for some clusters configurations "+
7070
"it is required to specify requests or limits for those values. Otherwise, the system or quota may "+
71-
"reject Pod creation. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", c.Name)
71+
"reject Pod creation. More info: https://master.sdk.operatorframework.io/docs/best-practices/managing-resources/", c.Name)
7272
warns = append(warns, msg)
7373
}
7474
}

pkg/validation/internal/good_practices_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ func Test_ValidateGoodPractices(t *testing.T) {
3232
{
3333
name: "should raise an waring when the resource request is NOT set for any of the containers defined in the bundle",
3434
wantWarning: true,
35-
warnStrings: []string{"Warning: Value memcached-operator.v0.0.1: unable to find the resource requests for the container kube-rbac-proxy. It is recommended to ensure the resource request for CPU and Memory. Be aware that for some clusters configurations it is required to specify requests or limits for those values. Otherwise, the system or quota may reject Pod creation. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/",
36-
"Warning: Value memcached-operator.v0.0.1: unable to find the resource requests for the container manager. It is recommended to ensure the resource request for CPU and Memory. Be aware that for some clusters configurations it is required to specify requests or limits for those values. Otherwise, the system or quota may reject Pod creation. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/"},
35+
warnStrings: []string{"Warning: Value memcached-operator.v0.0.1: unable to find the resource requests for the container: (kube-rbac-proxy). It is recommended to ensure the resource request for CPU and Memory. Be aware that for some clusters configurations it is required to specify requests or limits for those values. Otherwise, the system or quota may reject Pod creation. More info: https://master.sdk.operatorframework.io/docs/best-practices/managing-resources/",
36+
"Warning: Value memcached-operator.v0.0.1: unable to find the resource requests for the container: (manager). It is recommended to ensure the resource request for CPU and Memory. Be aware that for some clusters configurations it is required to specify requests or limits for those values. Otherwise, the system or quota may reject Pod creation. More info: https://master.sdk.operatorframework.io/docs/best-practices/managing-resources/"},
3737
args: args{
3838
bundleDir: "./testdata/valid_bundle_v1",
3939
},

0 commit comments

Comments
 (0)