Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
Delete secret scope.
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonTheDeveloper committed Nov 26, 2019
1 parent f81c590 commit a705c60
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/secretscope_controller_databricks.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,16 @@ func (r *SecretScopeReconciler) verifyWorkspace(instance *databricksv1alpha1.Sec

// checkSecrets checks if referenced secret is present in k8s or not.
func (r *SecretScopeReconciler) checkSecrets(instance *databricksv1alpha1.SecretScope) error {
scope := instance.ObjectMeta.Name
namespace := instance.Namespace

// if secret in cluster is reference, see if secret exists.
for _, secret := range instance.Spec.SecretScopeSecrets {
if secret.ValueFrom != nil {
if _, err := r.getSecretValueFrom(namespace, secret); err != nil {
// delete scope here because next time the config is applied, it will fail
// because the secret scope already exists from the previous run.
_ = r.APIClient.Secrets().DeleteSecretScope(scope)
return err
}
}
Expand Down

0 comments on commit a705c60

Please sign in to comment.