Skip to content

Commit

Permalink
move echo to a separate line
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecile Robert-Michon committed Jan 16, 2021
1 parent 892a2e6 commit c972045
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion bootstrap/kubeadm/internal/cloudinit/cloudinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import (
)

const (
standardJoinCommand = "kubeadm join --config /run/kubeadm/kubeadm-join-config.yaml %s && echo success > /run/cluster-api/bootstrap-success.complete"
standardJoinCommand = "kubeadm join --config /run/kubeadm/kubeadm-join-config.yaml %s"
sentinelFileCommand = "echo success > /run/cluster-api/bootstrap-success.complete"
retriableJoinScriptName = "/usr/local/bin/kubeadm-bootstrap-script"
retriableJoinScriptOwner = "root"
retriableJoinScriptPermissions = "0755"
Expand All @@ -50,6 +51,7 @@ type BaseUserData struct {
UseExperimentalRetry bool
KubeadmCommand string
KubeadmVerbosity string
SentinelFileCommand string
}

func (input *BaseUserData) prepare() error {
Expand All @@ -64,6 +66,7 @@ func (input *BaseUserData) prepare() error {
}
input.WriteFiles = append(input.WriteFiles, *joinScriptFile)
}
input.SentinelFileCommand = sentinelFileCommand
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion bootstrap/kubeadm/internal/cloudinit/controlplane_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ const (
content: ""
runcmd:
{{- template "commands" .PreKubeadmCommands }}
- 'kubeadm init --config /run/kubeadm/kubeadm.yaml {{.KubeadmVerbosity}} && echo success > /run/cluster-api/bootstrap-success.complete'
- 'kubeadm init --config /run/kubeadm/kubeadm.yaml {{.KubeadmVerbosity}}'
- {{ .SentinelFileCommand }}
{{- template "commands" .PostKubeadmCommands }}
{{- template "ntp" .NTP }}
{{- template "users" .Users }}
Expand Down
1 change: 1 addition & 0 deletions bootstrap/kubeadm/internal/cloudinit/controlplane_join.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
runcmd:
{{- template "commands" .PreKubeadmCommands }}
- {{ .KubeadmCommand }}
- {{ .SentinelFileCommand }}
{{- template "commands" .PostKubeadmCommands }}
{{- template "ntp" .NTP }}
{{- template "users" .Users }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ log::error_exit() {

log::success_exit() {
log::info "cluster.x-k8s.io kubeadm bootstrap script $0 finished"
echo success > /run/cluster-api/bootstrap-success.complete
exit 0
}

Expand Down
1 change: 1 addition & 0 deletions bootstrap/kubeadm/internal/cloudinit/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
runcmd:
{{- template "commands" .PreKubeadmCommands }}
- {{ .KubeadmCommand }}
- {{ .SentinelFileCommand }}
{{- template "commands" .PostKubeadmCommands }}
{{- template "ntp" .NTP }}
{{- template "users" .Users }}
Expand Down
4 changes: 2 additions & 2 deletions bootstrap/kubeadm/internal/cloudinit/zz_generated.bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c972045

Please sign in to comment.