Skip to content

Commit 3f0afe5

Browse files
camilamacedo86perdasilva
authored andcommitted
validator/good practices: Improve message (openshift#206)
Upstream-repository: api Upstream-commit: ff6b5ebe3c251e09ef4bf11a6fcd1bd8464be1d6
1 parent f7d6640 commit 3f0afe5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

staging/api/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
}

staging/api/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
},

vendor/github.com/operator-framework/api/pkg/validation/internal/good_practices.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)