@@ -37,7 +37,7 @@ import (
37
37
kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing"
38
38
"github.com/kcp-dev/logicalcluster/v3"
39
39
40
- apisv1alpha1 "github.com/kcp-dev/kcp/sdk/apis/apis/v1alpha1 "
40
+ apisv1alpha2 "github.com/kcp-dev/kcp/sdk/apis/apis/v1alpha2 "
41
41
"github.com/kcp-dev/kcp/sdk/apis/core"
42
42
corev1alpha1 "github.com/kcp-dev/kcp/sdk/apis/core/v1alpha1"
43
43
tenancyv1alpha1 "github.com/kcp-dev/kcp/sdk/apis/tenancy/v1alpha1"
@@ -68,7 +68,7 @@ func TestUse(t *testing.T) {
68
68
discovery map [logicalcluster.Path ][]* metav1.APIResourceList
69
69
discoveryErrors map [logicalcluster.Path ]error
70
70
unready map [logicalcluster.Path ]map [string ]bool // unready workspaces
71
- apiBindings []apisv1alpha1 .APIBinding // APIBindings that exist in the destination workspace, if any
71
+ apiBindings []apisv1alpha2 .APIBinding // APIBindings that exist in the destination workspace, if any
72
72
destination string // workspace set to 'current' at the end of execution
73
73
short bool
74
74
@@ -468,9 +468,9 @@ func TestUse(t *testing.T) {
468
468
param : "bar" ,
469
469
expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
470
470
destination : "root:foo:bar" ,
471
- apiBindings : []apisv1alpha1 .APIBinding {
471
+ apiBindings : []apisv1alpha2 .APIBinding {
472
472
newBindingBuilder ("a" ).
473
- WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha1 .ClaimAccepted ).
473
+ WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha2 .ClaimAccepted ).
474
474
WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
475
475
Build (),
476
476
},
@@ -486,7 +486,7 @@ func TestUse(t *testing.T) {
486
486
param : "bar" ,
487
487
expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
488
488
destination : "root:foo:bar" ,
489
- apiBindings : []apisv1alpha1 .APIBinding {
489
+ apiBindings : []apisv1alpha2 .APIBinding {
490
490
newBindingBuilder ("a" ).
491
491
WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , "" ).
492
492
WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
@@ -508,9 +508,9 @@ func TestUse(t *testing.T) {
508
508
param : "~" ,
509
509
expected : NewKubeconfig ().WithKcpCurrent (homeWorkspace .String ()).WithKcpPrevious ("root:foo" ).Build (),
510
510
destination : homeWorkspace .String (),
511
- apiBindings : []apisv1alpha1 .APIBinding {
511
+ apiBindings : []apisv1alpha2 .APIBinding {
512
512
newBindingBuilder ("a" ).
513
- WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha1 .ClaimAccepted ).
513
+ WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha2 .ClaimAccepted ).
514
514
WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
515
515
WithExportClaim ("" , "configmaps" , "" ).
516
516
Build (),
@@ -530,9 +530,9 @@ func TestUse(t *testing.T) {
530
530
param : "-" ,
531
531
expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
532
532
destination : "root:foo:bar" ,
533
- apiBindings : []apisv1alpha1 .APIBinding {
533
+ apiBindings : []apisv1alpha2 .APIBinding {
534
534
newBindingBuilder ("a" ).
535
- WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha1 .ClaimAccepted ).
535
+ WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha2 .ClaimAccepted ).
536
536
WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
537
537
WithExportClaim ("" , "configmaps" , "" ).
538
538
Build (),
@@ -553,9 +553,9 @@ func TestUse(t *testing.T) {
553
553
param : "bar" ,
554
554
expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
555
555
destination : "root:foo:bar" ,
556
- apiBindings : []apisv1alpha1 .APIBinding {
556
+ apiBindings : []apisv1alpha2 .APIBinding {
557
557
newBindingBuilder ("a" ).
558
- WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha1 .ClaimRejected ).
558
+ WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha2 .ClaimRejected ).
559
559
WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
560
560
Build (),
561
561
},
@@ -573,9 +573,9 @@ func TestUse(t *testing.T) {
573
573
param : "bar" ,
574
574
expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
575
575
destination : "root:foo:bar" ,
576
- apiBindings : []apisv1alpha1 .APIBinding {
576
+ apiBindings : []apisv1alpha2 .APIBinding {
577
577
newBindingBuilder ("a" ).
578
- WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha1 .ClaimAccepted ).
578
+ WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha2 .ClaimAccepted ).
579
579
WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
580
580
Build (),
581
581
},
@@ -593,9 +593,9 @@ func TestUse(t *testing.T) {
593
593
param : "bar" ,
594
594
expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
595
595
destination : "root:foo:bar" ,
596
- apiBindings : []apisv1alpha1 .APIBinding {
596
+ apiBindings : []apisv1alpha2 .APIBinding {
597
597
newBindingBuilder ("a" ).
598
- WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha1 .ClaimAccepted ).
598
+ WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha2 .ClaimAccepted ).
599
599
WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
600
600
WithExportClaim ("" , "configmaps" , "" ).
601
601
Build (),
@@ -616,7 +616,7 @@ func TestUse(t *testing.T) {
616
616
param : "bar" ,
617
617
expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
618
618
destination : "root:foo:bar" ,
619
- apiBindings : []apisv1alpha1 .APIBinding {
619
+ apiBindings : []apisv1alpha2 .APIBinding {
620
620
newBindingBuilder ("a" ).
621
621
WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , "" ).
622
622
WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
@@ -638,7 +638,7 @@ func TestUse(t *testing.T) {
638
638
param : "bar" ,
639
639
expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
640
640
destination : "root:foo:bar" ,
641
- apiBindings : []apisv1alpha1 .APIBinding {
641
+ apiBindings : []apisv1alpha2 .APIBinding {
642
642
newBindingBuilder ("a" ).
643
643
WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , "" ).
644
644
WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
@@ -662,7 +662,7 @@ func TestUse(t *testing.T) {
662
662
param : "bar" ,
663
663
expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
664
664
destination : "root:foo:bar" ,
665
- apiBindings : []apisv1alpha1 .APIBinding {
665
+ apiBindings : []apisv1alpha2 .APIBinding {
666
666
newBindingBuilder ("a" ).
667
667
WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , "" ).
668
668
WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
@@ -686,7 +686,7 @@ func TestUse(t *testing.T) {
686
686
param : "bar" ,
687
687
expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
688
688
destination : "root:foo:bar" ,
689
- apiBindings : []apisv1alpha1 .APIBinding {
689
+ apiBindings : []apisv1alpha2 .APIBinding {
690
690
newBindingBuilder ("a" ).
691
691
WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
692
692
WithExportClaim ("" , "configmaps" , "" ).
@@ -791,14 +791,14 @@ func TestUse(t *testing.T) {
791
791
})
792
792
793
793
// return nothing in the default case.
794
- getAPIBindings := func (ctx context.Context , kcpClusterClient kcpclientset.ClusterInterface , host string ) ([]apisv1alpha1 .APIBinding , error ) {
794
+ getAPIBindings := func (ctx context.Context , kcpClusterClient kcpclientset.ClusterInterface , host string ) ([]apisv1alpha2 .APIBinding , error ) {
795
795
return nil , nil
796
796
}
797
797
798
798
if tt .destination != "" {
799
799
// Add APIBindings to our Clientset if we have them
800
800
if len (tt .apiBindings ) > 0 {
801
- getAPIBindings = func (ctx context.Context , kcpClusterClient kcpclientset.ClusterInterface , host string ) ([]apisv1alpha1 .APIBinding , error ) {
801
+ getAPIBindings = func (ctx context.Context , kcpClusterClient kcpclientset.ClusterInterface , host string ) ([]apisv1alpha2 .APIBinding , error ) {
802
802
return tt .apiBindings , nil
803
803
}
804
804
}
@@ -946,7 +946,7 @@ func (c errorDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) {
946
946
}
947
947
948
948
type bindingBuilder struct {
949
- apisv1alpha1 .APIBinding
949
+ apisv1alpha2 .APIBinding
950
950
}
951
951
952
952
func newBindingBuilder (name string ) * bindingBuilder {
@@ -957,14 +957,14 @@ func newBindingBuilder(name string) *bindingBuilder {
957
957
return b
958
958
}
959
959
960
- func (b * bindingBuilder ) WithPermissionClaim (group , resource , identityHash string , state apisv1alpha1 .AcceptablePermissionClaimState ) * bindingBuilder {
960
+ func (b * bindingBuilder ) WithPermissionClaim (group , resource , identityHash string , state apisv1alpha2 .AcceptablePermissionClaimState ) * bindingBuilder {
961
961
if len (b .Spec .PermissionClaims ) == 0 {
962
- b .Spec .PermissionClaims = make ([]apisv1alpha1 .AcceptablePermissionClaim , 0 )
962
+ b .Spec .PermissionClaims = make ([]apisv1alpha2 .AcceptablePermissionClaim , 0 )
963
963
}
964
964
965
- pc := apisv1alpha1 .AcceptablePermissionClaim {
966
- PermissionClaim : apisv1alpha1 .PermissionClaim {
967
- GroupResource : apisv1alpha1 .GroupResource {
965
+ pc := apisv1alpha2 .AcceptablePermissionClaim {
966
+ PermissionClaim : apisv1alpha2 .PermissionClaim {
967
+ GroupResource : apisv1alpha2 .GroupResource {
968
968
Group : group ,
969
969
Resource : resource ,
970
970
},
@@ -982,11 +982,11 @@ func (b *bindingBuilder) WithPermissionClaim(group, resource, identityHash strin
982
982
983
983
func (b * bindingBuilder ) WithExportClaim (group , resource , identityHash string ) * bindingBuilder {
984
984
if len (b .Status .ExportPermissionClaims ) == 0 {
985
- b .Status .ExportPermissionClaims = make ([]apisv1alpha1 .PermissionClaim , 0 )
985
+ b .Status .ExportPermissionClaims = make ([]apisv1alpha2 .PermissionClaim , 0 )
986
986
}
987
987
988
- pc := apisv1alpha1 .PermissionClaim {
989
- GroupResource : apisv1alpha1 .GroupResource {
988
+ pc := apisv1alpha2 .PermissionClaim {
989
+ GroupResource : apisv1alpha2 .GroupResource {
990
990
Group : group ,
991
991
Resource : resource ,
992
992
},
@@ -997,6 +997,6 @@ func (b *bindingBuilder) WithExportClaim(group, resource, identityHash string) *
997
997
return b
998
998
}
999
999
1000
- func (b * bindingBuilder ) Build () apisv1alpha1 .APIBinding {
1000
+ func (b * bindingBuilder ) Build () apisv1alpha2 .APIBinding {
1001
1001
return b .APIBinding
1002
1002
}
0 commit comments