From 54cfa22720bbfce9d0b2a122cc49ea60f0721ef8 Mon Sep 17 00:00:00 2001 From: Ilia Medvedev Date: Tue, 10 Dec 2024 15:49:11 +0200 Subject: [PATCH] fix --- codefresh/cfclient/context.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/codefresh/cfclient/context.go b/codefresh/cfclient/context.go index 9b1f0e8..4a29dec 100644 --- a/codefresh/cfclient/context.go +++ b/codefresh/cfclient/context.go @@ -70,8 +70,15 @@ func (client *Client) GetContext(name string) (*Context, error) { return nil, err } + // This is so not to break existing behavior while adding support for forbidDecrypt feature flag + // The provider used to always decrypt the contexts, hence we treat all contexts as decrypted unless forbidDecrypt is set isEncryptedType := slices.Contains(encryptedContextTypes, respContext.Spec.Type) - respContext.IsEncrypred = isEncryptedType && !forbidDecrypt + + respContext.IsEncrypred = false + + if forbidDecrypt && isEncryptedType { + respContext.IsEncrypred = true + } return &respContext, nil }