Skip to content

Commit 6523aaa

Browse files
authored
Merge pull request #130 from kndpio/128-allow-apply-configuration-after-load-into-environment
added apply option to configuration load command
2 parents a26dc55 + e1f3cc7 commit 6523aaa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/kndp/configuration/load.go

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os"
77

88
"github.com/charmbracelet/log"
9+
"github.com/kndpio/kndp/internal/configuration"
910
cfg "github.com/kndpio/kndp/internal/configuration"
1011
"github.com/kndpio/kndp/internal/kube"
1112
"github.com/kndpio/kndp/internal/registry"
@@ -16,6 +17,7 @@ type loadCmd struct {
1617
Name string `arg:"" help:"Name of configuration."`
1718
Path string `help:"Path to configuration package archive."`
1819
Stdin bool `help:"Load configuration package from STDIN."`
20+
Apply bool `help:"Apply configuration after load."`
1921
}
2022

2123
func (c *loadCmd) Run(ctx context.Context, config *rest.Config, logger *log.Logger) error {
@@ -56,5 +58,9 @@ func (c *loadCmd) Run(ctx context.Context, config *rest.Config, logger *log.Logg
5658
return err
5759
}
5860
logger.Infof("Image archive %s loaded to local registry.", cfg.Name)
61+
62+
if c.Apply {
63+
return configuration.ApplyConfiguration(ctx, cfg.Name, config, logger)
64+
}
5965
return nil
6066
}

0 commit comments

Comments
 (0)