Skip to content

Commit

Permalink
Refactor CommonEnvironmentVariables
Browse files Browse the repository at this point in the history
  • Loading branch information
SaaldjorMike committed Apr 11, 2024
1 parent a886971 commit ed9cea6
Show file tree
Hide file tree
Showing 3 changed files with 190 additions and 283 deletions.
3 changes: 0 additions & 3 deletions controllers/humiocluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ func (r *HumioClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request

r.Log = r.Log.WithValues("Request.UID", hc.UID)

// Prefer CommonEnvironmentVariables over top-level HumioCluster.HumioNodeSpec.EnvironmentVariables as the latter will be deprecated in the future.
hc.Spec.CommonEnvironmentVariables = mergeEnvVars(hc.Spec.EnvironmentVariables, hc.Spec.CommonEnvironmentVariables)

var humioNodePools HumioNodePoolList
humioNodePools.Add(NewHumioNodeManagerFromHumioCluster(hc))
for idx := range hc.Spec.NodePools {
Expand Down
2 changes: 1 addition & 1 deletion controllers/humiocluster_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func NewHumioNodeManagerFromHumioCluster(hc *humiov1alpha1.HumioCluster) *HumioN
ExtraVolumes: hc.Spec.ExtraVolumes,
HumioServiceAccountAnnotations: hc.Spec.HumioServiceAccountAnnotations,
HumioServiceLabels: hc.Spec.HumioServiceLabels,
EnvironmentVariables: mergeEnvVars(hc.Spec.EnvironmentVariables, hc.Spec.CommonEnvironmentVariables),
EnvironmentVariables: mergeEnvVars(hc.Spec.CommonEnvironmentVariables, hc.Spec.EnvironmentVariables),
ImageSource: hc.Spec.ImageSource,
HumioESServicePort: hc.Spec.HumioESServicePort,
HumioServicePort: hc.Spec.HumioServicePort,
Expand Down
Loading

0 comments on commit ed9cea6

Please sign in to comment.