diff --git a/installer/cmd/validate-cluster.go b/installer/cmd/validate-cluster.go index b05360e3424953..08b1cc6b9e5f0a 100644 --- a/installer/cmd/validate-cluster.go +++ b/installer/cmd/validate-cluster.go @@ -55,6 +55,18 @@ var validateClusterCmd = &cobra.Command{ return err } + // Update the status + switch res.Status { + case cluster.ValidationStatusError: + // Always change the status if error + result.Status = cluster.ValidationStatusError + case cluster.ValidationStatusWarning: + // Only put to warning if status is ok + if result.Status == cluster.ValidationStatusOk { + result.Status = cluster.ValidationStatusWarning + } + } + result.Items = append(result.Items, res.Items...) } diff --git a/installer/pkg/config/v1/validation.go b/installer/pkg/config/v1/validation.go index c192bc6b6b56e2..a8057fc855b3b8 100644 --- a/installer/pkg/config/v1/validation.go +++ b/installer/pkg/config/v1/validation.go @@ -77,5 +77,15 @@ func (v version) ClusterValidation(rcfg interface{}) cluster.ValidationChecks { res = append(res, cluster.CheckSecret(secretName, cluster.CheckSecretRequiredData("service-account.json"))) } + if cfg.ContainerRegistry.External != nil { + secretName := cfg.ContainerRegistry.External.Certificate.Name + res = append(res, cluster.CheckSecret(secretName, cluster.CheckSecretRequiredData(".dockerconfigjson"))) + } + + if cfg.Database.CloudSQL != nil { + secretName := cfg.Database.CloudSQL.ServiceAccount.Name + res = append(res, cluster.CheckSecret(secretName, cluster.CheckSecretRequiredData("credentials.json", "encryptionKeys", "password", "username"))) + } + return res }