Skip to content

Commit f0c80a1

Browse files
authored
Add license to applier when running outro (#362)
* Add license to applier when running outro
1 parent d1a9cb5 commit f0c80a1

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

cmd/embedded-cluster/install.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,14 +237,20 @@ func runK0sKubeconfig(ctx context.Context) error {
237237
func runOutro(c *cli.Context) error {
238238
os.Setenv("KUBECONFIG", defaults.PathToConfig("kubeconfig"))
239239
opts := []addons.Option{}
240-
if c.String("overrides") == "" {
241-
return addons.NewApplier(opts...).Outro(c.Context)
240+
if c.String("license") != "" {
241+
license, err := helpers.ParseLicense(c.String("license"))
242+
if err != nil {
243+
return fmt.Errorf("unable to parse license: %w", err)
244+
}
245+
opts = append(opts, addons.WithLicense(license))
242246
}
243-
eucfg, err := helpers.ParseEndUserConfig(c.String("overrides"))
244-
if err != nil {
245-
return fmt.Errorf("unable to load overrides: %w", err)
247+
if c.String("overrides") != "" {
248+
eucfg, err := helpers.ParseEndUserConfig(c.String("overrides"))
249+
if err != nil {
250+
return fmt.Errorf("unable to load overrides: %w", err)
251+
}
252+
opts = append(opts, addons.WithEndUserConfig(eucfg))
246253
}
247-
opts = append(opts, addons.WithEndUserConfig(eucfg))
248254
return addons.NewApplier(opts...).Outro(c.Context)
249255
}
250256

0 commit comments

Comments
 (0)