Mohammed Nafees пре 3 година
родитељ
комит
88b6ef51ae
3 измењених фајлова са 6 додато и 0 уклоњено
  1. 4 0
      cli/cmd/preview/v2beta1/app_resource.go
  2. 1 0
      cli/cmd/preview/v2beta1/types.go
  3. 1 0
      porter.yaml

+ 4 - 0
cli/cmd/preview/v2beta1/app_resource.go

@@ -61,6 +61,10 @@ func (a *AppResource) getV1Resource(b *Build) (*types.Resource, error) {
 		})
 	}
 
+	if a.RunOnce != nil {
+		config.OnlyCreate = *a.RunOnce
+	}
+
 	rawConfig := make(map[string]any)
 
 	err := mapstructure.Decode(config, &rawConfig)

+ 1 - 0
cli/cmd/preview/v2beta1/types.go

@@ -43,6 +43,7 @@ type AppResource struct {
 	BuildRef  *string    `yaml:"build_ref"`
 	// Deploy     map[*string]*any `yaml:"deploy"`
 	HelmValues map[string]any `yaml:"helm_values"`
+	RunOnce    *bool          `yaml:"run_once"`
 }
 
 type AddonResource struct {

+ 1 - 0
porter.yaml

@@ -19,6 +19,7 @@ apps:
 - name: setup-job
   depends_on:
     - postgres
+  run_once: true
   helm_chart:
     name: job
   build_ref: job