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:
smruthi2187
2019-01-14 22:43:27 +08:00
committed by Ta-Ching Chen
parent 89081b087b
commit db5165e032
8 changed files with 60 additions and 30 deletions
+2 -4
View File
@@ -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)
}