-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug: Policy compliance status is truncated
Description of problem: The status message for non compliant policy is truncated with "..." when the policy has multiple objectTemplates or a namespace. This leaves the user unable to determine why the policy is non compliant. Expect result: message should include all information Signed-off-by: Yi Rae Kim <yikim@redhat.com>
- Loading branch information
1 parent
48f6ec2
commit d886661
Showing
5 changed files
with
163 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
test/resources/case31_policy_history/long-message-config-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
apiVersion: policy.open-cluster-management.io/v1 | ||
kind: ConfigurationPolicy | ||
metadata: | ||
name: long-message-config-policy | ||
ownerReferences: | ||
- apiVersion: policy.open-cluster-management.io/v1 | ||
blockOwnerDeletion: false | ||
controller: true | ||
kind: Policy | ||
name: long-message-policy | ||
uid: 08bae967-4262-498a-84e9-d1f0e321b41e | ||
spec: | ||
pruneObjectBehavior: DeleteAll | ||
remediationAction: inform | ||
namespaceSelector: | ||
exclude: | ||
- kube-* | ||
include: | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt1 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt2 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt3 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt4 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt5 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt6 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt7 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt8 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt9 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt10 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt11 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt12 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt13 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt14 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt15 | ||
object-templates: | ||
- complianceType: musthave | ||
objectDefinition: | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: case31-multi-namespace-inform-pod | ||
spec: | ||
containers: | ||
- image: nginx:1.7.9 | ||
imagePullPolicy: Never | ||
name: nginx | ||
ports: | ||
- containerPort: 80 |
50 changes: 50 additions & 0 deletions
50
test/resources/case31_policy_history/long-message-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apiVersion: policy.open-cluster-management.io/v1 | ||
kind: Policy | ||
metadata: | ||
resourceVersion: "306" | ||
name: long-message-policy | ||
spec: | ||
remediationAction: inform | ||
disabled: false | ||
policy-templates: | ||
- objectDefinition: | ||
apiVersion: policy.open-cluster-management.io/v1 | ||
kind: ConfigurationPolicy | ||
metadata: | ||
name: long-message-config-policy | ||
spec: | ||
namespaceselector: | ||
exclude: | ||
- kube-* | ||
include: | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt1 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt2 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt3 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt4 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt5 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt6 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt7 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt8 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt9 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt10 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt11 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt12 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt13 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt14 | ||
- innovafertanimvsmvtatasdicereformascorporinnovafertanimvsmvt15 | ||
object-templates: | ||
- complianceType: musthave | ||
objectDefinition: | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: case31-multi-namespace-inform-pod | ||
spec: | ||
containers: | ||
- image: nginx:1.7.9 | ||
imagePullPolicy: Never | ||
name: nginx | ||
ports: | ||
- containerPort: 80 | ||
remediationAction: inform | ||
severity: low |