Send the error message to user when enabling canary feature fails. (#990)
* Send the error message to user when enabling canary feature fails. * Fix controller doesn’t reply canary error when promClient tries connect to invalid prometheus server
This commit is contained in:
committed by
Ta-Ching Chen
parent
89081b087b
commit
db5165e032
@@ -44,15 +44,13 @@ func Start(port int, unitTestFlag bool) {
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
featureConfig, err := ConfigureFeatures(ctx, unitTestFlag, fc, kc)
|
||||
featureStatus, err := ConfigureFeatures(ctx, unitTestFlag, fc, kc)
|
||||
if err != nil {
|
||||
log.Printf("Error configuring features : %v. Proceeding without optional features", err.Error())
|
||||
// set all features to false for the MakeApi call below
|
||||
featureConfig.CanaryConfig.IsEnabled = false
|
||||
}
|
||||
defer cancel()
|
||||
|
||||
api, err := MakeAPI(featureConfig)
|
||||
api, err := MakeAPI(featureStatus)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to start controller: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user