diff --git a/client/pipeline.go b/client/pipeline.go index 0d505583..defb3527 100644 --- a/client/pipeline.go +++ b/client/pipeline.go @@ -70,10 +70,11 @@ type TriggerOptions struct { } type RuntimeEnvironment struct { - Name string `json:"name,omitempty"` - Memory string `json:"memory,omitempty"` - CPU string `json:"cpu,omitempty"` - DindStorage string `json:"dindStorage,omitempty"` + Name string `json:"name,omitempty"` + Memory string `json:"memory,omitempty"` + CPU string `json:"cpu,omitempty"` + DindStorage string `json:"dindStorage,omitempty"` + RequiredAvailableStorage string `json:"requiredAvailableStorage,omitempty"` } func (t *Trigger) SetVariables(variables map[string]interface{}) { diff --git a/codefresh/resource_pipeline.go b/codefresh/resource_pipeline.go index 5f435fec..ebab792a 100644 --- a/codefresh/resource_pipeline.go +++ b/codefresh/resource_pipeline.go @@ -322,6 +322,11 @@ Or: original_yaml_string = file("/path/to/my/codefresh.yml") Type: schema.TypeString, Optional: true, }, + "required_available_storage": { + Description: "Minimum disk space required for build filesystem ( unit Gi is required).", + Type: schema.TypeString, + Optional: true, + }, }, }, }, @@ -437,6 +442,11 @@ The following table presents how to configure this block based on the options av Type: schema.TypeString, Optional: true, }, + "required_available_storage": { + Description: "Minimum disk space required for build filesystem ( unit Gi is required).", + Type: schema.TypeString, + Optional: true, + }, }, }, }, @@ -690,10 +700,11 @@ func flattenSpecTemplate(spec cfClient.SpecTemplate) []map[string]interface{} { func flattenSpecRuntimeEnvironment(spec cfClient.RuntimeEnvironment) []map[string]interface{} { return []map[string]interface{}{ { - "name": spec.Name, - "memory": spec.Memory, - "cpu": spec.CPU, - "dind_storage": spec.DindStorage, + "name": spec.Name, + "memory": spec.Memory, + "cpu": spec.CPU, + "dind_storage": spec.DindStorage, + "required_available_storage": spec.RequiredAvailableStorage, }, } } @@ -788,10 +799,11 @@ func mapResourceToPipeline(d *schema.ResourceData) (*cfClient.Pipeline, error) { if _, ok := d.GetOk("spec.0.runtime_environment"); ok { pipeline.Spec.RuntimeEnvironment = cfClient.RuntimeEnvironment{ - Name: d.Get("spec.0.runtime_environment.0.name").(string), - Memory: d.Get("spec.0.runtime_environment.0.memory").(string), - CPU: d.Get("spec.0.runtime_environment.0.cpu").(string), - DindStorage: d.Get("spec.0.runtime_environment.0.dind_storage").(string), + Name: d.Get("spec.0.runtime_environment.0.name").(string), + Memory: d.Get("spec.0.runtime_environment.0.memory").(string), + CPU: d.Get("spec.0.runtime_environment.0.cpu").(string), + DindStorage: d.Get("spec.0.runtime_environment.0.dind_storage").(string), + RequiredAvailableStorage: d.Get("spec.0.runtime_environment.0.required_available_storage").(string), } } @@ -836,10 +848,11 @@ func mapResourceToPipeline(d *schema.ResourceData) (*cfClient.Pipeline, error) { } if _, ok := d.GetOk(fmt.Sprintf("spec.0.trigger.%v.runtime_environment", idx)); ok { triggerRuntime := cfClient.RuntimeEnvironment{ - Name: d.Get(fmt.Sprintf("spec.0.trigger.%v.runtime_environment.0.name", idx)).(string), - Memory: d.Get(fmt.Sprintf("spec.0.trigger.%v.runtime_environment.0.memory", idx)).(string), - CPU: d.Get(fmt.Sprintf("spec.0.trigger.%v.runtime_environment.0.cpu", idx)).(string), - DindStorage: d.Get(fmt.Sprintf("spec.0.trigger.%v.runtime_environment.0.dind_storage", idx)).(string), + Name: d.Get(fmt.Sprintf("spec.0.trigger.%v.runtime_environment.0.name", idx)).(string), + Memory: d.Get(fmt.Sprintf("spec.0.trigger.%v.runtime_environment.0.memory", idx)).(string), + CPU: d.Get(fmt.Sprintf("spec.0.trigger.%v.runtime_environment.0.cpu", idx)).(string), + DindStorage: d.Get(fmt.Sprintf("spec.0.trigger.%v.runtime_environment.0.dind_storage", idx)).(string), + RequiredAvailableStorage: d.Get(fmt.Sprintf("spec.0.trigger.%v.runtime_environment.0.required_available_storage", idx)).(string), } codefreshTrigger.RuntimeEnvironment = &triggerRuntime } diff --git a/docs/resources/pipeline.md b/docs/resources/pipeline.md index 095d223a..dca09222 100644 --- a/docs/resources/pipeline.md +++ b/docs/resources/pipeline.md @@ -160,6 +160,7 @@ Optional: - `dind_storage` (String) The storage allocated to the runtime environment. - `memory` (String) The memory allocated to the runtime environment. - `name` (String) The name of the runtime environment. +- `required_available_storage` (String) Minimum disk space required for build filesystem ( unit Gi is required). @@ -253,6 +254,7 @@ Optional: - `dind_storage` (String) The storage allocated to the runtime environment. - `memory` (String) The memory allocated to the runtime environment. - `name` (String) The name of the runtime environment. +- `required_available_storage` (String) Minimum disk space required for build filesystem ( unit Gi is required). ## Import