fix: ensure keda auth secrets are written out
This commit is contained in:
1 parent
4ddd341184
commit
042495bcd6
6 files changed
+134
-25
No files matched your search
@@ -266,11 +266,17 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e
|
||||
return fmt.Errorf("Error getting global labels: %w", err)
|
||||
}
|
||||
|
||||
kedaValues, err := getKedaValues(appName)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error getting keda values: %w", err)
|
||||
}
|
||||
|
||||
values := &AppValues{
|
||||
Global: GlobalValues{
|
||||
Annotations: globalAnnotations,
|
||||
AppName: appName,
|
||||
DeploymentID: fmt.Sprint(deploymentId),
|
||||
Keda: kedaValues,
|
||||
Image: GlobalImage{
|
||||
ImagePullSecrets: imagePullSecrets,
|
||||
PullSecretBase64: pullSecretBase64,
|
||||
@@ -289,6 +295,27 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e
|
||||
Processes: map[string]ProcessValues{},
|
||||
}
|
||||
|
||||
for authName := range kedaValues.Authentications {
|
||||
templateFiles := []string{"keda-secret", "keda-trigger-authentication"}
|
||||
for _, templateName := range templateFiles {
|
||||
b, err := templates.ReadFile(fmt.Sprintf("templates/chart/%s.yaml", templateName))
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error reading %s template: %w", templateName, err)
|
||||
}
|
||||
|
||||
filename := filepath.Join(chartDir, "templates", fmt.Sprintf("%s-%s.yaml", templateName, authName))
|
||||
contents := strings.ReplaceAll(string(b), "AUTH_NAME", authName)
|
||||
err = os.WriteFile(filename, []byte(contents), os.FileMode(0644))
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error writing %s template: %w", templateName, err)
|
||||
}
|
||||
|
||||
if os.Getenv("DOKKU_TRACE") == "1" {
|
||||
common.CatFile(filename)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for processType, processCount := range processes {
|
||||
// todo: implement deployment annotations
|
||||
// todo: implement pod annotations
|
||||
@@ -420,7 +447,6 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e
|
||||
common.CatFile(filename)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
clientset, err := NewKubernetesClient()
|
||||
|
||||
Reference in new issue
Block a user