diff --git a/builtin/providers/aws/resource_aws_elastic_transcoder_pipeline.go b/builtin/providers/aws/resource_aws_elastic_transcoder_pipeline.go index 6da9a1866..5bf78bd61 100644 --- a/builtin/providers/aws/resource_aws_elastic_transcoder_pipeline.go +++ b/builtin/providers/aws/resource_aws_elastic_transcoder_pipeline.go @@ -221,7 +221,7 @@ func resourceAwsElasticTranscoderPipelineCreate(d *schema.ResourceData, meta int d.SetId(*resp.Pipeline.Id) for _, w := range resp.Warnings { - log.Printf("[WARN] Elastic Transcoder Pipeline %s: %s", w.Code, w.Message) + log.Printf("[WARN] Elastic Transcoder Pipeline %v: %v", *w.Code, *w.Message) } return resourceAwsElasticTranscoderPipelineRead(d, meta) @@ -383,7 +383,7 @@ func resourceAwsElasticTranscoderPipelineUpdate(d *schema.ResourceData, meta int } for _, w := range output.Warnings { - log.Printf("[WARN] Elastic Transcoder Pipeline %s: %s", w.Code, w.Message) + log.Printf("[WARN] Elastic Transcoder Pipeline %v: %v", *w.Code, *w.Message) } return resourceAwsElasticTranscoderPipelineRead(d, meta) diff --git a/builtin/providers/aws/resource_aws_elastic_transcoder_preset_test.go b/builtin/providers/aws/resource_aws_elastic_transcoder_preset_test.go index abe8175be..4ae481e8d 100644 --- a/builtin/providers/aws/resource_aws_elastic_transcoder_preset_test.go +++ b/builtin/providers/aws/resource_aws_elastic_transcoder_preset_test.go @@ -27,7 +27,7 @@ func TestAccAWSElasticTranscoderPreset_basic(t *testing.T) { return nil } - return fmt.Errorf("Preset Id %s should not exist", preset.Id) + return fmt.Errorf("Preset Id %v should not exist", *preset.Id) } rs, ok := s.RootModule().Resources[name] diff --git a/builtin/providers/aws/resource_aws_elb_attachment_test.go b/builtin/providers/aws/resource_aws_elb_attachment_test.go index 84da24779..154f17c01 100644 --- a/builtin/providers/aws/resource_aws_elb_attachment_test.go +++ b/builtin/providers/aws/resource_aws_elb_attachment_test.go @@ -75,7 +75,7 @@ func TestAccAWSELBAttachment_drift(t *testing.T) { Instances: conf.Instances, } - log.Printf("[DEBUG] deregistering instance %s from ELB", conf.Instances[0].InstanceId) + log.Printf("[DEBUG] deregistering instance %v from ELB", *conf.Instances[0].InstanceId) _, err := conn.DeregisterInstancesFromLoadBalancer(&deRegisterInstancesOpts) if err != nil { diff --git a/builtin/providers/aws/resource_aws_ses_receipt_rule_test.go b/builtin/providers/aws/resource_aws_ses_receipt_rule_test.go index 4c24a4976..f5770fcc4 100644 --- a/builtin/providers/aws/resource_aws_ses_receipt_rule_test.go +++ b/builtin/providers/aws/resource_aws_ses_receipt_rule_test.go @@ -120,7 +120,7 @@ func testAccCheckAwsSESReceiptRuleExists(n string) resource.TestCheckFunc { } if !*response.Rule.Enabled { - return fmt.Errorf("Enabled (%s) was not set to true", *response.Rule.Enabled) + return fmt.Errorf("Enabled (%v) was not set to true", *response.Rule.Enabled) } if !reflect.DeepEqual(response.Rule.Recipients, []*string{aws.String("test@example.com")}) { @@ -128,7 +128,7 @@ func testAccCheckAwsSESReceiptRuleExists(n string) resource.TestCheckFunc { } if !*response.Rule.ScanEnabled { - return fmt.Errorf("ScanEnabled (%s) was not set to true", *response.Rule.ScanEnabled) + return fmt.Errorf("ScanEnabled (%v) was not set to true", *response.Rule.ScanEnabled) } if *response.Rule.TlsPolicy != "Require" { @@ -162,7 +162,7 @@ func testAccCheckAwsSESReceiptRuleOrder(n string) resource.TestCheckFunc { } if len(response.Rules) != 2 { - return fmt.Errorf("Number of rules (%s) was not equal to 2", len(response.Rules)) + return fmt.Errorf("Number of rules (%d) was not equal to 2", len(response.Rules)) } else if *response.Rules[0].Name != "first" || *response.Rules[1].Name != "second" { return fmt.Errorf("Order of rules (%v) was incorrect", response.Rules) } diff --git a/builtin/providers/docker/resource_docker_container.go b/builtin/providers/docker/resource_docker_container.go index 3bcf92231..604b116ea 100644 --- a/builtin/providers/docker/resource_docker_container.go +++ b/builtin/providers/docker/resource_docker_container.go @@ -95,6 +95,22 @@ func resourceDockerContainer() *schema.Resource { Set: schema.HashString, }, + "dns_opts": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + + "dns_search": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + "publish_all_ports": &schema.Schema{ Type: schema.TypeBool, Optional: true, diff --git a/builtin/providers/docker/resource_docker_container_funcs.go b/builtin/providers/docker/resource_docker_container_funcs.go index b475884b6..a2aa1479f 100644 --- a/builtin/providers/docker/resource_docker_container_funcs.go +++ b/builtin/providers/docker/resource_docker_container_funcs.go @@ -128,6 +128,14 @@ func resourceDockerContainerCreate(d *schema.ResourceData, meta interface{}) err hostConfig.DNS = stringSetToStringSlice(v.(*schema.Set)) } + if v, ok := d.GetOk("dns_opts"); ok { + hostConfig.DNSOptions = stringSetToStringSlice(v.(*schema.Set)) + } + + if v, ok := d.GetOk("dns_search"); ok { + hostConfig.DNSSearch = stringSetToStringSlice(v.(*schema.Set)) + } + if v, ok := d.GetOk("links"); ok { hostConfig.Links = stringSetToStringSlice(v.(*schema.Set)) } diff --git a/builtin/providers/docker/resource_docker_container_test.go b/builtin/providers/docker/resource_docker_container_test.go index 898773584..167ac5db6 100644 --- a/builtin/providers/docker/resource_docker_container_test.go +++ b/builtin/providers/docker/resource_docker_container_test.go @@ -102,6 +102,38 @@ func TestAccDockerContainer_customized(t *testing.T) { return fmt.Errorf("Container has wrong cpu shares setting: %d", c.HostConfig.CPUShares) } + if len(c.HostConfig.DNS) != 1 { + return fmt.Errorf("Container does not have the correct number of dns entries: %d", len(c.HostConfig.DNS)) + } + + if c.HostConfig.DNS[0] != "8.8.8.8" { + return fmt.Errorf("Container has wrong dns setting: %v", c.HostConfig.DNS[0]) + } + + if len(c.HostConfig.DNSOptions) != 1 { + return fmt.Errorf("Container does not have the correct number of dns option entries: %d", len(c.HostConfig.DNS)) + } + + if c.HostConfig.DNSOptions[0] != "rotate" { + return fmt.Errorf("Container has wrong dns option setting: %v", c.HostConfig.DNS[0]) + } + + if len(c.HostConfig.DNSSearch) != 1 { + return fmt.Errorf("Container does not have the correct number of dns search entries: %d", len(c.HostConfig.DNS)) + } + + if c.HostConfig.DNSSearch[0] != "example.com" { + return fmt.Errorf("Container has wrong dns search setting: %v", c.HostConfig.DNS[0]) + } + + if c.HostConfig.CPUShares != 32 { + return fmt.Errorf("Container has wrong cpu shares setting: %d", c.HostConfig.CPUShares) + } + + if c.HostConfig.CPUShares != 32 { + return fmt.Errorf("Container has wrong cpu shares setting: %d", c.HostConfig.CPUShares) + } + if c.Config.Labels["env"] != "prod" || c.Config.Labels["role"] != "test" { return fmt.Errorf("Container does not have the correct labels") } @@ -227,6 +259,9 @@ resource "docker_container" "foo" { memory = 512 memory_swap = 2048 cpu_shares = 32 + dns = ["8.8.8.8"] + dns_opts = ["rotate"] + dns_search = ["example.com"] labels { env = "prod" role = "test"