Skip to content

Commit 1afb2f1

Browse files
committed
cleanup and remove unused
1 parent 1408096 commit 1afb2f1

File tree

5 files changed

+11
-100
lines changed

5 files changed

+11
-100
lines changed

.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e-step-template.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ steps:
9797
retryCountOnTaskFailure: 3
9898
name: "CiliumStatus"
9999
displayName: "Cilium Status"
100-
100+
# Run LRP test after cns and config with lrp enabled config deployed
101101
- ${{ if eq( parameters['testLRP'], true) }}:
102102
- script: |
103103
set -e
104-
kubectl get pods -Aowide
105104
cd test/integration/lrp/
106105
go test ./lrp_test.go -v -tags "lrp" -count=1 -run ^TestLRP$
106+
kubectl get pods -Aowide
107107
retryCountOnTaskFailure: 3
108108
name: "LRPTest"
109109
displayName: "Run Cilium Local Redirect Policy Test"

test/integration/lrp/lrp_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ var (
4545
)
4646

4747
// TestLRP tests if the local redirect policy in a cilium cluster is functioning
48-
// The test assumes the current kubeconfig points to a cluster with cilium and kube-dns already installed
49-
// and with the lrp feature flag enabled in the cilium config
48+
// The test assumes the current kubeconfig points to a cluster with cilium (1.16+), cns,
49+
// and kube-dns already installed. The lrp feature flag should be enabled in the cilium config
5050
// Resources created are automatically cleaned up
5151
// From the lrp folder, run: go test ./lrp_test.go -v -tags "lrp" -run ^TestLRP$
5252
func TestLRP(t *testing.T) {
@@ -70,7 +70,7 @@ func TestLRP(t *testing.T) {
7070
// replace pillar dns
7171
replaced := strings.ReplaceAll(string(nodeLocalDNSContent), "__PILLAR__DNS__SERVER__", kubeDNS)
7272
// Write the updated content back to the file
73-
err = os.WriteFile(tempNodeLocalDNSDaemonsetPath, []byte(replaced), 0644)
73+
err = os.WriteFile(tempNodeLocalDNSDaemonsetPath, []byte(replaced), 0o644)
7474
require.NoError(t, err)
7575
defer func() {
7676
err := os.Remove(tempNodeLocalDNSDaemonsetPath)
@@ -166,6 +166,7 @@ func TestLRP(t *testing.T) {
166166
// count should go up
167167
require.Greater(t, afterMetric.GetCounter().GetValue(), beforeMetric.GetCounter().GetValue(), "dns metric count did not increase after nslookup")
168168
}
169+
169170
func TakeOne[T any](slice []T) T {
170171
if len(slice) == 0 {
171172
var zero T

test/integration/manifests/cilium/lrp/cilium-config-lrp.yaml

Lines changed: 0 additions & 89 deletions
This file was deleted.

test/internal/kubernetes/utils_create.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@ package kubernetes
22

33
import (
44
"context"
5-
6-
ciliumv2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2"
7-
typedciliumv2 "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2"
8-
95
"log"
106
"os"
117
"path"
128
"path/filepath"
139
"runtime"
1410
"strconv"
1511

12+
ciliumv2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2"
13+
typedciliumv2 "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2"
14+
1615
"github.com/pkg/errors"
1716
appsv1 "k8s.io/api/apps/v1"
1817
corev1 "k8s.io/api/core/v1"
@@ -83,7 +82,7 @@ func MustCreateDaemonset(ctx context.Context, daemonsets typedappsv1.DaemonSetIn
8382
MustDeleteDaemonset(ctx, daemonsets, ds)
8483
log.Printf("Creating Daemonset %v", ds.Name)
8584
if _, err := daemonsets.Create(ctx, &ds, metav1.CreateOptions{}); err != nil {
86-
log.Fatal(errors.Wrap(err, "failed to create daemonset"), ds)
85+
log.Fatal(errors.Wrap(err, "failed to create daemonset"))
8786
}
8887
}
8988

test/internal/kubernetes/utils_get.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func GetDeploymentAvailableReplicas(ctx context.Context, deploymentsClient typed
6363
}
6464

6565
func GetService(ctx context.Context, clientset *kubernetes.Clientset, namespace, name string) (*corev1.Service, error) {
66-
service, err := clientset.CoreV1().Services("kube-system").Get(ctx, "kube-dns", metav1.GetOptions{})
66+
service, err := clientset.CoreV1().Services(namespace).Get(ctx, name, metav1.GetOptions{})
6767
if err != nil {
6868
return service, errors.Wrap(err, "could not get service")
6969
}

0 commit comments

Comments
 (0)