-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Policy/policy.open-cluster-management.io stuck in progressing st…
…atus when no clusters match the policy (#21296) (#21297) Signed-off-by: Michele Baldessari <michele@acksyn.org>
- Loading branch information
1 parent
87539aa
commit ed3cc48
Showing
4 changed files
with
130 additions
and
1 deletion.
There are no files selected for viewing
17 changes: 16 additions & 1 deletion
17
resource_customizations/policy.open-cluster-management.io/Policy/health.lua
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
55 changes: 55 additions & 0 deletions
55
...cy.open-cluster-management.io/Policy/testdata/healthy_with_placement_empty_compliant.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,55 @@ | ||
apiVersion: policy.open-cluster-management.io/v1 | ||
kind: Policy | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/compare-options: IgnoreExtraneous | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
labels: | ||
argocd.argoproj.io/instance: acm | ||
name: acm-hub-ca-policy | ||
namespace: open-cluster-management | ||
spec: | ||
disabled: false | ||
policy-templates: | ||
- objectDefinition: | ||
apiVersion: policy.open-cluster-management.io/v1 | ||
kind: ConfigurationPolicy | ||
metadata: | ||
name: acm-hub-ca-config-policy | ||
spec: | ||
namespaceSelector: | ||
include: | ||
- default | ||
object-templates: | ||
- complianceType: mustonlyhave | ||
objectDefinition: | ||
apiVersion: v1 | ||
data: | ||
hub-kube-root-ca.crt: '{{hub fromConfigMap "" "kube-root-ca.crt" "ca.crt" | ||
| base64enc hub}}' | ||
hub-openshift-service-ca.crt: '{{hub fromConfigMap "" "openshift-service-ca.crt" | ||
"service-ca.crt" | base64enc hub}}' | ||
kind: Secret | ||
metadata: | ||
name: hub-ca | ||
namespace: golang-external-secrets | ||
type: Opaque | ||
- complianceType: mustonlyhave | ||
objectDefinition: | ||
apiVersion: v1 | ||
data: | ||
hub-kube-root-ca.crt: | | ||
{{hub fromConfigMap "" "kube-root-ca.crt" "ca.crt" | autoindent hub}} | ||
hub-openshift-service-ca.crt: | | ||
{{hub fromConfigMap "" "openshift-service-ca.crt" "service-ca.crt" | autoindent hub}} | ||
kind: ConfigMap | ||
metadata: | ||
name: trusted-hub-bundle | ||
namespace: imperative | ||
remediationAction: enforce | ||
severity: medium | ||
remediationAction: enforce | ||
status: | ||
placement: | ||
- placementBinding: acm-hub-ca-policy-placement-binding | ||
placementRule: acm-hub-ca-policy-placement |
51 changes: 51 additions & 0 deletions
51
...stomizations/policy.open-cluster-management.io/Policy/testdata/progressing_no_status.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,51 @@ | ||
apiVersion: policy.open-cluster-management.io/v1 | ||
kind: Policy | ||
metadata: | ||
annotations: | ||
argocd.argoproj.io/compare-options: IgnoreExtraneous | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
labels: | ||
argocd.argoproj.io/instance: acm | ||
name: acm-hub-ca-policy | ||
namespace: open-cluster-management | ||
spec: | ||
disabled: false | ||
policy-templates: | ||
- objectDefinition: | ||
apiVersion: policy.open-cluster-management.io/v1 | ||
kind: ConfigurationPolicy | ||
metadata: | ||
name: acm-hub-ca-config-policy | ||
spec: | ||
namespaceSelector: | ||
include: | ||
- default | ||
object-templates: | ||
- complianceType: mustonlyhave | ||
objectDefinition: | ||
apiVersion: v1 | ||
data: | ||
hub-kube-root-ca.crt: '{{hub fromConfigMap "" "kube-root-ca.crt" "ca.crt" | ||
| base64enc hub}}' | ||
hub-openshift-service-ca.crt: '{{hub fromConfigMap "" "openshift-service-ca.crt" | ||
"service-ca.crt" | base64enc hub}}' | ||
kind: Secret | ||
metadata: | ||
name: hub-ca | ||
namespace: golang-external-secrets | ||
type: Opaque | ||
- complianceType: mustonlyhave | ||
objectDefinition: | ||
apiVersion: v1 | ||
data: | ||
hub-kube-root-ca.crt: | | ||
{{hub fromConfigMap "" "kube-root-ca.crt" "ca.crt" | autoindent hub}} | ||
hub-openshift-service-ca.crt: | | ||
{{hub fromConfigMap "" "openshift-service-ca.crt" "service-ca.crt" | autoindent hub}} | ||
kind: ConfigMap | ||
metadata: | ||
name: trusted-hub-bundle | ||
namespace: imperative | ||
remediationAction: enforce | ||
severity: medium | ||
remediationAction: enforce |