@@ -18,10 +18,12 @@ import (
1818
1919const (
2020 configPolicyKind = "ConfigurationPolicy"
21- policyAPIVersion = "policy.open-cluster-management.io/v1"
21+ policyAPIGroup = "policy.open-cluster-management.io"
22+ policyAPIVersion = policyAPIGroup + "/v1"
2223 policyKind = "Policy"
24+ poilcySetAPIVersion = policyAPIGroup + "/v1beta1"
2325 policySetKind = "PolicySet"
24- placementBindingAPIVersion = "policy.open-cluster-management.io /v1"
26+ placementBindingAPIVersion = policyAPIGroup + " /v1"
2527 placementBindingKind = "PlacementBinding"
2628 placementRuleAPIVersion = "apps.open-cluster-management.io/v1"
2729 placementRuleKind = "PlacementRule"
@@ -870,7 +872,7 @@ func (p *Plugin) createPolicy(policyConf *types.PolicyConfig) error {
870872// manifests specified in the configuration are invalid or can't be read.
871873func (p * Plugin ) createPolicySet (policySetConf * types.PolicySetConfig ) error {
872874 policyset := map [string ]interface {}{
873- "apiVersion" : policyAPIVersion ,
875+ "apiVersion" : poilcySetAPIVersion ,
874876 "kind" : policySetKind ,
875877 "metadata" : map [string ]interface {}{
876878 "name" : policySetConf .Name ,
@@ -1142,8 +1144,7 @@ func (p *Plugin) createPlacementBinding(
11421144 subjects := make ([]map [string ]string , 0 , len (policyConfs )+ len (policySetConfs ))
11431145 for _ , policyConf := range policyConfs {
11441146 subject := map [string ]string {
1145- // Remove the version at the end
1146- "apiGroup" : strings .Split (policyAPIVersion , "/" )[0 ],
1147+ "apiGroup" : policyAPIGroup ,
11471148 "kind" : policyKind ,
11481149 "name" : policyConf .Name ,
11491150 }
@@ -1152,8 +1153,7 @@ func (p *Plugin) createPlacementBinding(
11521153
11531154 for _ , policySetConf := range policySetConfs {
11541155 subject := map [string ]string {
1155- // Remove the version at the end
1156- "apiGroup" : strings .Split (policyAPIVersion , "/" )[0 ],
1156+ "apiGroup" : policyAPIGroup ,
11571157 "kind" : policySetKind ,
11581158 "name" : policySetConf .Name ,
11591159 }
0 commit comments