Documentation
¶
Index ¶
Constants ¶
const ControllerName = "secret-name-change"
ControllerName is the name of this controller.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reconciler ¶
type Reconciler struct {
Client client.Client
ConfigDir string
FS afero.Afero
CancelContext context.CancelFunc
}
Reconciler checks if the label containing the relevant OSC secret for this node is changed and restarts if so. For hosted shoots, this never happens: During the lifecycle of a node, the OSC secret name is fixed. For self-hosted shoots, this may happen after the initial connect of the Shoot to the garden cluster: `gardenadm init` may not have run with the final spec of the Shoot (after registering it with gardener-apiserver, the spec might be augmented via admission plugins or webhooks). Hence, when gardenlet reconciles for the first time, it might compute a different OSC secret name. Without this controller, gardener-node-agent would have no means to switch to this new secret since its component config dictates which OSC secret to watch. This controller reacts on changes of said label on the node. If a change is detected, it overwrites the secret name in the component config and cancels the context (which triggers a restart to re-read the new config).
func (*Reconciler) AddToManager ¶
AddToManager adds Reconciler to the given manager.
func (*Reconciler) NodePredicate ¶
func (r *Reconciler) NodePredicate() predicate.Predicate
NodePredicate returns 'true' when the label describing which gardener-node-agent secret is relevant for this node gets set or changed.