Skip to content

Commit

Permalink
chore: rename webhook name
Browse files Browse the repository at this point in the history
Signed-off-by: hectorj2f <[email protected]>
  • Loading branch information
hectorj2f committed May 18, 2022
1 parent 74a7bc1 commit f46cbd4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions cmd/cosign/policy_webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import (
"knative.dev/pkg/webhook/resourcesemantics/validation"
"sigs.k8s.io/release-utils/version"

"github.com/sigstore/cosign/pkg/apis/cosigned"
"github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1"
"github.com/sigstore/cosign/pkg/apis/cosigned/v1beta1"
"github.com/sigstore/cosign/pkg/apis/policycontroller"
"github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1"
"github.com/sigstore/cosign/pkg/apis/policycontroller/v1beta1"
"github.com/sigstore/cosign/pkg/reconciler/clusterimagepolicy"

// Register the provider-specific plugins
Expand All @@ -52,15 +52,15 @@ var (
// with the resource types, namespace selectors, CABindle and service path.
// If this changes, you must also change:
// ./config/501-policy-webhook-configurations.yaml
// https://github.com/sigstore/helm-charts/blob/main/charts/cosigned/templates/policy-webhook/policy_webhook_configurations.yaml
// https://github.com/sigstore/helm-charts/blob/main/charts/policy-controller/templates/policy-webhook/policy_webhook_configurations.yaml
mutatingWebhookName = flag.String("mutating-webhook-name", "defaulting.clusterimagepolicy.sigstore.dev", "The name of the mutating webhook configuration as well as the webhook name that is automatically configured, if exists, with different rules and client settings setting how the admission requests to be dispatched to policy-webhook.")
// validatingWebhookName holds the name of the validating webhook configuration
// resource dispatching admission requests to policy-webhook.
// It is also the name of the webhook which is injected by the controller
// with the resource types, namespace selectors, CABindle and service path.
// If this changes, you must also change:
// ./config/501-policy-webhook-configurations.yaml
// https://github.com/sigstore/helm-charts/blob/main/charts/cosigned/templates/policy-webhook/policy_webhook_configurations.yaml
// https://github.com/sigstore/helm-charts/blob/main/charts/policy-controller/templates/policy-webhook/policy_webhook_configurations.yaml
validatingWebhookName = flag.String("validating-webhook-name", "validating.clusterimagepolicy.sigstore.dev", "The name of the validating webhook configuration as well as the webhook name that is automatically configured, if exists, with different rules and client settings setting how the admission requests to be dispatched to policy-webhook.")
)

Expand Down Expand Up @@ -135,7 +135,7 @@ func newConversionController(ctx context.Context, cmw configmap.Watcher) *contro
// Specify the types of custom resource definitions that should be converted
map[schema.GroupKind]conversion.GroupKindConversion{
v1beta1.Kind("ClusterImagePolicy"): {
DefinitionName: cosigned.ClusterImagePolicyResource.String(),
DefinitionName: policycontroller.ClusterImagePolicyResource.String(),
HubVersion: v1alpha1GroupVersion,
Zygotes: map[string]conversion.ConvertibleObject{
v1alpha1GroupVersion: &v1alpha1.ClusterImagePolicy{},
Expand Down
10 changes: 5 additions & 5 deletions cmd/cosign/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ import (
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 and mutating webhook
// configuration resources dispatching admission requests to cosigned.
// configuration resources dispatching admission requests to policy-controller.
// It is also the name of the webhook which is injected by the controller
// with the resource types, namespace selectors, CABindle and service path.
// If this changes, you must also change:
// ./config/500-webhook-configuration.yaml
// https://github.com/sigstore/helm-charts/blob/main/charts/cosigned/templates/webhook/webhook_mutating.yaml
// https://github.com/sigstore/helm-charts/blob/main/charts/cosigned/templates/webhook/webhook_validating.yaml
var webhookName = flag.String("webhook-name", "cosigned.sigstore.dev", "The name of the validating and mutating webhook configurations as well as the webhook name that is automatically configured, if exists, with different rules and client settings setting how the admission requests to be dispatched to cosigned.")
// https://github.com/sigstore/helm-charts/blob/main/charts/policy-controller/templates/webhook/webhook_mutating.yaml
// https://github.com/sigstore/helm-charts/blob/main/charts/policy-controller/templates/webhook/webhook_validating.yaml
var webhookName = flag.String("webhook-name", "policycontroller.sigstore.dev", "The name of the validating and mutating webhook configurations as well as the webhook name that is automatically configured, if exists, with different rules and client settings setting how the admission requests to be dispatched to policy-controller.")

func main() {
opts := webhook.Options{
Expand All @@ -69,7 +69,7 @@ func main() {
vJSON, _ := v.JSONString()
log.Printf("%v", vJSON)
// This calls flag.Parse()
sharedmain.MainWithContext(ctx, "cosigned",
sharedmain.MainWithContext(ctx, "policy-controller",
certificates.NewController,
NewValidatingAdmissionController,
NewMutatingAdmissionController,
Expand Down
2 changes: 1 addition & 1 deletion cmd/schema/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"knative.dev/hack/schema/commands"
"knative.dev/hack/schema/registry"

v1alpha1 "github.com/sigstore/cosign/pkg/apis/cosigned/v1alpha1"
v1alpha1 "github.com/sigstore/cosign/pkg/apis/policycontroller/v1alpha1"
)

// schema is a tool to dump the schema for Eventing resources.
Expand Down

0 comments on commit f46cbd4

Please sign in to comment.