Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions config/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ webhooks:
service:
name: webhook-service
namespace: system
path: /mutate-cluster-x-k8s-io-v1beta2-machine
path: /mutate-runtime-cluster-x-k8s-io-v1beta2-extensionconfig
failurePolicy: Fail
matchPolicy: Equivalent
name: default.machine.cluster.x-k8s.io
name: default.extensionconfig.runtime.addons.cluster.x-k8s.io
rules:
- apiGroups:
- cluster.x-k8s.io
- runtime.cluster.x-k8s.io
apiVersions:
- v1beta2
operations:
- CREATE
- UPDATE
resources:
- machines
- extensionconfigs
sideEffects: None
- admissionReviewVersions:
- v1
Expand All @@ -77,10 +77,10 @@ webhooks:
service:
name: webhook-service
namespace: system
path: /mutate-cluster-x-k8s-io-v1beta2-machinedeployment
path: /mutate-cluster-x-k8s-io-v1beta2-machine
failurePolicy: Fail
matchPolicy: Equivalent
name: default.machinedeployment.cluster.x-k8s.io
name: default.machine.cluster.x-k8s.io
rules:
- apiGroups:
- cluster.x-k8s.io
Expand All @@ -90,7 +90,7 @@ webhooks:
- CREATE
- UPDATE
resources:
- machinedeployments
- machines
sideEffects: None
- admissionReviewVersions:
- v1
Expand All @@ -99,10 +99,10 @@ webhooks:
service:
name: webhook-service
namespace: system
path: /mutate-cluster-x-k8s-io-v1beta2-machinehealthcheck
path: /mutate-cluster-x-k8s-io-v1beta2-machinedeployment
failurePolicy: Fail
matchPolicy: Equivalent
name: default.machinehealthcheck.cluster.x-k8s.io
name: default.machinedeployment.cluster.x-k8s.io
rules:
- apiGroups:
- cluster.x-k8s.io
Expand All @@ -112,7 +112,7 @@ webhooks:
- CREATE
- UPDATE
resources:
- machinehealthchecks
- machinedeployments
sideEffects: None
- admissionReviewVersions:
- v1
Expand All @@ -121,10 +121,10 @@ webhooks:
service:
name: webhook-service
namespace: system
path: /mutate-cluster-x-k8s-io-v1beta2-machinepool
path: /mutate-cluster-x-k8s-io-v1beta2-machinehealthcheck
failurePolicy: Fail
matchPolicy: Equivalent
name: default.machinepool.cluster.x-k8s.io
name: default.machinehealthcheck.cluster.x-k8s.io
rules:
- apiGroups:
- cluster.x-k8s.io
Expand All @@ -134,7 +134,7 @@ webhooks:
- CREATE
- UPDATE
resources:
- machinepools
- machinehealthchecks
sideEffects: None
- admissionReviewVersions:
- v1
Expand All @@ -143,10 +143,10 @@ webhooks:
service:
name: webhook-service
namespace: system
path: /mutate-cluster-x-k8s-io-v1beta2-machineset
path: /mutate-cluster-x-k8s-io-v1beta2-machinepool
failurePolicy: Fail
matchPolicy: Equivalent
name: default.machineset.cluster.x-k8s.io
name: default.machinepool.cluster.x-k8s.io
rules:
- apiGroups:
- cluster.x-k8s.io
Expand All @@ -156,7 +156,7 @@ webhooks:
- CREATE
- UPDATE
resources:
- machinesets
- machinepools
sideEffects: None
- admissionReviewVersions:
- v1
Expand All @@ -165,20 +165,20 @@ webhooks:
service:
name: webhook-service
namespace: system
path: /mutate-runtime-cluster-x-k8s-io-v1beta2-extensionconfig
path: /mutate-cluster-x-k8s-io-v1beta2-machineset
failurePolicy: Fail
matchPolicy: Equivalent
name: default.extensionconfig.runtime.addons.cluster.x-k8s.io
name: default.machineset.cluster.x-k8s.io
rules:
- apiGroups:
- runtime.cluster.x-k8s.io
- cluster.x-k8s.io
apiVersions:
- v1beta2
operations:
- CREATE
- UPDATE
resources:
- extensionconfigs
- machinesets
sideEffects: None
---
apiVersion: admissionregistration.k8s.io/v1
Expand Down Expand Up @@ -276,6 +276,28 @@ webhooks:
resources:
- clusterresourcesetbindings
sideEffects: None
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-runtime-cluster-x-k8s-io-v1beta2-extensionconfig
failurePolicy: Fail
matchPolicy: Equivalent
name: validation.extensionconfig.runtime.cluster.x-k8s.io
rules:
- apiGroups:
- runtime.cluster.x-k8s.io
apiVersions:
- v1beta2
operations:
- CREATE
- UPDATE
resources:
- extensionconfigs
sideEffects: None
- admissionReviewVersions:
- v1
- v1beta1
Expand Down Expand Up @@ -454,25 +476,3 @@ webhooks:
resources:
- machinesets
sideEffects: None
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-runtime-cluster-x-k8s-io-v1beta2-extensionconfig
failurePolicy: Fail
matchPolicy: Equivalent
name: validation.extensionconfig.runtime.cluster.x-k8s.io
rules:
- apiGroups:
- runtime.cluster.x-k8s.io
apiVersions:
- v1beta2
operations:
- CREATE
- UPDATE
resources:
- extensionconfigs
sideEffects: None
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package runtime
package webhooks

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,22 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package runtime
package webhooks

import (
"context"
"testing"

. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
utilfeature "k8s.io/component-base/featuregate/testing"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"

runtimev1 "sigs.k8s.io/cluster-api/api/runtime/v1beta2"
"sigs.k8s.io/cluster-api/feature"
"sigs.k8s.io/cluster-api/internal/webhooks/util"
)

var (
ctx = ctrl.SetupSignalHandler()
fakeScheme = runtime.NewScheme()
)

func init() {
_ = runtimev1.AddToScheme(fakeScheme)
}
Expand Down
18 changes: 0 additions & 18 deletions internal/webhooks/runtime/doc.go

This file was deleted.

3 changes: 1 addition & 2 deletions webhooks/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (

clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
"sigs.k8s.io/cluster-api/internal/webhooks"
runtimewebhooks "sigs.k8s.io/cluster-api/internal/webhooks/runtime"
)

// Cluster implements a validating and defaulting webhook for Cluster.
Expand Down Expand Up @@ -132,7 +131,7 @@ type ExtensionConfig struct{}

// SetupWebhookWithManager sets up ClusterResourceSet webhooks.
func (webhook *ExtensionConfig) SetupWebhookWithManager(mgr ctrl.Manager) error {
return (&runtimewebhooks.ExtensionConfig{}).SetupWebhookWithManager(mgr)
return (&webhooks.ExtensionConfig{}).SetupWebhookWithManager(mgr)
}

// MachinePool implements a validating and defaulting webhook for MachinePool.
Expand Down