Skip to content

Commit 1985671

Browse files
committed
rename packages to terminator naming
- pkg/virtual/finalizingworkspaces - sdk/apis/tenancyfinalization - test/e2e/virtual/finalizingworkspaces On-behalf-of: SAP <[email protected]> Signed-off-by: Simon Bein <[email protected]>
1 parent c2dcb64 commit 1985671

File tree

13 files changed

+36
-36
lines changed

13 files changed

+36
-36
lines changed

pkg/reconciler/core/logicalcluster/logicalcluster_reconcile_metadata.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import (
2626
"k8s.io/klog/v2"
2727

2828
corev1alpha1 "github.com/kcp-dev/kcp/sdk/apis/core/v1alpha1"
29-
"github.com/kcp-dev/kcp/sdk/apis/tenancy/finalization"
3029
"github.com/kcp-dev/kcp/sdk/apis/tenancy/initialization"
30+
"github.com/kcp-dev/kcp/sdk/apis/tenancy/termination"
3131
tenancyv1alpha1 "github.com/kcp-dev/kcp/sdk/apis/tenancy/v1alpha1"
3232
)
3333

@@ -67,7 +67,7 @@ func (r *metaDataReconciler) reconcile(ctx context.Context, logicalCluster *core
6767
// add finalizers from the status as hashed labels
6868
finalizerKeys := sets.New[string]()
6969
for _, finalizer := range logicalCluster.Status.Finalizers {
70-
key, value := finalization.FinalizerToLabel(finalizer)
70+
key, value := termination.FinalizerToLabel(finalizer)
7171
finalizerKeys.Insert(key)
7272
if got, expected := logicalCluster.Labels[key], value; got != expected {
7373
if logicalCluster.Labels == nil {

pkg/reconciler/tenancy/workspace/workspace_reconcile_scheduling.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ import (
4444
"github.com/kcp-dev/kcp/pkg/logging"
4545
"github.com/kcp-dev/kcp/sdk/apis/core"
4646
corev1alpha1 "github.com/kcp-dev/kcp/sdk/apis/core/v1alpha1"
47-
"github.com/kcp-dev/kcp/sdk/apis/tenancy/finalization"
4847
"github.com/kcp-dev/kcp/sdk/apis/tenancy/initialization"
48+
"github.com/kcp-dev/kcp/sdk/apis/tenancy/termination"
4949
tenancyv1alpha1 "github.com/kcp-dev/kcp/sdk/apis/tenancy/v1alpha1"
5050
conditionsv1alpha1 "github.com/kcp-dev/kcp/sdk/apis/third_party/conditions/apis/conditions/v1alpha1"
5151
"github.com/kcp-dev/kcp/sdk/apis/third_party/conditions/util/conditions"
@@ -327,7 +327,7 @@ func (r *schedulingReconciler) createLogicalCluster(ctx context.Context, shard *
327327
}
328328
logicalCluster.Spec.Finalizers = finalizers
329329
// append our finalizers to already existing ObjectMeta finalizers
330-
logicalCluster.ObjectMeta.Finalizers = finalization.MergeFinalizersUnique(finalizers, logicalCluster.ObjectMeta.Finalizers)
330+
logicalCluster.ObjectMeta.Finalizers = termination.MergeFinalizersUnique(finalizers, logicalCluster.ObjectMeta.Finalizers)
331331

332332
logicalClusterAdminClient, err := r.kcpLogicalClusterAdminClientFor(shard)
333333
if err != nil {
@@ -401,7 +401,7 @@ func LogicalClustersFinalizers(
401401

402402
for _, alias := range wtAliases {
403403
if alias.Spec.Finalizer {
404-
finalizers = append(finalizers, finalization.FinalizerForType(alias))
404+
finalizers = append(finalizers, termination.FinalizerForType(alias))
405405
}
406406
}
407407

pkg/reconciler/tenancy/workspacetype/workspacetype_controller_reconcile.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ import (
2626
"k8s.io/klog/v2"
2727

2828
virtualworkspacesoptions "github.com/kcp-dev/kcp/cmd/virtual-workspaces/options"
29-
"github.com/kcp-dev/kcp/pkg/virtual/finalizingworkspaces"
3029
"github.com/kcp-dev/kcp/pkg/virtual/initializingworkspaces"
31-
"github.com/kcp-dev/kcp/sdk/apis/tenancy/finalization"
30+
"github.com/kcp-dev/kcp/pkg/virtual/terminatingworkspaces"
3231
"github.com/kcp-dev/kcp/sdk/apis/tenancy/initialization"
32+
"github.com/kcp-dev/kcp/sdk/apis/tenancy/termination"
3333
tenancyv1alpha1 "github.com/kcp-dev/kcp/sdk/apis/tenancy/v1alpha1"
3434
conditionsv1alpha1 "github.com/kcp-dev/kcp/sdk/apis/third_party/conditions/apis/conditions/v1alpha1"
3535
"github.com/kcp-dev/kcp/sdk/apis/third_party/conditions/util/conditions"
@@ -90,8 +90,8 @@ func (c *controller) updateVirtualWorkspaceURLs(ctx context.Context, wt *tenancy
9090
u.Path = path.Join(
9191
base,
9292
virtualworkspacesoptions.DefaultRootPathPrefix,
93-
finalizingworkspaces.VirtualWorkspaceName,
94-
string(finalization.FinalizerForType(wt)),
93+
terminatingworkspaces.VirtualWorkspaceName,
94+
string(termination.FinalizerForType(wt)),
9595
)
9696

9797
desiredURLs.Insert(u.String())

pkg/virtual/options/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ import (
2626
kcpkubernetesinformers "github.com/kcp-dev/client-go/informers"
2727

2828
apiexportoptions "github.com/kcp-dev/kcp/pkg/virtual/apiexport/options"
29-
finalizingworkspacesoptions "github.com/kcp-dev/kcp/pkg/virtual/finalizingworkspaces/options"
3029
"github.com/kcp-dev/kcp/pkg/virtual/framework/rootapiserver"
3130
initializingworkspacesoptions "github.com/kcp-dev/kcp/pkg/virtual/initializingworkspaces/options"
3231
replicationoptions "github.com/kcp-dev/kcp/pkg/virtual/replication/options"
32+
finalizingworkspacesoptions "github.com/kcp-dev/kcp/pkg/virtual/terminatingworkspaces/options"
3333
kcpinformers "github.com/kcp-dev/kcp/sdk/client/informers/externalversions"
3434
)
3535

pkg/virtual/finalizingworkspaces/builder/build.go renamed to pkg/virtual/terminatingworkspaces/builder/build.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@ import (
4040
rootphase0 "github.com/kcp-dev/kcp/config/root-phase0"
4141
"github.com/kcp-dev/kcp/pkg/authorization/delegated"
4242
"github.com/kcp-dev/kcp/pkg/server/requestinfo"
43-
"github.com/kcp-dev/kcp/pkg/virtual/finalizingworkspaces"
4443
"github.com/kcp-dev/kcp/pkg/virtual/framework"
4544
virtualworkspacesdynamic "github.com/kcp-dev/kcp/pkg/virtual/framework/dynamic"
4645
"github.com/kcp-dev/kcp/pkg/virtual/framework/dynamic/apidefinition"
4746
"github.com/kcp-dev/kcp/pkg/virtual/framework/dynamic/apiserver"
4847
dynamiccontext "github.com/kcp-dev/kcp/pkg/virtual/framework/dynamic/context"
4948
"github.com/kcp-dev/kcp/pkg/virtual/framework/rootapiserver"
49+
"github.com/kcp-dev/kcp/pkg/virtual/terminatingworkspaces"
5050
apisv1alpha1 "github.com/kcp-dev/kcp/sdk/apis/apis/v1alpha1"
5151
corev1alpha1 "github.com/kcp-dev/kcp/sdk/apis/core/v1alpha1"
52-
"github.com/kcp-dev/kcp/sdk/apis/tenancy/finalization"
52+
"github.com/kcp-dev/kcp/sdk/apis/tenancy/termination"
5353
tenancyv1alpha1 "github.com/kcp-dev/kcp/sdk/apis/tenancy/v1alpha1"
5454
)
5555

5656
const (
57-
wildcardLogicalClustersName = finalizingworkspaces.VirtualWorkspaceName + "-wildcard-logicalclusters"
58-
logicalClustersName = finalizingworkspaces.VirtualWorkspaceName + "-logicalclusters"
57+
wildcardLogicalClustersName = terminatingworkspaces.VirtualWorkspaceName + "-wildcard-logicalclusters"
58+
logicalClustersName = terminatingworkspaces.VirtualWorkspaceName + "-logicalclusters"
5959
)
6060

6161
func BuildVirtualWorkspace(
@@ -264,7 +264,7 @@ func (a *singleResourceAPIDefinitionSetProvider) GetAPIDefinitionSet(ctx context
264264
var _ apidefinition.APIDefinitionSetGetter = &singleResourceAPIDefinitionSetProvider{}
265265

266266
func authorizerWithCache(ctx context.Context, cache delegated.Cache, attr authorizer.Attributes) (authorizer.Decision, string, error) {
267-
clusterName, name, err := finalization.TypeFrom(corev1alpha1.LogicalClusterFinalizer(dynamiccontext.APIDomainKeyFrom(ctx)))
267+
clusterName, name, err := termination.TypeFrom(corev1alpha1.LogicalClusterFinalizer(dynamiccontext.APIDomainKeyFrom(ctx)))
268268
if err != nil {
269269
klog.FromContext(ctx).V(2).Info(err.Error())
270270
return authorizer.DecisionNoOpinion, "unable to determine finalizer", fmt.Errorf("access not permitted")

pkg/virtual/finalizingworkspaces/builder/forwarding.go renamed to pkg/virtual/terminatingworkspaces/builder/forwarding.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import (
4444
"github.com/kcp-dev/kcp/pkg/virtual/framework/dynamic/apiserver"
4545
registry "github.com/kcp-dev/kcp/pkg/virtual/framework/forwardingregistry"
4646
corev1alpha1 "github.com/kcp-dev/kcp/sdk/apis/core/v1alpha1"
47-
"github.com/kcp-dev/kcp/sdk/apis/tenancy/finalization"
47+
"github.com/kcp-dev/kcp/sdk/apis/tenancy/termination"
4848
)
4949

5050
// filteredLogicalClusterReadWriteRestStorage creates a RestProvider which will
@@ -253,7 +253,7 @@ func logicalClusterFromObject(obj runtime.Object) (*corev1alpha1.LogicalCluster,
253253
func finalizerLabelSetRequirement(finalizer corev1alpha1.LogicalClusterFinalizer) (labels.Requirements, error) {
254254
labelSelector := map[string]string{}
255255

256-
key, value := finalization.FinalizerToLabel(finalizer)
256+
key, value := termination.FinalizerToLabel(finalizer)
257257
labelSelector[key] = value
258258

259259
requirements, selectable := labels.SelectorFromSet(labelSelector).Requirements()

pkg/virtual/finalizingworkspaces/doc.go renamed to pkg/virtual/terminatingworkspaces/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ limitations under the License.
2828
// WATCH semantics are similar to (and implemented by) timestamp and finalizers selectors - a LogicalCluster that stops
2929
// matching the requirements to be served (not being marked for deletion, not requesting finalization by
3030
// the controller) will be removed from the stream with a synthetic Deleted event.
31-
package finalizingworkspaces
31+
package terminatingworkspaces
3232

3333
const VirtualWorkspaceName string = "finalizingworkspaces"

pkg/virtual/finalizingworkspaces/options/options.go renamed to pkg/virtual/terminatingworkspaces/options/options.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import (
2626
kcpdynamic "github.com/kcp-dev/client-go/dynamic"
2727
kcpkubernetesclientset "github.com/kcp-dev/client-go/kubernetes"
2828

29-
"github.com/kcp-dev/kcp/pkg/virtual/finalizingworkspaces"
30-
"github.com/kcp-dev/kcp/pkg/virtual/finalizingworkspaces/builder"
3129
"github.com/kcp-dev/kcp/pkg/virtual/framework/rootapiserver"
30+
"github.com/kcp-dev/kcp/pkg/virtual/terminatingworkspaces"
31+
"github.com/kcp-dev/kcp/pkg/virtual/terminatingworkspaces/builder"
3232
kcpinformers "github.com/kcp-dev/kcp/sdk/client/informers/externalversions"
3333
)
3434

@@ -68,5 +68,5 @@ func (o *FinalizingWorkspaces) NewVirtualWorkspaces(
6868
return nil, err
6969
}
7070

71-
return builder.BuildVirtualWorkspace(config, path.Join(rootPathPrefix, finalizingworkspaces.VirtualWorkspaceName), dynamicClusterClient, kubeClusterClient)
71+
return builder.BuildVirtualWorkspace(config, path.Join(rootPathPrefix, terminatingworkspaces.VirtualWorkspaceName), dynamicClusterClient, kubeClusterClient)
7272
}

0 commit comments

Comments
 (0)