Skip to content

Commit

Permalink
Post merge-conflict fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Mazzotti <[email protected]>
  • Loading branch information
anmazzotti committed Mar 27, 2024
1 parent 5516a0a commit b2841f1
Show file tree
Hide file tree
Showing 7 changed files with 362 additions and 294 deletions.
13 changes: 7 additions & 6 deletions bootstrap/api/v1beta2/kthreesconfig_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)

// SetupWebhookWithManager will setup the webhooks for the KThreesControlPlane.
Expand All @@ -36,18 +37,18 @@ var _ webhook.Defaulter = &KThreesConfig{}
var _ webhook.Validator = &KThreesConfig{}

// ValidateCreate will do any extra validation when creating a KThreesControlPlane.
func (c *KThreesConfig) ValidateCreate() error {
return nil
func (c *KThreesConfig) ValidateCreate() (admission.Warnings, error) {
return []string{}, nil
}

// ValidateUpdate will do any extra validation when updating a KThreesControlPlane.
func (c *KThreesConfig) ValidateUpdate(runtime.Object) error {
return nil
func (c *KThreesConfig) ValidateUpdate(runtime.Object) (admission.Warnings, error) {
return []string{}, nil
}

// ValidateDelete allows you to add any extra validation when deleting.
func (c *KThreesConfig) ValidateDelete() error {
return nil
func (c *KThreesConfig) ValidateDelete() (admission.Warnings, error) {
return []string{}, nil
}

// Default will set default values for the KThreesControlPlane.
Expand Down
13 changes: 7 additions & 6 deletions bootstrap/api/v1beta2/kthreesconfigtemplate_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)

// SetupWebhookWithManager will setup the webhooks for the KThreesControlPlane.
Expand All @@ -36,18 +37,18 @@ var _ webhook.Defaulter = &KThreesConfigTemplate{}
var _ webhook.Validator = &KThreesConfigTemplate{}

// ValidateCreate will do any extra validation when creating a KThreesControlPlane.
func (c *KThreesConfigTemplate) ValidateCreate() error {
return nil
func (c *KThreesConfigTemplate) ValidateCreate() (admission.Warnings, error) {
return []string{}, nil
}

// ValidateUpdate will do any extra validation when updating a KThreesControlPlane.
func (c *KThreesConfigTemplate) ValidateUpdate(runtime.Object) error {
return nil
func (c *KThreesConfigTemplate) ValidateUpdate(runtime.Object) (admission.Warnings, error) {
return []string{}, nil
}

// ValidateDelete allows you to add any extra validation when deleting.
func (c *KThreesConfigTemplate) ValidateDelete() error {
return nil
func (c *KThreesConfigTemplate) ValidateDelete() (admission.Warnings, error) {
return []string{}, nil
}

// Default will set default values for the KThreesControlPlane.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
controller-gen.kubebuilder.io/version: v0.14.0
name: kthreesconfigs.bootstrap.cluster.x-k8s.io
spec:
group: bootstrap.cluster.x-k8s.io
Expand Down Expand Up @@ -293,14 +293,19 @@ spec:
description: KThreesConfig is the Schema for the kthreesconfigs API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down Expand Up @@ -335,9 +340,9 @@ spec:
type: string
type: array
privateRegistry:
description: 'TODO: take in a object or secret and write to file.
this is not useful PrivateRegistry registry configuration file
(default: "/etc/rancher/k3s/registries.yaml")'
description: |-
TODO: take in a object or secret and write to file. this is not useful
PrivateRegistry registry configuration file (default: "/etc/rancher/k3s/registries.yaml")
type: string
type: object
files:
Expand Down Expand Up @@ -492,37 +497,37 @@ spec:
operational state.
properties:
lastTransitionTime:
description: Last time the condition transitioned from one status
to another. This should be when the underlying condition changed.
If that is not known, then using the time when the API field
changed is acceptable.
description: |-
Last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when
the API field changed is acceptable.
format: date-time
type: string
message:
description: A human readable message indicating details about
the transition. This field may be empty.
description: |-
A human readable message indicating details about the transition.
This field may be empty.
type: string
reason:
description: The reason for the condition's last transition
in CamelCase. The specific API may choose whether or not this
field is considered a guaranteed API. This field may not be
empty.
description: |-
The reason for the condition's last transition in CamelCase.
The specific API may choose whether or not this field is considered a guaranteed API.
This field may not be empty.
type: string
severity:
description: Severity provides an explicit classification of
Reason code, so the users or machines can immediately understand
the current situation and act accordingly. The Severity field
MUST be set only when Status=False.
description: |-
Severity provides an explicit classification of Reason code, so the users or machines can immediately
understand the current situation and act accordingly.
The Severity field MUST be set only when Status=False.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: Type of condition in CamelCase or in foo.example.com/CamelCase.
Many .condition.type values are consistent across resources
like Available, but because arbitrary conditions can be useful
(see .node.status.conditions), the ability to deconflict is
important.
description: |-
Type of condition in CamelCase or in foo.example.com/CamelCase.
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
can be useful (see .node.status.conditions), the ability to deconflict is important.
type: string
required:
- lastTransitionTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.13.0
controller-gen.kubebuilder.io/version: v0.14.0
name: kthreesconfigtemplates.bootstrap.cluster.x-k8s.io
spec:
group: bootstrap.cluster.x-k8s.io
Expand Down Expand Up @@ -241,14 +241,19 @@ spec:
API.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
Expand Down Expand Up @@ -292,9 +297,9 @@ spec:
type: string
type: array
privateRegistry:
description: 'TODO: take in a object or secret and write
to file. this is not useful PrivateRegistry registry
configuration file (default: "/etc/rancher/k3s/registries.yaml")'
description: |-
TODO: take in a object or secret and write to file. this is not useful
PrivateRegistry registry configuration file (default: "/etc/rancher/k3s/registries.yaml")
type: string
type: object
files:
Expand Down
13 changes: 7 additions & 6 deletions controlplane/api/v1beta2/kthreescontrolplane_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)

// SetupWebhookWithManager will setup the webhooks for the KThreesControlPlane.
Expand All @@ -36,18 +37,18 @@ var _ webhook.Defaulter = &KThreesControlPlane{}
var _ webhook.Validator = &KThreesControlPlane{}

// ValidateCreate will do any extra validation when creating a KThreesControlPlane.
func (in *KThreesControlPlane) ValidateCreate() error {
return nil
func (in *KThreesControlPlane) ValidateCreate() (admission.Warnings, error) {
return []string{}, nil
}

// ValidateUpdate will do any extra validation when updating a KThreesControlPlane.
func (in *KThreesControlPlane) ValidateUpdate(runtime.Object) error {
return nil
func (in *KThreesControlPlane) ValidateUpdate(runtime.Object) (admission.Warnings, error) {
return []string{}, nil
}

// ValidateDelete allows you to add any extra validation when deleting.
func (in *KThreesControlPlane) ValidateDelete() error {
return nil
func (in *KThreesControlPlane) ValidateDelete() (admission.Warnings, error) {
return []string{}, nil
}

// Default will set default values for the KThreesControlPlane.
Expand Down
Loading

0 comments on commit b2841f1

Please sign in to comment.