Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 *: remove tenancy.kcp.dev/v1alpha1.ClusterWorkspace #2543

Merged
1 change: 0 additions & 1 deletion cmd/sharded-test-server/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func newShard(ctx context.Context, n int, args []string, servingCA *crypto.CA, h
fmt.Sprintf("--tls-cert-file=%s", filepath.Join(workDirPath, fmt.Sprintf(".kcp-%d/apiserver.crt", n))),
fmt.Sprintf("--tls-private-key-file=%s", filepath.Join(workDirPath, fmt.Sprintf(".kcp-%d/apiserver.key", n))),
fmt.Sprintf("--secure-port=%d", 6444+n),
"--virtual-workspaces-workspaces.authorization-cache.resync-period=1s",
fmt.Sprintf("--logical-cluster-admin-kubeconfig=%s", filepath.Join(workDirPath, ".kcp/logical-cluster-admin.kubeconfig")),
)
if len(cacheServerConfigPath) > 0 {
Expand Down
1 change: 0 additions & 1 deletion cmd/test-server/kcp/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ func (s *Shard) Start(ctx context.Context, quiet bool) error {
"--audit-log-batch-throttle-enable=true",
"--audit-log-batch-throttle-qps=10",
"--audit-policy-file", filepath.Join(s.runtimeDir, "audit-policy.yaml"),
"--virtual-workspaces-workspaces.authorization-cache.resync-period=1s",
)
fmt.Fprintf(out, "running: %v\n", strings.Join(commandLine, " "))

Expand Down
3 changes: 0 additions & 3 deletions hack/logcheck.out
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,4 @@
/pkg/virtual/syncer/transformations/transformer.go:399:11: Key positional arguments are expected to be inlined constant strings. Please replace SyncTargetKey provided with string value.
/pkg/virtual/syncer/transformations/transformer.go:93:12: Key positional arguments are expected to be inlined constant strings. Please replace SyncTargetName provided with string value.
/pkg/virtual/syncer/transformations/transformer.go:95:11: Additional arguments to WithValues should always be Key Value pairs. Please check if there is any key or value missing.
/pkg/virtual/workspaces/builder/build.go:100:4: function "Errorf" should not be used, convert to contextual logging
/pkg/virtual/workspaces/builder/build.go:108:4: function "Errorf" should not be used, convert to contextual logging
/pkg/virtual/workspaces/builder/build.go:123:4: function "Errorf" should not be used, convert to contextual logging
/test/e2e/framework/config.go:42:2: function "InitFlags" should not be used, convert to contextual logging
5 changes: 3 additions & 2 deletions pkg/admission/reservednames/admission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"k8s.io/apiserver/pkg/authentication/user"

tenancyv1alpha1 "github.com/kcp-dev/kcp/pkg/apis/tenancy/v1alpha1"
tenancyv1beta1 "github.com/kcp-dev/kcp/pkg/apis/tenancy/v1beta1"
)

