mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Add clusterid tags to the instances in AWS tests
In practice these were in most cases required to exist, but kubelet did not previously enforce this. It now does, so these tests need to change a bit.
This commit is contained in:
parent
3876a688eb
commit
a58f16bdfa
@ -272,6 +272,12 @@ func TestNodeAddresses(t *testing.T) {
|
||||
var instance1 ec2.Instance
|
||||
var instance2 ec2.Instance
|
||||
|
||||
// ClusterID needs to be set
|
||||
var tag ec2.Tag
|
||||
tag.Key = aws.String(TagNameKubernetesClusterLegacy)
|
||||
tag.Value = aws.String(TestClusterId)
|
||||
tags := []*ec2.Tag{&tag}
|
||||
|
||||
//0
|
||||
instance0.InstanceId = aws.String("i-0")
|
||||
instance0.PrivateDnsName = aws.String("instance-same.ec2.internal")
|
||||
@ -290,6 +296,7 @@ func TestNodeAddresses(t *testing.T) {
|
||||
}
|
||||
instance0.InstanceType = aws.String("c3.large")
|
||||
instance0.Placement = &ec2.Placement{AvailabilityZone: aws.String("us-east-1a")}
|
||||
instance0.Tags = tags
|
||||
state0 := ec2.InstanceState{
|
||||
Name: aws.String("running"),
|
||||
}
|
||||
@ -301,6 +308,7 @@ func TestNodeAddresses(t *testing.T) {
|
||||
instance1.PrivateIpAddress = aws.String("192.168.0.2")
|
||||
instance1.InstanceType = aws.String("c3.large")
|
||||
instance1.Placement = &ec2.Placement{AvailabilityZone: aws.String("us-east-1a")}
|
||||
instance1.Tags = tags
|
||||
state1 := ec2.InstanceState{
|
||||
Name: aws.String("running"),
|
||||
}
|
||||
@ -313,6 +321,7 @@ func TestNodeAddresses(t *testing.T) {
|
||||
instance2.PublicIpAddress = aws.String("1.2.3.4")
|
||||
instance2.InstanceType = aws.String("c3.large")
|
||||
instance2.Placement = &ec2.Placement{AvailabilityZone: aws.String("us-east-1a")}
|
||||
instance2.Tags = tags
|
||||
state2 := ec2.InstanceState{
|
||||
Name: aws.String("running"),
|
||||
}
|
||||
@ -351,12 +360,19 @@ func TestNodeAddresses(t *testing.T) {
|
||||
func TestNodeAddressesWithMetadata(t *testing.T) {
|
||||
var instance ec2.Instance
|
||||
|
||||
// ClusterID needs to be set
|
||||
var tag ec2.Tag
|
||||
tag.Key = aws.String(TagNameKubernetesClusterLegacy)
|
||||
tag.Value = aws.String(TestClusterId)
|
||||
tags := []*ec2.Tag{&tag}
|
||||
|
||||
instanceName := "instance.ec2.internal"
|
||||
instance.InstanceId = aws.String("i-0")
|
||||
instance.PrivateDnsName = &instanceName
|
||||
instance.PublicIpAddress = aws.String("2.3.4.5")
|
||||
instance.InstanceType = aws.String("c3.large")
|
||||
instance.Placement = &ec2.Placement{AvailabilityZone: aws.String("us-east-1a")}
|
||||
instance.Tags = tags
|
||||
state := ec2.InstanceState{
|
||||
Name: aws.String("running"),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user