diff --git a/apis/kubedb/v1alpha2/constants.go b/apis/kubedb/v1alpha2/constants.go index 66ffa69802..db183df4c0 100644 --- a/apis/kubedb/v1alpha2/constants.go +++ b/apis/kubedb/v1alpha2/constants.go @@ -522,6 +522,7 @@ const ( KafkaPortNameExternal = "external" KafkaTopicNameHealth = "kafka-health" KafkaTopicDeletionThresholdOffset = 1000 + KafkaMaxNumberOfController = 1000 KafkaRESTPort = 9092 KafkaControllerRESTPort = 9093 KafkaInternalRESTPort = 29092 diff --git a/apis/ops/v1alpha1/kafka_ops_helpers.go b/apis/ops/v1alpha1/kafka_ops_helpers.go index 1a175490c1..c06975df27 100644 --- a/apis/ops/v1alpha1/kafka_ops_helpers.go +++ b/apis/ops/v1alpha1/kafka_ops_helpers.go @@ -27,39 +27,39 @@ import ( "kmodules.xyz/client-go/apiextensions" ) -func (_ KafkaOpsRequest) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { +func (_ *KafkaOpsRequest) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourcePluralKafkaOpsRequest)) } var _ apis.ResourceInfo = &KafkaOpsRequest{} -func (k KafkaOpsRequest) ResourceFQN() string { +func (k *KafkaOpsRequest) ResourceFQN() string { return fmt.Sprintf("%s.%s", ResourcePluralKafkaOpsRequest, ops.GroupName) } -func (k KafkaOpsRequest) ResourceShortCode() string { +func (k *KafkaOpsRequest) ResourceShortCode() string { return ResourceCodeKafkaOpsRequest } -func (k KafkaOpsRequest) ResourceKind() string { +func (k *KafkaOpsRequest) ResourceKind() string { return ResourceKindKafkaOpsRequest } -func (k KafkaOpsRequest) ResourceSingular() string { +func (k *KafkaOpsRequest) ResourceSingular() string { return ResourceSingularKafkaOpsRequest } -func (k KafkaOpsRequest) ResourcePlural() string { +func (k *KafkaOpsRequest) ResourcePlural() string { return ResourcePluralKafkaOpsRequest } -func (k KafkaOpsRequest) ValidateSpecs() error { +func (k *KafkaOpsRequest) ValidateSpecs() error { return nil } var _ Accessor = &KafkaOpsRequest{} -func (k KafkaOpsRequest) GetRequestType() any { +func (k *KafkaOpsRequest) GetRequestType() any { return k.Spec.Type } @@ -67,7 +67,7 @@ func (k *KafkaOpsRequest) GetObjectMeta() metav1.ObjectMeta { return k.ObjectMeta } -func (k KafkaOpsRequest) GetUpdateVersionSpec() *KafkaUpdateVersionSpec { +func (k *KafkaOpsRequest) GetUpdateVersionSpec() *KafkaUpdateVersionSpec { return k.Spec.UpdateVersion } diff --git a/apis/ops/v1alpha1/kafka_ops_types.go b/apis/ops/v1alpha1/kafka_ops_types.go index 2bb2a33252..4bb70e6363 100644 --- a/apis/ops/v1alpha1/kafka_ops_types.go +++ b/apis/ops/v1alpha1/kafka_ops_types.go @@ -43,7 +43,7 @@ const ( // +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.phase" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" type KafkaOpsRequest struct { - metav1.TypeMeta `json:",omitempty"` + metav1.TypeMeta `json:",inline,omitempty"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec KafkaOpsRequestSpec `json:"spec,omitempty"` Status OpsRequestStatus `json:"status,omitempty"` diff --git a/apis/ops/v1alpha1/openapi_generated.go b/apis/ops/v1alpha1/openapi_generated.go index f8d6d59648..f9a990f613 100644 --- a/apis/ops/v1alpha1/openapi_generated.go +++ b/apis/ops/v1alpha1/openapi_generated.go @@ -22583,6 +22583,20 @@ func schema_apimachinery_apis_ops_v1alpha1_KafkaOpsRequest(ref common.ReferenceC SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, "metadata": { SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, diff --git a/crds/ops.kubedb.com_kafkaopsrequests.yaml b/crds/ops.kubedb.com_kafkaopsrequests.yaml index 8f1e7cb7a1..85b2288157 100644 --- a/crds/ops.kubedb.com_kafkaopsrequests.yaml +++ b/crds/ops.kubedb.com_kafkaopsrequests.yaml @@ -339,14 +339,14 @@ spec: type: integer reason: type: string + severity: + type: string status: type: string type: type: string required: - lastTransitionTime - - message - - reason - status - type type: object