Skip to content

Commit 3bc0632

Browse files
authored
Infrastructure: allow control plane migration (#63)
* Infrastructure: allow control plane migration * Clarify doc string
1 parent d8690fc commit 3bc0632

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

pkg/controller/infrastructure/openstack/actuator_migrate.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ import (
1212
"github.com/go-logr/logr"
1313
)
1414

15-
// Migrate deletes the k8s infrastructure resources without deleting the corresponding resources in the IaaS provider.
16-
func (a *actuator) Migrate(ctx context.Context, log logr.Logger, infra *extensionsv1alpha1.Infrastructure, _ *controller.Cluster) error {
15+
// Migrate deletes resources in the seed cluster related to the Infrastructure object without deleting the corresponding
16+
// IaaS resources in the cloud provider. As this Infrastructure controller does not create any Kubernetes objects in the
17+
// seed cluster, there is nothing to do when preparing the control plane migration. The finalizer is removed from the
18+
// Infrastructure object so the Delete method is not called and the IaaS resources are simply adopted by the Restore
19+
// method invoked on the destination seed cluster.
20+
func (a *actuator) Migrate(context.Context, logr.Logger, *extensionsv1alpha1.Infrastructure, *controller.Cluster) error {
1721
return nil
1822
}

pkg/controller/infrastructure/stackit/actuator_migrate.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ package stackit
66

77
import (
88
"context"
9-
"fmt"
109

1110
"github.com/gardener/gardener/extensions/pkg/controller"
1211
extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
1312
"github.com/go-logr/logr"
1413
)
1514

16-
// Migrate deletes the k8s infrastructure resources without deleting the corresponding resources in the IaaS provider.
17-
func (a *actuator) Migrate(ctx context.Context, log logr.Logger, infra *extensionsv1alpha1.Infrastructure, _ *controller.Cluster) error {
18-
return fmt.Errorf("not yet implemented")
15+
// Migrate deletes resources in the seed cluster related to the Infrastructure object without deleting the corresponding
16+
// IaaS resources in the cloud provider. As this Infrastructure controller does not create any Kubernetes objects in the
17+
// seed cluster, there is nothing to do when preparing the control plane migration. The finalizer is removed from the
18+
// Infrastructure object so the Delete method is not called and the IaaS resources are simply adopted by the Restore
19+
// method invoked on the destination seed cluster.
20+
func (a *actuator) Migrate(context.Context, logr.Logger, *extensionsv1alpha1.Infrastructure, *controller.Cluster) error {
21+
return nil
1922
}

0 commit comments

Comments
 (0)