-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_container_registry
- deprecated classic
sku
and storage_account_id
#11165
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,11 +56,6 @@ func dataSourceContainerRegistry() *schema.Resource { | |
Computed: true, | ||
}, | ||
|
||
"storage_account_id": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
|
||
"tags": tags.SchemaDataSource(), | ||
}, | ||
} | ||
|
@@ -96,10 +91,6 @@ func dataSourceContainerRegistryRead(d *schema.ResourceData, meta interface{}) e | |
d.Set("sku", string(sku.Tier)) | ||
} | ||
|
||
if account := resp.StorageAccount; account != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and it could be an old account so maybe we should leave this till 3.0 - should be migrated isn't a 100% yes they are all migrated |
||
d.Set("storage_account_id", account.ID) | ||
} | ||
|
||
if *resp.AdminUserEnabled { | ||
credsResp, err := client.ListCredentials(ctx, resourceGroup, name) | ||
if err != nil { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,10 +56,9 @@ func resourceContainerRegistry() *schema.Resource { | |
"sku": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
Default: string(containerregistry.Classic), | ||
Default: string(containerregistry.Basic), | ||
DiffSuppressFunc: suppress.CaseDifference, | ||
ValidateFunc: validation.StringInSlice([]string{ | ||
string(containerregistry.Classic), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is probably fine if puts where failing, but what if someone had an old one that never udpated? |
||
string(containerregistry.Basic), | ||
string(containerregistry.Standard), | ||
string(containerregistry.Premium), | ||
|
@@ -89,12 +88,6 @@ func resourceContainerRegistry() *schema.Resource { | |
Default: true, | ||
}, | ||
|
||
"storage_account_id": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here, i don't see any reason to remove it now instead of deprecating it and removing in 3.0 |
||
Type: schema.TypeString, | ||
Optional: true, | ||
ForceNew: true, | ||
}, | ||
|
||
"login_server": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
|
@@ -330,18 +323,6 @@ func resourceContainerRegistryCreate(d *schema.ResourceData, meta interface{}) e | |
Tags: tags.Expand(t), | ||
} | ||
|
||
if v, ok := d.GetOk("storage_account_id"); ok { | ||
if !strings.EqualFold(sku, string(containerregistry.Classic)) { | ||
return fmt.Errorf("`storage_account_id` can only be specified for a Classic (unmanaged) Sku.") | ||
} | ||
|
||
parameters.StorageAccount = &containerregistry.StorageAccountProperties{ | ||
ID: utils.String(v.(string)), | ||
} | ||
} else if strings.EqualFold(sku, string(containerregistry.Classic)) { | ||
return fmt.Errorf("`storage_account_id` must be specified for a Classic (unmanaged) Sku.") | ||
} | ||
|
||
future, err := client.Create(ctx, resourceGroup, name, parameters) | ||
if err != nil { | ||
return fmt.Errorf("Error creating Container Registry %q (Resource Group %q): %+v", name, resourceGroup, err) | ||
|
@@ -633,10 +614,6 @@ func resourceContainerRegistryRead(d *schema.ResourceData, meta interface{}) err | |
d.Set("sku", string(sku.Tier)) | ||
} | ||
|
||
if account := resp.StorageAccount; account != nil { | ||
d.Set("storage_account_id", account.ID) | ||
} | ||
|
||
if *resp.AdminUserEnabled { | ||
credsResp, errList := client.ListCredentials(ctx, resourceGroup, name) | ||
if errList != nil { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
someone might be using this in a config so can we just deprecate it for now?