Skip to content

Commit

Permalink
Remove webhook cleanup logic
Browse files Browse the repository at this point in the history
  • Loading branch information
marcobebway committed Apr 18, 2024
1 parent ed204a6 commit cb0c887
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 395 deletions.
2 changes: 1 addition & 1 deletion api/operator/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package main

import (
"context"
"errors"
"flag"
"log"
"os"
Expand All @@ -45,7 +44,6 @@ import (
controllercache "github.com/kyma-project/eventing-manager/internal/controller/cache"
controllerclient "github.com/kyma-project/eventing-manager/internal/controller/client"
eventingcontroller "github.com/kyma-project/eventing-manager/internal/controller/operator/eventing"
"github.com/kyma-project/eventing-manager/internal/webhook"
"github.com/kyma-project/eventing-manager/options"
backendmetrics "github.com/kyma-project/eventing-manager/pkg/backend/metrics"
"github.com/kyma-project/eventing-manager/pkg/env"
Expand Down Expand Up @@ -218,12 +216,6 @@ func main() { //nolint:funlen // main function needs to initialize many object
os.Exit(1)
}

if errs := webhook.CleanupResources(ctx, k8sClient); len(errs) > 0 {
setupLog.Error(errors.Join(errs...), "failed to cleanup kubernetes webhook resources")
syncLogger(ctrLogger)
os.Exit(1)
}

setupLog.Info("starting manager")
if err = mgr.Start(kctrl.SetupSignalHandler()); err != nil {
setupLog.Error(err, "problem running manager")
Expand Down
16 changes: 0 additions & 16 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,6 @@ rules:
- patch
- update
- watch
- apiGroups:
- batch
resourceNames:
- eventing-manager-cert-handler
resources:
- cronjobs
verbs:
- delete
- apiGroups:
- batch
resourceNames:
- eventing-manager-cert-handler
resources:
- jobs
verbs:
- delete
- apiGroups:
- eventing.kyma-project.io
resources:
Expand Down
2 changes: 0 additions & 2 deletions internal/controller/operator/eventing/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ func NewReconciler(
// +kubebuilder:rbac:groups="eventing.kyma-project.io",resources=subscriptions,verbs=get;list;watch;update;patch;create;delete
// +kubebuilder:rbac:groups=eventing.kyma-project.io,resources=subscriptions/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=security.istio.io,resources=peerauthentications,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups="batch",resources=jobs,verbs=delete,resourceNames={"eventing-manager-cert-handler"}
// +kubebuilder:rbac:groups="batch",resources=cronjobs,verbs=delete,resourceNames={"eventing-manager-cert-handler"}
// Generate required RBAC to emit kubernetes events in the controller.
// +kubebuilder:rbac:groups="",resources=events,verbs=create;patch

Expand Down
114 changes: 0 additions & 114 deletions internal/webhook/cleanup.go

This file was deleted.

Loading

0 comments on commit cb0c887

Please sign in to comment.