Skip to content

Commit

Permalink
Update Azure SDK to newer version and standard IP
Browse files Browse the repository at this point in the history
Updates the use of the Azure sdk to a newer (not the newest version yet).
Uses the standard SKU for the public IP address (defaults to this atm).
  • Loading branch information
Veebers committed Nov 22, 2018
1 parent 203ac68 commit 9cd72eb
Show file tree
Hide file tree
Showing 19 changed files with 428 additions and 287 deletions.
19 changes: 13 additions & 6 deletions dependencies.tsv
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
github.com/Azure/azure-sdk-for-go git 03719f665513a71a89cf687d260c39a120ac00e7 2017-08-22T19:53:18Z
github.com/Azure/go-autorest git 10cfe58defab0c9a33be1f7b3ee656857670b509 2017-08-16T17:19:00Z
contrib.go.opencensus.io/exporter/ocagent git b8ece14a43f0cda76036504e4a4fd7fa27ce1869 2018-10-24T04:13:55Z
github.com/Azure/azure-sdk-for-go git 9699bdefa481d47c5c7638a1cc05d87ce53601fd 2018-11-14T17:11:15Z
github.com/Azure/go-autorest git 528b76fd0ebec0682f3e3da7c808cd472b999615 2018-11-12T18:30:27Z
github.com/EvilSuperstars/go-cidrman git 4e5a4a63d9b78757b4891b8de60be2606d8972ee 2017-02-11T23:11:53Z
github.com/ajstarks/svgo git 89e3ac64b5b3e403a5e7c35ea4f98d45db7b4518 2014-10-04T21:11:59Z
github.com/altoros/gosigma git 31228935eec685587914528585da4eb9b073c76d 2015-04-08T14:52:32Z
github.com/armon/go-metrics git 93f237eba9b0602f3e73710416558854a81d9337 2017-01-14T13:47:37Z
github.com/beorn7/perks git 3ac7bf7a47d159a033b107610db8a1b6575507a4 2016-02-29T21:34:45Z
github.com/bmizerany/pat git c068ca2f0aacee5ac3681d68e4d0a003b7d1fd2c 2016-02-17T10:32:42Z
github.com/boltdb/bolt git e9cf4fae01b5a8ff89d0ec6b32f0d9c9f79aefdd 2017-01-31T19:20:18Z
github.com/census-instrumentation/opencensus-proto git b11a67434194733b34c11f206938263fa16ad1cf 2018-11-06T20:00:49Z
github.com/cloud-green/monitoring git 666e3beca3cb4f6b5c8f176ba80daf2b3adbd84e 2017-11-27T13:22:20Z
github.com/coreos/go-systemd git 7b2428fec40033549c68f54e26e89e7ca9a9ce31 2016-02-02T21:14:25Z
github.com/dgrijalva/jwt-go git 01aeca54ebda6e0fbfafd0a524d234159c05ec20 2016-07-05T20:30:06Z
github.com/dustin/go-humanize git 145fabdb1ab757076a70a886d092a3af27f66f4c 2014-12-28T07:11:48Z
github.com/godbus/dbus git 32c6cc29c14570de4cf6d7e7737d68fb2d01ad15 2016-05-06T22:25:50Z
github.com/golang/glog git 23def4e6c14b4da8ac2ed8007337bc5eb5007998 2016-01-26T23:53:08Z
github.com/golang/mock git 69521b3833175dfcfb1cc1fdb0c9be92e66faa81 2018-04-03T23:54:22Z
github.com/golang/protobuf git 4bd1920723d7b7c925de087aa32e2187708897f7 2016-11-09T07:27:36Z
github.com/golang/protobuf git 882cf97a83ad205fd22af574246a3bc647d7a7d2 2018-11-20T00:18:57Z
github.com/google/go-querystring git 9235644dd9e52eeae6fa48efd539fdc351a0af53 2016-04-01T23:30:42Z
github.com/google/gofuzz git 24818f796faf91cd76ec7bddd72458fbced7a6c1 2017-06-12T17:47:53Z
github.com/gorilla/handlers git 13d73096a474cac93275c679c7b8a2dc17ddba82 2017-02-24T19:39:55Z
Expand Down Expand Up @@ -80,6 +82,7 @@ github.com/lestrrat/go-pdebug git 2e6eaaa5717f81bda41d27070d3c966f40a1e75f 2016-
github.com/lestrrat/go-structinfo git f74c056fe41f860aa6264478c664a6fff8a64298 2016-03-08T13:11:05Z
github.com/lunixbochs/vtclean git 4fbf7632a2c6d3fbdb9931439bdbbeded02cbe36 2016-01-25T03:51:06Z
github.com/lxc/lxd git d0d66b4842f459c6c3e039a9e2f25eff02174ab1 2018-05-15T16:43:15Z
github.com/marstr/guid git 8bdf7d1a087ccc975cf37dd6507da50698fd19ca 2017-04-27T23:51:15Z
github.com/masterzen/azure-sdk-for-go git ee4f0065d00cd12b542f18f5bc45799e88163b12 2016-10-14T13:56:28Z
github.com/masterzen/simplexml git 4572e39b1ab9fe03ee513ce6fc7e289e98482190 2016-06-08T18:30:07Z
github.com/masterzen/winrm git 7a535cd943fccaeed196718896beec3fb51aff41 2016-10-14T15:10:40Z
Expand All @@ -96,15 +99,19 @@ github.com/prometheus/client_model git fa8ad6fec33561be4280a8f0514318c79d7f6cb6
github.com/prometheus/common git dd586c1c5abb0be59e60f942c22af711a2008cb4 2016-05-03T22:05:32Z
github.com/prometheus/procfs git abf152e5f3e97f2fafac028d2cc06c1feb87ffa5 2016-04-11T19:08:41Z
github.com/rogpeppe/fastuuid git 6724a57986aff9bff1a1770e9347036def7c89f6 2015-01-06T09:32:20Z
github.com/satori/uuid git 5bf94b69c6b68ee1b541973bb8e1144db23a194b 2017-03-21T23:07:31Z
github.com/satori/go.uuid git b2ce2384e17bbe0c6d34077efa39dbab3e09123b 2018-10-28T12:50:25Z
github.com/vmware/govmomi git 05504416e95561e1478196d7058721c827a7bb8c 2018-03-06T20:02:55Z
go.opencensus.io git 91a0276ece6ad4cbdc4b46116f88d2b47a5f58e5 2018-11-12T17:26:09Z
golang.org/x/crypto git 650f4a345ab4e5b245a3034b110ebc7299e68186 2018-02-14T00:00:28Z
golang.org/x/net git 61147c48b25b599e5b561d2e9c4f3e1ef489ca41 2018-04-06T21:48:16Z
golang.org/x/oauth2 git 11c60b6f71a6ad48ed6f93c65fa4c6f9b1b5b46a 2015-03-25T02:00:22Z
golang.org/x/sys git 37707fdb30a5b38865cfb95e5aab41707daec7fd 2018-02-02T13:58:01Z
golang.org/x/text git 2910a502d2bf9e43193af9d68ca516529614eed3 2016-07-26T16:48:57Z
golang.org/x/sync git f52d1811a62927559de87708c8913c1650ce4f26 2017-05-17T21:12:32Z
golang.org/x/sys git 0cf1ed9e522b7dbb416f080a5c8003de9b702bf4 2018-11-21T00:28:34Z
golang.org/x/text git 6f44c5a2ea40ee3593d98cdcc905cc1fdaa660e2 2018-10-30T14:13:23Z
google.golang.org/api git ed10e890a8366167a7ce33fac2b12447987bcb1c 2017-08-17T20:34:27Z
google.golang.org/cloud git f20d6dcccb44ed49de45ae3703312cb46e627db1 2015-03-19T22:36:35Z
google.golang.org/genproto git b5d43981345bdb2c233eb4bf3277847b48c6fdc6 2018-11-09T15:42:31Z
google.golang.org/grpc git ef2b8e2f53fcd6654d12966394462f84e0f04066 2018-11-15T21:29:39Z
gopkg.in/amz.v3 git 8c3190dff075bf5442c9eedbf8f8ed6144a099e7 2016-12-15T13:08:49Z
gopkg.in/check.v1 git 4f90aeace3a26ad7021961c297b22c42160c7b25 2016-01-05T16:49:36Z
gopkg.in/errgo.v1 git 442357a80af5c6bf9b6d51ae791a39c3421004f3 2016-12-22T12:58:16Z
Expand Down
8 changes: 5 additions & 3 deletions provider/azure/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
package azure

