forked from gardener/gardener
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathactuator.go
More file actions
73 lines (64 loc) · 3.06 KB
/
actuator.go
File metadata and controls
73 lines (64 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// SPDX-FileCopyrightText: SAP SE or an SAP affiliate company and Gardener contributors
//
// SPDX-License-Identifier: Apache-2.0
package infrastructure
import (
"context"
"github.com/go-logr/logr"
extensionscontroller "github.com/gardener/gardener/extensions/pkg/controller"
extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
)
// Actuator acts upon [extensionsv1alpha1.Infrastructure] resources.
type Actuator interface {
// Reconcile reconciles the [extensionsv1alpha1.Infrastructure] resource.
//
// Implementations should ensure that required infrastructure resources
// are created or updated to reach the desired state.
Reconcile(context.Context, logr.Logger, *extensionsv1alpha1.Infrastructure, *extensionscontroller.Cluster) error
// Delete is invoked when the [extensionsv1alpha1.Infrastructure]
// resource is deleted.
//
// Implementations should take care of cleaning up any infrastructure
// related resources (e.g. subnets, routers, etc.) which were created by
// the Extension.
//
// Implementations must wait until all resources managed by the
// extension have been gracefully cleaned up.
Delete(context.Context, logr.Logger, *extensionsv1alpha1.Infrastructure, *extensionscontroller.Cluster) error
// ForceDelete is invoked when the shoot cluster associated with the
// [extensionsv1alpha1.Infrastructure] resource is being deleted in a
// forceful manner.
//
// Implementations should take care of unblocking the deletion flow by
// attempting to cleanup any resources created by the extension, remove
// any finalizers created for custom resources, etc., and also skip
// waiting for external resources (e.g. subnets, routers, etc.), if they
// cannot be deleted gracefully.
//
// If some resources managed by the extension implementation cannot be
// deleted gracefully, this method should still succeed, even if some
// resources are orphaned.
ForceDelete(context.Context, logr.Logger, *extensionsv1alpha1.Infrastructure, *extensionscontroller.Cluster) error
// Restore restores the [extensionsv1alpha1.Infrastructure] from a
// previously saved state.
//
// This method is invoked when the shoot cluster associated with the
// [extensionsv1alpha1.Infrastructure] resource is being restored on the
// target seed cluster.
//
// Implementations may use the persisted data in the .status.state field
// for restoring the state, when the shoot is being migrated to a
// different seed cluster.
Restore(context.Context, logr.Logger, *extensionsv1alpha1.Infrastructure, *extensionscontroller.Cluster) error
// Migrate prepares the [extensionsv1alpha1.Infrastructure] resource for
// migration.
//
// This method is invoked when the shoot cluster associated with the
// [extensionsv1alpha1.Infrastructure] resource is being migrated to
// another seed cluster.
//
// Implementations should take care of storing any required state in the
// .status.state field, so that it can later be restored from this
// state.
Migrate(context.Context, logr.Logger, *extensionsv1alpha1.Infrastructure, *extensionscontroller.Cluster) error
}