Skip to content

Commit

Permalink
fix(CNV-52011): generate random VMExport secret name
Browse files Browse the repository at this point in the history
When running disk-uploader it creates
VMExport secret to store a token that
required by the Export API endpoints.

Currently the name of VMExport secret
is not random generated and will fail to
be created again if the disk-uploader
(as a Tekton Task) will run twice.
As a result, it throws a panic error that
causes the failure of the execution.

Signed-off-by: Ben Oukhanov <[email protected]>
  • Loading branch information
codingben committed Nov 28, 2024
1 parent 796c31b commit 6762428
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/disk-uploader/pkg/secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func CreateVirtualMachineExportSecret(k8sClient kubernetes.Interface, namespace,

v1Secret := &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
GenerateName: name + "-",
Namespace: namespace,
},
StringData: map[string]string{
"token": token,
Expand Down

0 comments on commit 6762428

Please sign in to comment.