mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-04 05:06:05 +08:00
Compare commits
18
Commits
v1.6.0
...
v1.6.1-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d31979a91f | ||
|
|
3ef5a14567 | ||
|
|
1e0e2ea867 | ||
|
|
16e5fd3177 | ||
|
|
20696f6801 | ||
|
|
e5b487ebcb | ||
|
|
f058698fb5 | ||
|
|
208496d6f7 | ||
|
|
967966e852 | ||
|
|
f19809da04 | ||
|
|
bc3d9389f2 | ||
|
|
6fbdf5244e | ||
|
|
7b21f6bb2e | ||
|
|
0f6faed2dc | ||
|
|
021de41e68 | ||
|
|
65f4405d29 | ||
|
|
4bae62d046 | ||
|
|
4cc60e22a8 |
@@ -0,0 +1,40 @@
|
|||||||
|
# .github/release.yml
|
||||||
|
changelog:
|
||||||
|
categories:
|
||||||
|
- title: Features
|
||||||
|
labels:
|
||||||
|
- feat
|
||||||
|
- title: Bug Fixes
|
||||||
|
labels:
|
||||||
|
- fix
|
||||||
|
- title: Dependencies
|
||||||
|
labels:
|
||||||
|
- deps
|
||||||
|
- title: Performance
|
||||||
|
labels:
|
||||||
|
- perf
|
||||||
|
- title: Documentation
|
||||||
|
labels:
|
||||||
|
- docs
|
||||||
|
- title: Style
|
||||||
|
labels:
|
||||||
|
- style
|
||||||
|
- title: Build & Continuous Integration
|
||||||
|
labels:
|
||||||
|
- build
|
||||||
|
- ci
|
||||||
|
- title: Security
|
||||||
|
labels:
|
||||||
|
- security
|
||||||
|
- title: Tests
|
||||||
|
labels:
|
||||||
|
- test
|
||||||
|
- title: Refactoring
|
||||||
|
labels:
|
||||||
|
- refactor
|
||||||
|
- title: Chores
|
||||||
|
labels:
|
||||||
|
- chore
|
||||||
|
- title: Others
|
||||||
|
labels:
|
||||||
|
- other
|
||||||
@@ -1,15 +1,17 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"extends": ["config:recommended"],
|
"extends": [
|
||||||
|
"config:recommended",
|
||||||
|
":semanticCommitTypeAll(deps)",
|
||||||
|
":semanticCommitScopeDisabled"
|
||||||
|
],
|
||||||
"baseBranches": [
|
"baseBranches": [
|
||||||
"master",
|
|
||||||
"main",
|
"main",
|
||||||
"/^release-harvester-v\\d+\\.\\d+$/"
|
"/^release-harvester-v\\d+\\.\\d+$/"
|
||||||
],
|
],
|
||||||
"automergeMajor": false,
|
"automergeMajor": false,
|
||||||
"semanticCommits": "enabled",
|
"semanticCommits": "enabled",
|
||||||
"semanticCommitType": "chore",
|
"semanticCommitType": "deps",
|
||||||
"semanticCommitScope": "deps",
|
|
||||||
"prHourlyLimit": 12,
|
"prHourlyLimit": 12,
|
||||||
"timezone": "Asia/Taipei",
|
"timezone": "Asia/Taipei",
|
||||||
"schedule": ["after 10am on sunday"],
|
"schedule": ["after 10am on sunday"],
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ jobs:
|
|||||||
git push origin ${{ needs.setup-target-branch.outputs.target_branch }}
|
git push origin ${{ needs.setup-target-branch.outputs.target_branch }}
|
||||||
|
|
||||||
- name: Run Helm chart releaser
|
- name: Run Helm chart releaser
|
||||||
uses: helm/chart-releaser-action@v1.4.1
|
uses: helm/chart-releaser-action@v1.7.0
|
||||||
with:
|
with:
|
||||||
charts_dir: ./charts
|
charts_dir: ./charts
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
name: "[PR Management] Add PR Label"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [opened, reopened, edited]
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- 'release-harvester-v*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-assign-pr-label:
|
||||||
|
if: github.event.pull_request.draft == false
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.base_ref }}
|
||||||
|
- name: Setup Nodejs and yarn install
|
||||||
|
uses: ./.github/actions/setup
|
||||||
|
- name: Set PR label
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
PR_LABEL=$(node ./scripts/extract-release-label.mjs "${{ github.event.pull_request.title }}")
|
||||||
|
echo "PR_LABEL = $PR_LABEL"
|
||||||
|
gh pr edit ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --add-label "$PR_LABEL"
|
||||||
@@ -7,6 +7,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
- 'release-*'
|
- 'release-*'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
types: [opened, reopened, edited, synchronize]
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- 'release-*'
|
- 'release-*'
|
||||||
@@ -22,6 +23,11 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
uses: ./.github/actions/lint
|
uses: ./.github/actions/lint
|
||||||
|
|
||||||
|
- name: Validate PR title lint
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
shell: bash
|
||||||
|
run: echo "${{ github.event.pull_request.title }}" | npx commitlint
|
||||||
|
|
||||||
- name: Validate commit messages
|
- name: Validate commit messages
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
+11
-10
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "harvester-ui-extension",
|
"name": "harvester-ui-extension",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1-rc2",
|
||||||
"private": false,
|
"private": false,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20.0.0"
|
"node": ">=20.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/plugin-transform-class-static-block": "7.26.0",
|
"@babel/plugin-transform-class-static-block": "7.28.3",
|
||||||
"@rancher/shell": "3.0.5-rc.7",
|
"@rancher/shell": "3.0.5-rc.8",
|
||||||
"cache-loader": "^4.1.0",
|
"cache-loader": "^4.1.0",
|
||||||
"color": "4.2.3",
|
"color": "4.2.3",
|
||||||
"ip": "2.0.1",
|
"ip": "2.0.1",
|
||||||
@@ -16,21 +16,21 @@
|
|||||||
"yaml": "^2.5.1"
|
"yaml": "^2.5.1"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"@types/node": "~20.10.0",
|
"@types/node": "~20.19.0",
|
||||||
"cronstrue": "2.50.0",
|
"cronstrue": "2.59.0",
|
||||||
"d3-color": "3.1.0",
|
"d3-color": "3.1.0",
|
||||||
"ejs": "3.1.10",
|
"ejs": "3.1.10",
|
||||||
"follow-redirects": "1.15.6",
|
"follow-redirects": "1.15.11",
|
||||||
"glob": "7.2.3",
|
"glob": "7.2.3",
|
||||||
"glob-parent": "6.0.2",
|
"glob-parent": "6.0.2",
|
||||||
"json5": "2.2.3",
|
"json5": "2.2.3",
|
||||||
"@types/lodash": "4.17.5",
|
"@types/lodash": "4.17.20",
|
||||||
"merge": "2.1.1",
|
"merge": "2.1.1",
|
||||||
"node-forge": "1.3.1",
|
"node-forge": "1.3.1",
|
||||||
"nth-check": "2.1.1",
|
"nth-check": "2.1.1",
|
||||||
"qs": "6.11.1",
|
"qs": "6.14.0",
|
||||||
"roarr": "7.0.4",
|
"roarr": "7.21.1",
|
||||||
"semver": "7.5.4",
|
"semver": "7.7.2",
|
||||||
"@vue/cli-service/html-webpack-plugin": "^5.0.0"
|
"@vue/cli-service/html-webpack-plugin": "^5.0.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -46,6 +46,7 @@
|
|||||||
"prepare": "husky"
|
"prepare": "husky"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@commitlint/load": "^19.8.1",
|
||||||
"@commitlint/cli": "^19.8.1",
|
"@commitlint/cli": "^19.8.1",
|
||||||
"@commitlint/config-conventional": "^19.8.1",
|
"@commitlint/config-conventional": "^19.8.1",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
softReboot() {
|
softReboot() {
|
||||||
this.vmResource.softrebootVM();
|
this.vmResource.doSoftReboot();
|
||||||
},
|
},
|
||||||
|
|
||||||
showKeysModal() {
|
showKeysModal() {
|
||||||
@@ -372,3 +372,12 @@ export default {
|
|||||||
background: rgb(40, 40, 40);
|
background: rgb(40, 40, 40);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.vm-console .v-popper__arrow-container {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.vm-console .v-popper__popper{
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ const FEATURE_FLAGS = {
|
|||||||
'cpuMemoryHotplug',
|
'cpuMemoryHotplug',
|
||||||
'cdiSettings',
|
'cdiSettings',
|
||||||
'vmCloneRunStrategy',
|
'vmCloneRunStrategy',
|
||||||
]
|
],
|
||||||
|
'v1.6.1': [],
|
||||||
};
|
};
|
||||||
|
|
||||||
const generateFeatureFlags = () => {
|
const generateFeatureFlags = () => {
|
||||||
|
|||||||
@@ -338,6 +338,15 @@ export default {
|
|||||||
saveVM(buttonCb) {
|
saveVM(buttonCb) {
|
||||||
clear(this.errors);
|
clear(this.errors);
|
||||||
|
|
||||||
|
this.validateCPUMemory();
|
||||||
|
|
||||||
|
// block create VM flow if has validation errors
|
||||||
|
if (this.errors.length) {
|
||||||
|
buttonCb(false);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.isSingle) {
|
if (this.isSingle) {
|
||||||
this.saveSingle(buttonCb);
|
this.saveSingle(buttonCb);
|
||||||
} else {
|
} else {
|
||||||
@@ -345,6 +354,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
validateCPUMemory() {
|
||||||
|
const { cpu, memory } = this;
|
||||||
|
|
||||||
|
if ((!cpu)) {
|
||||||
|
this.errors.push(this.t('validation.required', { key: this.t('harvester.virtualMachine.input.cpu') }, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((!memory)) {
|
||||||
|
this.errors.push(this.t('validation.required', { key: this.t('harvester.virtualMachine.input.memory') }, true));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
async saveSingle(buttonCb) {
|
async saveSingle(buttonCb) {
|
||||||
this.parseVM();
|
this.parseVM();
|
||||||
this.value.spec.template.spec.hostname = this.hostname ? this.hostname : this.value.metadata.name;
|
this.value.spec.template.spec.hostname = this.hostname ? this.hostname : this.value.metadata.name;
|
||||||
@@ -466,9 +487,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const cpuMemoryErrors = this.getCPUMemoryValidation();
|
const errors = this.getAccessCredentialsValidation();
|
||||||
const accessCredentialsErrors = this.getAccessCredentialsValidation();
|
|
||||||
const errors = [...cpuMemoryErrors, ...accessCredentialsErrors];
|
|
||||||
|
|
||||||
if (errors.length > 0) {
|
if (errors.length > 0) {
|
||||||
return Promise.reject(errors);
|
return Promise.reject(errors);
|
||||||
|
|||||||
@@ -687,14 +687,12 @@ export default {
|
|||||||
set(this.spec.template.spec, 'domain.memory.maxGuest', this.maxMemory);
|
set(this.spec.template.spec, 'domain.memory.maxGuest', this.maxMemory);
|
||||||
set(this.spec.template.spec, 'domain.resources.limits.memory', this.maxMemory);
|
set(this.spec.template.spec, 'domain.resources.limits.memory', this.maxMemory);
|
||||||
} else {
|
} else {
|
||||||
|
this.spec.template.spec.domain.cpu.maxSockets = 1;
|
||||||
this.spec.template.spec.domain.cpu.sockets = 1;
|
this.spec.template.spec.domain.cpu.sockets = 1;
|
||||||
this.spec.template.spec.domain.cpu.cores = this.cpu;
|
this.spec.template.spec.domain.cpu.cores = this.cpu;
|
||||||
this.spec.template.spec.domain.resources.limits.cpu = this.cpu?.toString();
|
this.spec.template.spec.domain.resources.limits.cpu = this.cpu?.toString();
|
||||||
this.spec.template.spec.domain.resources.limits.memory = this.memory;
|
this.spec.template.spec.domain.resources.limits.memory = this.memory;
|
||||||
// clean below fields as we don't need them if not enable CPU and memory hotplug
|
// clean below fields as we don't need them if not enable CPU and memory hotplug
|
||||||
if (this.spec?.template?.spec?.domain?.cpu?.maxSockets) {
|
|
||||||
delete this.spec.template.spec.domain.cpu.maxSockets;
|
|
||||||
}
|
|
||||||
if (this.spec?.template?.spec?.domain?.memory?.maxGuest) {
|
if (this.spec?.template?.spec?.domain?.memory?.maxGuest) {
|
||||||
delete this.spec.template.spec.domain.memory.maxGuest;
|
delete this.spec.template.spec.domain.memory.maxGuest;
|
||||||
}
|
}
|
||||||
@@ -1361,21 +1359,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getCPUMemoryValidation() {
|
|
||||||
const errors = [];
|
|
||||||
const { cpu, memory } = this;
|
|
||||||
|
|
||||||
if ((!cpu)) {
|
|
||||||
errors.push(this.t('validation.required', { key: this.t('harvester.virtualMachine.input.cpu') }, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((!memory)) {
|
|
||||||
errors.push(this.t('validation.required', { key: this.t('harvester.virtualMachine.input.memory') }, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
return errors;
|
|
||||||
},
|
|
||||||
|
|
||||||
getAccessCredentialsValidation() {
|
getAccessCredentialsValidation() {
|
||||||
const errors = [];
|
const errors = [];
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,12 @@ import Secret from '@shell/models/secret';
|
|||||||
import { NAMESPACE } from '@shell/config/types';
|
import { NAMESPACE } from '@shell/config/types';
|
||||||
|
|
||||||
export default class HciSecret extends Secret {
|
export default class HciSecret extends Secret {
|
||||||
|
// prevent harvester secret detail page be overridden.
|
||||||
|
// See isFullPageOverride in https://github.com/rancher/dashboard/blob/master/shell/components/ResourceDetail/index.vue
|
||||||
|
get fullDetailPageOverride() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
get listLocation() {
|
get listLocation() {
|
||||||
const listLocation = clone(super.listLocation);
|
const listLocation = clone(super.listLocation);
|
||||||
|
|
||||||
|
|||||||
@@ -156,4 +156,8 @@ export default class HciSetting extends HarvesterResource {
|
|||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get disableResourceDetailDrawer() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -327,6 +327,10 @@ export default class VirtVm extends HarvesterResource {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doSoftReboot() {
|
||||||
|
this.doActionGrowl('softreboot', {});
|
||||||
|
}
|
||||||
|
|
||||||
softrebootVM(resources = this) {
|
softrebootVM(resources = this) {
|
||||||
this.$dispatch('promptModal', {
|
this.$dispatch('promptModal', {
|
||||||
resources,
|
resources,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "harvester",
|
"name": "harvester",
|
||||||
"description": "Rancher UI Extension for Harvester",
|
"description": "Rancher UI Extension for Harvester",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1-rc2",
|
||||||
"private": false,
|
"private": false,
|
||||||
"rancher": {
|
"rancher": {
|
||||||
"annotations": {
|
"annotations": {
|
||||||
|
|||||||
@@ -3,17 +3,19 @@ import { HCI as HCI_ANNOTATIONS } from '@pkg/harvester/config/labels-annotations
|
|||||||
export function getVmCPUMemoryValues(vm) {
|
export function getVmCPUMemoryValues(vm) {
|
||||||
if (!vm) {
|
if (!vm) {
|
||||||
return {
|
return {
|
||||||
cpu: 0,
|
cpu: null,
|
||||||
memory: null,
|
memory: null,
|
||||||
isHotplugEnabled: false
|
isHotplugEnabled: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const isHotplugEnabled = isCPUMemoryHotPlugEnabled(vm);
|
const isHotplugEnabled = isCPUMemoryHotPlugEnabled(vm);
|
||||||
|
const { sockets = 1, threads = 1, cores = null } = vm.spec.template.spec.domain.cpu || {};
|
||||||
|
const cpu = cores === null ? null : sockets * threads * cores;
|
||||||
|
|
||||||
if (isHotplugEnabled) {
|
if (isHotplugEnabled) {
|
||||||
return {
|
return {
|
||||||
cpu: vm.spec.template.spec.domain.cpu.sockets,
|
cpu,
|
||||||
memory: vm.spec.template.spec.domain?.memory?.guest || null,
|
memory: vm.spec.template.spec.domain?.memory?.guest || null,
|
||||||
maxCpu: vm.spec.template.spec.domain.cpu?.maxSockets || 0,
|
maxCpu: vm.spec.template.spec.domain.cpu?.maxSockets || 0,
|
||||||
maxMemory: vm.spec.template.spec.domain?.memory?.maxGuest || null,
|
maxMemory: vm.spec.template.spec.domain?.memory?.maxGuest || null,
|
||||||
@@ -21,7 +23,7 @@ export function getVmCPUMemoryValues(vm) {
|
|||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
cpu: vm.spec.template.spec.domain.cpu.cores,
|
cpu,
|
||||||
memory: vm.spec.template.spec.domain.resources?.limits?.memory || null,
|
memory: vm.spec.template.spec.domain.resources?.limits?.memory || null,
|
||||||
isHotplugEnabled
|
isHotplugEnabled
|
||||||
};
|
};
|
||||||
@@ -29,8 +31,5 @@ export function getVmCPUMemoryValues(vm) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isCPUMemoryHotPlugEnabled(vm) {
|
export function isCPUMemoryHotPlugEnabled(vm) {
|
||||||
return vm?.metadata?.annotations[HCI_ANNOTATIONS.VM_CPU_MEMORY_HOTPLUG] === 'true' ||
|
return vm?.metadata?.annotations[HCI_ANNOTATIONS.VM_CPU_MEMORY_HOTPLUG] === 'true' || !!vm?.spec?.template?.spec?.domain?.memory?.maxGuest || false;
|
||||||
!!vm?.spec?.template?.spec?.domain.cpu?.maxSockets ||
|
|
||||||
!!vm?.spec?.template?.spec?.domain?.memory?.maxGuest ||
|
|
||||||
false;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ if [[ "$VERSION" != "$EXTENSION_VERSION" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${TAG_VERSION}" != "$PKG_VERSION" ]]; then
|
if [[ "${TAG_VERSION}" != "${PKG_VERSION}"* ]]; then
|
||||||
echo "Package version $PKG_VERSION in pkg/harvester/package.json does not match tag version ${TAG_VERSION}"
|
echo "Package version $PKG_VERSION in pkg/harvester/package.json does not match tag version ${TAG_VERSION}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
/* eslint-disable no-console */
|
||||||
|
import load from "@commitlint/load";
|
||||||
|
|
||||||
|
if (process.argv.length < 3) {
|
||||||
|
console.error('No PR title as first argument');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const prTitle = process.argv[2];
|
||||||
|
const prLabel = prTitle.split(':')[0].trim();
|
||||||
|
|
||||||
|
const config = await load({ extends: ["./commitlint.config.js"] });
|
||||||
|
const commitPrefix = config?.rules?.['type-enum']?.[2] || [];
|
||||||
|
const label = commitPrefix.includes(prLabel) ? prLabel : 'other';
|
||||||
|
|
||||||
|
console.log(label);
|
||||||
Reference in New Issue
Block a user