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
Bug 1870114: Updated template PVC name and namespace to use parameters #6428
Bug 1870114: Updated template PVC name and namespace to use parameters #6428
Conversation
@yaacov: This pull request references Bugzilla bug 1870114, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
`${TEMPLATE_DATAVOLUME_ANNOTATION}/${relevantOptions.os}`, | ||
); | ||
const pvcNamespace = iGetAnnotation(iTemplate, `${TEMPLATE_DATAVOLUME_ANNOTATION}/namespace`); | ||
const pvcName = iGetPrameter(iTemplate, TEMPLATE_DATAVOLUME_NAME_PARAMETER).value; |
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.
is the parameter returned really a plain JS object?
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.
:-) no, I'm fixing that 👍
2f26c05
to
4df9af0
Compare
4df9af0
to
adb17c3
Compare
return { | ||
id: osId, | ||
name: getAnnotation(template, nameAnnotation), | ||
dataVolumeName: getOperatingSystemDataVolumeAnnotation(template, osId), | ||
dataVolumeNamespace: getOperatingSystemDataVolumeNamespaceAnnotation(template), | ||
dataVolumeName: getParameter(template, TEMPLATE_DATAVOLUME_NAME_PARAMETER)?.value, |
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.
can we have similar selectors and change it to getPrameterValue?
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.
done :-)
@@ -86,6 +86,13 @@ export const iGetRelevantTemplates = ( | |||
const versionCMP = compareVersions(splitVersion(aVersion), splitVersion(bVersion)) * -1; // descending | |||
|
|||
if (versionCMP !== 0) { |
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.
can we move this logic to compareVersions and also add it to the unit test?
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.
done 👍
@@ -129,14 +134,16 @@ const baseImageUpdater = ({ id, prevState, dispatch, getState }: UpdateOptions) | |||
const iCommonTemplates = iGetLoadedCommonData(state, id, VMWizardProps.commonTemplates); | |||
const iTemplate = | |||
iCommonTemplates && iGetRelevantTemplate(null, iCommonTemplates, relevantOptions); |
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.
can you please include flavor and workloadProfile in hasVMSettingsValueChanged so we always get relevant template here?
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.
ok
p.s.
the spec says that os disk image should not change on cpu/mem or orher none os related changes,
but since we have this problem all over the code, so we can fix it in a folow-up.
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.
it is not an problem as this not about the spec. I'd be glad if our code worked also on a broken/customized env with different templates of different versions with different base images for different oses, if it doesn't cost us that much. Just using these selectors properly with all the relevant info.
ad2c586
to
a5f557c
Compare
8936c4a
to
7db54ae
Compare
|
||
it('check devel version when both of them are not null', () => { | ||
expect(compareVersions(osVersion10, osVersion9)).toEqual(1); | ||
}); | ||
}); | ||
|
||
describe('removeOSDups', () => { |
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.
can you please add it to this test as well?
@@ -129,14 +134,16 @@ const baseImageUpdater = ({ id, prevState, dispatch, getState }: UpdateOptions) | |||
const iCommonTemplates = iGetLoadedCommonData(state, id, VMWizardProps.commonTemplates); | |||
const iTemplate = | |||
iCommonTemplates && iGetRelevantTemplate(null, iCommonTemplates, relevantOptions); |
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.
it is not an problem as this not about the spec. I'd be glad if our code worked also on a broken/customized env with different templates of different versions with different base images for different oses, if it doesn't cost us that much. Just using these selectors properly with all the relevant info.
@@ -48,7 +48,7 @@ export const ignoreCaseSort = <T>( | |||
return array.sort((a, b) => resolve(a).localeCompare(resolve(b))); | |||
}; | |||
|
|||
export const splitVersion = (osID: string): number[] => | |||
const splitVersion = (osID: string): number[] => |
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.
+1 nice refactoring
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: suomiy, yaacov The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@yaacov: All pull requests linked via external trackers have merged: Bugzilla bug 1870114 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
https://issues.redhat.com/browse/CNV-4764 updated the way PVC name and namespace are stated in the template.
We currently use the old way, we need to update according to latest updates.
Refs:
kubevirt/common-templates#168
kubevirt/kubevirt-ssp-operator#212