Skip to content

Commit

Permalink
Drop GO111MODULE, drop v1beta1 admission review, improve flag desc, h…
Browse files Browse the repository at this point in the history
…oist and comment webhook name as constant

Signed-off-by: Matt Moore <mattomata@gmail.com>
  • Loading branch information
mattmoor committed Sep 9, 2021
1 parent b494c78 commit c78cfe1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/kind-e2e-cosigned.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:

env:
GOPATH: ${{ github.workspace }}
GO111MODULE: on
# https://github.com/google/go-containerregistry/pull/125 allows insecure registry for
# '*.local' hostnames.
REGISTRY_NAME: registry.local
Expand Down
9 changes: 7 additions & 2 deletions cmd/cosign/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ import (
cwebhook "github.com/sigstore/cosign/pkg/cosign/kubernetes/webhook"
)

var secretName = flag.String("secret-name", "", "The name of the secret in the webhook's namespace.")
var secretName = flag.String("secret-name", "", "The name of the secret in the webhook's namespace that holds the public key for verification.")

// webhookName holds the name of the validating webhook to set up with the
// types we are watching. If this changes, you must also change:
// ./config/500-webhook-configuration.yaml
const webhookName = "cosigned.sigstore.dev"

func main() {
opts := webhook.Options{
Expand All @@ -61,7 +66,7 @@ func NewValidatingAdmissionController(ctx context.Context, cmw configmap.Watcher

return validation.NewAdmissionController(ctx,
// Name of the resource webhook.
"cosigned.sigstore.dev",
webhookName,

// The path on which to serve the webhook.
"/validations",
Expand Down
2 changes: 1 addition & 1 deletion config/500-webhook-configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ webhooks:
- key: cosigned.sigstore.dev/include
operator: In
values: ["true"]
admissionReviewVersions: [v1beta1, v1]
admissionReviewVersions: [v1]
clientConfig:
service:
name: webhook
Expand Down

0 comments on commit c78cfe1

Please sign in to comment.