From b88c35694d56b2a484f2806de15e0e8cf0cef273 Mon Sep 17 00:00:00 2001 From: Ariel Septon <64063409+arielsepton@users.noreply.github.com> Date: Fri, 3 Jan 2025 20:54:31 +0200 Subject: [PATCH] Feat/update secrets on expected response (#79) * feat: update secrets on expected response Signed-off-by: Ariel Septon * bump version to v1.0.8 Signed-off-by: Ariel Septon --------- Signed-off-by: Ariel Septon Co-authored-by: Ariel Septon --- .github/workflows/promote.yml | 2 +- .github/workflows/tag.yml | 2 +- README.md | 4 ++-- deploy.yml | 2 +- internal/controller/disposablerequest/disposablerequest.go | 5 +++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml index d099135..2237c93 100644 --- a/.github/workflows/promote.yml +++ b/.github/workflows/promote.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: version: - description: "Release version (e.g. v1.0.7)" + description: "Release version (e.g. v1.0.8)" required: true channel: description: "Release channel" diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index eda0615..aa7d32c 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: version: - description: "Release version (e.g. v1.0.7)" + description: "Release version (e.g. v1.0.8)" required: true message: description: "Tag message" diff --git a/README.md b/README.md index 27390b8..3de5ec8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ To install `provider-http`, you have two options: 1. Using the Crossplane CLI in a Kubernetes cluster where Crossplane is installed: ```console - crossplane xpkg install provider xpkg.upbound.io/crossplane-contrib/provider-http:v1.0.7 + crossplane xpkg install provider xpkg.upbound.io/crossplane-contrib/provider-http:v1.0.8 ``` 2. Manually creating a Provider by applying the following YAML: @@ -20,7 +20,7 @@ To install `provider-http`, you have two options: metadata: name: provider-http spec: - package: "xpkg.upbound.io/crossplane-contrib/provider-http:v1.0.7" + package: "xpkg.upbound.io/crossplane-contrib/provider-http:v1.0.8" ``` ## Supported Resources diff --git a/deploy.yml b/deploy.yml index 8a22fa2..b898d20 100644 --- a/deploy.yml +++ b/deploy.yml @@ -4,7 +4,7 @@ kind: Provider metadata: name: http-provider spec: - package: xpkg.upbound.io/crossplane-contrib/provider-http:v1.0.7 + package: xpkg.upbound.io/crossplane-contrib/provider-http:v1.0.8 controllerConfigRef: name: debug-config diff --git a/internal/controller/disposablerequest/disposablerequest.go b/internal/controller/disposablerequest/disposablerequest.go index 5b92457..7704af7 100644 --- a/internal/controller/disposablerequest/disposablerequest.go +++ b/internal/controller/disposablerequest/disposablerequest.go @@ -234,8 +234,9 @@ func (c *external) deployAction(ctx context.Context, cr *v1alpha2.DisposableRequ return err } - datapatcher.ApplyResponseDataToSecrets(ctx, c.localKube, c.logger, &resource.HttpResponse, cr.Spec.ForProvider.SecretInjectionConfigs, cr) - if !isExpectedResponse { + if isExpectedResponse { + datapatcher.ApplyResponseDataToSecrets(ctx, c.localKube, c.logger, &resource.HttpResponse, cr.Spec.ForProvider.SecretInjectionConfigs, cr) + } else { limit := utils.GetRollbackRetriesLimit(cr.Spec.ForProvider.RollbackRetriesLimit) return utils.SetRequestResourceStatus(*resource, resource.SetStatusCode(), resource.SetLastReconcileTime(), resource.SetHeaders(), resource.SetBody(), resource.SetError(errors.New(errResponseFormat+fmt.Sprint(limit))), resource.SetRequestDetails())