Skip to content

Commit

Permalink
order changed for config creation
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekr-splunk committed Nov 19, 2024
1 parent 97d4e18 commit 1dc3d37
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pkg/splunk/enterprise/searchheadcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ func ApplySearchHeadCluster(ctx context.Context, client splcommon.ControllerClie
return result, err
}

// create or update general config resources
namespaceScopedSecret, err := ApplySplunkConfig(ctx, client, cr, cr.Spec.CommonSplunkSpec, SplunkSearchHead)
if err != nil {
scopedLog.Error(err, "create or update general config failed", "error", err.Error())
eventPublisher.Warning(ctx, "ApplySplunkConfig", fmt.Sprintf("create or update general config failed with error %s", err.Error()))
return result, err
}

// If the app framework is configured then do following things -
// 1. Initialize the S3Clients based on providers
// 2. Check the status of apps on remote storage.
Expand Down Expand Up @@ -101,13 +109,7 @@ func ApplySearchHeadCluster(ctx context.Context, client splcommon.ControllerClie
cr.Status.AdminPasswordChangedSecrets = make(map[string]bool)
}

// create or update general config resources
namespaceScopedSecret, err := ApplySplunkConfig(ctx, client, cr, cr.Spec.CommonSplunkSpec, SplunkSearchHead)
if err != nil {
scopedLog.Error(err, "create or update general config failed", "error", err.Error())
eventPublisher.Warning(ctx, "ApplySplunkConfig", fmt.Sprintf("create or update general config failed with error %s", err.Error()))
return result, err
}


// check if deletion has been requested
if cr.ObjectMeta.DeletionTimestamp != nil {
Expand Down

0 comments on commit 1dc3d37

Please sign in to comment.