Skip to content
Open
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
3 changes: 3 additions & 0 deletions .github/workflows/auto_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ jobs:
--force \
--push \
--restore-path .github/workflows \
--restore-path config/rbac \
--restore-path .custom-gcl.yml \
--restore-path test/utils \
--open-gh-issue
2 changes: 1 addition & 1 deletion PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
cliVersion: 4.13.0
cliVersion: 4.13.1
domain: cluster.x-k8s.io
layout:
- go.kubebuilder.io/v4
Expand Down
12 changes: 8 additions & 4 deletions api/v1beta2/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ import (
)

var (
// GroupVersion is group version used to register these objects.
GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta2"}
// SchemeGroupVersion is group version used to register these objects.
// This name is used by applyconfiguration generators (e.g. controller-gen).
SchemeGroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta2"}

// GroupVersion is an alias for SchemeGroupVersion, for backward compatibility.
GroupVersion = SchemeGroupVersion

// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
Expand All @@ -39,7 +43,7 @@ var (
)

func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(GroupVersion, objectTypes...)
metav1.AddToGroupVersion(scheme, GroupVersion)
scheme.AddKnownTypes(SchemeGroupVersion, objectTypes...)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func main() {

// Metrics endpoint is enabled in 'config/default/kustomization.yaml'. The Metrics options configure the server.
// More info:
// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.23.1/pkg/metrics/server
// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.23.3/pkg/metrics/server
// - https://book.kubebuilder.io/reference/metrics.html
metricsServerOptions := metricsserver.Options{
BindAddress: metricsAddr,
Expand All @@ -146,7 +146,7 @@ func main() {
// FilterProvider is used to protect the metrics endpoint with authn/authz.
// These configurations ensure that only authorized users and service accounts
// can access the metrics endpoint. The RBAC are configured in 'config/rbac/kustomization.yaml'. More info:
// https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.23.1/pkg/metrics/filters#WithAuthenticationAndAuthorization
// https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.23.3/pkg/metrics/filters#WithAuthenticationAndAuthorization
metricsServerOptions.FilterProvider = filters.WithAuthenticationAndAuthorization
}

Expand Down
2 changes: 1 addition & 1 deletion internal/controller/cloudscalecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func (r *CloudscaleClusterReconciler) SetupWithManager(ctx context.Context, mgr
WithEventFilter(predicates.ResourceIsNotExternallyManaged(r.Scheme, logger)).
Watches(
&clusterv1.Cluster{},
handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrastructurev1beta2.GroupVersion.WithKind("CloudscaleCluster"), mgr.GetClient(), &infrastructurev1beta2.CloudscaleCluster{})),
handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(ctx, infrastructurev1beta2.SchemeGroupVersion.WithKind("CloudscaleCluster"), mgr.GetClient(), &infrastructurev1beta2.CloudscaleCluster{})),
).
Watches(
&infrastructurev1beta2.CloudscaleMachine{},
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/cloudscalemachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func (r *CloudscaleMachineReconciler) SetupWithManager(ctx context.Context, mgr
WithEventFilter(predicates.ResourceIsNotExternallyManaged(r.Scheme, logger)).
Watches(
&clusterv1.Machine{},
handler.EnqueueRequestsFromMapFunc(util.MachineToInfrastructureMapFunc(infrastructurev1beta2.GroupVersion.WithKind("CloudscaleMachine"))),
handler.EnqueueRequestsFromMapFunc(util.MachineToInfrastructureMapFunc(infrastructurev1beta2.SchemeGroupVersion.WithKind("CloudscaleMachine"))),
).
Watches(
&clusterv1.Cluster{},
Expand Down
4 changes: 2 additions & 2 deletions internal/webhook/v1beta2/cloudscalecluster_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (v *CloudscaleClusterCustomValidator) ValidateCreate(_ context.Context, clu

if len(allErrs) > 0 {
return nil, apierrors.NewInvalid(
schema.GroupKind{Group: infrastructurev1beta2.GroupVersion.Group, Kind: "CloudscaleCluster"},
schema.GroupKind{Group: infrastructurev1beta2.SchemeGroupVersion.Group, Kind: "CloudscaleCluster"},
cluster.Name, allErrs)
}

Expand Down Expand Up @@ -225,7 +225,7 @@ func (v *CloudscaleClusterCustomValidator) ValidateUpdate(_ context.Context, old

if len(allErrs) > 0 {
return nil, apierrors.NewInvalid(
schema.GroupKind{Group: infrastructurev1beta2.GroupVersion.Group, Kind: "CloudscaleCluster"},
schema.GroupKind{Group: infrastructurev1beta2.SchemeGroupVersion.Group, Kind: "CloudscaleCluster"},
newCluster.Name, allErrs)
}

Expand Down
4 changes: 2 additions & 2 deletions internal/webhook/v1beta2/cloudscalemachine_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (v *CloudscaleMachineCustomValidator) ValidateCreate(_ context.Context, obj
allErrs := validateMachineSpec(&obj.Spec, v.FlavorInfo, field.NewPath("spec"))
if len(allErrs) > 0 {
return nil, apierrors.NewInvalid(
schema.GroupKind{Group: infrastructurev1beta2.GroupVersion.Group, Kind: "CloudscaleMachine"},
schema.GroupKind{Group: infrastructurev1beta2.SchemeGroupVersion.Group, Kind: "CloudscaleMachine"},
obj.Name, allErrs)
}

Expand All @@ -90,7 +90,7 @@ func (v *CloudscaleMachineCustomValidator) ValidateUpdate(_ context.Context, old
allErrs := validateMachineSpecUpdate(&newObj.Spec, &oldObj.Spec, field.NewPath("spec"))
if len(allErrs) > 0 {
return nil, apierrors.NewInvalid(
schema.GroupKind{Group: infrastructurev1beta2.GroupVersion.Group, Kind: "CloudscaleMachine"},
schema.GroupKind{Group: infrastructurev1beta2.SchemeGroupVersion.Group, Kind: "CloudscaleMachine"},
newObj.Name, allErrs)
}

Expand Down
4 changes: 2 additions & 2 deletions internal/webhook/v1beta2/cloudscalemachinetemplate_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (v *CloudscaleMachineTemplateCustomValidator) ValidateCreate(_ context.Cont
allErrs := validateMachineSpec(&obj.Spec.Template.Spec, v.FlavorInfo, field.NewPath("spec", "template", "spec"))
if len(allErrs) > 0 {
return nil, apierrors.NewInvalid(
schema.GroupKind{Group: infrastructurev1beta2.GroupVersion.Group, Kind: "CloudscaleMachineTemplate"},
schema.GroupKind{Group: infrastructurev1beta2.SchemeGroupVersion.Group, Kind: "CloudscaleMachineTemplate"},
obj.Name, allErrs)
}

Expand All @@ -95,7 +95,7 @@ func (v *CloudscaleMachineTemplateCustomValidator) ValidateUpdate(_ context.Cont
field.NewPath("spec", "template", "spec"),
"field is immutable"))
return nil, apierrors.NewInvalid(
schema.GroupKind{Group: infrastructurev1beta2.GroupVersion.Group, Kind: "CloudscaleMachineTemplate"},
schema.GroupKind{Group: infrastructurev1beta2.SchemeGroupVersion.Group, Kind: "CloudscaleMachineTemplate"},
newObj.Name, allErrs)
}

Expand Down
Loading