Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Jul 19, 2021
1 parent 1c011c5 commit 8656f55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 2 additions & 4 deletions pkg/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ func GetManifests(runtime config.Runtime) string {

func ToInstruction(imageOverride, systemDefaultRegistry, k8sVersion, dataDir string) (*applyinator.Instruction, error) {
bootstrap := GetBootstrapManifests(dataDir)
kubectlCmd := kubectl.Command(k8sVersion)

cmd, err := self.Self()
if err != nil {
return nil, fmt.Errorf("resolving location of %s: %w", os.Args[0], err)
Expand All @@ -192,8 +190,8 @@ func ToInstruction(imageOverride, systemDefaultRegistry, k8sVersion, dataDir str
Name: "bootstrap",
SaveOutput: true,
Image: images.GetInstallerImage(imageOverride, systemDefaultRegistry, k8sVersion),
Args: []string{"retry", kubectlCmd, "apply", "--validate=false", "-f", bootstrap},
Env: kubectl.Env(k8sVersion),
Args: []string{"retry", kubectl.Command(k8sVersion), "apply", "--validate=false", "-f", bootstrap},
Command: cmd,
Env: kubectl.Env(k8sVersion),
}, nil
}
9 changes: 5 additions & 4 deletions pkg/runtime/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ var (
)

func ToBootstrapFile(runtime config.Runtime) (*applyinator.File, error) {
bootstrapConfig := map[string]interface{}{}
if runtime == config.RuntimeK3S {
bootstrapConfig["cluster-init"] = "true"
if runtime != config.RuntimeK3S {
return nil, nil
}
data, err := json.Marshal(bootstrapConfig)
data, err := json.Marshal(map[string]interface{}{
"cluster-init": "true",
})
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 8656f55

Please sign in to comment.