import (
"context"
"net/http"
"sync"

"github.com/Azure/azure-sdk-for-go/arm/resources/subscriptions"
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2016-06-01/subscriptions"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/adal"
"github.com/juju/errors"
Expand Down Expand Up @@ -84,10 +85,11 @@ func AuthToken(cloud environs.CloudSpec, sender autorest.Sender) (*adal.ServiceP
subscriptionId := credAttrs[credAttrSubscriptionId]
appId := credAttrs[credAttrAppId]
appPassword := credAttrs[credAttrAppPassword]
client := subscriptions.GroupClient{subscriptions.NewWithBaseURI(cloud.Endpoint)}
client := subscriptions.Client{subscriptions.NewWithBaseURI(cloud.Endpoint)}
useragent.UpdateClient(&client.Client)
client.Sender = sender
oauthConfig, _, err := azureauth.OAuthConfig(client, cloud.Endpoint, subscriptionId)
ctx := context.Background()
oauthConfig, _, err := azureauth.OAuthConfig(ctx, client, cloud.Endpoint, subscriptionId)
if err != nil {
return nil, errors.Trace(err)
}
Expand Down
2 changes: 1 addition & 1 deletion provider/azure/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package azure
import (
"strings"

"github.com/Azure/azure-sdk-for-go/arm/storage"
"github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-06-01/storage"
"github.com/juju/errors"
"github.com/juju/schema"
"gopkg.in/juju/names.v2"
Expand Down
11 changes: 6 additions & 5 deletions provider/azure/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package azure

import (
"context"
"fmt"
"io"
"strings"
Expand Down Expand Up @@ -34,8 +35,8 @@ const (
)

type ServicePrincipalCreator interface {
InteractiveCreate(stderr io.Writer, params azureauth.ServicePrincipalParams) (appid, password string, _ error)
Create(params azureauth.ServicePrincipalParams) (appid, password string, _ error)
InteractiveCreate(ctx context.Context, stderr io.Writer, params azureauth.ServicePrincipalParams) (appid, password string, _ error)
Create(ctx context.Context, params azureauth.ServicePrincipalParams) (appid, password string, _ error)
}

type AzureCLI interface {
Expand Down Expand Up @@ -189,7 +190,7 @@ func (c environProviderCredentials) deviceCodeCredential(
args environs.FinalizeCredentialParams,
params azureauth.ServicePrincipalParams,
) (*cloud.Credential, error) {
applicationId, password, err := c.servicePrincipalCreator.InteractiveCreate(ctx.GetStderr(), params)
applicationId, password, err := c.servicePrincipalCreator.InteractiveCreate(context.Background(), ctx.GetStderr(), params)
if err != nil {
return nil, errors.Trace(err)
}
Expand Down Expand Up @@ -223,7 +224,7 @@ func (c environProviderCredentials) azureCLICredential(
}
params.ResourceManagerAuthorizer = autorest.NewBearerAuthorizer(resourceManagerAuthorizer.Token())

applicationId, password, err := c.servicePrincipalCreator.Create(params)
applicationId, password, err := c.servicePrincipalCreator.Create(context.Background(), params)
if err != nil {
return nil, errors.Annotatef(err, "cannot get service principal")
}
Expand All @@ -248,7 +249,7 @@ func (c environProviderCredentials) accountCredential(
if err != nil {
return cloud.Credential{}, errors.Annotatef(err, "cannot get access token for %s", acc.ID)
}
applicationId, password, err := c.servicePrincipalCreator.Create(azureauth.ServicePrincipalParams{
applicationId, password, err := c.servicePrincipalCreator.Create(context.Background(), azureauth.ServicePrincipalParams{
GraphEndpoint: cloudInfo.Endpoints.ActiveDirectoryGraphResourceID,
GraphResourceId: cloudInfo.Endpoints.ActiveDirectoryGraphResourceID,
GraphAuthorizer: autorest.NewBearerAuthorizer(graphToken.Token()),
Expand Down
12 changes: 8 additions & 4 deletions provider/azure/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
package azure

import (
"github.com/Azure/azure-sdk-for-go/arm/resources/resources"
"context"

"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources"
"github.com/juju/errors"

"github.com/juju/juju/provider/azure/internal/armtemplates"
Expand All @@ -26,13 +28,15 @@ func createDeployment(
Mode: resources.Incremental,
},
}
_, errChan := client.CreateOrUpdate(
ctx := context.Background()
_, err = client.CreateOrUpdate(
ctx,
resourceGroup,
deploymentName,
deployment,
nil, // abort channel
)
if err := <-errChan; err != nil {
// veebers: I think its fine that we're ignoring the result future.
if err != nil {
return errors.Annotatef(err, "creating deployment %q", deploymentName)
}
return nil
Expand Down
Loading

0 comments on commit 9cd72eb

Please sign in to comment.