From 8d60beaea1aca29df06078f24afa26ffc959184d Mon Sep 17 00:00:00 2001 From: ShobhitSingh11 Date: Fri, 22 Nov 2024 01:04:13 +0530 Subject: [PATCH] fix: [CI-14780]: Comments resolved --- engine/compiler/compiler.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/compiler/compiler.go b/engine/compiler/compiler.go index a9554d2..c44d4b6 100644 --- a/engine/compiler/compiler.go +++ b/engine/compiler/compiler.go @@ -497,7 +497,12 @@ func (c *Compiler) Compile(ctx context.Context, args runtime.CompilerArgs) runti } for _, s := range step.Secrets { - + // if the secret was already fetched and stored in the + // secret map it can be skipped. + if _, ok := spec.Secrets[s.Name]; ok { + step.SpecSecrets = append(step.SpecSecrets, spec.Secrets[s.Name]) + continue + } secret, ok := c.findSecret(ctx, args, s.Name) if ok { s := &engine.Secret{