Skip to content

Commit

Permalink
Merge pull request #398 from portworx/PTX-1641-2
Browse files Browse the repository at this point in the history
[PTX-1641] Add AKS node driver
  • Loading branch information
Craig Rodrigues authored Jan 24, 2020
2 parents 1cb6442 + 41a9ac5 commit 20d6f07
Show file tree
Hide file tree
Showing 192 changed files with 47,686 additions and 2,167 deletions.
24 changes: 23 additions & 1 deletion deployments/deploy-ssh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ if [ -z "$STORAGENODE_RECOVERY_TIMEOUT" ]; then
echo "Using default storage node recovery timeout of ${STORAGENODE_RECOVERY_TIMEOUT}"
fi

AZURE_TENANTID=""
if [ -n "$AZURE_TENANT_ID" ]; then
AZURE_TENANTID="${AZURE_TENANT_ID}"
fi

AZURE_CLIENTID=""
if [ -n "$AZURE_CLIENT_ID" ]; then
AZURE_CLIENTID="${AZURE_CLIENT_ID}"
fi

AZURE_CLIENTSECRET=""
if [ -n "$AZURE_CLIENT_SECRET" ]; then
AZURE_CLIENTSECRET="${AZURE_CLIENT_SECRET}"
fi

if [ -z "$TEST_SUITE" ]; then
TEST_SUITE='"bin/asg.test",
"bin/autopilot-capacity.test",
Expand Down Expand Up @@ -183,6 +198,7 @@ if [ -n "${K8S_VENDOR}" ]; then
K8S_VENDOR_KEY=px/enabled
K8S_VENDOR_OPERATOR="In"
K8S_VENDOR_VALUE='values: ["false"]'
NODE_DRIVER="aks"
;;
eks)
# Run torpedo on worker node, where px installation is disabled.
Expand Down Expand Up @@ -306,6 +322,12 @@ spec:
value: "${TORPEDO_SSH_PASSWORD}"
- name: TORPEDO_SSH_KEY
value: "${TORPEDO_SSH_KEY}"
- name: AZURE_TENANT_ID
value: "${AZURE_TENANTID}"
- name: AZURE_CLIENT_ID
value: "${AZURE_CLIENTID}"
- name: AZURE_CLIENT_SECRET
value: "${AZURE_CLIENTSECRET}"
volumes: [${VOLUMES}]
restartPolicy: Never
serviceAccountName: torpedo-account
Expand Down Expand Up @@ -337,4 +359,4 @@ for i in $(seq 1 600) ; do
done

echo "Error: Failed to wait for torpedo to start running..."
describe_pod_then_exit
describe_pod_then_exit
80 changes: 80 additions & 0 deletions drivers/node/aks/aks.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package aks

import (
"os"
"time"

"github.com/libopenstorage/cloudops"
"github.com/libopenstorage/cloudops/azure"
"github.com/portworx/torpedo/drivers/node"
"github.com/portworx/torpedo/drivers/node/ssh"
"github.com/sirupsen/logrus"
)

const (
// DriverName is the name of the gke driver
DriverName = "aks"
// ZoneCount number of zones in autoscaling group
ZoneCount = 3
)

type aks struct {
ssh.SSH
ops cloudops.Ops
instanceGroup string
}

func (a *aks) String() string {
return DriverName
}

func (a *aks) Init() error {

instanceGroup := os.Getenv("INSTANCE_GROUP")
if len(instanceGroup) != 0 {
a.instanceGroup = instanceGroup
} else {
a.instanceGroup = "nodepool1"
}

ops, err := azure.NewClientFromMetadata()
if err != nil {
return err
}
a.ops = ops

return nil
}

func (a *aks) SetASGClusterSize(perZoneCount int64, timeout time.Duration) error {
// Azure SDK requires total cluster size
totalClusterSize := perZoneCount * ZoneCount
err := a.ops.SetInstanceGroupSize(a.instanceGroup, totalClusterSize, timeout)
if err != nil {
logrus.Errorf("failed to set size of node pool %s. Error: %v", a.instanceGroup, err)
return err
}

return nil
}

