-
Notifications
You must be signed in to change notification settings - Fork 103
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
Added support for machine image update strategy #1807
Conversation
Use GMultiMessage component for Kubernetes version on GNewShootDetails Fixed empty tooltip on worker groups Show kubernetes version update information as list
@holgerkoser You have pull request review open invite, please check |
@@ -405,14 +411,13 @@ export const useCloudProfileStore = defineStore('cloudProfile', () => { | |||
continue | |||
} | |||
|
|||
logger.error(`Skipped machine image ${machineImage.name} as version ${versionObj.version} is not a valid semver version and cannot be normalized`) | |||
logger.error(`Skipped machine image ${name} as version ${versionObj.version} is not a valid semver version and cannot be normalized`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be logged as error and not inside the getter. I prosose that we remove it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it should not be logged (as an error) inside the getter. However, if there is no place where we log that we skipped some entries, this might make it harder to troubleshoot issues where an entry is expected to be there but is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the main Problem here is that the machine image getter is not cached (because of param). That's why we get the log message multiple times. We should solve the root problem. @holgerkoser removed it in his refactoring PR afaik
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved the flattening of the machineImages into an own function and call it right after data fetching. The getter now directly returns the already flattened machine images.
async function fetchCloudProfiles () {
const response = await api.getCloudProfiles()
for (const cloudProfile of response.data) {
set(cloudProfile, 'data.machineImages', flattenMachineImages(get(cloudProfile, 'data.machineImages')))
}
list.value = response.data
}
function flattenMachineImages (machineImages) {
return flatMap(machineImages, machineImage => {
const versions = filter(machineImage.versions, ({ version, expirationDate }) => {
if (!semver.valid(version)) {
logger.warn(`Skipped machine image ${machineImage.name} as version ${version} is not a valid semver version`)
return false
}
return true
})
versions.sort((a, b) => {
return semver.rcompare(a.version, b.version)
})
const name = machineImage.name
const vendorName = vendorNameFromImageName(machineImage.name)
const vendorHint = findVendorHint(configStore.vendorHints, vendorName)
return map(versions, ({ version, expirationDate, cri, classification, architectures }) => {
if (isEmpty(architectures)) {
architectures = ['amd64'] // default if not maintained
}
return decorateClassificationObject({
key: name + '/' + version,
name,
version,
cri,
classification,
expirationDate,
vendorName,
icon: vendorName,
vendorHint,
architectures,
})
})
})
}
function machineImagesByCloudProfileName (cloudProfileName) {
const cloudProfile = cloudProfileByName(cloudProfileName)
return get(cloudProfile, 'data.machineImages')
}
</div> | ||
<div v-if="shootSupportedUpgradeAvailable"> | ||
Upgrade is available for this version | ||
<div :class="{ 'list-style': shootSupportedPatchAvailable && shootSupportedUpgradeAvailable }"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If both boolean flags are false we render an empty list item content block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this cannot happen as the whole section is hidden in tis case see line 98
@@ -405,14 +411,13 @@ export const useCloudProfileStore = defineStore('cloudProfile', () => { | |||
continue | |||
} | |||
|
|||
logger.error(`Skipped machine image ${machineImage.name} as version ${versionObj.version} is not a valid semver version and cannot be normalized`) | |||
logger.error(`Skipped machine image ${name} as version ${versionObj.version} is not a valid semver version and cannot be normalized`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it should not be logged (as an error) inside the getter. However, if there is no place where we log that we skipped some entries, this might make it harder to troubleshoot issues where an entry is expected to be there but is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
* master: (78 commits) remove `pragma: whitelist secret` comments (#1836) Ticket title should contain project name (#1824) Update dependency @fontsource/roboto to v5.0.13 (#1828) Update dependency vite to v5.2.10 (#1827) Update dependency jest-date-mock to v1.0.10 (#1829) `Terminal`: show last error description on timeout (#1810) Added support for machine image update strategy (#1807) Update dependency vue-router to v4.3.2 (#1821) Update dependency eslint-plugin-vue to v9.25.0 (#1811) Update renovate.json5 Update renovate.json5 Update renovate.json5 renovate: Ignore eslint major updates (#1819) Update dependency vuetify to v3.5.16 (#1818) Update dependency vue to v3.4.23 (#1817) Update dependency prom-client to v15.1.2 (#1814) Update dependency vite to v5.2.9 (#1815) Update dependency vue to v3.4.22 (#1813) Update dependency sass to v1.75.0 (#1809) Update vitest monorepo to v1.5.0 (#1808) ... # Conflicts: # .pnp.cjs # frontend/__tests__/stores/cloudProfile.spec.js # frontend/package.json # frontend/src/components/GSeedConfiguration.vue # frontend/src/components/GShootActionRotateCredentials.vue # frontend/src/components/GShootListRow.vue # frontend/src/components/GShootListRowActions.vue # frontend/src/components/NewShoot/GNewShootDetails.vue # frontend/src/components/ShootDetails/GShootDetailsCard.vue # frontend/src/components/ShootVersion/GShootVersion.vue # frontend/src/components/ShootWorkers/GManageWorkers.vue # frontend/src/components/ShootWorkers/GWorkerGroup.vue # frontend/src/mixins/shootItem.js # frontend/src/store/cloudProfile/index.js # frontend/src/utils/index.js # yarn.lock Resoved conflicts and fixed tests not yet tested
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #1793
Special notes for your reviewer:
Release note: