Skip to content

Commit

Permalink
[mod] ic의 target branch에 *^? 문자가 포함된 경우 정규표현식으로 매칭되는 브랜치를 동작할 수 있도록 수정 (
Browse files Browse the repository at this point in the history
  • Loading branch information
chanwook-lee authored Jan 11, 2024
1 parent 4b88491 commit d24a5a1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Current Operator version
VERSION ?= v0.6.3
VERSION ?= v0.6.4
REGISTRY ?= tmaxcloudck

# Image URL to use all building/pushing image targets
Expand Down
8 changes: 4 additions & 4 deletions config/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ spec:
containers:
- command:
- /controller
image: docker.io/tmaxcloudck/cicd-operator:v0.6.3
image: docker.io/tmaxcloudck/cicd-operator:v0.6.4
imagePullPolicy: Always
name: manager
env:
Expand Down Expand Up @@ -171,7 +171,7 @@ spec:
containers:
- command:
- /blocker
image: docker.io/tmaxcloudck/cicd-blocker:v0.6.3
image: docker.io/tmaxcloudck/cicd-blocker:v0.6.4
imagePullPolicy: Always
name: manager
resources:
Expand Down Expand Up @@ -231,7 +231,7 @@ spec:
containers:
- command:
- /webhook
image: docker.io/tmaxcloudck/cicd-webhook:v0.6.3
image: docker.io/tmaxcloudck/cicd-webhook:v0.6.4
imagePullPolicy: Always
name: manager
resources:
Expand Down Expand Up @@ -291,7 +291,7 @@ spec:
containers:
- command:
- /apiserver
image: docker.io/tmaxcloudck/cicd-api-server:v0.6.3
image: docker.io/tmaxcloudck/cicd-api-server:v0.6.4
imagePullPolicy: Always
name: manager
resources:
Expand Down
11 changes: 10 additions & 1 deletion pkg/dispatcher/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package dispatcher
import (
"context"
"fmt"
"regexp"
"strings"

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

func matchString(incoming, target string) bool {
return incoming == target
if strings.ContainsAny(target, "*^?") {
re, err := regexp.Compile(target)
if err != nil {
return false
}
return re.MatchString(incoming)
} else {
return incoming == target
}
}

0 comments on commit d24a5a1

Please sign in to comment.