diff --git a/client/pipeline.go b/client/pipeline.go index 8495afba..2f6ac93a 100644 --- a/client/pipeline.go +++ b/client/pipeline.go @@ -55,9 +55,9 @@ type RuntimeEnvironment struct { DindStorage string `json:"dindStorage,omitempty"` } -func (t *Trigger) SetVariables(variables map[string]string) { +func (t *Trigger) SetVariables(variables map[string]interface{}) { for key, value := range variables { - t.Variables = append(t.Variables, Variable{Key: key, Value: value}) + t.Variables = append(t.Variables, Variable{Key: key, Value: value.(string)}) } } @@ -80,9 +80,9 @@ type Pipeline struct { Version string `json:"version,omitempty"` } -func (p *Pipeline) SetVariables(variables map[string]string) { +func (p *Pipeline) SetVariables(variables map[string]interface{}) { for key, value := range variables { - p.Spec.Variables = append(p.Spec.Variables, Variable{Key: key, Value: value}) + p.Spec.Variables = append(p.Spec.Variables, Variable{Key: key, Value: value.(string)}) } } diff --git a/client/project.go b/client/project.go index 44fd3aa8..70e68969 100644 --- a/client/project.go +++ b/client/project.go @@ -19,9 +19,9 @@ func (project *Project) GetID() string { } // SetVariables project variables -func (project *Project) SetVariables(variables map[string]string) { +func (project *Project) SetVariables(variables map[string]interface{}) { for key, value := range variables { - project.Variables = append(project.Variables, Variable{Key: key, Value: value}) + project.Variables = append(project.Variables, Variable{Key: key, Value: value.(string)}) } } diff --git a/codefresh/resource_pipeline.go b/codefresh/resource_pipeline.go index 39def9d7..480d7db4 100644 --- a/codefresh/resource_pipeline.go +++ b/codefresh/resource_pipeline.go @@ -406,7 +406,7 @@ func mapResourceToPipeline(d *schema.ResourceData) *cfClient.Pipeline { } } - variables := d.Get("spec.0.variables").(map[string]string) + variables := d.Get("spec.0.variables").(map[string]interface{}) pipeline.SetVariables(variables) triggers := d.Get("spec.0.trigger").([]interface{}) @@ -425,7 +425,7 @@ func mapResourceToPipeline(d *schema.ResourceData) *cfClient.Pipeline { Context: d.Get(fmt.Sprintf("spec.0.trigger.%v.context", idx)).(string), Events: convertStringArr(events), } - variables := d.Get(fmt.Sprintf("spec.0.trigger.%v.variables", idx)).(map[string]string) + variables := d.Get(fmt.Sprintf("spec.0.trigger.%v.variables", idx)).(map[string]interface{}) codefreshTrigger.SetVariables(variables) pipeline.Spec.Triggers = append(pipeline.Spec.Triggers, codefreshTrigger) diff --git a/codefresh/resource_project.go b/codefresh/resource_project.go index 0dcf02b1..51f625e0 100644 --- a/codefresh/resource_project.go +++ b/codefresh/resource_project.go @@ -125,7 +125,7 @@ func mapResourceToProject(d *schema.ResourceData) *cfClient.Project { ProjectName: d.Get("name").(string), Tags: convertStringArr(tags), } - variables := d.Get("variables").(map[string]string) + variables := d.Get("variables").(map[string]interface{}) project.SetVariables(variables) return project } diff --git a/go.sum b/go.sum index 4ee7295d..d0826620 100644 --- a/go.sum +++ b/go.sum @@ -339,6 +339,7 @@ github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8j github.com/hashicorp/terraform-plugin-sdk v1.7.0 h1:B//oq0ZORG+EkVrIJy0uPGSonvmXqxSzXe8+GhknoW0= github.com/hashicorp/terraform-plugin-sdk v1.7.0/go.mod h1:OjgQmey5VxnPej/buEhe+YqKm0KNvV3QqU4hkqHqPCY= github.com/hashicorp/terraform-plugin-sdk v1.13.0 h1:8v2/ZNiI12OHxEn8pzJ3noCHyRc0biKbKj+iFv5ZWKw= +github.com/hashicorp/terraform-plugin-sdk v1.13.1 h1:kWq+V+4BMFKtzIuO8wb/k4SRGB/VVF8g468VSFmAnKM= github.com/hashicorp/terraform-plugin-test v1.2.0 h1:AWFdqyfnOj04sxTdaAF57QqvW7XXrT8PseUHkbKsE8I= github.com/hashicorp/terraform-plugin-test v1.2.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg=