Skip to content

Commit

Permalink
Merge pull request #1538 from ChuckQuinnIV/main
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkennedy513 authored Feb 26, 2024
2 parents 03acfbb + acad428 commit 69b2c6d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package main
import (
"context"
"log"
"os"
"strconv"

"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
Expand All @@ -26,6 +28,8 @@ import (
"github.com/pivotal/kpack/pkg/apis/build/v1alpha2"
)

const defaultWebhookPort = 8443

var types = map[schema.GroupVersionKind]resourcesemantics.GenericCRD{
v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.ImageKind): &v1alpha2.Image{},
v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.BuildKind): &v1alpha2.Build{},
Expand All @@ -42,9 +46,14 @@ func init() {
}

func main() {
webhookPort := defaultWebhookPort
webhookPortEnv := os.Getenv("WEBHOOK_PORT")
if parsedWebhookPort, err := strconv.Atoi(webhookPortEnv); err == nil {
webhookPort = parsedWebhookPort
}
ctx := webhook.WithOptions(signals.NewContext(), webhook.Options{
ServiceName: "kpack-webhook",
Port: 8443,
Port: webhookPort,
SecretName: "webhook-certs",
})

Expand Down

0 comments on commit 69b2c6d

Please sign in to comment.