Skip to content

Commit

Permalink
Cr 15222 (#661)
Browse files Browse the repository at this point in the history
* make sure git integration secret is deleted even if app-proxy is not available during uninstall

* bump
  • Loading branch information
danielm-codefresh authored Dec 26, 2022
1 parent b8be1fd commit b52e05e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=v0.1.22
VERSION=v0.1.23

OUT_DIR=dist
YEAR?=$(shell date +"%Y")
Expand Down
11 changes: 9 additions & 2 deletions cmd/commands/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,12 +595,19 @@ func runRuntimeUninstall(ctx context.Context, opts *RuntimeUninstallOptions) err
}

func runPostUninstallCleanup(ctx context.Context, kubeFactory kube.Factory, namespace string) error {
secrets, err := kubeutil.GetSecretsWithLabel(ctx, kubeFactory, namespace, store.Get().LabelSelectorSealedSecret)
sealedSecrets, err := kubeutil.GetSecretsWithLabel(ctx, kubeFactory, namespace, store.Get().LabelSelectorSealedSecret)
if err != nil {
return err
}

for _, secret := range secrets.Items {
gitIntegrationSecrets, err := kubeutil.GetSecretsWithLabel(ctx, kubeFactory, namespace, store.Get().LabelSelectorGitIntegrationSecret)
if err != nil {
return err
}

secrets := append(sealedSecrets.Items, gitIntegrationSecrets.Items...)

for _, secret := range secrets {
err = kubeutil.DeleteSecretWithFinalizer(ctx, kubeFactory, &secret)
if err != nil {
log.G().Warnf("failed to delete secret: %w", err)
Expand Down
4 changes: 2 additions & 2 deletions docs/releases/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cf version

```bash
# download and extract the binary
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.22/cf-linux-amd64.tar.gz | tar zx
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.23/cf-linux-amd64.tar.gz | tar zx

# move the binary to your $PATH
mv ./cf-linux-amd64 /usr/local/bin/cf
Expand All @@ -36,7 +36,7 @@ cf version

```bash
# download and extract the binary
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.22/cf-darwin-amd64.tar.gz | tar zx
curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.23/cf-darwin-amd64.tar.gz | tar zx

# move the binary to your $PATH
mv ./cf-darwin-amd64 /usr/local/bin/cf
Expand Down
2 changes: 2 additions & 0 deletions pkg/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ type Store struct {
LabelKeyCFType string
LabelKeyCFInternal string
LabelSelectorSealedSecret string
LabelSelectorGitIntegrationSecret string
AnnotationKeySyncWave string
MarketplaceGitSourceName string
MarketplaceRepo string
Expand Down Expand Up @@ -210,6 +211,7 @@ func init() {
s.LabelKeyCFType = "codefresh.io/entity"
s.LabelKeyCFInternal = "codefresh.io/internal"
s.LabelSelectorSealedSecret = "codefresh.io/sealing-key=true"
s.LabelSelectorGitIntegrationSecret = "io.codefresh.integration-type=git"
s.AnnotationKeySyncWave = "argocd.argoproj.io/sync-wave"
s.MaxDefVersion = semver.MustParse(maxDefVersion)
s.LastRuntimeVersionInCLI = semver.MustParse(lastRuntimeVersionInCLI)
Expand Down

0 comments on commit b52e05e

Please sign in to comment.