change if to switch
@@ -221,12 +221,13 @@ func (h *ScaleHandler) resolveSecretValue(secretKeyRef *core_v1.SecretKeySelecto
}
func getScaler(trigger kore_v1alpha1.ScaleTriggers, resolvedSecrets *map[string]string) (Scaler, error) {
- if trigger.Type == "azure-queue" {
+ switch trigger.Type {
+ case "azure-queue":
return &azureQueueScaler{
metadata: &trigger.Metadata,
resolvedSecrets: resolvedSecrets,
}, nil
- }
-
+ default:
return nil, fmt.Errorf("no scaler found for type: %s", trigger.Type)
}
+}
