Skip to content

Commit d24a5a1

Browse files
authored
[mod] ic의 target branch에 *^? 문자가 포함된 경우 정규표현식으로 매칭되는 브랜치를 동작할 수 있도록 수정 (#406)
1 parent 4b88491 commit d24a5a1

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Current Operator version
2-
VERSION ?= v0.6.3
2+
VERSION ?= v0.6.4
33
REGISTRY ?= tmaxcloudck
44

55
# Image URL to use all building/pushing image targets

config/release.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ spec:
8484
containers:
8585
- command:
8686
- /controller
87-
image: docker.io/tmaxcloudck/cicd-operator:v0.6.3
87+
image: docker.io/tmaxcloudck/cicd-operator:v0.6.4
8888
imagePullPolicy: Always
8989
name: manager
9090
env:
@@ -171,7 +171,7 @@ spec:
171171
containers:
172172
- command:
173173
- /blocker
174-
image: docker.io/tmaxcloudck/cicd-blocker:v0.6.3
174+
image: docker.io/tmaxcloudck/cicd-blocker:v0.6.4
175175
imagePullPolicy: Always
176176
name: manager
177177
resources:
@@ -231,7 +231,7 @@ spec:
231231
containers:
232232
- command:
233233
- /webhook
234-
image: docker.io/tmaxcloudck/cicd-webhook:v0.6.3
234+
image: docker.io/tmaxcloudck/cicd-webhook:v0.6.4
235235
imagePullPolicy: Always
236236
name: manager
237237
resources:
@@ -291,7 +291,7 @@ spec:
291291
containers:
292292
- command:
293293
- /apiserver
294-
image: docker.io/tmaxcloudck/cicd-api-server:v0.6.3
294+
image: docker.io/tmaxcloudck/cicd-api-server:v0.6.4
295295
imagePullPolicy: Always
296296
name: manager
297297
resources:

pkg/dispatcher/dispatcher.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package dispatcher
1919
import (
2020
"context"
2121
"fmt"
22+
"regexp"
2223
"strings"
2324

2425
cicdv1 "github.com/tmax-cloud/cicd-operator/api/v1"
@@ -362,5 +363,13 @@ func applyNotification(jobs []cicdv1.Job, noti *cicdv1.Notification) []cicdv1.Jo
362363
}
363364

364365
func matchString(incoming, target string) bool {
365-
return incoming == target
366+
if strings.ContainsAny(target, "*^?") {
367+
re, err := regexp.Compile(target)
368+
if err != nil {
369+
return false
370+
}
371+
return re.MatchString(incoming)
372+
} else {
373+
return incoming == target
374+
}
366375
}

0 commit comments

Comments
 (0)