Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit f67b65f

Browse files
committed
fix: using wrong store api
Signed-off-by: Hector Fernandez <hector@chainguard.dev>
1 parent 21f631a commit f67b65f

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

.github/workflows/kind-cluster-image-policy-resync-period.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ jobs:
9090
make ko-policy-controller
9191
kustomize build test/kustomize-invalid-policy-resync-period | kubectl apply -f -
9292
93-
# Wait for the webhook to come up and become Ready
94-
kubectl rollout status --timeout 5m --namespace cosign-system deployments/webhook
95-
9693
sleep 30
9794
9895
# And make sure a panic occurred

cmd/webhook/main.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/sigstore/policy-controller/pkg/apis/policy/common"
2929
"github.com/sigstore/policy-controller/pkg/apis/policy/v1alpha1"
3030
"github.com/sigstore/policy-controller/pkg/apis/policy/v1beta1"
31+
policycontrollerconfig "github.com/sigstore/policy-controller/pkg/config"
3132
"github.com/sigstore/policy-controller/pkg/reconciler/clusterimagepolicy"
3233
"github.com/sigstore/policy-controller/pkg/reconciler/trustroot"
3334
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
@@ -55,7 +56,6 @@ import (
5556
"github.com/sigstore/sigstore/pkg/tuf"
5657

5758
"github.com/sigstore/policy-controller/pkg/apis/config"
58-
policycontrollerconfig "github.com/sigstore/policy-controller/pkg/config"
5959
cwebhook "github.com/sigstore/policy-controller/pkg/webhook"
6060
)
6161

@@ -306,8 +306,9 @@ func NewMutatingAdmissionController(ctx context.Context, _ configmap.Watcher) *c
306306
func NewPolicyValidatingAdmissionController(ctx context.Context, cmw configmap.Watcher) *controller.Impl {
307307
store := config.NewStore(logging.FromContext(ctx).Named("config-store"))
308308
store.WatchConfigs(cmw)
309-
policyControllerConfigStore := config.NewStore(logging.FromContext(ctx).Named("config-policy-controller"))
309+
policyControllerConfigStore := policycontrollerconfig.NewStore(logging.FromContext(ctx).Named("config-policy-controller"))
310310
policyControllerConfigStore.WatchConfigs(cmw)
311+
311312
logger := logging.FromContext(ctx)
312313

313314
woptions := webhook.GetOptions(ctx)
@@ -330,7 +331,7 @@ func NewPolicyValidatingAdmissionController(ctx context.Context, cmw configmap.W
330331
)
331332
}
332333

333-
func NewPolicyMutatingAdmissionController(ctx context.Context, cmw configmap.Watcher) *controller.Impl {
334+
func NewPolicyMutatingAdmissionController(ctx context.Context, _ configmap.Watcher) *controller.Impl {
334335
woptions := webhook.GetOptions(ctx)
335336
logger := logging.FromContext(ctx)
336337
woptions.ControllerOptions = &controller.ControllerOptions{
@@ -351,12 +352,19 @@ func NewPolicyMutatingAdmissionController(ctx context.Context, cmw configmap.Wat
351352
)
352353
}
353354

354-
func newConversionController(ctx context.Context, cmw configmap.Watcher) *controller.Impl {
355+
func newConversionController(ctx context.Context, _ configmap.Watcher) *controller.Impl {
355356
// nolint: revive
356357
var (
357358
v1alpha1GroupVersion = v1alpha1.SchemeGroupVersion.Version
358359
v1beta1GroupVersion = v1beta1.SchemeGroupVersion.Version
359360
)
361+
logger := logging.FromContext(ctx)
362+
woptions := webhook.GetOptions(ctx)
363+
woptions.ControllerOptions = &controller.ControllerOptions{
364+
WorkQueueName: "resource-conversion",
365+
Logger: logger.Named("resource-conversion"),
366+
}
367+
ctx = webhook.WithOptions(ctx, *woptions)
360368

361369
return conversion.NewConversionController(ctx,
362370
// The path on which to serve the webhook

0 commit comments

Comments
 (0)