Skip to content

Commit e566f3c

Browse files
committed
OSD-24275: Add webhook build flag to allow building outside of cluster env
1 parent 2aed50c commit e566f3c

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

build/resources.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ func sliceContains(needle string, haystack []string) bool {
884884

885885
func main() {
886886
flag.Parse()
887+
utils.BuildRun = true
887888

888889
skip := strings.Split(*excludes, ",")
889890
onlyInclude := strings.Split(*only, "")

pkg/webhooks/ingresscontroller/ingresscontroller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ func NewWebhook(params ...interface{}) *IngressControllerWebhook {
343343
}
344344
// utils.TestHooks maps to cli flag 'testhooks' and is used during 'make test' to "test webhook URI uniqueness".
345345
// 'make test' does not require this hook to build runtime clients/config at this time...
346-
if utils.TestHooks {
346+
if utils.TestHooks || utils.BuildRun {
347347
return wh
348348
}
349349

pkg/webhooks/utils/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const (
2828
var (
2929
// Allows sharing of testhooks 'make test' flag value used by main to test "webhook URI uniqueness"
3030
TestHooks bool
31+
BuildRun bool
3132
admissionScheme = runtime.NewScheme()
3233
admissionCodecs = serializer.NewCodecFactory(admissionScheme)
3334
)

0 commit comments

Comments
 (0)