Skip to content

Commit 15c6719

Browse files
author
Yu Cao
authored
Upgrade placement API to v1beta1 (#38)
Signed-off-by: Yu Cao <[email protected]>
1 parent 14c3d0f commit 15c6719

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

examples/input/placement.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: cluster.open-cluster-management.io/v1alpha1
1+
apiVersion: cluster.open-cluster-management.io/v1beta1
22
kind: Placement
33
metadata:
44
labels:
@@ -7,7 +7,7 @@ metadata:
77
namespace: my-policies
88
spec:
99
predicates:
10-
requiredClusterSelector:
10+
- requiredClusterSelector:
1111
labelSelector:
1212
matchExpressions:
1313
- key: cloud

internal/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const (
2424
placementBindingKind = "PlacementBinding"
2525
placementRuleAPIVersion = "apps.open-cluster-management.io/v1"
2626
placementRuleKind = "PlacementRule"
27-
placementAPIVersion = "cluster.open-cluster-management.io/v1alpha1"
27+
placementAPIVersion = "cluster.open-cluster-management.io/v1beta1"
2828
placementKind = "Placement"
2929
maxObjectNameLength = 63
3030
)

internal/plugin_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ func TestCreatePlacementDefault(t *testing.T) {
534534
output := p.outputBuffer.String()
535535
expected := `
536536
---
537-
apiVersion: cluster.open-cluster-management.io/v1alpha1
537+
apiVersion: cluster.open-cluster-management.io/v1beta1
538538
kind: Placement
539539
metadata:
540540
name: placement-policy-app-config
@@ -574,7 +574,7 @@ func TestCreatePlacementSinglePlr(t *testing.T) {
574574
output := p.outputBuffer.String()
575575
expected := `
576576
---
577-
apiVersion: cluster.open-cluster-management.io/v1alpha1
577+
apiVersion: cluster.open-cluster-management.io/v1beta1
578578
kind: Placement
579579
metadata:
580580
name: my-placement-rule
@@ -660,7 +660,7 @@ func TestCreatePlacementLabelSelector(t *testing.T) {
660660
output := p.outputBuffer.String()
661661
expected := `
662662
---
663-
apiVersion: cluster.open-cluster-management.io/v1alpha1
663+
apiVersion: cluster.open-cluster-management.io/v1beta1
664664
kind: Placement
665665
metadata:
666666
name: placement-policy-app-config
@@ -910,7 +910,7 @@ func TestCreatePlacementPlPath(t *testing.T) {
910910
t.Parallel()
911911
plrYAML := `
912912
---
913-
apiVersion: cluster.open-cluster-management.io/v1alpha1
913+
apiVersion: cluster.open-cluster-management.io/v1beta1
914914
kind: Placement
915915
metadata:
916916
name: my-plr
@@ -942,7 +942,7 @@ func TestCreatePlacementPlPathSkip(t *testing.T) {
942942
t.Parallel()
943943
plrYAML := `
944944
---
945-
apiVersion: cluster.open-cluster-management.io/v1alpha1
945+
apiVersion: cluster.open-cluster-management.io/v1beta1
946946
kind: Placement
947947
metadata:
948948
name: my-plr
@@ -965,7 +965,7 @@ func TestCreatePlacementPlPathNoName(t *testing.T) {
965965
t.Parallel()
966966
plrYAML := `
967967
---
968-
apiVersion: cluster.open-cluster-management.io/v1alpha1
968+
apiVersion: cluster.open-cluster-management.io/v1beta1
969969
kind: Placement
970970
metadata:
971971
namespace: my-policies
@@ -990,7 +990,7 @@ func TestCreatePlacementPlPathNoNamespace(t *testing.T) {
990990
t.Parallel()
991991
plrYAML := `
992992
---
993-
apiVersion: cluster.open-cluster-management.io/v1alpha1
993+
apiVersion: cluster.open-cluster-management.io/v1beta1
994994
kind: Placement
995995
metadata:
996996
name: my-plr
@@ -1015,7 +1015,7 @@ func TestCreatePlacementPlPathWrongNamespace(t *testing.T) {
10151015
t.Parallel()
10161016
plrYAML := `
10171017
---
1018-
apiVersion: cluster.open-cluster-management.io/v1alpha1
1018+
apiVersion: cluster.open-cluster-management.io/v1beta1
10191019
kind: Placement
10201020
metadata:
10211021
name: my-plr
@@ -1069,7 +1069,7 @@ func TestCreatePlacementPlrPathFoundPl(t *testing.T) {
10691069
t.Parallel()
10701070
plrYAML := `
10711071
---
1072-
apiVersion: cluster.open-cluster-management.io/v1alpha1
1072+
apiVersion: cluster.open-cluster-management.io/v1beta1
10731073
kind: Placement
10741074
metadata:
10751075
name: my-plr

0 commit comments

Comments
 (0)