Skip to content

Commit

Permalink
Remove the legacy AddressPool - Attempt number 3
Browse files Browse the repository at this point in the history
We missed a few other spots, hopefully this is the last cleanup.

Signed-off-by: Ori Braunshtein <obraunsh@redhat.com>
  • Loading branch information
oribon authored and fedepaol committed Feb 1, 2024
1 parent c3693e5 commit 4633b39
Show file tree
Hide file tree
Showing 17 changed files with 8 additions and 181 deletions.
8 changes: 1 addition & 7 deletions charts/metallb/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ rules:
verbs: ["list", "watch"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
resourceNames: ["addresspools.metallb.io","bfdprofiles.metallb.io","bgpadvertisements.metallb.io",
resourceNames: ["bfdprofiles.metallb.io","bgpadvertisements.metallb.io",
"bgppeers.metallb.io","ipaddresspools.metallb.io","l2advertisements.metallb.io","communities.metallb.io"]
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
- apiGroups: ["apiextensions.k8s.io"]
Expand Down Expand Up @@ -83,9 +83,6 @@ rules:
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "list", "watch"]
- apiGroups: ["metallb.io"]
resources: ["addresspools"]
verbs: ["get", "list", "watch"]
- apiGroups: ["metallb.io"]
resources: ["bfdprofiles"]
verbs: ["get", "list", "watch"]
Expand Down Expand Up @@ -133,9 +130,6 @@ rules:
- apiGroups: [""]
resources: ["secrets"]
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
- apiGroups: ["metallb.io"]
resources: ["addresspools"]
verbs: ["get", "list", "watch"]
- apiGroups: ["metallb.io"]
resources: ["ipaddresspools"]
verbs: ["get", "list", "watch"]
Expand Down
4 changes: 0 additions & 4 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ resources:
- bases/metallb.io_communities.yaml

patches:
- path: patches/crd-conversion-patch-addresspools.yaml
target:
kind: CustomResourceDefinition
name: addresspools.metallb.io
- path: patches/crd-conversion-patch-bgppeers.yaml
target:
kind: CustomResourceDefinition
Expand Down
19 changes: 0 additions & 19 deletions config/crd/patches/crd-conversion-patch-addresspools.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions config/manifests/metallb-frr-k8s-prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1619,14 +1619,6 @@ rules:
verbs:
- get
- list
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down Expand Up @@ -1726,14 +1718,6 @@ rules:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down Expand Up @@ -2000,7 +1984,6 @@ rules:
- apiGroups:
- apiextensions.k8s.io
resourceNames:
- addresspools.metallb.io
- bfdprofiles.metallb.io
- bgpadvertisements.metallb.io
- bgppeers.metallb.io
Expand Down
17 changes: 0 additions & 17 deletions config/manifests/metallb-frr-k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1614,14 +1614,6 @@ rules:
verbs:
- get
- list
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down Expand Up @@ -1721,14 +1713,6 @@ rules:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down Expand Up @@ -1966,7 +1950,6 @@ rules:
- apiGroups:
- apiextensions.k8s.io
resourceNames:
- addresspools.metallb.io
- bfdprofiles.metallb.io
- bgpadvertisements.metallb.io
- bgppeers.metallb.io
Expand Down
17 changes: 0 additions & 17 deletions config/manifests/metallb-frr-prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1136,14 +1136,6 @@ rules:
verbs:
- get
- list
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down Expand Up @@ -1215,14 +1207,6 @@ rules:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down Expand Up @@ -1370,7 +1354,6 @@ rules:
- apiGroups:
- apiextensions.k8s.io
resourceNames:
- addresspools.metallb.io
- bfdprofiles.metallb.io
- bgpadvertisements.metallb.io
- bgppeers.metallb.io
Expand Down
17 changes: 0 additions & 17 deletions config/manifests/metallb-frr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1136,14 +1136,6 @@ rules:
verbs:
- get
- list
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down Expand Up @@ -1215,14 +1207,6 @@ rules:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down Expand Up @@ -1341,7 +1325,6 @@ rules:
- apiGroups:
- apiextensions.k8s.io
resourceNames:
- addresspools.metallb.io
- bfdprofiles.metallb.io
- bgpadvertisements.metallb.io
- bgppeers.metallb.io
Expand Down
17 changes: 0 additions & 17 deletions config/manifests/metallb-native-prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1136,14 +1136,6 @@ rules:
verbs:
- get
- list
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down Expand Up @@ -1215,14 +1207,6 @@ rules:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down Expand Up @@ -1370,7 +1354,6 @@ rules:
- apiGroups:
- apiextensions.k8s.io
resourceNames:
- addresspools.metallb.io
- bfdprofiles.metallb.io
- bgpadvertisements.metallb.io
- bgppeers.metallb.io
Expand Down
17 changes: 0 additions & 17 deletions config/manifests/metallb-native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1136,14 +1136,6 @@ rules:
verbs:
- get
- list
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down Expand Up @@ -1215,14 +1207,6 @@ rules:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down Expand Up @@ -1341,7 +1325,6 @@ rules:
- apiGroups:
- apiextensions.k8s.io
resourceNames:
- addresspools.metallb.io
- bfdprofiles.metallb.io
- bgpadvertisements.metallb.io
- bgppeers.metallb.io
Expand Down
17 changes: 0 additions & 17 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ rules:
resources:
- customresourcedefinitions
resourceNames:
- addresspools.metallb.io
- bfdprofiles.metallb.io
- bgpadvertisements.metallb.io
- bgppeers.metallb.io
Expand Down Expand Up @@ -162,14 +161,6 @@ rules:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down Expand Up @@ -261,14 +252,6 @@ rules:
verbs:
- get
- list
- apiGroups:
- metallb.io
resources:
- addresspools
verbs:
- get
- list
- watch
- apiGroups:
- metallb.io
resources:
Expand Down
18 changes: 0 additions & 18 deletions config/webhook/patches/webhook_conversion.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: addresspools.metallb.io
spec:
conversion:
strategy: Webhook
webhook:
conversionReviewVersions: ["v1alpha1", "v1beta1"]
clientConfig:
# this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
# but we're going to set it later using the cert-controller.
caBundle: Cg==
service:
namespace: metallb-system
name: webhook-service
path: /convert
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: bgppeers.metallb.io
spec:
Expand Down
9 changes: 4 additions & 5 deletions internal/k8s/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ const (
)

var (
scheme = runtime.NewScheme()
setupLog = ctrl.Log.WithName("setup")
validatingWebhookName = "metallb-webhook-configuration"
addresspoolConvertingWebhookCRD = "addresspools.metallb.io"
bgppeerConvertingWebhookCRD = "bgppeers.metallb.io"
scheme = runtime.NewScheme()
setupLog = ctrl.Log.WithName("setup")
validatingWebhookName = "metallb-webhook-configuration"
bgppeerConvertingWebhookCRD = "bgppeers.metallb.io"
)

func init() {
Expand Down
4 changes: 0 additions & 4 deletions internal/k8s/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ func enableCertRotation(notifyFinished chan struct{}, cfg *Config, mgr manager.M
Name: validatingWebhookName,
Type: rotator.Validating,
},
{
Name: addresspoolConvertingWebhookCRD,
Type: rotator.CRDConversion,
},
{
Name: bgppeerConvertingWebhookCRD,
Type: rotator.CRDConversion,
Expand Down
1 change: 0 additions & 1 deletion internal/k8s/webhooks/webhookv1beta1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

// log is for logging addresspool-webhook.
var (
Logger log.Logger
WebhookClient client.Reader
Expand Down
Loading

0 comments on commit 4633b39

Please sign in to comment.