Skip to content

Commit

Permalink
issue-607, kafkauser crud was moved to reconciler
Browse files Browse the repository at this point in the history
  • Loading branch information
Bohdan Siryk authored and Bohdan Siryk committed Nov 16, 2023
1 parent 3357738 commit fad0cae
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 244 deletions.
29 changes: 27 additions & 2 deletions apis/clusters/v1beta1/kafka_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ type KafkaSpec struct {
KarapaceRestProxy []*KarapaceRestProxy `json:"karapaceRestProxy,omitempty"`
KarapaceSchemaRegistry []*KarapaceSchemaRegistry `json:"karapaceSchemaRegistry,omitempty"`
BundledUseOnly bool `json:"bundledUseOnly,omitempty"`
UserRefs []*Reference `json:"userRefs,omitempty"`
UserRefs References `json:"userRefs,omitempty"`
Kraft []*Kraft `json:"kraft,omitempty"`
}

Expand All @@ -103,7 +103,8 @@ type KafkaDataCentre struct {

// KafkaStatus defines the observed state of Kafka
type KafkaStatus struct {
ClusterStatus `json:",inline"`
ClusterStatus `json:",inline"`
AvailableUsers References `json:"availableUsers,omitempty"`
}

//+kubebuilder:object:root=true
Expand Down Expand Up @@ -459,3 +460,27 @@ func (rs *KafkaSpec) areDCsEqual(b []*KafkaDataCentre) bool {

return true
}

func (k *Kafka) GetUserRefs() References {
return k.Spec.UserRefs
}

func (k *Kafka) SetUserRefs(refs References) {
k.Spec.UserRefs = refs
}

func (k *Kafka) GetAvailableUsers() References {
return k.Status.AvailableUsers
}

func (k *Kafka) SetAvailableUsers(users References) {
k.Status.AvailableUsers = users
}

func (k *Kafka) GetClusterID() string {
return k.Status.ID
}

func (k *Kafka) SetClusterID(id string) {
k.Status.ID = id
}
13 changes: 12 additions & 1 deletion apis/clusters/v1beta1/zz_generated.deepcopy.go

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

8 changes: 8 additions & 0 deletions apis/kafkamanagement/v1beta1/kafkauser_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ func (ku *KafkaUser) NewCertificateSecret(name, namespace string) *k8sCore.Secre
}
}

func (ku *KafkaUser) GetClusterEvents() map[string]string {
return ku.Status.ClustersEvents
}

func (ku *KafkaUser) SetClusterEvents(events map[string]string) {
ku.Status.ClustersEvents = events
}

func init() {
SchemeBuilder.Register(&KafkaUser{}, &KafkaUserList{})
}
Expand Down
Loading

0 comments on commit fad0cae

Please sign in to comment.