Skip to content

Commit 688992e

Browse files
alvaroalemankubermatic-bot
authored andcommitted
Add AnnotationMachineUninitialized to allow external initialization (#465)
1 parent 184b4f6 commit 688992e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/controller/machine/machine.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ const (
6464
FinalizerDeleteInstance = "machine-delete-finalizer"
6565
FinalizerDeleteNode = "machine-node-delete-finalizer"
6666

67+
// AnnotationMachineUninitialized indicates that a machine is not yet
68+
// ready to be worked on by the machine-controller. The machine-controller
69+
// will ignore all machines that have this anotation with any value
70+
// Its value should consist of one or more initializers, separated by a comma
71+
AnnotationMachineUninitialized = "machine-controller.kubermatic.io/initializers"
72+
6773
deletionRetryWaitPeriod = 10 * time.Second
6874

6975
NodeOwnerLabelName = "machine-controller/owned-by"
@@ -356,6 +362,12 @@ func (c *Controller) syncHandler(key string) error {
356362
}
357363
return err
358364
}
365+
366+
if listerMachine.Annotations[AnnotationMachineUninitialized] != "" {
367+
glog.V(4).Infof("Ignoring machine %q because it has a non-emtpy %q annotation", listerMachine.Name, AnnotationMachineUninitialized)
368+
return nil
369+
}
370+
359371
machine := listerMachine.DeepCopy()
360372

361373
// This must stay in the controller, it can not be moved into the webhook

0 commit comments

Comments
 (0)