Skip to content

Commit

Permalink
fix(cd-service): empty list of regexes when no regex provided (#1998)
Browse files Browse the repository at this point in the history
Ref: SRX-8WMJ13

- When no `KUBERPULT_MINOR_REGEXES` env var provided, The list of minor
regexes to use should be empty
- Added a description for minor regexes to the tooltip
  • Loading branch information
AminSlk authored Oct 2, 2024
1 parent 127d6ec commit b7b2c23
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ services:
- KUBERPULT_ALLOW_LONG_APP_NAMES=true
- KUBERPULT_ARGO_CD_GENERATE_FILES=true
- KUBERPULT_DB_SSL_MODE=disable
- KUBERPULT_MINOR_REGEXES=^.*exampleRegexForMinors:.*$,^secondExampleRegexForMinors:.*$
- KUBERPULT_DB_MAX_OPEN_CONNECTIONS=10
- KUBERPULT_DB_MAX_IDLE_CONNECTIONS=5
ports:
Expand Down
14 changes: 8 additions & 6 deletions services/cd-service/pkg/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,15 @@ func RunServer() {
ctx = context.WithValue(ctx, repository.DdMetricsKey, ddMetrics)
}
minorRegexes := []*regexp.Regexp{}
for _, minorRegexStr := range strings.Split(c.MinorRegexes, ",") {
regex, err := regexp.Compile(minorRegexStr)
if err != nil {
logger.FromContext(ctx).Sugar().Warnf("Invalid regex input: %s", minorRegexStr)
continue
if c.MinorRegexes != "" {
for _, minorRegexStr := range strings.Split(c.MinorRegexes, ",") {
regex, err := regexp.Compile(minorRegexStr)
if err != nil {
logger.FromContext(ctx).Sugar().Warnf("Invalid regex input: %s", minorRegexStr)
continue
}
minorRegexes = append(minorRegexes, regex)
}
minorRegexes = append(minorRegexes, regex)
}

// If the tracer is not started, calling this function is a no-op.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ export const ReleaseCard: React.FC<ReleaseCardProps> = (props) => {
<span>Author:</span> {sourceAuthor}
</div>
)}
{isMinor && (
<div>
<span>
'💤' icon means that this release is a minor release; it has no changes to the manifests
comparing to the previous release.
</span>
</div>
)}
{isPrepublish && (
<div className="prerelease__description">
<span>This is a pre-release. It doesn't have any manifests. It can't be deployed anywhere.</span>
Expand Down

0 comments on commit b7b2c23

Please sign in to comment.