Skip to content

webhookSecretName is hardcoded to webhook-server-cert #1993

@btrepp

Description

@btrepp

It appears that webhookSecretName is hardcoded to 'webhook-server-cert'. This causes some issues when deploying via kustomize. As if you have 'namePrefix' you can't skip or wind that back.

Most other items in MetalLb seem to be configurable, but this one seems hardcoded here

webhookSecretName = "webhook-server-cert" //#nosec G101

This leads to a situation in which kustomize has correctly prefixed resources, but metal-lb still doesn't work

W0704 11:24:20.560894       1 warnings.go:70] metallb.io v1beta1 AddressPool is deprecated, consider using IPAddressPool
{"level":"error","ts":"2023-07-04T11:24:20Z","logger":"cert-rotation","msg":"could not refresh cert on startup","error":"acquiring secret to update certificates: Secret \"webhook-server-cert\" not found","errorVerbose":"Secret \"webhook-server-cert\" not found\nacquiring secret to update certificates\ngithub.com/open-policy-agent/cert-controller/pkg/rotator.(*CertRotator).refreshCertIfNeeded.func1\n\t/go/pkg/mod/github.com/open-policy-agent/cert-controller@v0.7.0/pkg/rotator/rotator.go:246\nk8s.io/apimachinery/pkg/util/wait.ConditionFunc.WithContext.func1\n\t/go/pkg/mod/k8s.io/apimachinery@v0.26.4/pkg/util/wait/wait.go:222\nk8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtectionWithContext\n\t/go/pkg/mod/k8s.io/apimachinery@v0.26.4/pkg/util/wait/wait.go:235\nk8s.io/apimachinery/pkg/util/wait.runConditionWithCrashProtection\n\t/go/pkg/mod/k8s.io/apimachinery@v0.26.4/pkg/util/wait/wait.go:228\nk8s.io/apimachinery/pkg/util/wait.ExponentialBackoff\n\t/go/pkg/mod/k8s.io/apimachinery@v0.26.4/pkg/util/wait/wait.go:423\ngithub.com/open-policy-agent/cert-controller/pkg/rotator.(*CertRotator).refreshCertIfNeeded\n\t/go/pkg/mod/github.com/open-policy-agent/cert-controller@v0.7.0/pkg/rotator/rotator.go:278\ngithub.com/open-policy-agent/cert-controller/pkg/rotator.(*CertRotator).Start\n\t/go/pkg/mod/github.com/open-policy-agent/cert-controller@v0.7.0/pkg/rotator/rotator.go:210\nsigs.k8s.io/controller-runtime/pkg/manager.(*runnableGroup).reconcile.func1\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.6/pkg/manager/runnable_group.go:219\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_arm64.s:1172","stacktrace":"github.com/open-policy-agent/cert-controller/pkg/rotator.(*CertRotator).Start\n\t/go/pkg/mod/github.com/open-policy-agent/cert-controller@v0.7.0/pkg/rotator/rotator.go:211\nsigs.k8s.io/controller-runtime/pkg/manager.(*runnableGroup).reconcile.func1\n\t/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.14.6/pkg/manager/runnable_group.go:219"}
apiVersion: v1
kind: Secret
metadata:
  name: metallb-webhook-server-cert

This is in version 0.13.9, but as it's hardcoded in main I think the problem still exists.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions