Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: failed to create vm template on Rancher managed Harvester #55

Merged
merged 2 commits into from
Jan 2, 2025

Conversation

houhoucoop
Copy link
Collaborator

Summary

Unable to create vm template on Rancher managed Harvester successfully

PR Checklists

  • Do we need to backport this PR change to the Harvester Dashboard?
    • Yes, the relevant PR is at:
  • Are backend engineers aware of UI changes?
    • Yes, the backend owner is:

Related Issue

[BUG] Failed to create vm template on Rancher managed Harvester #7183

Test screenshot/video

Screen.Recording.2024-12-30.at.4.58.04.PM.mov

Extra technical notes summary

@houhoucoop houhoucoop self-assigned this Dec 30, 2024

updateNameNsDescriptionValue(newValue) {
this.templateValue.metadata.name = newValue.metadata.name;
this.templateValue.metadata.namespace = newValue.metadata.namespace;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that line 166 is missing this.templateValue?.metadata?.name in create mode.
Fix it by updating templateValue as the user types.

@a110605 a110605 requested review from torchiaf and a110605 December 30, 2024 09:11
@@ -226,7 +231,7 @@ export default {
:mode="realTemplateMode"
name-label="harvester.vmTemplate.nameNsDescription.name"
:namespaced="true"
@update:value="$emit('update:value', $event)"
@update:value="updateNameNsDescriptionValue"
Copy link
Collaborator

@a110605 a110605 Jan 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared to https://github.com/harvester/dashboard/blob/44458a0e0e2e6848180a7e3b080feb6f55d064f3/pkg/harvester/edit/harvesterhci.io.virtualmachinetemplateversion.vue#L223,

The update value should be templateValue which matches the logic in saveVMT(), even there is no parent component needs $emit('update:templateValue', $event), but it's fine and existing pattern for NameNsDescription to emit an action. (You can search <NameNsDescription in harvester-ui-extension)

<NameNsDescription
      :value="templateValue"
      :mode="realTemplateMode"
      name-label="harvester.vmTemplate.nameNsDescription.name"
      :namespaced="true"
      @update:value="$emit('update:templateValue', $event)"
/>

Remember to update emits: ['update:templateValue'] in line 32.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update in commit 4d48e75.

Copy link
Collaborator

@a110605 a110605 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@houhoucoop houhoucoop merged commit 687943a into harvester:main Jan 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants