Skip to content

Commit

Permalink
Merge pull request #6092 from irbekrm/1_11_disable_apf_for_webhook
Browse files Browse the repository at this point in the history
[release-1.11] cherry-pick of disabling APF controller in webhook
  • Loading branch information
jetstack-bot committed May 23, 2023
2 parents 4767427 + 99fb24a commit 570574d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/acme/webhook/cmd/server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ import (

"github.com/spf13/cobra"

utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apiserver/pkg/features"
genericapiserver "k8s.io/apiserver/pkg/server"
genericoptions "k8s.io/apiserver/pkg/server/options"
utilfeature "k8s.io/apiserver/pkg/util/feature"

"github.com/cert-manager/cert-manager/pkg/acme/webhook"
whapi "github.com/cert-manager/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1"
Expand Down Expand Up @@ -124,6 +127,13 @@ func (o WebhookServerOptions) Config() (*apiserver.Config, error) {
// RunWebhookServer creates a new apiserver, registers an API Group for each of
// the configured solvers and runs the new apiserver.
func (o WebhookServerOptions) RunWebhookServer(stopCh <-chan struct{}) error {
// extension apiserver does not need priority and fairness.
// TODO: this is a short term fix; when APF graduates we will need to
// find another way. Alternatives are either to find a way how to
// disable APF controller (without the feature gate), run the controller
// (create RBAC and ensure required resources are installed) or do some
// bigger refactor of this project that could solve the problem
utilruntime.Must(utilfeature.DefaultMutableFeatureGate.Set(fmt.Sprintf("%s=false", features.APIPriorityAndFairness)))
config, err := o.Config()
if err != nil {
return err
Expand Down

0 comments on commit 570574d

Please sign in to comment.