Skip to content

Commit

Permalink
Rename soaking annotation to ran.openshift.io/soak-seconds (#498)
Browse files Browse the repository at this point in the history
Signed-off-by: Saeid Askari <saskari@redhat.com>
Co-authored-by: Saeid Askari <saskari@redhat.com>
  • Loading branch information
1 parent 86dd218 commit 7085aea
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion controllers/utils/constants.go
Expand Up @@ -145,4 +145,4 @@ const SpaceRequiredForPrecache = "15" // Gigabytes

// SoakAnnotation is the annotation that can be set on policies, which indicates the least number number of seconds
// which policies should be compliant before the cgu moves on from that policy
const SoakAnnotation = "soakSeconds"
const SoakAnnotation = "ran.openshift.io/soak-seconds"
4 changes: 2 additions & 2 deletions controllers/utils/policy_util_test.go
Expand Up @@ -31,7 +31,7 @@ func TestShouldSoak(t *testing.T) {
// annotation present and soak duration is not over
policy := &unstructured.Unstructured{}
policy.SetAnnotations(map[string]string{
"soakSeconds": "10",
SoakAnnotation: "10",
})
res, err = ShouldSoak(policy, v1.Now())
assert.Equal(t, true, res)
Expand All @@ -50,7 +50,7 @@ func TestShouldSoak(t *testing.T) {

// annotation present, soak duration is invalid
policy.SetAnnotations(map[string]string{
"soakSeconds": "-1",
SoakAnnotation: "-1",
})
_, err = ShouldSoak(policy, v1.Now())
assert.Error(t, err)
Expand Down
2 changes: 1 addition & 1 deletion deploy/acm/policies/all_policies/child-policy1-soak.yaml
Expand Up @@ -5,7 +5,7 @@ metadata:
policy.open-cluster-management.io/categories: CM Configuration Management
policy.open-cluster-management.io/controls: CM-2 Baseline Configuration
policy.open-cluster-management.io/standards: NIST SP 800-53
soakSeconds: "5"
ran.openshift.io/soak-seconds: "5"
labels:
policy.open-cluster-management.io/root-policy: policy1-common-cluster-version-policy
name: default.policy1-common-cluster-version-policy
Expand Down
2 changes: 1 addition & 1 deletion deploy/acm/policies/all_policies/policy1-soak.yaml
Expand Up @@ -5,7 +5,7 @@ metadata:
policy.open-cluster-management.io/categories: CM Configuration Management
policy.open-cluster-management.io/controls: CM-2 Baseline Configuration
policy.open-cluster-management.io/standards: NIST SP 800-53
soakSeconds: "5"
ran.openshift.io/soak-seconds: "5"
name: policy1-common-cluster-version-policy
spec:
disabled: false
Expand Down
2 changes: 1 addition & 1 deletion tests/kuttl/tests/soaking/02-wait-and-reconcile.yaml
Expand Up @@ -2,6 +2,6 @@ apiVersion: kuttl.dev/v1beta1
kind: TestStep

commands:
# Wait for the soakSeconds and trigger reconcilation
# Wait for 'ran.openshift.io/soak-seconds' and trigger reconcilation
- command: sleep 5
- command: oc --namespace=default patch clustergroupupgrade.ran.openshift.io/cgu-soaking --patch '{"spec":{"remediationStrategy":{"timeout":240}}}' --type=merge

0 comments on commit 7085aea

Please sign in to comment.