Преглед изворни кода

update predeploy job charts to batch/v1 (#3092)

Stefan McShane пре 3 година
родитељ
комит
964249ef5c

+ 7 - 0
api/server/handlers/porter_app/create.go

@@ -268,12 +268,19 @@ func (c *CreatePorterAppHandler) ServeHTTP(w http.ResponseWriter, r *http.Reques
 					}
 					return
 				} else {
+					chart, err := loader.LoadChartPublic(ctx, c.Config().Metadata.DefaultAppHelmRepoURL, "job", "")
+					if err != nil {
+						c.HandleAPIError(w, r, apierrors.NewErrPassThroughToClient(fmt.Errorf("error loading release job chart: %w", err), http.StatusBadRequest))
+						return
+					}
+
 					conf := &helm.UpgradeReleaseConfig{
 						Name:       helmRelease.Name,
 						Cluster:    cluster,
 						Repo:       c.Repo(),
 						Registries: registries,
 						Values:     releaseJobValues,
+						Chart:      chart,
 					}
 					_, err = helmAgent.UpgradeReleaseByValues(ctx, conf, c.Config().DOConf, c.Config().ServerConf.DisablePullSecretsInjection, false)
 					if err != nil {

+ 0 - 2
api/server/handlers/porter_app/list_events.go

@@ -179,8 +179,6 @@ func (p *PorterAppEventListHandler) updateExistingAppEvent(ctx context.Context,
 		}
 	}
 
-	fmt.Println("STEFAN", *actionRun.Status, actionRun.Conclusion, event.Status)
-
 	telemetry.WithAttributes(span, telemetry.AttributeKV{Key: "porter-app-event-updated-status", Value: event.Status})
 
 	err = p.Repo().PorterAppEvent().UpdateEvent(ctx, &event)