Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
tatlat committed Feb 14, 2024
1 parent e65577d commit 379dbca
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 23 deletions.
5 changes: 0 additions & 5 deletions pkg/clustermanager/cluster_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1403,11 +1403,6 @@ func (c *ClusterManager) DeletePackageResources(ctx context.Context, managementC
return c.clusterClient.DeletePackageResources(ctx, managementCluster, clusterName)
}

// CreateNamespace creates a namespace on the target cluster if it does not already exist.
func (c *ClusterManager) CreateNamespace(ctx context.Context, targetCluster *types.Cluster, namespace string) error {
return c.clusterClient.CreateNamespaceIfNotPresent(ctx, targetCluster.KubeconfigFile, namespace)
}

func (c *ClusterManager) getUpgraderImagesFromBundle(ctx context.Context, cluster *types.Cluster, cl *cluster.Spec) (*corev1.ConfigMap, error) {
upgraderImages := make(map[string]string)
for _, versionBundle := range cl.Bundles.Spec.VersionsBundles {
Expand Down
3 changes: 2 additions & 1 deletion pkg/workflows/create_prep.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package workflows
import (
"context"

"github.com/aws/eks-anywhere/pkg/workflows/interfaces"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/aws/eks-anywhere/pkg/workflows/interfaces"
)

// CreateNamespaceIfNotPresent creates the namespace on the cluster if it does not already exist.
Expand Down
3 changes: 1 addition & 2 deletions pkg/workflows/create_prep_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"testing"

"github.com/golang/mock/gomock"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -13,7 +14,6 @@ import (
clientmocks "github.com/aws/eks-anywhere/pkg/clients/kubernetes/mocks"
"github.com/aws/eks-anywhere/pkg/workflows"
"github.com/aws/eks-anywhere/pkg/workflows/interfaces/mocks"
"github.com/golang/mock/gomock"
)

type createPrepTestSetup struct {
Expand Down Expand Up @@ -54,7 +54,6 @@ func TestCreateNamespaceNotExists(t *testing.T) {
test.client.EXPECT().Create(test.ctx, newNamespace(namespace)).Return(nil)

err := workflows.CreateNamespaceIfNotPresent(test.ctx, namespace, kubeconfig, test.clientFactory)

if err != nil {
t.Fatalf("Expected nil, but got %v", err)
}
Expand Down
1 change: 0 additions & 1 deletion pkg/workflows/interfaces/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ type ClusterManager interface {
GenerateIamAuthKubeconfig(ctx context.Context, management, workload *types.Cluster, spec *cluster.Spec) error
DeletePackageResources(ctx context.Context, managementCluster *types.Cluster, clusterName string) error
CreateRegistryCredSecret(ctx context.Context, mgmt *types.Cluster) error
CreateNamespace(ctx context.Context, targetCluster *types.Cluster, namespace string) error
}

type GitOpsManager interface {
Expand Down
14 changes: 0 additions & 14 deletions pkg/workflows/interfaces/mocks/clients.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 379dbca

Please sign in to comment.