Skip to content

Commit

Permalink
fix file descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
tatlat committed Jan 16, 2024
1 parent 2065e57 commit b39cf7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/clustermanager/cluster_creator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestClusterCreatorCreateSync(t *testing.T) {
clusCreator, tt := newClusterCreator(t)
clusterName := tt.spec.Cluster.Name
path := "testpath"
writer := os.NewFile(uintptr(*pointer.Uint(1)), "test")
writer := os.NewFile(uintptr(*pointer.Uint(0)), "test")
tt.expectApplierRun(tt.ctx, tt.spec, *tt.mgmtCluster)
tt.expectWriteKubeconfig(tt.ctx, clusterName, tt.mgmtCluster.KubeconfigFile, writer)
tt.expectFileCreate(clusterName, path, writer)
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubeconfig/kubeconfig_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestWriteKubeconfig(t *testing.T) {
}
for _, tc := range tests {
writer, tt := newKubeconfigWriter(t)
buf := bytes.NewBuffer([]byte{})
buf := bytes.NewBuffer(make([]byte, tc.secret.Size()))
tt.buildClient(tc.buildErr, tc.secret)
err := writer.WriteKubeconfig(tt.ctx, tc.clusterName, tt.mgmtCluster.KubeconfigFile, buf)
if !tc.expectErr {
Expand Down

0 comments on commit b39cf7d

Please sign in to comment.