func (a *aks) GetASGClusterSize() (int64, error) {
nodeCount, err := a.ops.GetInstanceGroupSize(a.instanceGroup)
if err != nil {
logrus.Errorf("failed to get size of node pool %s. Error: %v", a.instanceGroup, err)
return 0, err
}

return nodeCount, nil
}

func init() {

SSHDriver := ssh.SSH{}
SSHDriver.Init()
g := &aks{
SSH: SSHDriver,
}

node.Register(DriverName, g)
}
5 changes: 3 additions & 2 deletions drivers/node/gke/gke.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ func (g *gke) Init() error {
return nil
}

func (g *gke) SetASGClusterSize(count int64, timeout time.Duration) error {
err := g.ops.SetInstanceGroupSize(g.instanceGroup, count, timeout)
func (g *gke) SetASGClusterSize(perZoneCount int64, timeout time.Duration) error {
// GCP SDK requires per zone cluster size
err := g.ops.SetInstanceGroupSize(g.instanceGroup, perZoneCount, timeout)
if err != nil {
logrus.Errorf("failed to set size of node pool %s. Error: %v", g.instanceGroup, err)
return err
Expand Down
4 changes: 2 additions & 2 deletions drivers/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ type Driver interface {
// SystemCheck checks whether core files are present on the given node.
SystemCheck(node Node, options ConnectionOpts) (string, error)

// SetASGClusterSize sets node count for an asg cluster
SetASGClusterSize(count int64, timeout time.Duration) error
// SetASGClusterSize sets node count per zone for an asg cluster
SetASGClusterSize(perZoneCount int64, timeout time.Duration) error

// GetASGClusterSize gets node count for an asg cluster
GetASGClusterSize() (int64, error)
Expand Down
11 changes: 8 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ go 1.12

require (
cloud.google.com/go v0.37.4 // indirect
github.com/Azure/azure-sdk-for-go v38.2.0+incompatible // indirect
github.com/Azure/go-autorest v13.3.1+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.9.4 // indirect
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 // indirect
github.com/Azure/go-autorest/autorest/to v0.3.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect
github.com/Microsoft/go-winio v0.4.14 // indirect
github.com/aws/aws-sdk-go v1.25.11
github.com/coreos/go-oidc v2.1.0+incompatible // indirect
github.com/coreos/prometheus-operator v0.31.1 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/docker v1.4.2-0.20170731201938-4f3616fb1c11
github.com/docker/go-connections v0.4.0 // indirect
Expand All @@ -31,7 +36,7 @@ require (
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/kubernetes-incubator/external-storage v0.0.0-00010101000000-000000000000
github.com/libopenstorage/autopilot-api v0.6.0
github.com/libopenstorage/cloudops v0.0.0-20190814221430-32b6af4bb132
github.com/libopenstorage/cloudops v0.0.0-20200114171448-10fa10d97720
github.com/libopenstorage/gossip v0.0.0-20190507031959-c26073a01952 // indirect
github.com/libopenstorage/openstorage v7.0.1-0.20191218211301-d03367435351+incompatible
github.com/libopenstorage/operator v0.0.0-20191009190641-8642de5d0812 // indirect
Expand All @@ -54,7 +59,7 @@ require (
github.com/sirupsen/logrus v1.4.2
github.com/spf13/pflag v1.0.5 // indirect
go.opencensus.io v0.22.1 // indirect
golang.org/x/crypto v0.0.0-20191011161858-a950601f39e6
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413
golang.org/x/net v0.0.0-20191009170851-d66e71096ffb
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
golang.org/x/sys v0.0.0-20191010194322-b09406accb47 // indirect
Expand Down
43 changes: 43 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,45 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU=
cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
contrib.go.opencensus.io/exporter/ocagent v0.4.12 h1:jGFvw3l57ViIVEPKKEUXPcLYIXJmQxLUh6ey1eJhwyc=
contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA=
github.com/Azure/azure-pipeline-go v0.1.8/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg=
github.com/Azure/azure-sdk-for-go v23.2.0+incompatible h1:bch1RS060vGpHpY3zvQDV4rOiRw25J1zmR/B9a76aSA=
github.com/Azure/azure-sdk-for-go v23.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v38.2.0+incompatible h1:ZeCdp1E/V5lI8oLR/BjWQh0OW9aFBYlgXGKRVIWNPXY=
github.com/Azure/azure-sdk-for-go v38.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-storage-blob-go v0.0.0-20181022225951-5152f14ace1c/go.mod h1:oGfmITT1V6x//CswqY2gtAHND+xIP64/qL7a5QJix0Y=
github.com/Azure/go-autorest v11.2.8+incompatible h1:Q2feRPMlcfVcqz3pF87PJzkm5lZrL+x6BDtzhODzNJM=
github.com/Azure/go-autorest v11.2.8+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v13.3.1+incompatible h1:IwJyD1VqWPEbOfq50o1OV3JQr92uz8q/CCbcm9zvnsE=
github.com/Azure/go-autorest v13.3.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v13.3.2+incompatible h1:VxzPyuhtnlBOzc4IWCZHqpyH2d+QMLQEuy3wREyY4oc=
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0=
github.com/Azure/go-autorest/autorest v0.9.4 h1:1cM+NmKw91+8h5vfjgzK4ZGLuN72k87XVZBWyGwNjUM=
github.com/Azure/go-autorest/autorest v0.9.4/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0=
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc=
github.com/Azure/go-autorest/autorest/adal v0.8.1 h1:pZdL8o72rK+avFWl+p9nE8RWi1JInZrWJYlnpfXJwHk=
github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk=
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM=
github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 h1:LXl088ZQlP0SBppGFsRZonW6hSvwgL5gRByMbvUbx8U=
github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw=
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
github.com/Azure/go-autorest/autorest/date v0.2.0 h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM=
github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g=
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM=
github.com/Azure/go-autorest/autorest/to v0.3.0 h1:zebkZaadz7+wIQYgC7GXaz3Wb28yKYfVkkBKwc38VF8=
github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA=
github.com/Azure/go-autorest/autorest/validation v0.2.0 h1:15vMO4y76dehZSq7pAaOLQxC6dZYsSrj2GQpflyM/L4=
github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI=
github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY=
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k=
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU=
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
Expand Down Expand Up @@ -43,6 +77,7 @@ github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnweb
github.com/brancz/gojsontoyaml v0.0.0-20190425155809-e8bd32d46b3d/go.mod h1:IyUJYN1gvWjtLF5ZuygmxbnsAyP3aJS6cHzIuZY50B0=
github.com/campoy/embedmd v1.0.0/go.mod h1:oxyr9RCiSXg0M3VJ3ks0UGfp98BpSSGr0kpiX3MzVl8=
github.com/cenk/backoff v2.0.0+incompatible/go.mod h1:7FtoeaSnHoZnmZzz47cM35Y9nSW7tNyaidugnHTaFDE=
github.com/census-instrumentation/opencensus-proto v0.2.0 h1:LzQXZOgg4CQfE6bFvXGM30YZL1WW/M337pXml+GrcZ4=
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/certifi/gocertifi v0.0.0-20180905225744-ee1a9a0726d2/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
Expand All @@ -65,6 +100,8 @@ github.com/dgrijalva/jwt-go v0.0.0-20161101193935-9ed569b5d1ac/go.mod h1:E3ru+11
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4=
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v1.4.2-0.20170731201938-4f3616fb1c11 h1:AkZzEIjFIDwDG0GuGnduBMcT/SKf9xTRQVJ4JD1mWc0=
Expand Down Expand Up @@ -252,6 +289,8 @@ github.com/libopenstorage/autopilot-api v0.6.0 h1:xPB47jeWA7j0kyzlnR5vKBQCFVxyaf
github.com/libopenstorage/autopilot-api v0.6.0/go.mod h1:6JLrPbR3ZJQFbUY/+QJMl/aF00YdIrLf8/GWAplgvJs=
github.com/libopenstorage/cloudops v0.0.0-20190814221430-32b6af4bb132 h1:uLspFdYgbXX3UjjKWfklmZAUOm0azPgVXjX1xfO0uAg=
github.com/libopenstorage/cloudops v0.0.0-20190814221430-32b6af4bb132/go.mod h1:quSDXGC3Fhc+pBwMRIi1Gk+kaSfBDZo5rRsftapTzGE=
github.com/libopenstorage/cloudops v0.0.0-20200114171448-10fa10d97720 h1:Rjx1Xvg/VzRTldQdzQ5VGThMwV0q3tLmjFqenMHEk4E=
github.com/libopenstorage/cloudops v0.0.0-20200114171448-10fa10d97720/go.mod h1:quSDXGC3Fhc+pBwMRIi1Gk+kaSfBDZo5rRsftapTzGE=
github.com/libopenstorage/external-storage v5.1.1-0.20190919185747-9394ee8dd536+incompatible h1:HmWu2hsQCysqdwGpW5XjQ2HpleRAIv9LekxB631EE2g=
github.com/libopenstorage/external-storage v5.1.1-0.20190919185747-9394ee8dd536+incompatible/go.mod h1:H0Gzy0h36rbJPxu3lKdrIPw1h0k0c4YFtTGGlBEBPc8=
github.com/libopenstorage/gossip v0.0.0-20190507031959-c26073a01952 h1:lWjqr0jCFpRZMZyOLUcIwz0A2pcZ2+XsN5jcAkOqm0I=
Expand Down Expand Up @@ -284,6 +323,7 @@ github.com/minio/cli v1.20.0/go.mod h1:bYxnK0uS629N3Bq+AOZZ+6lwF77Sodk4+UL9vNuXh
github.com/minio/minio-go/v6 v6.0.27-0.20190529152532-de69c0e465ed/go.mod h1:vaNT59cWULS37E+E9zkuN/BVnKHyXtVGS+b04Boc66Y=
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
github.com/mitchellh/go-homedir v0.0.0-20180523094522-3864e76763d9/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
Expand Down Expand Up @@ -424,6 +464,8 @@ golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011161858-a950601f39e6 h1:w8KIlm7HkDEQx6EtcrA+tJK38f+NJTDOKKFSM96fwBA=
golang.org/x/crypto v0.0.0-20191011161858-a950601f39e6/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
Expand Down Expand Up @@ -459,6 +501,7 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down
13 changes: 11 additions & 2 deletions tests/asg/asg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ var _ = Describe("{ClusterScaleUpDown}", func() {
Step(fmt.Sprintf("scale up cluster from %d to %d nodes and validate",
intitialNodeCount, (scaleupCount/3)*3), func() {

// After scale up, get fresh list of nodes
// by re-initializing scheduler and volume driver
err = Inst().S.RefreshNodeRegistry()
Expect(err).NotTo(HaveOccurred())

err = Inst().V.RefreshDriverEndpoints()
Expect(err).NotTo(HaveOccurred())

Scale(scaleupCount)
Step(fmt.Sprintf("validate number of storage nodes after scale up"), func() {
ValidateClusterSize(scaleupCount)
Expand Down Expand Up @@ -229,8 +237,9 @@ func ValidateClusterSize(count int64) {
storageNodes, err := getStorageNodes()
Expect(err).NotTo(HaveOccurred())
Expect(len(storageNodes)).Should(Equal(expectedStorageNodesPerZone*3),
"Current number of storeage nodes [%d] does not match expected number of storage nodes [%d]",
len(storageNodes), expectedStorageNodesPerZone*3)
"Current number of storeage nodes [%d] does not match expected number of storage nodes [%d]."+
"List of storage nodes:[%v]",
len(storageNodes), expectedStorageNodesPerZone*3, storageNodes)

logrus.Infof("Validated successfully that [%d] storage nodes are present", len(storageNodes))
}
Expand Down
3 changes: 3 additions & 0 deletions tests/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ import (
"github.com/portworx/torpedo/drivers/node"
"github.com/sirupsen/logrus"

// import aks driver to invoke it's init
_ "github.com/portworx/torpedo/drivers/node/aks"
// import aws driver to invoke it's init
_ "github.com/portworx/torpedo/drivers/node/aws"
// import gke driver to invoke it's init
_ "github.com/portworx/torpedo/drivers/node/gke"

// import ssh driver to invoke it's init
Expand Down
Loading

0 comments on commit 20d6f07

Please sign in to comment.