Warn if cilium encryption is enabled, but no secret has been set

This commit is contained in:
Ole Markus With 2021-01-19 20:20:12 +01:00
parent 55e38c96d3
commit f476857add
1 changed files with 14 additions and 0 deletions

View File

@ -342,6 +342,20 @@ func (c *ApplyClusterCmd) Run(ctx context.Context) error {
}
}
ciliumSpec := c.Cluster.Spec.Networking.Cilium
if ciliumSpec != nil && ciliumSpec.EnableEncryption {
secret, err := secretStore.FindSecret("ciliumpassword")
if err != nil {
return fmt.Errorf("could not load the ciliumpassword secret: %w", err)
}
if secret == nil {
fmt.Println("")
fmt.Println("You have cilium encryption enabled, but no ciliumpassword secret has been set.")
fmt.Println("See `kops create secret ciliumpassword -h`")
return fmt.Errorf("could not find ciliumpassword secret")
}
}
if err := c.addFileAssets(assetBuilder); err != nil {
return err
}