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

HARVESTER: Fix HARVESTER v1.0.3 VM issues #6560

Merged
merged 6 commits into from
Aug 3, 2022

Conversation

n313893254
Copy link
Contributor

@n313893254 n313893254 commented Aug 1, 2022

Summary

Fixes VM issues

Occurred changes and/or fixed issues

Technical notes summary

  • cloneValue is a steve model and loss most of the spec property, need to cloneSpec to clone the real spec.
  • Wrap reservedMemory as a component is a workaround for avoiding $attrs changed every time when the resource is updated by the Websocket.

Areas or cases that should be tested

Areas which could experience regressions

Screenshot/Video

@n313893254 n313893254 marked this pull request as ready for review August 1, 2022 16:03
@n313893254 n313893254 changed the title HARVESTER: Fix VM issues HARVESTER: Fix HARVESTER v1.0.3 VM issues Aug 1, 2022
@richard-cox richard-cox added this to the v2.7.0 milestone Aug 2, 2022
@richard-cox
Copy link
Member

@n313893254 This one too, is now targeted to merge in 2.7.0

@@ -156,6 +150,14 @@ export default {
});
}
});

try {
const { data: nodes } = await this.$store.dispatch('cluster/request', { url: `${ url }/${ NODE }s` });
Copy link
Member

Choose a reason for hiding this comment

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

Why did this request need to move out of the allHashSettled above?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to catch the errors of node's request since the response of node may have 404/500 error code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for I missed the link to the issue 2567 that the local cluster owner has no permission to access the node resource.

const inStore = this.overrideStore || this.$store.getters['currentStore'](NAMESPACE);
let choices = this.$store.getters[`${ inStore }/all`](NAMESPACE);

if (this.overrideStore === HARVESTER) {
Copy link
Member

Choose a reason for hiding this comment

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

We are trying to reduce harvester-specific code in generic components as part of making a Harvester plugin. It is important to look for alternative solutions to this type of logic. See my comment in the harvester machine-config.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am going to remove the overrideStore prop, we can pass namespaces into podAffinity.

}
},

hasNamespaces: {
Copy link
Member

Choose a reason for hiding this comment

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

This also doesn't need to be a prop: compute from this.allNamespaces.length

default: ''
},

hasNodes: {
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't need to be a prop: compute from this.nodes.length

Changing this to a computed property will change the UX in workload pod scheduling, but I think the behavior in harvester machine-config is preferable there, too. eg if a user making a workload can't see nodes, they could still type in a topology key.

:nodes="allNodeObjects"
:has-nodes="allNodeObjects.length > 0"
:has-namespaces="isImportCluster"
override-store="harvester"
Copy link
Member

Choose a reason for hiding this comment

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

Since the harvester machine-config component already has a list of namespaceOptions, we can pass that through as a prop and override choices in allNamespaces. Then we keep harvester-specific code out of the PodAffinity component.

@mantis-toboggan-md mantis-toboggan-md modified the milestones: v2.7.0, v2.6.7 Aug 3, 2022
@n313893254
Copy link
Contributor Author

@mantis-toboggan-md Done, thanks for your review.

@mantis-toboggan-md mantis-toboggan-md merged commit 55b0564 into rancher:master Aug 3, 2022
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.

5 participants