@@ -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" , "" ).
@@ -789,14 +789,14 @@ func TestUse(t *testing.T) {
789789 })
790790
791791 // return nothing in the default case.
792- getAPIBindings := func (ctx context.Context , kcpClusterClient kcpclientset.ClusterInterface , host string ) ([]apisv1alpha1 .APIBinding , error ) {
792+ getAPIBindings := func (ctx context.Context , kcpClusterClient kcpclientset.ClusterInterface , host string ) ([]apisv1alpha2 .APIBinding , error ) {
793793 return nil , nil
794794 }
795795
796796 if tt .destination != "" {
797797 // Add APIBindings to our Clientset if we have them
798798 if len (tt .apiBindings ) > 0 {
799- getAPIBindings = func (ctx context.Context , kcpClusterClient kcpclientset.ClusterInterface , host string ) ([]apisv1alpha1 .APIBinding , error ) {
799+ getAPIBindings = func (ctx context.Context , kcpClusterClient kcpclientset.ClusterInterface , host string ) ([]apisv1alpha2 .APIBinding , error ) {
800800 return tt .apiBindings , nil
801801 }
802802 }
@@ -944,7 +944,7 @@ func (c errorDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error) {
944944}
945945
946946type bindingBuilder struct {
947- apisv1alpha1 .APIBinding
947+ apisv1alpha2 .APIBinding
948948}
949949
950950func newBindingBuilder (name string ) * bindingBuilder {
@@ -955,14 +955,14 @@ func newBindingBuilder(name string) *bindingBuilder {
955955 return b
956956}
957957
958- func (b * bindingBuilder ) WithPermissionClaim (group , resource , identityHash string , state apisv1alpha1 .AcceptablePermissionClaimState ) * bindingBuilder {
958+ func (b * bindingBuilder ) WithPermissionClaim (group , resource , identityHash string , state apisv1alpha2 .AcceptablePermissionClaimState ) * bindingBuilder {
959959 if len (b .Spec .PermissionClaims ) == 0 {
960- b .Spec .PermissionClaims = make ([]apisv1alpha1 .AcceptablePermissionClaim , 0 )
960+ b .Spec .PermissionClaims = make ([]apisv1alpha2 .AcceptablePermissionClaim , 0 )
961961 }
962962
963- pc := apisv1alpha1 .AcceptablePermissionClaim {
964- PermissionClaim : apisv1alpha1 .PermissionClaim {
965- GroupResource : apisv1alpha1 .GroupResource {
963+ pc := apisv1alpha2 .AcceptablePermissionClaim {
964+ PermissionClaim : apisv1alpha2 .PermissionClaim {
965+ GroupResource : apisv1alpha2 .GroupResource {
966966 Group : group ,
967967 Resource : resource ,
968968 },
@@ -980,11 +980,11 @@ func (b *bindingBuilder) WithPermissionClaim(group, resource, identityHash strin
980980
981981func (b * bindingBuilder ) WithExportClaim (group , resource , identityHash string ) * bindingBuilder {
982982 if len (b .Status .ExportPermissionClaims ) == 0 {
983- b .Status .ExportPermissionClaims = make ([]apisv1alpha1 .PermissionClaim , 0 )
983+ b .Status .ExportPermissionClaims = make ([]apisv1alpha2 .PermissionClaim , 0 )
984984 }
985985
986- pc := apisv1alpha1 .PermissionClaim {
987- GroupResource : apisv1alpha1 .GroupResource {
986+ pc := apisv1alpha2 .PermissionClaim {
987+ GroupResource : apisv1alpha2 .GroupResource {
988988 Group : group ,
989989 Resource : resource ,
990990 },
@@ -995,6 +995,6 @@ func (b *bindingBuilder) WithExportClaim(group, resource, identityHash string) *
995995 return b
996996}
997997
998- func (b * bindingBuilder ) Build () apisv1alpha1 .APIBinding {
998+ func (b * bindingBuilder ) Build () apisv1alpha2 .APIBinding {
999999 return b .APIBinding
10001000}
0 commit comments