Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No need to add read-only objects to client #308

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 1 addition & 34 deletions pkg/controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -818,8 +818,6 @@ func TestSyncDefaultBackend(t *testing.T) {
f.secretStore = append(f.secretStore, nghttpxSecret)
f.epSliceStore = append(f.epSliceStore, ess...)

f.objects = append(f.objects, cm, svc)

f.prepare()
f.run()

Expand Down Expand Up @@ -877,8 +875,6 @@ func TestSyncDefaultTLSSecretNotFound(t *testing.T) {
f.svcStore = append(f.svcStore, svc)
f.epSliceStore = append(f.epSliceStore, ess...)

f.objects = append(f.objects, svc)

f.prepare()
f.lbc.defaultTLSSecret = &types.NamespacedName{
Namespace: "kube-system",
Expand All @@ -901,8 +897,6 @@ func TestSyncDefaultSecret(t *testing.T) {
f.svcStore = append(f.svcStore, svc)
f.epSliceStore = append(f.epSliceStore, ess...)

f.objects = append(f.objects, tlsSecret, svc)

f.prepare()
f.lbc.defaultTLSSecret = &types.NamespacedName{
Namespace: tlsSecret.Namespace,
Expand Down Expand Up @@ -960,8 +954,6 @@ func TestSyncDupDefaultSecret(t *testing.T) {
f.epSliceStore = append(f.epSliceStore, ess...)
f.epSliceStore = append(f.epSliceStore, bes1)

f.objects = append(f.objects, tlsSecret, svc, bs1, ing1)

f.prepare()
f.lbc.defaultTLSSecret = &types.NamespacedName{
Namespace: tlsSecret.Namespace,
Expand Down Expand Up @@ -1038,8 +1030,6 @@ Qu6PQqBCMaMh3xbmq1M9OwKwW/NwU0GW7w==
f.epSliceStore = append(f.epSliceStore, ess...)
f.epSliceStore = append(f.epSliceStore, bes1)

f.objects = append(f.objects, tlsSecret, svc, bs1, ing1)

f.prepare()
f.run()

Expand Down Expand Up @@ -1152,8 +1142,6 @@ func TestSyncStringNamedPort(t *testing.T) {
f.podStore = append(f.podStore, bp1, bp2)
f.secretStore = append(f.secretStore, nghttpxSecret)

f.objects = append(f.objects, svc, bs1, ing1, bp1, bp2)

f.prepare()
f.run()

Expand Down Expand Up @@ -1205,8 +1193,6 @@ func TestSyncEmptyTargetPort(t *testing.T) {
f.ingStore = append(f.ingStore, ing1)
f.secretStore = append(f.secretStore, nghttpxSecret)

f.objects = append(f.objects, svc, bs1, ing1)

f.prepare()
f.run()

Expand Down Expand Up @@ -1255,8 +1241,6 @@ func TestSyncWithoutSelectors(t *testing.T) {
f.ingStore = append(f.ingStore, ing1)
f.secretStore = append(f.secretStore, nghttpxSecret)

f.objects = append(f.objects, svc, bs1, ing1)

f.prepare()
f.run()

Expand Down Expand Up @@ -1400,8 +1384,6 @@ func TestSyncIngressDefaultBackend(t *testing.T) {
f.ingStore = append(f.ingStore, ing1)
f.secretStore = append(f.secretStore, nghttpxSecret)

f.objects = append(f.objects, svc, bs1, ing1, bs2)

f.prepare()
f.run()

Expand Down Expand Up @@ -1562,11 +1544,8 @@ func TestGetLoadBalancerIngressSelector(t *testing.T) {
f.podStore = append(f.podStore, po1, po2)
f.nodeStore = append(f.nodeStore, node2)

f.objects = append(f.objects, po1, po2, node2)

if tt.hostNetwork {
f.nodeStore = append(f.nodeStore, node1)
f.objects = append(f.objects, node1)
}

f.preparePod(po1)
Expand Down Expand Up @@ -1641,7 +1620,7 @@ func TestSyncIngress(t *testing.T) {

f.ingStore = append(f.ingStore, tt.ingress)
f.podStore = append(f.podStore, ingPo1, ingPo2)
f.objects = append(f.objects, tt.ingress, ingPo1, ingPo2)
f.objects = append(f.objects, tt.ingress)

if !reflect.DeepEqual(tt.wantLoadBalancerIngresses, tt.ingress.Status.LoadBalancer.Ingress) {
f.expectUpdateIngAction(tt.ingress)
Expand Down Expand Up @@ -1694,8 +1673,6 @@ func TestSyncNamedServicePort(t *testing.T) {
f.ingStore = append(f.ingStore, ing1)
f.secretStore = append(f.secretStore, nghttpxSecret)

f.objects = append(f.objects, svc, bs1, ing1)

f.prepare()
f.run()

Expand Down Expand Up @@ -1791,8 +1768,6 @@ func TestSyncDoNotForward(t *testing.T) {
f.ingStore = append(f.ingStore, ing1)
f.secretStore = append(f.secretStore, nghttpxSecret)

f.objects = append(f.objects, svc, ing1)

f.prepare()
f.run()

Expand Down Expand Up @@ -1866,8 +1841,6 @@ func TestSyncNormalizePath(t *testing.T) {
f.ingStore = append(f.ingStore, ing1)
f.secretStore = append(f.secretStore, nghttpxSecret)

f.objects = append(f.objects, svc, bs1, ing1)

f.prepare()
f.run()

Expand Down Expand Up @@ -2655,8 +2628,6 @@ func TestSyncIgnoreUpstreamsWithInconsistentBackendParams(t *testing.T) {
f.ingStore = append(f.ingStore, ing1, ing2, ing3)
f.secretStore = append(f.secretStore, nghttpxSecret)

f.objects = append(f.objects, svc, bs1, bs2, bs3, ing1, ing2, ing3)

f.prepare()
f.run()

Expand Down Expand Up @@ -2720,8 +2691,6 @@ func TestSyncEmptyAffinityCookieName(t *testing.T) {
f.ingStore = append(f.ingStore, ing1, ing2, ing3)
f.secretStore = append(f.secretStore, nghttpxSecret)

f.objects = append(f.objects, svc, bs1, bs2, bs3, ing1, ing2, ing3)

f.prepare()
f.run()

Expand Down Expand Up @@ -2805,8 +2774,6 @@ func TestSyncWithTLSTicketKey(t *testing.T) {
f.svcStore = append(f.svcStore, svc)
f.epSliceStore = append(f.epSliceStore, ess...)

f.objects = append(f.objects, tlsSecret, nghttpxSecret, svc)

f.prepare()
f.lbc.defaultTLSSecret = &types.NamespacedName{
Namespace: tlsSecret.Namespace,
Expand Down
Loading