Skip to content

Commit

Permalink
Update api
Browse files Browse the repository at this point in the history
Signed-off-by: obaydullahmhs <[email protected]>
  • Loading branch information
obaydullahmhs committed Jan 2, 2025
1 parent 73b30c0 commit c8af2d3
Show file tree
Hide file tree
Showing 5 changed files with 845 additions and 72 deletions.
7 changes: 7 additions & 0 deletions apis/kubedb/v1/kafka_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,3 +546,10 @@ func (k *Kafka) KafkaSaslListenerProtocolConfigKey(protocol string, mechanism st
func (k *Kafka) KafkaEnabledSASLMechanismsKey(protocol string) string {
return fmt.Sprintf("listener.name.%s.sasl.enabled.mechanisms", strings.ToLower(protocol))
}

func (k *Kafka) GetKafkaBrokerCounts() int {
if k.Spec.Topology != nil {
return int(*k.Spec.Topology.Broker.Replicas)
}
return int(*k.Spec.Replicas)
}
24 changes: 3 additions & 21 deletions apis/kubedb/v1/kafka_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
kmapi "kmodules.xyz/client-go/api/v1"
mona "kmodules.xyz/monitoring-agent-api/api/v1"
ofstv2 "kmodules.xyz/offshoot-api/api/v2"
storageapi "kubestash.dev/apimachinery/apis/storage/v1alpha1"
)

const (
Expand Down Expand Up @@ -173,19 +174,9 @@ type KafkaStatus struct {
Conditions []kmapi.Condition `json:"conditions,omitempty"`
}

// +kubebuilder:validation:Enum=s3;gcs;azure;file
type TieredStorageBackendType string

const (
TieredStorageBackendTypeS3 TieredStorageBackendType = "s3"
TieredStorageBackendTypeGCS TieredStorageBackendType = "gcs"
TieredStorageBackendTypeAzure TieredStorageBackendType = "azure"
TieredStorageBackendTypeFile TieredStorageBackendType = "file"
)

type KafkaTieredStorage struct {
// StorageBackendType is defined as the type of storage backend to be used for tiered storage(like S3, GCS, Azure, File etc)
StorageBackendType TieredStorageBackendType `json:"storageBackendType"`
// Backend is the storage backend to be used for tiered storage
*storageapi.Backend `json:",omitempty"`

// StorageManagerClassName is defined as the class name of the storage manager to be used for tiered storage
// It can be used your own custom storage manager class name
Expand All @@ -195,15 +186,6 @@ type KafkaTieredStorage struct {
// StorageManagerClassPath is defined as the class path of the storage manager to be used for tiered storage
// If you use your own custom storage manager class, you can specify the class path here
StorageManagerClassPath string `json:"storageManagerClassPath,omitempty"`

// StorageSecret is defined as the secret reference to be used for tiered storage backend type
// AWS credentials for S3, GCS credentials for GCS, Azure credentials for Azure etc
// +optional
StorageSecret *core.LocalObjectReference `json:"storageSecret,omitempty"`

// ConfigSecret is used for tiered storage additional configurations
// +optional
ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"`
}

type KafkaCruiseControl struct {
Expand Down
23 changes: 0 additions & 23 deletions apis/kubedb/v1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions apis/kubedb/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c8af2d3

Please sign in to comment.