Skip to content

Commit 3564022

Browse files
committed
azure: Add e2e testing
1 parent 6ac7fcc commit 3564022

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
Copyright 2025 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package do
18+
19+
import (
20+
"math/rand"
21+
)
22+
23+
var allZones = []string{
24+
"uksouth-1",
25+
}
26+
27+
// RandomZones returns a random set of availability zones within a region
28+
func RandomZones(count int) ([]string, error) {
29+
n := rand.Intn(1000) % len(allZones)
30+
chosenZone := allZones[n]
31+
32+
chosenZones := make([]string, 0)
33+
chosenZones = append(chosenZones, chosenZone)
34+
35+
return chosenZones, nil
36+
}

tests/e2e/kubetest2-kops/deployer/common.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ func (d *deployer) initialize() error {
8181
d.SSHPublicKeyPath = os.Getenv("DO_SSH_PUBLIC_KEY_FILE")
8282
}
8383
d.SSHUser = "root"
84+
case "azure":
85+
if d.SSHPrivateKeyPath == "" {
86+
d.SSHPrivateKeyPath = os.Getenv("DO_SSH_PRIVATE_KEY_FILE")
87+
}
88+
if d.SSHPublicKeyPath == "" {
89+
d.SSHPublicKeyPath = os.Getenv("DO_SSH_PUBLIC_KEY_FILE")
90+
}
91+
d.SSHUser = "ubuntu"
8492
case "gce":
8593
if d.GCPProject == "" {
8694
klog.V(1).Info("No GCP project provided, acquiring from Boskos")

0 commit comments

Comments
 (0)