func createAttr(name string, obj runtime.Object, kind, resource string) admission.Attributes {
Expand Down Expand Up @@ -64,10 +65,10 @@ func TestAdmission(t *testing.T) {
attr: createAttr("cool-cwt", &tenancyv1alpha1.WorkspaceType{}, "WorkspaceType", "workspacetypes"),
},
"NotApplicableResource": {
attr: createAttr("root", &tenancyv1alpha1.ClusterWorkspace{}, "ClusterWorkspace", "notacworcwt"),
attr: createAttr("root", &tenancyv1beta1.Workspace{}, "ClusterWorkspace", "notacworcwt"),
},
"NotApplicableKind": {
attr: createAttr("root", &tenancyv1alpha1.ClusterWorkspace{}, "NotaCWorCWT", "clusterworkspaces"),
attr: createAttr("root", &tenancyv1beta1.Workspace{}, "NotaCWorCWT", "workspaces"),
},
}
for name, tc := range cases {
Expand Down
42 changes: 21 additions & 21 deletions pkg/admission/workspace/admission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func TestAdmit(t *testing.T) {
Name: "test",
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand All @@ -127,7 +127,7 @@ func TestAdmit(t *testing.T) {
},
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand All @@ -148,7 +148,7 @@ func TestAdmit(t *testing.T) {
},
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "Foo",
Path: "root:org",
},
Expand All @@ -169,7 +169,7 @@ func TestAdmit(t *testing.T) {
},
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "Foo",
Path: "root:org",
},
Expand All @@ -190,7 +190,7 @@ func TestAdmit(t *testing.T) {
},
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "Foo",
Path: "root:org",
},
Expand All @@ -211,7 +211,7 @@ func TestAdmit(t *testing.T) {
},
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "Foo",
Path: "root:org",
},
Expand Down Expand Up @@ -335,7 +335,7 @@ func TestValidate(t *testing.T) {
Annotations: map[string]string{"experimental.tenancy.kcp.io/owner": "{}"},
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand All @@ -347,7 +347,7 @@ func TestValidate(t *testing.T) {
Annotations: map[string]string{"experimental.tenancy.kcp.io/owner": "{}"},
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "universal",
Path: "root:org",
},
Expand All @@ -366,7 +366,7 @@ func TestValidate(t *testing.T) {
Annotations: map[string]string{"experimental.tenancy.kcp.io/owner": "{}"},
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand All @@ -379,7 +379,7 @@ func TestValidate(t *testing.T) {
},
Spec: tenancyv1beta1.WorkspaceSpec{
Cluster: "somewhere",
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand All @@ -400,7 +400,7 @@ func TestValidate(t *testing.T) {
Spec: tenancyv1beta1.WorkspaceSpec{
Cluster: "somewhere",
URL: "https://kcp.bigcorp.com/clusters/org:test",
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand All @@ -416,7 +416,7 @@ func TestValidate(t *testing.T) {
Annotations: map[string]string{"experimental.tenancy.kcp.io/owner": "{}"},
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand All @@ -440,7 +440,7 @@ func TestValidate(t *testing.T) {
Spec: tenancyv1beta1.WorkspaceSpec{
Cluster: "somewhere",
URL: "https://kcp.bigcorp.com/clusters/org:test",
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand All @@ -464,7 +464,7 @@ func TestValidate(t *testing.T) {
Spec: tenancyv1beta1.WorkspaceSpec{
Cluster: "somewhere",
URL: "https://kcp.bigcorp.com/clusters/org:test",
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand All @@ -489,7 +489,7 @@ func TestValidate(t *testing.T) {
Spec: tenancyv1beta1.WorkspaceSpec{
Cluster: "somewhere",
URL: "https://kcp.bigcorp.com/clusters/org:test",
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand All @@ -507,7 +507,7 @@ func TestValidate(t *testing.T) {
Spec: tenancyv1beta1.WorkspaceSpec{
Cluster: "somewhere",
URL: "https://kcp.otherbigcorp.com/clusters/org:test",
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand All @@ -531,7 +531,7 @@ func TestValidate(t *testing.T) {
},
Spec: tenancyv1beta1.WorkspaceSpec{
Cluster: "somewhere",
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand All @@ -547,7 +547,7 @@ func TestValidate(t *testing.T) {
Annotations: map[string]string{"experimental.tenancy.kcp.io/owner": "{}"},
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand Down Expand Up @@ -594,7 +594,7 @@ func TestValidate(t *testing.T) {
Annotations: map[string]string{"experimental.tenancy.kcp.io/owner": "{}"},
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "foo",
Path: "root:org",
},
Expand Down Expand Up @@ -622,7 +622,7 @@ func TestValidate(t *testing.T) {
},
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "Foo",
Path: "root:org",
},
Expand Down Expand Up @@ -652,7 +652,7 @@ func TestValidate(t *testing.T) {
},
},
Spec: tenancyv1beta1.WorkspaceSpec{
Type: tenancyv1beta1.WorkspaceTypeReference{
Type: tenancyv1alpha1.WorkspaceTypeReference{
Name: "Foo",
Path: "root:org",
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/admission/workspacetypeexists/admission.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (o *workspacetypeExists) Admit(ctx context.Context, a admission.Attributes,
}

// if the user has not provided any type, use the default from the parent workspace
empty := tenancyv1beta1.WorkspaceTypeReference{}
empty := tenancyv1alpha1.WorkspaceTypeReference{}
if ws.Spec.Type == empty {
typeAnnotation, found := logicalCluster.Annotations[tenancyv1beta1.LogicalClusterTypeAnnotationKey]
if !found {
Expand All @@ -149,7 +149,7 @@ func (o *workspacetypeExists) Admit(ctx context.Context, a admission.Attributes,
if parentCwt.Spec.DefaultChildWorkspaceType == nil {
return admission.NewForbidden(a, errors.New("spec.defaultChildWorkspaceType of workspace type %s:%s must be set"))
}
ws.Spec.Type = tenancyv1beta1.WorkspaceTypeReference{
ws.Spec.Type = tenancyv1alpha1.WorkspaceTypeReference{
Path: parentCwt.Spec.DefaultChildWorkspaceType.Path,
Name: parentCwt.Spec.DefaultChildWorkspaceType.Name,
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/admission/workspacetypeexists/admission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ func newWorkspace(qualifiedName string) wsBuilder {

func (b wsBuilder) withType(qualifiedName string) wsBuilder {
path, name := logicalcluster.NewPath(qualifiedName).Split()
b.Spec.Type = tenancyv1beta1.WorkspaceTypeReference{
b.Spec.Type = tenancyv1alpha1.WorkspaceTypeReference{
Path: path.String(),
Name: tenancyv1alpha1.WorkspaceTypeName(name),
}
Expand Down
40 changes: 0 additions & 40 deletions pkg/apis/tenancy/projection/workspaces.go

This file was deleted.

2 changes: 0 additions & 2 deletions pkg/apis/tenancy/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ var (
// Adds the list of known types to Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&ClusterWorkspace{},
&ClusterWorkspaceList{},
&WorkspaceType{},
&WorkspaceTypeList{},
)
Expand Down
Loading