@@ -1376,7 +1376,7 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1376
1376
Filters : []ec2types.Filter {
1377
1377
{
1378
1378
Name : aws .String ("tag-key" ),
1379
- Values : []string {"node.k8s.amazonaws.com/instance_id" },
1379
+ Values : []string {eniNodeTagKey },
1380
1380
},
1381
1381
{
1382
1382
Name : aws .String ("status" ),
@@ -1409,7 +1409,7 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1409
1409
Filters : []ec2types.Filter {
1410
1410
{
1411
1411
Name : aws .String ("tag-key" ),
1412
- Values : []string {"node.k8s.amazonaws.com/instance_id" },
1412
+ Values : []string {eniNodeTagKey },
1413
1413
},
1414
1414
{
1415
1415
Name : aws .String ("status" ),
@@ -1431,11 +1431,11 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1431
1431
Status : "available" ,
1432
1432
TagSet : []ec2types.Tag {
1433
1433
{
1434
- Key : aws .String ("node.k8s.amazonaws.com/instance_id" ),
1434
+ Key : aws .String (eniNodeTagKey ),
1435
1435
Value : aws .String ("i-xxxxx" ),
1436
1436
},
1437
1437
{
1438
- Key : aws .String ("node.k8s.amazonaws.com/createdAt" ),
1438
+ Key : aws .String (eniCreatedAtTagKey ),
1439
1439
Value : aws .String (tenMinuteAgo .Format (time .RFC3339 )),
1440
1440
},
1441
1441
},
@@ -1453,11 +1453,11 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1453
1453
Status : "available" ,
1454
1454
TagSet : []ec2types.Tag {
1455
1455
{
1456
- Key : aws .String ("node.k8s.amazonaws.com/instance_id" ),
1456
+ Key : aws .String (eniNodeTagKey ),
1457
1457
Value : aws .String ("i-xxxxx" ),
1458
1458
},
1459
1459
{
1460
- Key : aws .String ("node.k8s.amazonaws.com/createdAt" ),
1460
+ Key : aws .String (eniCreatedAtTagKey ),
1461
1461
Value : aws .String (tenMinuteAgo .Format (time .RFC3339 )),
1462
1462
},
1463
1463
},
@@ -1474,7 +1474,7 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1474
1474
Filters : []ec2types.Filter {
1475
1475
{
1476
1476
Name : aws .String ("tag-key" ),
1477
- Values : []string {"node.k8s.amazonaws.com/instance_id" },
1477
+ Values : []string {eniNodeTagKey },
1478
1478
},
1479
1479
{
1480
1480
Name : aws .String ("status" ),
@@ -1496,11 +1496,11 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1496
1496
Status : "available" ,
1497
1497
TagSet : []ec2types.Tag {
1498
1498
{
1499
- Key : aws .String ("node.k8s.amazonaws.com/instance_id" ),
1499
+ Key : aws .String (eniNodeTagKey ),
1500
1500
Value : aws .String ("i-xxxxx" ),
1501
1501
},
1502
1502
{
1503
- Key : aws .String ("node.k8s.amazonaws.com/createdAt" ),
1503
+ Key : aws .String (eniCreatedAtTagKey ),
1504
1504
Value : aws .String (tenMinuteAgo .Format (time .RFC3339 )),
1505
1505
},
1506
1506
},
@@ -1523,7 +1523,7 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1523
1523
Filters : []ec2types.Filter {
1524
1524
{
1525
1525
Name : aws .String ("tag-key" ),
1526
- Values : []string {"node.k8s.amazonaws.com/instance_id" },
1526
+ Values : []string {eniNodeTagKey },
1527
1527
},
1528
1528
{
1529
1529
Name : aws .String ("status" ),
@@ -1545,11 +1545,11 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1545
1545
Status : "available" ,
1546
1546
TagSet : []ec2types.Tag {
1547
1547
{
1548
- Key : aws .String ("node.k8s.amazonaws.com/instance_id" ),
1548
+ Key : aws .String (eniNodeTagKey ),
1549
1549
Value : aws .String ("i-xxxxx" ),
1550
1550
},
1551
1551
{
1552
- Key : aws .String ("node.k8s.amazonaws.com/createdAt" ),
1552
+ Key : aws .String (eniCreatedAtTagKey ),
1553
1553
Value : aws .String (now .Format (time .RFC3339 )),
1554
1554
},
1555
1555
},
@@ -1572,7 +1572,7 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1572
1572
Filters : []ec2types.Filter {
1573
1573
{
1574
1574
Name : aws .String ("tag-key" ),
1575
- Values : []string {"node.k8s.amazonaws.com/instance_id" },
1575
+ Values : []string {eniNodeTagKey },
1576
1576
},
1577
1577
{
1578
1578
Name : aws .String ("status" ),
@@ -1605,7 +1605,7 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1605
1605
Filters : []ec2types.Filter {
1606
1606
{
1607
1607
Name : aws .String ("tag-key" ),
1608
- Values : []string {"node.k8s.amazonaws.com/instance_id" },
1608
+ Values : []string {eniNodeTagKey },
1609
1609
},
1610
1610
{
1611
1611
Name : aws .String ("status" ),
@@ -1631,15 +1631,15 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1631
1631
Status : "available" ,
1632
1632
TagSet : []ec2types.Tag {
1633
1633
{
1634
- Key : aws .String ("node.k8s.amazonaws.com/instance_id" ),
1634
+ Key : aws .String (eniNodeTagKey ),
1635
1635
Value : aws .String ("i-xxxxx" ),
1636
1636
},
1637
1637
{
1638
- Key : aws .String ("node.k8s.amazonaws.com/createdAt" ),
1638
+ Key : aws .String (eniCreatedAtTagKey ),
1639
1639
Value : aws .String (tenMinuteAgo .Format (time .RFC3339 )),
1640
1640
},
1641
1641
{
1642
- Key : aws .String ("cluster.k8s.amazonaws.com/name" ),
1642
+ Key : aws .String (eniClusterTagKey ),
1643
1643
Value : aws .String ("awesome-cluster" ),
1644
1644
},
1645
1645
},
@@ -1657,15 +1657,15 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1657
1657
Status : "available" ,
1658
1658
TagSet : []ec2types.Tag {
1659
1659
{
1660
- Key : aws .String ("node.k8s.amazonaws.com/instance_id" ),
1660
+ Key : aws .String (eniNodeTagKey ),
1661
1661
Value : aws .String ("i-xxxxx" ),
1662
1662
},
1663
1663
{
1664
- Key : aws .String ("node.k8s.amazonaws.com/createdAt" ),
1664
+ Key : aws .String (eniCreatedAtTagKey ),
1665
1665
Value : aws .String (tenMinuteAgo .Format (time .RFC3339 )),
1666
1666
},
1667
1667
{
1668
- Key : aws .String ("cluster.k8s.amazonaws.com/name" ),
1668
+ Key : aws .String (eniClusterTagKey ),
1669
1669
Value : aws .String ("awesome-cluster" ),
1670
1670
},
1671
1671
},
@@ -1682,7 +1682,7 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1682
1682
Filters : []ec2types.Filter {
1683
1683
{
1684
1684
Name : aws .String ("tag-key" ),
1685
- Values : []string {"node.k8s.amazonaws.com/instance_id" },
1685
+ Values : []string {eniNodeTagKey },
1686
1686
},
1687
1687
{
1688
1688
Name : aws .String ("status" ),
@@ -1708,15 +1708,15 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1708
1708
Status : "available" ,
1709
1709
TagSet : []ec2types.Tag {
1710
1710
{
1711
- Key : aws .String ("node.k8s.amazonaws.com/instance_id" ),
1711
+ Key : aws .String (eniNodeTagKey ),
1712
1712
Value : aws .String ("i-xxxxx" ),
1713
1713
},
1714
1714
{
1715
- Key : aws .String ("node.k8s.amazonaws.com/createdAt" ),
1715
+ Key : aws .String (eniCreatedAtTagKey ),
1716
1716
Value : aws .String (tenMinuteAgo .Format (time .RFC3339 )),
1717
1717
},
1718
1718
{
1719
- Key : aws .String ("cluster.k8s.amazonaws.com/name" ),
1719
+ Key : aws .String (eniClusterTagKey ),
1720
1720
Value : aws .String ("awesome-cluster" ),
1721
1721
},
1722
1722
},
@@ -1739,7 +1739,7 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1739
1739
Filters : []ec2types.Filter {
1740
1740
{
1741
1741
Name : aws .String ("tag-key" ),
1742
- Values : []string {"node.k8s.amazonaws.com/instance_id" },
1742
+ Values : []string {eniNodeTagKey },
1743
1743
},
1744
1744
{
1745
1745
Name : aws .String ("status" ),
@@ -1765,15 +1765,15 @@ func TestEC2InstanceMetadataCache_getLeakedENIs(t *testing.T) {
1765
1765
Status : "available" ,
1766
1766
TagSet : []ec2types.Tag {
1767
1767
{
1768
- Key : aws .String ("node.k8s.amazonaws.com/instance_id" ),
1768
+ Key : aws .String (eniNodeTagKey ),
1769
1769
Value : aws .String ("i-xxxxx" ),
1770
1770
},
1771
1771
{
1772
- Key : aws .String ("node.k8s.amazonaws.com/createdAt" ),
1772
+ Key : aws .String (eniCreatedAtTagKey ),
1773
1773
Value : aws .String (now .Format (time .RFC3339 )),
1774
1774
},
1775
1775
{
1776
- Key : aws .String ("cluster.k8s.amazonaws.com/name" ),
1776
+ Key : aws .String (eniClusterTagKey ),
1777
1777
Value : aws .String ("awesome-cluster" ),
1778
1778
},
1779
1779
},
@@ -1853,15 +1853,15 @@ func TestEC2InstanceMetadataCache_TagENI(t *testing.T) {
1853
1853
Resources : []string {"eni-xxxx" },
1854
1854
Tags : []ec2types.Tag {
1855
1855
{
1856
- Key : aws .String ("cluster.k8s.amazonaws.com/name" ),
1856
+ Key : aws .String (eniClusterTagKey ),
1857
1857
Value : aws .String ("awesome-cluster" ),
1858
1858
},
1859
1859
{
1860
- Key : aws .String ("eks:eni:owner" ),
1861
- Value : aws .String ("amazon-vpc-cni" ),
1860
+ Key : aws .String (eniOwnerTagKey ),
1861
+ Value : aws .String (eniOwnerTagValue ),
1862
1862
},
1863
1863
{
1864
- Key : aws .String ("node.k8s.amazonaws.com/instance_id" ),
1864
+ Key : aws .String (eniNodeTagKey ),
1865
1865
Value : aws .String ("i-xxxx" ),
1866
1866
},
1867
1867
},
@@ -1885,9 +1885,9 @@ func TestEC2InstanceMetadataCache_TagENI(t *testing.T) {
1885
1885
args : args {
1886
1886
eniID : "eni-xxxx" ,
1887
1887
currentTags : map [string ]string {
1888
- "node.k8s.amazonaws.com/instance_id" : "i-xxxx" ,
1889
- "cluster.k8s.amazonaws.com/name" : "awesome-cluster" ,
1890
- "eks:eni:owner" : "amazon-vpc-cni" ,
1888
+ eniNodeTagKey : "i-xxxx" ,
1889
+ eniClusterTagKey : "awesome-cluster" ,
1890
+ eniOwnerTagKey : eniOwnerTagValue ,
1891
1891
},
1892
1892
},
1893
1893
wantErr : nil ,
@@ -1903,12 +1903,12 @@ func TestEC2InstanceMetadataCache_TagENI(t *testing.T) {
1903
1903
Resources : []string {"eni-xxxx" },
1904
1904
Tags : []ec2types.Tag {
1905
1905
{
1906
- Key : aws .String ("cluster.k8s.amazonaws.com/name" ),
1906
+ Key : aws .String (eniClusterTagKey ),
1907
1907
Value : aws .String ("awesome-cluster" ),
1908
1908
},
1909
1909
{
1910
- Key : aws .String ("eks:eni:owner" ),
1911
- Value : aws .String ("amazon-vpc-cni" ),
1910
+ Key : aws .String (eniOwnerTagKey ),
1911
+ Value : aws .String (eniOwnerTagValue ),
1912
1912
},
1913
1913
},
1914
1914
},
@@ -1918,8 +1918,8 @@ func TestEC2InstanceMetadataCache_TagENI(t *testing.T) {
1918
1918
args : args {
1919
1919
eniID : "eni-xxxx" ,
1920
1920
currentTags : map [string ]string {
1921
- "node.k8s.amazonaws.com/instance_id" : "i-xxxx" ,
1922
- "anotherKey" : "anotherDay" ,
1921
+ eniNodeTagKey : "i-xxxx" ,
1922
+ "anotherKey" : "anotherDay" ,
1923
1923
},
1924
1924
},
1925
1925
wantErr : nil ,
@@ -1935,15 +1935,15 @@ func TestEC2InstanceMetadataCache_TagENI(t *testing.T) {
1935
1935
Resources : []string {"eni-xxxx" },
1936
1936
Tags : []ec2types.Tag {
1937
1937
{
1938
- Key : aws .String ("cluster.k8s.amazonaws.com/name" ),
1938
+ Key : aws .String (eniClusterTagKey ),
1939
1939
Value : aws .String ("awesome-cluster" ),
1940
1940
},
1941
1941
{
1942
- Key : aws .String ("eks:eni:owner" ),
1943
- Value : aws .String ("amazon-vpc-cni" ),
1942
+ Key : aws .String (eniOwnerTagKey ),
1943
+ Value : aws .String (eniOwnerTagValue ),
1944
1944
},
1945
1945
{
1946
- Key : aws .String ("node.k8s.amazonaws.com/instance_id" ),
1946
+ Key : aws .String (eniNodeTagKey ),
1947
1947
Value : aws .String ("i-xxxx" ),
1948
1948
},
1949
1949
},
0 commit comments