Skip to content

Commit

Permalink
Use k8s 1.32 client libs
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Feb 21, 2025
1 parent a75252a commit c8d660e
Show file tree
Hide file tree
Showing 3,235 changed files with 155,416 additions and 112,213 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ BIN := apimachinery

CRD_OPTIONS ?= "crd:maxDescLen=0,generateEmbeddedObjectMeta=true,allowDangerousTypes=true"
# https://github.com/appscodelabs/gengo-builder
CODE_GENERATOR_IMAGE ?= ghcr.io/appscode/gengo:release-1.29
CODE_GENERATOR_IMAGE ?= ghcr.io/appscode/gengo:release-1.32
CORE_API_GROUPS ?= kubedb:v1alpha1 kubedb:v1alpha2 kubedb:v1 postgres:v1alpha1 catalog:v1alpha1 config:v1alpha1 ops:v1alpha1 autoscaling:v1alpha1 elasticsearch:v1alpha1 schema:v1alpha1 archiver:v1alpha1 kafka:v1alpha1
API_GROUPS ?= $(CORE_API_GROUPS) ui:v1alpha1

Expand Down
13 changes: 7 additions & 6 deletions apis/autoscaling/v1alpha1/cassandra_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ import (
// log is for logging in this package.
var casLog = logf.Log.WithName("cassandra-autoscaler")

var _ webhook.Defaulter = &CassandraAutoscaler{}
var _ webhook.CustomDefaulter = &CassandraAutoscaler{}

// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
func (r *CassandraAutoscaler) Default() {
func (r *CassandraAutoscaler) Default(ctx context.Context, obj runtime.Object) error {
casLog.Info("defaulting", "name", r.Name)
r.setDefaults()
return nil
}

func (r *CassandraAutoscaler) setDefaults() {
Expand Down Expand Up @@ -75,21 +76,21 @@ func (r *CassandraAutoscaler) setOpsReqOptsDefaults() {
}
}

var _ webhook.Validator = &CassandraAutoscaler{}
var _ webhook.CustomValidator = &CassandraAutoscaler{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (r *CassandraAutoscaler) ValidateCreate() (admission.Warnings, error) {
func (r *CassandraAutoscaler) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
casLog.Info("validate create", "name", r.Name)
return nil, r.validate()
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (r *CassandraAutoscaler) ValidateUpdate(oldObj runtime.Object) (admission.Warnings, error) {
func (r *CassandraAutoscaler) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
casLog.Info("validate create", "name", r.Name)
return nil, r.validate()
}

func (r *CassandraAutoscaler) ValidateDelete() (admission.Warnings, error) {
func (r *CassandraAutoscaler) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
return nil, nil
}

Expand Down
13 changes: 7 additions & 6 deletions apis/autoscaling/v1alpha1/clickhouse_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ import (
// log is for logging in this package.
var chLog = logf.Log.WithName("clickhouse-autoscaler")

var _ webhook.Defaulter = &ClickHouseAutoscaler{}
var _ webhook.CustomDefaulter = &ClickHouseAutoscaler{}

// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
func (r *ClickHouseAutoscaler) Default() {
func (r *ClickHouseAutoscaler) Default(ctx context.Context, obj runtime.Object) error {
chLog.Info("defaulting", "name", r.Name)
r.setDefaults()
return nil
}

func (r *ClickHouseAutoscaler) setDefaults() {
Expand Down Expand Up @@ -75,21 +76,21 @@ func (r *ClickHouseAutoscaler) setOpsReqOptsDefaults() {
}
}

var _ webhook.Validator = &ClickHouseAutoscaler{}
var _ webhook.CustomValidator = &ClickHouseAutoscaler{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (r *ClickHouseAutoscaler) ValidateCreate() (admission.Warnings, error) {
func (r *ClickHouseAutoscaler) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
chLog.Info("validate create", "name", r.Name)
return nil, r.validate()
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (r *ClickHouseAutoscaler) ValidateUpdate(oldObj runtime.Object) (admission.Warnings, error) {
func (r *ClickHouseAutoscaler) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
chLog.Info("validate create", "name", r.Name)
return nil, r.validate()
}

func (r *ClickHouseAutoscaler) ValidateDelete() (admission.Warnings, error) {
func (r *ClickHouseAutoscaler) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
return nil, nil
}

Expand Down
13 changes: 7 additions & 6 deletions apis/autoscaling/v1alpha1/druid_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ import (
// log is for logging in this package.
var druidLog = logf.Log.WithName("druid-autoscaler")

var _ webhook.Defaulter = &DruidAutoscaler{}
var _ webhook.CustomDefaulter = &DruidAutoscaler{}

// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
func (d *DruidAutoscaler) Default() {
func (d *DruidAutoscaler) Default(ctx context.Context, obj runtime.Object) error {
druidLog.Info("defaulting", "name", d.Name)
d.setDefaults()
return nil
}

func (d *DruidAutoscaler) setDefaults() {
Expand Down Expand Up @@ -102,21 +103,21 @@ func (d *DruidAutoscaler) setOpsReqOptsDefaults() {
}
}

var _ webhook.Validator = &DruidAutoscaler{}
var _ webhook.CustomValidator = &DruidAutoscaler{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (d *DruidAutoscaler) ValidateCreate() (admission.Warnings, error) {
func (d *DruidAutoscaler) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
druidLog.Info("validate create", "name", d.Name)
return nil, d.validate()
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (d *DruidAutoscaler) ValidateUpdate(oldObj runtime.Object) (admission.Warnings, error) {
func (d *DruidAutoscaler) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
druidLog.Info("validate create", "name", d.Name)
return nil, d.validate()
}

func (_ *DruidAutoscaler) ValidateDelete() (admission.Warnings, error) {
func (_ *DruidAutoscaler) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
return nil, nil
}

Expand Down
13 changes: 7 additions & 6 deletions apis/autoscaling/v1alpha1/elasticsearch_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ func (in *ElasticsearchAutoscaler) SetupWebhookWithManager(mgr manager.Manager)

// +kubebuilder:webhook:path=/mutate-autoscaling-kubedb-com-v1alpha1-elasticsearchautoscaler,mutating=true,failurePolicy=fail,sideEffects=None,groups=autoscaling.kubedb.com,resources=elasticsearchautoscaler,verbs=create;update,versions=v1alpha1,name=melasticsearchautoscaler.kb.io,admissionReviewVersions={v1,v1beta1}

var _ webhook.Defaulter = &ElasticsearchAutoscaler{}
var _ webhook.CustomDefaulter = &ElasticsearchAutoscaler{}

// Default implements webhook.Defaulter so a webhook will be registered for the type
func (in *ElasticsearchAutoscaler) Default() {
func (in *ElasticsearchAutoscaler) Default(ctx context.Context, obj runtime.Object) error {
esLog.Info("defaulting", "name", in.Name)
in.setDefaults()
return nil
}

func (in *ElasticsearchAutoscaler) setDefaults() {
Expand Down Expand Up @@ -98,20 +99,20 @@ func (in *ElasticsearchAutoscaler) setOpsReqOptsDefaults() {

// +kubebuilder:webhook:path=/validate-schema-kubedb-com-v1alpha1-elasticsearchautoscaler,mutating=false,failurePolicy=fail,sideEffects=None,groups=schema.kubedb.com,resources=elasticsearchautoscalers,verbs=create;update;delete,versions=v1alpha1,name=velasticsearchautoscaler.kb.io,admissionReviewVersions={v1,v1beta1}

var _ webhook.Validator = &ElasticsearchAutoscaler{}
var _ webhook.CustomValidator = &ElasticsearchAutoscaler{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (in *ElasticsearchAutoscaler) ValidateCreate() (admission.Warnings, error) {
func (in *ElasticsearchAutoscaler) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
esLog.Info("validate create", "name", in.Name)
return nil, in.validate()
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (in *ElasticsearchAutoscaler) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
func (in *ElasticsearchAutoscaler) ValidateUpdate(ctx context.Context, old, newObj runtime.Object) (admission.Warnings, error) {
return nil, in.validate()
}

func (_ ElasticsearchAutoscaler) ValidateDelete() (admission.Warnings, error) {
func (_ ElasticsearchAutoscaler) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
return nil, nil
}

Expand Down
13 changes: 7 additions & 6 deletions apis/autoscaling/v1alpha1/ferretdb_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ import (
// log is for logging in this package.
var frLog = logf.Log.WithName("ferretdb-autoscaler")

var _ webhook.Defaulter = &FerretDBAutoscaler{}
var _ webhook.CustomDefaulter = &FerretDBAutoscaler{}

// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
func (r *FerretDBAutoscaler) Default() {
func (r *FerretDBAutoscaler) Default(ctx context.Context, obj runtime.Object) error {
frLog.Info("defaulting", "name", r.Name)
r.setDefaults()
return nil
}

func (r *FerretDBAutoscaler) setDefaults() {
Expand Down Expand Up @@ -75,21 +76,21 @@ func (r *FerretDBAutoscaler) setOpsReqOptsDefaults() {
}
}

var _ webhook.Validator = &FerretDBAutoscaler{}
var _ webhook.CustomValidator = &FerretDBAutoscaler{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (r *FerretDBAutoscaler) ValidateCreate() (admission.Warnings, error) {
func (r *FerretDBAutoscaler) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
frLog.Info("validate create", "name", r.Name)
return nil, r.validate()
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (r *FerretDBAutoscaler) ValidateUpdate(oldObj runtime.Object) (admission.Warnings, error) {
func (r *FerretDBAutoscaler) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
frLog.Info("validate create", "name", r.Name)
return nil, r.validate()
}

func (r *FerretDBAutoscaler) ValidateDelete() (admission.Warnings, error) {
func (r *FerretDBAutoscaler) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
return nil, nil
}

Expand Down
13 changes: 7 additions & 6 deletions apis/autoscaling/v1alpha1/kafka_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ import (
// log is for logging in this package.
var kafkaLog = logf.Log.WithName("kafka-autoscaler")

var _ webhook.Defaulter = &KafkaAutoscaler{}
var _ webhook.CustomDefaulter = &KafkaAutoscaler{}

// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
func (k *KafkaAutoscaler) Default() {
func (k *KafkaAutoscaler) Default(ctx context.Context, obj runtime.Object) error {
kafkaLog.Info("defaulting", "name", k.Name)
k.setDefaults()
return nil
}

func (k *KafkaAutoscaler) setDefaults() {
Expand Down Expand Up @@ -85,21 +86,21 @@ func (k *KafkaAutoscaler) setOpsReqOptsDefaults() {
}
}

var _ webhook.Validator = &KafkaAutoscaler{}
var _ webhook.CustomValidator = &KafkaAutoscaler{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (k *KafkaAutoscaler) ValidateCreate() (admission.Warnings, error) {
func (k *KafkaAutoscaler) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
kafkaLog.Info("validate create", "name", k.Name)
return nil, k.validate()
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (k *KafkaAutoscaler) ValidateUpdate(oldObj runtime.Object) (admission.Warnings, error) {
func (k *KafkaAutoscaler) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
kafkaLog.Info("validate create", "name", k.Name)
return nil, k.validate()
}

func (_ *KafkaAutoscaler) ValidateDelete() (admission.Warnings, error) {
func (_ *KafkaAutoscaler) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
return nil, nil
}

Expand Down
14 changes: 8 additions & 6 deletions apis/autoscaling/v1alpha1/mariadb_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1

import (
"context"
"errors"

opsapi "kubedb.dev/apimachinery/apis/ops/v1alpha1"
Expand All @@ -40,12 +41,13 @@ func (in *MariaDBAutoscaler) SetupWebhookWithManager(mgr manager.Manager) error

// +kubebuilder:webhook:path=/mutate-autoscaling-kubedb-com-v1alpha1-mariadbautoscaler,mutating=true,failurePolicy=fail,sideEffects=None,groups=autoscaling.kubedb.com,resources=mariadbautoscaler,verbs=create;update,versions=v1alpha1,name=mmariadbautoscaler.kb.io,admissionReviewVersions={v1,v1beta1}

var _ webhook.Defaulter = &MariaDBAutoscaler{}
var _ webhook.CustomDefaulter = &MariaDBAutoscaler{}

// Default implements webhook.Defaulter so a webhook will be registered for the type
func (in *MariaDBAutoscaler) Default() {
func (in *MariaDBAutoscaler) Default(ctx context.Context, obj runtime.Object) error {
mariaLog.Info("defaulting", "name", in.Name)
in.setDefaults()
return nil
}

func (in *MariaDBAutoscaler) setDefaults() {
Expand All @@ -72,20 +74,20 @@ func (in *MariaDBAutoscaler) setOpsReqOptsDefaults() {

// +kubebuilder:webhook:path=/validate-schema-kubedb-com-v1alpha1-mariadbautoscaler,mutating=false,failurePolicy=fail,sideEffects=None,groups=schema.kubedb.com,resources=mariadbautoscalers,verbs=create;update;delete,versions=v1alpha1,name=vmariadbautoscaler.kb.io,admissionReviewVersions={v1,v1beta1}

var _ webhook.Validator = &MariaDBAutoscaler{}
var _ webhook.CustomValidator = &MariaDBAutoscaler{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (in *MariaDBAutoscaler) ValidateCreate() (admission.Warnings, error) {
func (in *MariaDBAutoscaler) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
mariaLog.Info("validate create", "name", in.Name)
return nil, in.validate()
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (in *MariaDBAutoscaler) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
func (in *MariaDBAutoscaler) ValidateUpdate(ctx context.Context, old, newObj runtime.Object) (admission.Warnings, error) {
return nil, in.validate()
}

func (_ MariaDBAutoscaler) ValidateDelete() (admission.Warnings, error) {
func (_ MariaDBAutoscaler) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
return nil, nil
}

Expand Down
13 changes: 7 additions & 6 deletions apis/autoscaling/v1alpha1/memcached_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ import (
// log is for logging in this package.
var mcLog = logf.Log.WithName("memcached-autoscaler")

var _ webhook.Defaulter = &MemcachedAutoscaler{}
var _ webhook.CustomDefaulter = &MemcachedAutoscaler{}

// Default implements webhook.CustomDefaulter so a webhook will be registered for the type
func (r *MemcachedAutoscaler) Default() {
func (r *MemcachedAutoscaler) Default(ctx context.Context, obj runtime.Object) error {
mcLog.Info("defaulting", "name", r.Name)
r.setDefaults()
return nil
}

func (r *MemcachedAutoscaler) setDefaults() {
Expand Down Expand Up @@ -75,21 +76,21 @@ func (r *MemcachedAutoscaler) setOpsReqOptsDefaults() {
}
}

var _ webhook.Validator = &MemcachedAutoscaler{}
var _ webhook.CustomValidator = &MemcachedAutoscaler{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (r *MemcachedAutoscaler) ValidateCreate() (admission.Warnings, error) {
func (r *MemcachedAutoscaler) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
mcLog.Info("validate create", "name", r.Name)
return nil, r.validate()
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (r *MemcachedAutoscaler) ValidateUpdate(oldObj runtime.Object) (admission.Warnings, error) {
func (r *MemcachedAutoscaler) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
mcLog.Info("validate create", "name", r.Name)
return nil, r.validate()
}

func (r *MemcachedAutoscaler) ValidateDelete() (admission.Warnings, error) {
func (r *MemcachedAutoscaler) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
return nil, nil
}

Expand Down
13 changes: 7 additions & 6 deletions apis/autoscaling/v1alpha1/mongodb_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ func (in *MongoDBAutoscaler) SetupWebhookWithManager(mgr manager.Manager) error

// +kubebuilder:webhook:path=/mutate-autoscaling-kubedb-com-v1alpha1-mongodbautoscaler,mutating=true,failurePolicy=fail,sideEffects=None,groups=autoscaling.kubedb.com,resources=mongodbautoscaler,verbs=create;update,versions=v1alpha1,name=mmongodbautoscaler.kb.io,admissionReviewVersions={v1,v1beta1}

var _ webhook.Defaulter = &MongoDBAutoscaler{}
var _ webhook.CustomDefaulter = &MongoDBAutoscaler{}

// Default implements webhook.Defaulter so a webhook will be registered for the type
func (in *MongoDBAutoscaler) Default() {
func (in *MongoDBAutoscaler) Default(ctx context.Context, obj runtime.Object) error {
mongoLog.Info("defaulting", "name", in.Name)
in.setDefaults()
return nil
}

func (in *MongoDBAutoscaler) setDefaults() {
Expand Down Expand Up @@ -105,21 +106,21 @@ func (in *MongoDBAutoscaler) setOpsReqOptsDefaults() {

// +kubebuilder:webhook:path=/validate-schema-kubedb-com-v1alpha1-mongodbautoscaler,mutating=false,failurePolicy=fail,sideEffects=None,groups=schema.kubedb.com,resources=mongodbautoscalers,verbs=create;update;delete,versions=v1alpha1,name=vmongodbautoscaler.kb.io,admissionReviewVersions={v1,v1beta1}

var _ webhook.Validator = &MongoDBAutoscaler{}
var _ webhook.CustomValidator = &MongoDBAutoscaler{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (in *MongoDBAutoscaler) ValidateCreate() (admission.Warnings, error) {
func (in *MongoDBAutoscaler) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
mongoLog.Info("validate create", "name", in.Name)
return nil, in.validate()
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (in *MongoDBAutoscaler) ValidateUpdate(old runtime.Object) (admission.Warnings, error) {
func (in *MongoDBAutoscaler) ValidateUpdate(ctx context.Context, old, newObj runtime.Object) (admission.Warnings, error) {
mongoLog.Info("validate update", "name", in.Name)
return nil, in.validate()
}

func (_ MongoDBAutoscaler) ValidateDelete() (admission.Warnings, error) {
func (_ MongoDBAutoscaler) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
return nil, nil
}

Expand Down
Loading

0 comments on commit c8d660e

Please sign in to comment.