Skip to content

Commit

Permalink
expect for variadic arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
tatlat committed Jan 16, 2024
1 parent b39cf7d commit 3476508
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/clustermanager/cluster_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ func (cc ClusterCreator) buildClusterAccess(ctx context.Context, clusterName str
Name: clusterName,
}

fsOptions := []filewriter.FileOptionsFunc{filewriter.PersistentFile, filewriter.Permission0600}
fh, path, err := cc.fs.Create(
kubeconfig.FormatWorkloadClusterKubeconfigFilename(clusterName),
filewriter.PersistentFile,
filewriter.Permission0600,
fsOptions...,
)
if err != nil {
return nil, err
Expand Down
4 changes: 3 additions & 1 deletion pkg/clustermanager/cluster_creator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/aws/eks-anywhere/pkg/cluster"
"github.com/aws/eks-anywhere/pkg/clustermanager"
"github.com/aws/eks-anywhere/pkg/clustermanager/mocks"
"github.com/aws/eks-anywhere/pkg/filewriter"
mockswriter "github.com/aws/eks-anywhere/pkg/filewriter/mocks"
"github.com/aws/eks-anywhere/pkg/kubeconfig"
mockskubeconfig "github.com/aws/eks-anywhere/pkg/kubeconfig/mocks"
Expand Down Expand Up @@ -50,7 +51,8 @@ func newClusterCreator(t *testing.T) (*clustermanager.ClusterCreator, *clusterCr
}

func (cct *clusterCreatorTest) expectFileCreate(clusterName, path string, w io.WriteCloser) {
cct.writer.EXPECT().Create(kubeconfig.FormatWorkloadClusterKubeconfigFilename(clusterName), gomock.Any(), gomock.Any()).Return(w, path, nil)
//opts := []interface{}{filewriter.PersistentFile, filewriter.Permission0600}

Check failure on line 54 in pkg/clustermanager/cluster_creator_test.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed (gofumpt)
cct.writer.EXPECT().Create(kubeconfig.FormatWorkloadClusterKubeconfigFilename(clusterName), gomock.AssignableToTypeOf([]filewriter.FileOptionsFunc{})).Return(w, path, nil)
}

func (cct *clusterCreatorTest) expectWriteKubeconfig(ctx context.Context, clusterName, kubeconfig string, w io.Writer) {
Expand Down

0 comments on commit 3476508

Please sign in to comment.