Skip to content

Commit e052bd3

Browse files
committed
annotation tests
vendor changes made the service to LB type
1 parent cfddc49 commit e052bd3

File tree

219 files changed

+32303
-1741
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+32303
-1741
lines changed

go.mod

+12-10
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ require (
2424
sigs.k8s.io/cluster-api v1.8.4
2525
sigs.k8s.io/cluster-api-provider-aws/v2 v2.6.1
2626
sigs.k8s.io/cluster-api-provider-azure v1.17.1
27+
sigs.k8s.io/cluster-api-provider-gcp v1.8.0
2728
sigs.k8s.io/controller-runtime v0.19.0
2829
sigs.k8s.io/yaml v1.4.0
2930
)
@@ -143,6 +144,7 @@ require (
143144
github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect
144145
github.com/kisielk/errcheck v1.7.0 // indirect
145146
github.com/kkHAIKE/contextcheck v1.1.5 // indirect
147+
github.com/klauspost/compress v1.17.9 // indirect
146148
github.com/kulti/thelper v0.6.3 // indirect
147149
github.com/kunwardeep/paralleltest v1.0.10 // indirect
148150
github.com/kyoh86/exportloopref v0.1.11 // indirect
@@ -184,9 +186,9 @@ require (
184186
github.com/pkg/errors v0.9.1 // indirect
185187
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
186188
github.com/polyfloyd/go-errorlint v1.6.0 // indirect
187-
github.com/prometheus/client_golang v1.19.1 // indirect
189+
github.com/prometheus/client_golang v1.20.4 // indirect
188190
github.com/prometheus/client_model v0.6.1 // indirect
189-
github.com/prometheus/common v0.55.0 // indirect
191+
github.com/prometheus/common v0.59.1 // indirect
190192
github.com/prometheus/procfs v0.15.1 // indirect
191193
github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 // indirect
192194
github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect
@@ -245,20 +247,20 @@ require (
245247
go.uber.org/automaxprocs v1.5.3 // indirect
246248
go.uber.org/multierr v1.11.0 // indirect
247249
go.uber.org/zap v1.27.0 // indirect
248-
golang.org/x/crypto v0.27.0 // indirect
250+
golang.org/x/crypto v0.28.0 // indirect
249251
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect
250252
golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect
251253
golang.org/x/mod v0.21.0 // indirect
252-
golang.org/x/net v0.28.0 // indirect
253-
golang.org/x/oauth2 v0.22.0 // indirect
254+
golang.org/x/net v0.30.0 // indirect
255+
golang.org/x/oauth2 v0.23.0 // indirect
254256
golang.org/x/sync v0.8.0 // indirect
255-
golang.org/x/sys v0.25.0 // indirect
256-
golang.org/x/term v0.24.0 // indirect
257-
golang.org/x/text v0.18.0 // indirect
258-
golang.org/x/time v0.6.0 // indirect
257+
golang.org/x/sys v0.26.0 // indirect
258+
golang.org/x/term v0.25.0 // indirect
259+
golang.org/x/text v0.19.0 // indirect
260+
golang.org/x/time v0.7.0 // indirect
259261
golang.org/x/tools v0.24.0 // indirect
260262
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
261-
google.golang.org/protobuf v1.34.2 // indirect
263+
google.golang.org/protobuf v1.35.1 // indirect
262264
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
263265
gopkg.in/inf.v0 v0.9.1 // indirect
264266
gopkg.in/ini.v1 v1.67.0 // indirect

go.sum

+24-20
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/
316316
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
317317
github.com/kkHAIKE/contextcheck v1.1.5 h1:CdnJh63tcDe53vG+RebdpdXJTc9atMgGqdx8LXxiilg=
318318
github.com/kkHAIKE/contextcheck v1.1.5/go.mod h1:O930cpht4xb1YQpK+1+AgoM3mFsvxr7uyFptcnWTYUA=
319+
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
320+
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
319321
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
320322
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
321323
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
@@ -437,13 +439,13 @@ github.com/polyfloyd/go-errorlint v1.6.0 h1:tftWV9DE7txiFzPpztTAwyoRLKNj9gpVm2cg
437439
github.com/polyfloyd/go-errorlint v1.6.0/go.mod h1:HR7u8wuP1kb1NeN1zqTd1ZMlqUKPPHF+Id4vIPvDqVw=
438440
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
439441
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
440-
github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=
441-
github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
442+
github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI=
443+
github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
442444
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
443445
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
444446
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
445-
github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc=
446-
github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8=
447+
github.com/prometheus/common v0.59.1 h1:LXb1quJHWm1P6wq/U824uxYi4Sg0oGvNeUm1z5dJoX0=
448+
github.com/prometheus/common v0.59.1/go.mod h1:GpWM7dewqmVYcd7SmRaiWVe9SSqjf0UrwnYnpEZNuT0=
447449
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
448450
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
449451
github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 h1:+Wl/0aFp0hpuHM3H//KMft64WQ1yX9LdJY64Qm/gFCo=
@@ -602,8 +604,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
602604
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
603605
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
604606
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
605-
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
606-
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
607+
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
608+
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
607609
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
608610
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk=
609611
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
@@ -643,11 +645,11 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
643645
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
644646
golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
645647
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
646-
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
647-
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
648+
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
649+
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
648650
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
649-
golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA=
650-
golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
651+
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
652+
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
651653
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
652654
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
653655
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -683,17 +685,17 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
683685
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
684686
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
685687
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
686-
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
687-
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
688+
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
689+
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
688690
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
689691
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
690692
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
691693
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
692694
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
693695
golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
694696
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
695-
golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
696-
golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
697+
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
698+
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
697699
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
698700
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
699701
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -702,10 +704,10 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
702704
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
703705
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
704706
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
705-
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
706-
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
707-
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
708-
golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
707+
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
708+
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
709+
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
710+
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
709711
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
710712
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
711713
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
@@ -758,8 +760,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
758760
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
759761
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
760762
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
761-
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
762-
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
763+
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
764+
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
763765
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
764766
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
765767
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
@@ -814,6 +816,8 @@ sigs.k8s.io/cluster-api-provider-aws/v2 v2.6.1 h1:vbZUYEB7OfPlfHk6wis+UrvRLTqv5F
814816
sigs.k8s.io/cluster-api-provider-aws/v2 v2.6.1/go.mod h1:1aq1EZbirRW6NC2gYUFCc7cVFwX9PM/vDvoU+2oGPuw=
815817
sigs.k8s.io/cluster-api-provider-azure v1.17.1 h1:f1sTGfv6hAN9WrxeawE4pQ2nRhEKb7AJjH6MhU/wAzg=
816818
sigs.k8s.io/cluster-api-provider-azure v1.17.1/go.mod h1:16VtsvIpK8qtNHplG2ZHZ74/JKTzOUQIAWWutjnpvEc=
819+
sigs.k8s.io/cluster-api-provider-gcp v1.8.0 h1:K3/fa4VEPCIgtzGsKKPs3qwbJEkMxt+YjT+fkmE7CG8=
820+
sigs.k8s.io/cluster-api-provider-gcp v1.8.0/go.mod h1:dHC23Chv/PpH2M8pvkVpleW9auCsXuxmEQUz8UUwk7A=
817821
sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC0ji/Q=
818822
sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4=
819823
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=

pkg/annotations/gcp.go

+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
package annotations
2+
3+
import (
4+
"context"
5+
"fmt"
6+
"time"
7+
8+
configv1 "github.com/openshift/api/config/v1"
9+
corev1 "k8s.io/api/core/v1"
10+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
11+
"sigs.k8s.io/controller-runtime/pkg/client"
12+
"sigs.k8s.io/controller-runtime/pkg/client/config"
13+
14+
"sigs.k8s.io/controller-runtime/pkg/envtest/komega"
15+
16+
"github.com/openshift/cluster-api-actuator-pkg/pkg/framework"
17+
18+
g "github.com/onsi/ginkgo/v2"
19+
o "github.com/onsi/gomega"
20+
)
21+
22+
var (
23+
annotationsToTest = map[string]string{
24+
"traffic-policy.network.alpha.openshift.io/local-with-fallback": "true",
25+
"alpha.cloud.google.com/load-balancer-backend-share": "",
26+
"networking.gke.io/internal-load-balancer-allow-global-access": "true",
27+
"networking.gke.io/internal-load-balancer-subnet": "",
28+
}
29+
)
30+
31+
var cl client.Client
32+
33+
var _ = g.Describe("Service Annotation tests GCP", framework.LabelCCM, framework.LabelDisruptive, g.Ordered, func() {
34+
var (
35+
ctx context.Context
36+
platform configv1.PlatformType
37+
namespace string
38+
createdServices []string
39+
)
40+
41+
g.BeforeAll(func() {
42+
cfg, err := config.GetConfig()
43+
o.Expect(err).ToNot(o.HaveOccurred(), "Failed to GetConfig")
44+
45+
cl, err = client.New(cfg, client.Options{})
46+
o.Expect(err).NotTo(o.HaveOccurred(), "Failed to create Kubernetes client for test")
47+
komega.SetClient(cl)
48+
ctx = framework.GetContext()
49+
platform, err = framework.GetPlatform(ctx, cl)
50+
fmt.Println("platform is ", platform)
51+
o.Expect(err).ToNot(o.HaveOccurred(), "Failed to get platform")
52+
if platform != configv1.GCPPlatformType {
53+
g.Skip("Skipping GCP E2E tests")
54+
}
55+
56+
namespace = "default"
57+
})
58+
59+
g.AfterAll(func() {
60+
for _, svcName := range createdServices {
61+
service := &corev1.Service{
62+
ObjectMeta: metav1.ObjectMeta{
63+
Name: svcName,
64+
Namespace: namespace,
65+
},
66+
}
67+
_ = cl.Delete(ctx, service)
68+
}
69+
})
70+
71+
g.It("should add annotations to a LoadBalancer service without annotations", func() {
72+
service := &corev1.Service{
73+
ObjectMeta: metav1.ObjectMeta{
74+
Name: "test-service-add-annotations",
75+
Namespace: namespace,
76+
},
77+
Spec: corev1.ServiceSpec{
78+
Type: corev1.ServiceTypeLoadBalancer,
79+
Selector: map[string]string{"app": "test"},
80+
Ports: []corev1.ServicePort{{
81+
Port: 80,
82+
}},
83+
},
84+
}
85+
o.Expect(cl.Create(ctx, service)).To(o.Succeed())
86+
createdServices = append(createdServices, service.Name)
87+
88+
o.Eventually(func() (string, error) {
89+
updatedService := &corev1.Service{}
90+
err := cl.Get(ctx, client.ObjectKey{Name: service.Name, Namespace: namespace}, updatedService)
91+
if err != nil {
92+
return "", err
93+
}
94+
if len(updatedService.Status.LoadBalancer.Ingress) > 0 {
95+
return updatedService.Status.LoadBalancer.Ingress[0].IP, nil
96+
}
97+
98+
return "", nil
99+
}, 2*time.Minute, 10*time.Second).ShouldNot(o.BeEmpty(), "LoadBalancer service did not get an external IP")
100+
101+
// Add annotations
102+
latestService := &corev1.Service{}
103+
o.Expect(cl.Get(ctx, client.ObjectKey{Name: service.Name, Namespace: namespace}, latestService)).To(o.Succeed())
104+
latestService.Annotations = annotationsToTest
105+
o.Expect(cl.Update(ctx, latestService)).To(o.Succeed())
106+
107+
// Verify annotations
108+
updatedService := &corev1.Service{}
109+
o.Expect(cl.Get(ctx, client.ObjectKey{Name: service.Name, Namespace: namespace}, updatedService)).To(o.Succeed())
110+
for key, value := range annotationsToTest {
111+
o.Expect(updatedService.Annotations).To(o.HaveKeyWithValue(key, value))
112+
}
113+
})
114+
115+
g.It("should update annotations of a LoadBalancer service", func() {
116+
service := &corev1.Service{
117+
ObjectMeta: metav1.ObjectMeta{
118+
Name: "test-service-update-annotations",
119+
Namespace: namespace,
120+
Annotations: annotationsToTest,
121+
},
122+
Spec: corev1.ServiceSpec{
123+
Type: corev1.ServiceTypeLoadBalancer,
124+
Selector: map[string]string{"app": "test"},
125+
Ports: []corev1.ServicePort{{
126+
Port: 80,
127+
}},
128+
},
129+
}
130+
o.Expect(cl.Create(ctx, service)).To(o.Succeed())
131+
createdServices = append(createdServices, service.Name)
132+
133+
// Update annotations
134+
updatedAnnotations := map[string]string{
135+
"traffic-policy.network.alpha.openshift.io/local-with-fallback": "false",
136+
}
137+
latestService := &corev1.Service{}
138+
o.Expect(cl.Get(ctx, client.ObjectKey{Name: service.Name, Namespace: namespace}, latestService)).To(o.Succeed())
139+
for key, value := range updatedAnnotations {
140+
latestService.Annotations[key] = value
141+
}
142+
o.Expect(cl.Update(ctx, latestService)).To(o.Succeed())
143+
144+
// Verify updated annotations
145+
updatedService := &corev1.Service{}
146+
o.Expect(cl.Get(ctx, client.ObjectKey{Name: service.Name, Namespace: namespace}, updatedService)).To(o.Succeed())
147+
for key, value := range updatedAnnotations {
148+
o.Expect(updatedService.Annotations).To(o.HaveKeyWithValue(key, value))
149+
}
150+
})
151+
152+
g.It("should remove annotations from a LoadBalancer service", func() {
153+
service := &corev1.Service{
154+
ObjectMeta: metav1.ObjectMeta{
155+
Name: "test-service-remove-annotations",
156+
Namespace: namespace,
157+
Annotations: annotationsToTest,
158+
},
159+
Spec: corev1.ServiceSpec{
160+
Type: corev1.ServiceTypeLoadBalancer,
161+
Selector: map[string]string{"app": "test"},
162+
Ports: []corev1.ServicePort{{
163+
Port: 80,
164+
}},
165+
},
166+
}
167+
o.Expect(cl.Create(ctx, service)).To(o.Succeed())
168+
createdServices = append(createdServices, service.Name)
169+
170+
// Remove annotations
171+
latestService := &corev1.Service{}
172+
o.Expect(cl.Get(ctx, client.ObjectKey{Name: service.Name, Namespace: namespace}, latestService)).To(o.Succeed())
173+
latestService.Annotations = nil
174+
o.Expect(cl.Update(ctx, latestService)).To(o.Succeed())
175+
176+
// Verify annotations are removed
177+
updatedService := &corev1.Service{}
178+
o.Expect(cl.Get(ctx, client.ObjectKey{Name: service.Name, Namespace: namespace}, updatedService)).To(o.Succeed())
179+
o.Expect(updatedService.Annotations).To(o.BeNil())
180+
})
181+
})

pkg/e2e_test.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ import (
1616
caov1alpha1 "github.com/openshift/cluster-autoscaler-operator/pkg/apis"
1717
awsv1 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
1818
azurev1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
19+
gcpv1 "sigs.k8s.io/cluster-api-provider-gcp/api/v1beta1"
1920
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
2021

22+
_ "github.com/openshift/cluster-api-actuator-pkg/pkg/annotations"
2123
_ "github.com/openshift/cluster-api-actuator-pkg/pkg/autoscaler"
2224
_ "github.com/openshift/cluster-api-actuator-pkg/pkg/capi"
2325
_ "github.com/openshift/cluster-api-actuator-pkg/pkg/infra"
@@ -50,6 +52,10 @@ func init() {
5052
klog.Fatal(err)
5153
}
5254

55+
if err := gcpv1.AddToScheme(scheme.Scheme); err != nil {
56+
klog.Fatal(err)
57+
}
58+
5359
if err := awsv1.AddToScheme(scheme.Scheme); err != nil {
5460
klog.Fatal(err)
5561
}
@@ -71,7 +77,7 @@ var _ = BeforeSuite(func() {
7177

7278
// Extend timeouts for slower providers
7379
switch platform {
74-
case osconfigv1.AzurePlatformType, osconfigv1.VSpherePlatformType, osconfigv1.OpenStackPlatformType, osconfigv1.PowerVSPlatformType, osconfigv1.NutanixPlatformType:
80+
case osconfigv1.AzurePlatformType, osconfigv1.GCPPlatformType, osconfigv1.VSpherePlatformType, osconfigv1.OpenStackPlatformType, osconfigv1.PowerVSPlatformType, osconfigv1.NutanixPlatformType:
7581
framework.WaitShort = 2 * time.Minute // Normally 1m
7682
framework.WaitMedium = 6 * time.Minute // Normally 3m
7783
framework.WaitLong = 30 * time.Minute // Normally 15m

vendor/github.com/klauspost/compress/.gitattributes

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)