Skip to content

Commit

Permalink
move admin user check to better location
Browse files Browse the repository at this point in the history
  • Loading branch information
hongooi73 committed Jul 15, 2019
1 parent 93c8d8e commit 839b24f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/add_acr_methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' - `name`: The name of the container registry.
#' - `location`: The location/region in which to create the container registry. Defaults to this resource group's location.
#' - `admin_user_enabled`: Whether to enable the Admin user. Currently this must be TRUE to allow Docker to access the registry.
#' - `sku`: The SKU.
#' - `sku`: Either "Basic", "Standard" (the default) or "Premium".
#' - `wait`: Whether to wait until the ACR resource provisioning is complete.
#' - `...`: Other named arguments to pass to the [az_resource] initialization function.
#'
Expand Down
6 changes: 3 additions & 3 deletions R/az_container_registry.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public=list(

list_credentials=function()
{
if(!self$properties$adminUserEnabled)
stop("Admin user account is disabled", call.=FALSE)

creds <- private$res_op("listCredentials", http_verb="POST")
pwds <- sapply(creds$passwords, `[[`, "value")
names(pwds) <- sapply(creds$passwords, `[[`, "name")
Expand All @@ -99,9 +102,6 @@ public=list(
server <- paste0("https://", self$properties$loginServer)
if(as_admin)
{
if(!self$properties$adminUserEnabled)
stop("Admin user account is disabled", call.=FALSE)

creds <- self$list_credentials()
docker_registry(server, username=creds$username, password=creds$passwords[1], app=NULL)
}
Expand Down
2 changes: 1 addition & 1 deletion man/create_acr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 839b24f

Please sign in to comment.