Skip to content

Commit

Permalink
Merge pull request #2177 from avivtur/bug-secret-not-created-on-templ…
Browse files Browse the repository at this point in the history
…ate-quick-create-flow

CNV-47291: public ssh key credential does not get created
  • Loading branch information
openshift-merge-bot[bot] authored Sep 16, 2024
2 parents 6f58d9b + ba4b3fe commit 7f473a4
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import {
} from '@kubevirt-ui/kubevirt-api/console';
import VirtualMachineModel from '@kubevirt-ui/kubevirt-api/console/models/VirtualMachineModel';
import { updateCloudInitRHELSubscription } from '@kubevirt-utils/components/CloudinitModal/utils/cloudinit-utils';
import { SecretSelectionOption } from '@kubevirt-utils/components/SSHSecretModal/utils/types';
import {
addSecretToVM,
applyCloudDriveCloudInitVolume,
createSSHSecret,
} from '@kubevirt-utils/components/SSHSecretModal/utils/utils';
import { logTemplateFlowEvent } from '@kubevirt-utils/extensions/telemetry/telemetry';
import {
Expand Down Expand Up @@ -154,6 +156,11 @@ const useCreateDrawerForm = (
vm: getTemplateVirtualMachineObject(processedTemplate),
}),
});

if (sshDetails?.secretOption === SecretSelectionOption.addNew) {
await createSSHSecret(sshDetails?.sshPubKey, sshDetails?.sshSecretName, namespace);
}

setIsQuickCreating(false);
navigate(getResourceUrl({ model: VirtualMachineModel, resource: quickCreatedVM }));
logTemplateFlowEvent(CREATE_VM_SUCCEEDED, templateToProcess);
Expand Down

0 comments on commit 7f473a4

Please sign in to comment.