Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.1'
go-version-file: go.mod

- name: Download dependencies
run: go mod download
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.1'
go-version-file: go.mod

- name: Build
run: make build
Expand Down
228 changes: 117 additions & 111 deletions go.mod

Large diffs are not rendered by default.

638 changes: 304 additions & 334 deletions go.sum

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions pkg/argocd/foundational_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestCreateNamespace(t *testing.T) {
ctx := context.Background()

t.Run("creates new namespace", func(t *testing.T) {
client := fake.NewSimpleClientset() //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset()

err := createNamespace(ctx, client, "test-namespace")
if err != nil {
Expand All @@ -49,7 +49,7 @@ func TestCreateNamespace(t *testing.T) {
Name: "existing-namespace",
},
}
client := fake.NewSimpleClientset(existingNS) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(existingNS)

err := createNamespace(ctx, client, "existing-namespace")
if err != nil {
Expand All @@ -68,7 +68,7 @@ func TestCreateKeycloakSecrets(t *testing.T) {
Name: "keycloak",
},
}
client := fake.NewSimpleClientset(ns) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(ns)

cfg := KeycloakConfig{
Enabled: true,
Expand Down Expand Up @@ -121,7 +121,7 @@ func TestCreateKeycloakSecrets(t *testing.T) {
Name: "keycloak",
},
}
client := fake.NewSimpleClientset(ns) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(ns)

cfg := KeycloakConfig{
Enabled: true,
Expand Down Expand Up @@ -159,7 +159,7 @@ func TestCreateKeycloakSecrets(t *testing.T) {
Name: "keycloak",
},
}
client := fake.NewSimpleClientset(ns) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(ns)

cfg := KeycloakConfig{
Enabled: true,
Expand Down Expand Up @@ -196,7 +196,7 @@ func TestCreateKeycloakSecrets(t *testing.T) {
"admin-password": []byte("existing-password"),
},
}
client := fake.NewSimpleClientset(ns, existingSecret) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(ns, existingSecret)

cfg := KeycloakConfig{
Enabled: true,
Expand Down Expand Up @@ -295,7 +295,7 @@ func TestCreateKeycloakSecrets_CreatesArgoCDOIDCSecret(t *testing.T) {
Name: "keycloak",
},
}
client := fake.NewSimpleClientset(ns) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(ns)

keycloakCfg := KeycloakConfig{
Enabled: true,
Expand Down Expand Up @@ -338,7 +338,7 @@ func TestCreateKeycloakSecrets_SkipsArgoCDSecretWhenEmpty(t *testing.T) {
Name: "keycloak",
},
}
client := fake.NewSimpleClientset(ns) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(ns)

keycloakCfg := KeycloakConfig{
Enabled: true,
Expand Down
14 changes: 7 additions & 7 deletions pkg/argocd/secrets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestConfigureOCIAccess(t *testing.T) {
ns := &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{Name: namespace},
}
client := fake.NewSimpleClientset(ns) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(ns)

err := ConfigureOCIAccess(ctx, client, namespace)
if err != nil {
Expand Down Expand Up @@ -78,7 +78,7 @@ func TestConfigureOCIAccess(t *testing.T) {
"old-key": []byte("old-value"),
},
}
client := fake.NewSimpleClientset(ns, existingSecret) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(ns, existingSecret)

err := ConfigureOCIAccess(ctx, client, namespace)
if err != nil {
Expand All @@ -103,7 +103,7 @@ func TestConfigureGitRepoAccess(t *testing.T) {
namespace := "argocd"

t.Run("returns nil when no git repository configured", func(t *testing.T) {
client := fake.NewSimpleClientset() //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset()

err := ConfigureGitRepoAccess(ctx, client, nil, namespace)
if err != nil {
Expand All @@ -121,7 +121,7 @@ func TestConfigureGitRepoAccess(t *testing.T) {
ns := &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{Name: namespace},
}
client := fake.NewSimpleClientset(ns) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(ns)

gitConfig := &git.Config{
URL: "https://github.com/example/repo.git",
Expand Down Expand Up @@ -166,7 +166,7 @@ func TestConfigureGitRepoAccess(t *testing.T) {
ns := &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{Name: namespace},
}
client := fake.NewSimpleClientset(ns) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(ns)

gitConfig := &git.Config{
URL: "https://github.com/example/repo.git",
Expand Down Expand Up @@ -198,7 +198,7 @@ func TestConfigureGitRepoAccess(t *testing.T) {
"old-key": []byte("old-value"),
},
}
client := fake.NewSimpleClientset(ns, existingSecret) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(ns, existingSecret)

gitConfig := &git.Config{
URL: "https://github.com/example/new-repo.git",
Expand Down Expand Up @@ -236,7 +236,7 @@ test-ssh-key-content
ns := &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{Name: namespace},
}
client := fake.NewSimpleClientset(ns) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(ns)

gitConfig := &git.Config{
URL: "git@github.com:example/repo.git",
Expand Down
4 changes: 2 additions & 2 deletions pkg/endpoint/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestGetLoadBalancerEndpoint(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
client := fake.NewSimpleClientset(tt.objects...) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(tt.objects...)
ep, err := GetLoadBalancerEndpoint(context.Background(), client, tt.opts...)

if tt.errContains != "" {
Expand Down Expand Up @@ -135,7 +135,7 @@ func TestGetLoadBalancerEndpoint_ContextCancelled(t *testing.T) {
},
Status: corev1.ServiceStatus{},
}
client := fake.NewSimpleClientset(svc) //nolint:staticcheck // SA1019: NewSimpleClientset is deprecated but still functional for tests
client := fake.NewSimpleClientset(svc)

ctx, cancel := context.WithCancel(context.Background())
cancel()
Expand Down
8 changes: 4 additions & 4 deletions pkg/provider/aws/cleanup_k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestSweepLoadBalancerServices(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
//nolint:staticcheck // fake.NewSimpleClientset is still the standard

c := k8sfake.NewSimpleClientset(tt.seed...)

if err := sweepLoadBalancerServices(context.Background(), c); err != nil {
Expand Down Expand Up @@ -151,7 +151,7 @@ func TestCleanupKubernetesResources_HappyPath(t *testing.T) {
Spec: corev1.ServiceSpec{Type: corev1.ServiceTypeLoadBalancer},
}
dyn := newDynamicClientWithGateway(gw)
//nolint:staticcheck

k8s := k8sfake.NewSimpleClientset(svc)

// Short wait: we're validating orchestration, not timing. 200ms is enough
Expand All @@ -172,7 +172,7 @@ func TestCleanupKubernetesResources_HappyPath(t *testing.T) {

func TestWaitForLoadBalancerServicesGone(t *testing.T) {
t.Run("returns nil when no LB services remain", func(t *testing.T) {
//nolint:staticcheck

c := k8sfake.NewSimpleClientset()
err := waitForLoadBalancerServicesGone(context.Background(), c, 500*time.Millisecond)
if err != nil {
Expand All @@ -185,7 +185,7 @@ func TestWaitForLoadBalancerServicesGone(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{Namespace: "default", Name: "stuck"},
Spec: corev1.ServiceSpec{Type: corev1.ServiceTypeLoadBalancer},
}
//nolint:staticcheck

c := k8sfake.NewSimpleClientset(svc)
ctx, cancel := context.WithTimeout(context.Background(), 300*time.Millisecond)
defer cancel()
Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/aws/efs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func TestCreateEFSStorageClassWithClient(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
client := fake.NewSimpleClientset(tt.existing...) //nolint:staticcheck
client := fake.NewSimpleClientset(tt.existing...)

err := createEFSStorageClassWithClient(context.Background(), client, tt.config, tt.efsID)
if tt.wantErr {
Expand Down
8 changes: 4 additions & 4 deletions pkg/storage/longhorn/longhorn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func TestEnsureNamespace(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
client := fake.NewSimpleClientset(tt.existing...) //nolint:staticcheck
client := fake.NewSimpleClientset(tt.existing...)
if err := ensureNamespace(context.Background(), client, tt.namespace); err != nil {
t.Fatalf("ensureNamespace() error = %v", err)
}
Expand Down Expand Up @@ -372,7 +372,7 @@ func TestEnsureISCSIWithClient(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
client := fake.NewSimpleClientset(tt.existing...) //nolint:staticcheck
client := fake.NewSimpleClientset(tt.existing...)
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()

Expand Down Expand Up @@ -445,7 +445,7 @@ func TestWaitForDaemonSetReady(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
ns := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: Namespace}}
client := fake.NewSimpleClientset(ns, tt.ds) //nolint:staticcheck
client := fake.NewSimpleClientset(ns, tt.ds)
err := waitForDaemonSetReady(context.Background(), kubernetes.Interface(client), Namespace, tt.ds.Name, 1*time.Second)
if tt.wantErr && err == nil {
t.Fatal("expected timeout error, got nil")
Expand Down Expand Up @@ -525,7 +525,7 @@ func TestEnsureSoleDefaultStorageClassWithClient(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
client := fake.NewSimpleClientset(tt.existing...) //nolint:staticcheck
client := fake.NewSimpleClientset(tt.existing...)
if err := ensureSoleDefaultStorageClassWithClient(context.Background(), client, tt.keep); err != nil {
t.Fatalf("ensureSoleDefaultStorageClassWithClient() error = %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/longhorn/storage_nodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func TestWarnIfMissingStorageDiskLabel(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
client := fake.NewSimpleClientset(tt.nodes...) //nolint:staticcheck
client := fake.NewSimpleClientset(tt.nodes...)

var mu sync.Mutex
var warned bool
Expand Down
Loading