File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
test/e2e/framework/providers/aws Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,29 @@ func (p *Provider) CreatePD(zone string) (string, error) {
100
100
request .AvailabilityZone = aws .String (zone )
101
101
request .Size = aws .Int64 (10 )
102
102
request .VolumeType = aws .String (awscloud .DefaultVolumeType )
103
+
104
+ // We need to tag the volume so that locked-down IAM configurations can still mount it
105
+ if framework .TestContext .CloudConfig .ClusterTag != "" {
106
+ clusterID := framework .TestContext .CloudConfig .ClusterTag
107
+
108
+ legacyTag := & ec2.Tag {
109
+ Key : aws .String (awscloud .TagNameKubernetesClusterLegacy ),
110
+ Value : aws .String (clusterID ),
111
+ }
112
+
113
+ newTag := & ec2.Tag {
114
+ Key : aws .String (awscloud .TagNameKubernetesClusterPrefix + clusterID ),
115
+ Value : aws .String (awscloud .ResourceLifecycleOwned ),
116
+ }
117
+
118
+ tagSpecification := & ec2.TagSpecification {
119
+ ResourceType : aws .String (ec2 .ResourceTypeVolume ),
120
+ Tags : []* ec2.Tag {legacyTag , newTag },
121
+ }
122
+
123
+ request .TagSpecifications = append (request .TagSpecifications , tagSpecification )
124
+ }
125
+
103
126
response , err := client .CreateVolume (request )
104
127
if err != nil {
105
128
return "" , err
You can’t perform that action at this time.
0 commit comments