Skip to content

Commit 8656f55

Browse files
Small cleanup
1 parent 1c011c5 commit 8656f55

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

pkg/resources/resources.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,6 @@ func GetManifests(runtime config.Runtime) string {
182182

183183
func ToInstruction(imageOverride, systemDefaultRegistry, k8sVersion, dataDir string) (*applyinator.Instruction, error) {
184184
bootstrap := GetBootstrapManifests(dataDir)
185-
kubectlCmd := kubectl.Command(k8sVersion)
186-
187185
cmd, err := self.Self()
188186
if err != nil {
189187
return nil, fmt.Errorf("resolving location of %s: %w", os.Args[0], err)
@@ -192,8 +190,8 @@ func ToInstruction(imageOverride, systemDefaultRegistry, k8sVersion, dataDir str
192190
Name: "bootstrap",
193191
SaveOutput: true,
194192
Image: images.GetInstallerImage(imageOverride, systemDefaultRegistry, k8sVersion),
195-
Args: []string{"retry", kubectlCmd, "apply", "--validate=false", "-f", bootstrap},
196-
Env: kubectl.Env(k8sVersion),
193+
Args: []string{"retry", kubectl.Command(k8sVersion), "apply", "--validate=false", "-f", bootstrap},
197194
Command: cmd,
195+
Env: kubectl.Env(k8sVersion),
198196
}, nil
199197
}

pkg/runtime/role.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ var (
2323
)
2424

2525
func ToBootstrapFile(runtime config.Runtime) (*applyinator.File, error) {
26-
bootstrapConfig := map[string]interface{}{}
27-
if runtime == config.RuntimeK3S {
28-
bootstrapConfig["cluster-init"] = "true"
26+
if runtime != config.RuntimeK3S {
27+
return nil, nil
2928
}
30-
data, err := json.Marshal(bootstrapConfig)
29+
data, err := json.Marshal(map[string]interface{}{
30+
"cluster-init": "true",
31+
})
3132
if err != nil {
3233
return nil, err
3334
}

0 commit comments

Comments
 (0)