Skip to content

Commit e63f156

Browse files
committed
bugfixes from testing
Signed-off-by: grokspawn <[email protected]>
1 parent 677995d commit e63f156

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

alpha/template/substitutes/substitutes.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/json"
66
"fmt"
77
"io"
8+
"slices"
89

910
"k8s.io/apimachinery/pkg/util/yaml"
1011

@@ -144,6 +145,15 @@ func (t Template) processSubstitution(ctx context.Context, cfg *declcfg.Declarat
144145
entry.Replaces = substituteBundle.Name
145146
entry.Skips = append(entry.Skips, substitution.Base)
146147
}
148+
149+
// If this entry skips substitution.base, update it to skip substitution.name
150+
// and remove substitution.base from the skips list
151+
if entry.Skips != nil && slices.Contains(entry.Skips, substitution.Base) {
152+
entry.Skips = append(entry.Skips, substituteBundle.Name)
153+
entry.Skips = slices.DeleteFunc(entry.Skips, func(skip string) bool {
154+
return skip == substitution.Base
155+
})
156+
}
147157
}
148158
}
149159

0 commit comments

Comments
 (0)