Fix panic in azure go discover provider (#3876)

This commit is contained in:
Preetha 2018-02-08 16:46:33 -06:00 committed by GitHub
parent 3a49730503
commit dfd484c090
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 6 deletions

View File

@ -22,16 +22,20 @@ func (p *Provider) Help() string {
subscription_id: The id of the subscription
secret_access_key: The authentication credential
Use these configuration parameters when using network interfaces:
Use these configuration parameters when using tags:
tag_name: The name of the tag to filter on
tag_value: The value of the tag to filter on
Use these configuration parameters when using vm scale sets:
Use these configuration parameters when using Virtual Machine Scale Sets:
resource_group: The name of the resource group to filter on
vm_scale_set: The name of the virtual machine scale set to filter on
When using tags the only permission needed is the 'ListAll' method for 'NetworkInterfaces'.
When using vm scale sets the only Role Action needed is "Microsoft.Compute/virtualMachineScaleSets/*/read".
When using tags the only permission needed is the 'ListAll' method for
'NetworkInterfaces'. When using Virtual Machine Scale Sets the only Role
Action needed is 'Microsoft.Compute/virtualMachineScaleSets/*/read'.
It is recommended you make a dedicated key used only for auto-joining.
`
}
@ -111,7 +115,11 @@ func fetchAddrsWithTags(tagName string, tagValue string, vmnet network.Interface
continue
}
tv := (*v.Tags)[tagName] // *string
if tv == nil || *tv != tagValue {
if tv == nil {
l.Printf("[DEBUG] discover-azure: Interface %s did not have tag: %s", id, tagName)
continue
}
if *tv != tagValue {
l.Printf("[DEBUG] discover-azure: Interface %s tag value was: %s which did not match: %s", id, *tv, tagValue)
continue
}

2
vendor/vendor.json vendored
View File

@ -33,7 +33,7 @@
{"path":"github.com/hashicorp/go-discover","checksumSHA1":"yG6DzmNiB7kOdLcgvI1v9GacoSA=","revision":"4e49190abe2f3801a8653d7745a14bc445381615","revisionTime":"2018-01-20T00:19:59Z"},
{"path":"github.com/hashicorp/go-discover/provider/aliyun","checksumSHA1":"ZmU/47XUGUQpFP6E8T6Tl8QKszI=","revision":"c98e36ab72ce62b7d8fbc7f7e76f9a60e163cb45","revisionTime":"2017-10-30T10:26:55Z","tree":true},
{"path":"github.com/hashicorp/go-discover/provider/aws","checksumSHA1":"lyPRg8aZKgGiNkMILk/VKwOqMy4=","revision":"c98e36ab72ce62b7d8fbc7f7e76f9a60e163cb45","revisionTime":"2017-10-30T10:26:55Z","tree":true},
{"path":"github.com/hashicorp/go-discover/provider/azure","checksumSHA1":"+5VD2xEOEvTZhWn2Uk009wD6XvY=","revision":"4e49190abe2f3801a8653d7745a14bc445381615","revisionTime":"2018-01-20T00:19:59Z","tree":true},
{"path":"github.com/hashicorp/go-discover/provider/azure","checksumSHA1":"xgO+vNiKIhQlH8cPbkX9TCZXBKQ=","revision":"8f2af0ac44208783caab4dd65462ffb965229c60","revisionTime":"2018-02-08T17:16:50Z","tree":true},
{"path":"github.com/hashicorp/go-discover/provider/digitalocean","checksumSHA1":"qoy/euk2dwrONYMUsaAPznHHpxQ=","revision":"c98e36ab72ce62b7d8fbc7f7e76f9a60e163cb45","revisionTime":"2017-10-30T10:26:55Z","tree":true},
{"path":"github.com/hashicorp/go-discover/provider/gce","checksumSHA1":"tnKls5vtzpNQAj7b987N4i81HvY=","revision":"7642001b443a3723e2aba277054f16d1df172d97","revisionTime":"2018-01-03T21:14:29Z","tree":true},
{"path":"github.com/hashicorp/go-discover/provider/os","checksumSHA1":"LZwn9B00AjulYRCKapmJWFAamoo=","revision":"c98e36ab72ce62b7d8fbc7f7e76f9a60e163cb45","revisionTime":"2017-10-30T10:26:55Z","tree":true},