diff --git a/pkg/clustermanager/cluster_creator_test.go b/pkg/clustermanager/cluster_creator_test.go index 9c049926a5ea9..8a16344584da2 100644 --- a/pkg/clustermanager/cluster_creator_test.go +++ b/pkg/clustermanager/cluster_creator_test.go @@ -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) diff --git a/pkg/kubeconfig/kubeconfig_writer_test.go b/pkg/kubeconfig/kubeconfig_writer_test.go index 67a700d2f4137..8c7f727a3328b 100644 --- a/pkg/kubeconfig/kubeconfig_writer_test.go +++ b/pkg/kubeconfig/kubeconfig_writer_test.go @@ -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 {