Skip to content

Commit

Permalink
add labels to jetstream statefulset generated by eventbus controller (#…
Browse files Browse the repository at this point in the history
…2510)

Signed-off-by: Sudesh Jethoe <sudesh.jethoe@fika.works>
Co-authored-by: Sudesh Jethoe <sudesh.jethoe@fika.works>
  • Loading branch information
sudeshjethoe and Sudesh Jethoe authored Mar 13, 2023
1 parent 1cd2fc1 commit fb99769
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Organizations below are **officially** using Argo Events. Please send a PR with
1. [iFood](https://www.ifood.com.br)
1. [InsideBoard](https://www.insideboard.com)
1. [Intuit](https://www.intuit.com/)
1. [FikaWorks](https://fika.works/)
1. [Loam](https://www.getloam.com/)
1. [Mobimeo GmbH](https://mobimeo.com/en/home/)
1. [OneCause](https://www.onecause.com/)
Expand Down
15 changes: 14 additions & 1 deletion controllers/eventbus/installer/jetstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func (r *jetStreamInstaller) createStatefulSet(ctx context.Context) error {
ObjectMeta: metav1.ObjectMeta{
Namespace: r.eventBus.Namespace,
Name: generateJetStreamStatefulSetName(r.eventBus),
Labels: r.labels,
Labels: r.mergeEventBusLabels(r.labels),
Annotations: map[string]string{
common.AnnotationResourceSpecHash: hash,
},
Expand Down Expand Up @@ -752,6 +752,19 @@ func generateJetStreamServerSecretName(eventBus *v1alpha1.EventBus) string {
return fmt.Sprintf("eventbus-%s-js-server", eventBus.Name)
}

func (r *jetStreamInstaller) mergeEventBusLabels(given map[string]string) map[string]string {
result := map[string]string{}
if r.eventBus.Labels != nil {
for k, v := range r.eventBus.Labels {
result[k] = v
}
}
for k, v := range given {
result[k] = v
}
return result
}

func generateJetStreamClientAuthSecretName(eventBus *v1alpha1.EventBus) string {
return fmt.Sprintf("eventbus-%s-js-client-auth", eventBus.Name)
}
Expand Down

0 comments on commit fb99769

Please sign in to comment.