Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Commit

Permalink
update-operator: add config options for pre/post reboot actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sdemos committed Aug 5, 2017
1 parent 1d70a17 commit 350e022
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/update-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
)

var (
beforeRebootAnnotations flagutil.StringSliceFlag
afterRebootAnnotations flagutil.StringSliceFlag
kubeconfig = flag.String("kubeconfig", "", "Path to a kubeconfig file. Default to the in-cluster config if not provided.")
analyticsEnabled = flag.Bool("analytics", true, "Send analytics to Google Analytics")
autoLabelContainerLinux = flag.Bool("auto-label-container-linux", false, "Auto-label Container Linux nodes with agent=true (convenience)")
Expand All @@ -25,12 +27,16 @@ var (
)

func main() {
flag.Var(&beforeRebootAnnotations, "before-reboot-annotations", "List of comma-separated Kubernetes node annotations that must be set to 'true' before a reboot is allowed")
flag.Var(&afterRebootAnnotations, "after-reboot-annotations", "List of comma-separated Kubernetes node annotations that must be set to 'true' before a node is marked schedulable and the operator lock is released")

flag.Set("logtostderr", "true")
flag.Parse()

if err := flagutil.SetFlagsFromEnv(flag.CommandLine, "UPDATE_OPERATOR"); err != nil {
glog.Fatalf("Failed to parse environment variables: %v", err)
}

// respect KUBECONFIG without the prefix as well
if *kubeconfig == "" {
*kubeconfig = os.Getenv("KUBECONFIG")
Expand Down Expand Up @@ -61,6 +67,8 @@ func main() {
AutoLabelContainerLinux: *autoLabelContainerLinux,
ManageAgent: *manageAgent,
AgentImageRepo: *agentImageRepo,
BeforeRebootAnnotations: beforeRebootAnnotations,
AfterRebootAnnotations: afterRebootAnnotations,
})
if err != nil {
glog.Fatalf("Failed to initialize %s: %v", os.Args[0], err)
Expand Down

0 comments on commit 350e022

Please sign in to comment.