Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Commit

Permalink
Merge pull request #115 from zmalik/delete-secrets
Browse files Browse the repository at this point in the history
Provide a way to avoid deleting the secrets during the update
  • Loading branch information
rollulus authored Mar 30, 2018
2 parents 1d5efbb + e88ddff commit e1a6d1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ Upon success, `kubectl get secret --namespace example` should contain a Secret o

Tue Dec 20 08:34:10 UTC 2016 | my name is rumpelstiltskin and I am 42 years old

### Updating secrets

By default landscaper always delete the old secrets during the update of a component.

A workaround to avoid deleting the old secrets with the same name as of the component you can use the flag `--disable deleteSecrets` during the landscaper apply.
That would only work if the new landscaper object have no secrets.
## Using Loop mode with Git repository sync

Loop mode is especially useful when watching a remote Git repository, so that whenever a PR got merged Landscaper will automatically apply the changes. We can use the Git repo sync image to constantly check out the latest commit of a branch and share this path with Landscaper running as a separate container in the same pod.
Expand Down
4 changes: 3 additions & 1 deletion pkg/landscaper/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ func (e *executor) UpdateComponent(cmp *Component) error {
}

if !e.dryRun {
err = e.kubeSecrets.Delete(cmp.Name, cmp.Namespace)
if e.stageEnabled("deleteSecrets") || len(cmp.Secrets) > 0 {
err = e.kubeSecrets.Delete(cmp.Name, cmp.Namespace)
}

if len(cmp.Secrets) > 0 {
err = e.kubeSecrets.Write(cmp.Name, cmp.Namespace, cmp.SecretValues)
Expand Down

0 comments on commit e1a6d1f

Please sign in to comment.