@@ -37,7 +37,7 @@ import (
3737 kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing"
3838 "github.com/kcp-dev/logicalcluster/v3"
3939
40- apisv1alpha1 "github.com/kcp-dev/kcp/sdk/apis/apis/v1alpha1 "
40+ apisv1alpha2 "github.com/kcp-dev/kcp/sdk/apis/apis/v1alpha2 "
4141 "github.com/kcp-dev/kcp/sdk/apis/core"
4242 corev1alpha1 "github.com/kcp-dev/kcp/sdk/apis/core/v1alpha1"
4343 tenancyv1alpha1 "github.com/kcp-dev/kcp/sdk/apis/tenancy/v1alpha1"
@@ -68,7 +68,7 @@ func TestUse(t *testing.T) {
6868 discovery map [logicalcluster.Path ][]* metav1.APIResourceList
6969 discoveryErrors map [logicalcluster.Path ]error
7070 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
7272 destination string // workspace set to 'current' at the end of execution
7373 short bool
7474
@@ -468,9 +468,9 @@ func TestUse(t *testing.T) {
468468 param : "bar" ,
469469 expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
470470 destination : "root:foo:bar" ,
471- apiBindings : []apisv1alpha1 .APIBinding {
471+ apiBindings : []apisv1alpha2 .APIBinding {
472472 newBindingBuilder ("a" ).
473- WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha1 .ClaimAccepted ).
473+ WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha2 .ClaimAccepted ).
474474 WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
475475 Build (),
476476 },
@@ -486,7 +486,7 @@ func TestUse(t *testing.T) {
486486 param : "bar" ,
487487 expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
488488 destination : "root:foo:bar" ,
489- apiBindings : []apisv1alpha1 .APIBinding {
489+ apiBindings : []apisv1alpha2 .APIBinding {
490490 newBindingBuilder ("a" ).
491491 WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , "" ).
492492 WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
@@ -508,9 +508,9 @@ func TestUse(t *testing.T) {
508508 param : "~" ,
509509 expected : NewKubeconfig ().WithKcpCurrent (homeWorkspace .String ()).WithKcpPrevious ("root:foo" ).Build (),
510510 destination : homeWorkspace .String (),
511- apiBindings : []apisv1alpha1 .APIBinding {
511+ apiBindings : []apisv1alpha2 .APIBinding {
512512 newBindingBuilder ("a" ).
513- WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha1 .ClaimAccepted ).
513+ WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha2 .ClaimAccepted ).
514514 WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
515515 WithExportClaim ("" , "configmaps" , "" ).
516516 Build (),
@@ -530,9 +530,9 @@ func TestUse(t *testing.T) {
530530 param : "-" ,
531531 expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
532532 destination : "root:foo:bar" ,
533- apiBindings : []apisv1alpha1 .APIBinding {
533+ apiBindings : []apisv1alpha2 .APIBinding {
534534 newBindingBuilder ("a" ).
535- WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha1 .ClaimAccepted ).
535+ WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha2 .ClaimAccepted ).
536536 WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
537537 WithExportClaim ("" , "configmaps" , "" ).
538538 Build (),
@@ -553,9 +553,9 @@ func TestUse(t *testing.T) {
553553 param : "bar" ,
554554 expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
555555 destination : "root:foo:bar" ,
556- apiBindings : []apisv1alpha1 .APIBinding {
556+ apiBindings : []apisv1alpha2 .APIBinding {
557557 newBindingBuilder ("a" ).
558- WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha1 .ClaimRejected ).
558+ WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha2 .ClaimRejected ).
559559 WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
560560 Build (),
561561 },
@@ -573,9 +573,9 @@ func TestUse(t *testing.T) {
573573 param : "bar" ,
574574 expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
575575 destination : "root:foo:bar" ,
576- apiBindings : []apisv1alpha1 .APIBinding {
576+ apiBindings : []apisv1alpha2 .APIBinding {
577577 newBindingBuilder ("a" ).
578- WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha1 .ClaimAccepted ).
578+ WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha2 .ClaimAccepted ).
579579 WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
580580 Build (),
581581 },
@@ -593,9 +593,9 @@ func TestUse(t *testing.T) {
593593 param : "bar" ,
594594 expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
595595 destination : "root:foo:bar" ,
596- apiBindings : []apisv1alpha1 .APIBinding {
596+ apiBindings : []apisv1alpha2 .APIBinding {
597597 newBindingBuilder ("a" ).
598- WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha1 .ClaimAccepted ).
598+ WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , apisv1alpha2 .ClaimAccepted ).
599599 WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
600600 WithExportClaim ("" , "configmaps" , "" ).
601601 Build (),
@@ -616,7 +616,7 @@ func TestUse(t *testing.T) {
616616 param : "bar" ,
617617 expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
618618 destination : "root:foo:bar" ,
619- apiBindings : []apisv1alpha1 .APIBinding {
619+ apiBindings : []apisv1alpha2 .APIBinding {
620620 newBindingBuilder ("a" ).
621621 WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , "" ).
622622 WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
@@ -638,7 +638,7 @@ func TestUse(t *testing.T) {
638638 param : "bar" ,
639639 expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
640640 destination : "root:foo:bar" ,
641- apiBindings : []apisv1alpha1 .APIBinding {
641+ apiBindings : []apisv1alpha2 .APIBinding {
642642 newBindingBuilder ("a" ).
643643 WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , "" ).
644644 WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
@@ -662,7 +662,7 @@ func TestUse(t *testing.T) {
662662 param : "bar" ,
663663 expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
664664 destination : "root:foo:bar" ,
665- apiBindings : []apisv1alpha1 .APIBinding {
665+ apiBindings : []apisv1alpha2 .APIBinding {
666666 newBindingBuilder ("a" ).
667667 WithPermissionClaim ("test.kcp.io" , "test" , "abcdef" , "" ).
668668 WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
@@ -686,7 +686,7 @@ func TestUse(t *testing.T) {
686686 param : "bar" ,
687687 expected : NewKubeconfig ().WithKcpCurrent ("root:foo:bar" ).WithKcpPrevious ("root:foo" ).Build (),
688688 destination : "root:foo:bar" ,
689- apiBindings : []apisv1alpha1 .APIBinding {
689+ apiBindings : []apisv1alpha2 .APIBinding {
690690 newBindingBuilder ("a" ).
691691 WithExportClaim ("test.kcp.io" , "test" , "abcdef" ).
692692 WithExportClaim ("" , "configmaps" , "" ).
@@ -791,14 +791,14 @@ func TestUse(t *testing.T) {
791791 })
792792
793793 // 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 ) {
795795 return nil , nil
796796 }
797797
798798 if tt .destination != "" {
799799 // Add APIBindings to our Clientset if we have them
800800 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 ) {
802802 return tt .apiBindings , nil
803803 }
804804 }
@@ -946,7 +946,7 @@ func (c errorDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) {
946946}
947947
948948type bindingBuilder struct {
949- apisv1alpha1 .APIBinding
949+ apisv1alpha2 .APIBinding
950950}
951951
952952func newBindingBuilder (name string ) * bindingBuilder {
@@ -957,14 +957,14 @@ func newBindingBuilder(name string) *bindingBuilder {
957957 return b
958958}
959959
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 {
961961 if len (b .Spec .PermissionClaims ) == 0 {
962- b .Spec .PermissionClaims = make ([]apisv1alpha1 .AcceptablePermissionClaim , 0 )
962+ b .Spec .PermissionClaims = make ([]apisv1alpha2 .AcceptablePermissionClaim , 0 )
963963 }
964964
965- pc := apisv1alpha1 .AcceptablePermissionClaim {
966- PermissionClaim : apisv1alpha1 .PermissionClaim {
967- GroupResource : apisv1alpha1 .GroupResource {
965+ pc := apisv1alpha2 .AcceptablePermissionClaim {
966+ PermissionClaim : apisv1alpha2 .PermissionClaim {
967+ GroupResource : apisv1alpha2 .GroupResource {
968968 Group : group ,
969969 Resource : resource ,
970970 },
@@ -982,11 +982,11 @@ func (b *bindingBuilder) WithPermissionClaim(group, resource, identityHash strin
982982
983983func (b * bindingBuilder ) WithExportClaim (group , resource , identityHash string ) * bindingBuilder {
984984 if len (b .Status .ExportPermissionClaims ) == 0 {
985- b .Status .ExportPermissionClaims = make ([]apisv1alpha1 .PermissionClaim , 0 )
985+ b .Status .ExportPermissionClaims = make ([]apisv1alpha2 .PermissionClaim , 0 )
986986 }
987987
988- pc := apisv1alpha1 .PermissionClaim {
989- GroupResource : apisv1alpha1 .GroupResource {
988+ pc := apisv1alpha2 .PermissionClaim {
989+ GroupResource : apisv1alpha2 .GroupResource {
990990 Group : group ,
991991 Resource : resource ,
992992 },
@@ -997,6 +997,6 @@ func (b *bindingBuilder) WithExportClaim(group, resource, identityHash string) *
997997 return b
998998}
999999
1000- func (b * bindingBuilder ) Build () apisv1alpha1 .APIBinding {
1000+ func (b * bindingBuilder ) Build () apisv1alpha2 .APIBinding {
10011001 return b .APIBinding
10021002}
0 commit comments