зеркало из https://github.com/Azure/aks-engine.git
Keep tags when ensure group (#1585)
This commit is contained in:
Родитель
eede20bbe8
Коммит
290b6109ae
|
@ -7,10 +7,17 @@ import (
|
|||
|
||||
// EnsureResourceGroup ensures the named resouce group exists in the given location.
|
||||
func (az *AzureClient) EnsureResourceGroup(name, location string, managedBy *string) (resourceGroup *resources.Group, err error) {
|
||||
var tags *map[string]*string
|
||||
group, err := az.groupsClient.Get(name)
|
||||
if err == nil {
|
||||
tags = group.Tags
|
||||
}
|
||||
|
||||
response, err := az.groupsClient.CreateOrUpdate(name, resources.Group{
|
||||
Name: &name,
|
||||
Location: &location,
|
||||
ManagedBy: managedBy,
|
||||
Tags: tags,
|
||||
})
|
||||
if err != nil {
|
||||
return &response, err
|
||||
|
|
Загрузка…
Ссылка в новой задаче