refactor(edge/update): choose images from registry [BE-10964] (#6)

Co-authored-by: oscarzhou <oscar.zhou@portainer.io>
release/2.25.0
Yajith Dayarathna 2024-11-18 14:11:26 +13:00 committed by GitHub
parent c59872553a
commit 333dfe1ebf
4 changed files with 23 additions and 9 deletions

View File

@ -76,6 +76,10 @@ function CreateView() {
Edge Groups
</Link>{' '}
page to assign environments and create groups.
<br />
You can upgrade from any agent version to 2.17 or later only.
You can not upgrade to an agent version prior to 2.17 . The
ability to rollback to originating version is for 2.15.0+ only.
</TextTip>
<Formik
@ -96,13 +100,6 @@ function CreateView() {
error={errors.groupIds}
/>
<TextTip color="blue">
You can upgrade from any agent version to 2.17 or later
only. You can not upgrade to an agent version prior to
2.17 . The ability to rollback to originating version is
for 2.15.0+ only.
</TextTip>
<div className="mt-2">
<ScheduleTypeSelector />
</div>

View File

@ -91,7 +91,7 @@ function ItemView() {
<Widget>
<Widget.Title title="Update & Rollback Scheduler" icon={Settings} />
<Widget.Body>
<TextTip color="blue">
<TextTip color="blue" className="mb-2">
Devices need to be allocated to an Edge group, visit the{' '}
<Link
to="edge.groups"
@ -100,6 +100,10 @@ function ItemView() {
Edge Groups
</Link>{' '}
page to assign environments and create groups.
<br />
You can upgrade from any agent version to 2.17 or later only.
You can not upgrade to an agent version prior to 2.17 . The
ability to rollback to originating version is for 2.15.0+ only.
</TextTip>
<Formik

View File

@ -44,5 +44,19 @@ export function validation(
otherwise: (schema) => schema.required('No rollback options available'),
}),
registryId: number().default(0),
agentImage: string()
.default('')
.when('registryId', {
is: 0,
then: (schema) => schema.optional(),
otherwise: (schema) => schema.required('Agent image is required'),
}),
updaterImage: string()
.default('')
.when('registryId', {
is: 0,
then: (schema) => schema.optional(),
otherwise: (schema) => schema.required('Updater image is required'),
}),
});
}

View File

@ -78,7 +78,6 @@ export function useGenericRegistriesQuery<T = Registry[]>(
export async function getRegistries() {
try {
const { data } = await axios.get<Registry[]>('/registries');
return data;
} catch (e) {
throw parseAxiosError(e as Error, 'Unable to retrieve registries');