Skip to content

Commit

Permalink
NAS-131437 / 25.04 / Restarting Plex container breaks migration mounts (
Browse files Browse the repository at this point in the history
#10778)

* NAS-131437: Restarting Plex container breaks migration mounts

* NAS-131437: Restarting Plex container breaks migration mounts
  • Loading branch information
AlexKarpov98 authored Oct 1, 2024
1 parent e4cf522 commit eaf41dc
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const appVersion121 = {
schema: {
default: 'OnFailure',
enum: [],
hidden: true,
show_if: [
['workloadType', '!=', 'Deployment'],
],
Expand Down Expand Up @@ -148,9 +147,9 @@ const appVersion121 = {
label: 'Liveness Probe',
schema: {
attrs: [],
default: null,
default: false,
hidden: true,
type: 'dict',
type: 'boolean',
},
variable: 'livenessProbe',
},
Expand Down Expand Up @@ -206,15 +205,27 @@ const appVersion120 = {
name: 'Networking',
},
],
questions: [{
group: 'Networking',
label: 'Provide access to node network namespace for the workload Another Version',
schema: {
default: true,
type: 'boolean',
questions: [
{
group: 'Networking',
label: 'Provide access to node network namespace for the workload Another Version',
schema: {
default: true,
type: 'boolean',
},
variable: 'hostNetworkDifferentVersion',
},
variable: 'hostNetworkDifferentVersion',
}],
{
group: 'Networking',
label: 'Provide access hidden',
schema: {
default: true,
type: 'boolean',
hidden: true,
},
variable: 'hostNetworkDifferentVersionHidden',
},
],
},
} as CatalogAppVersion;

Expand Down Expand Up @@ -415,8 +426,7 @@ describe('AppWizardComponent', () => {
});
});

// TODO:
it.skip('creating when form is submitted', async () => {
it('creating when form is submitted', async () => {
const form = await loader.getHarness(IxFormHarness);
await form.fillForm({
'Application Name': 'appname',
Expand Down Expand Up @@ -444,18 +454,19 @@ describe('AppWizardComponent', () => {
expect(spectator.inject(WebSocketService).job).toHaveBeenCalledWith(
'app.create',
[{
catalog: 'TRUENAS',
item: 'ipfs',
release_name: 'appname',
app_name: 'appname',
catalog_app: 'ipfs',
train: 'stable',
values: {
livenessProbe: false,
release_name: 'appname',
service: {
apiPort: 9599,
gatewayPort: 9822,
swarmPort: 9401,
},
updateStrategy: 'Recreate',
workloadType: 'Deployment',
},
version: '1.2.1',
}],
Expand All @@ -479,6 +490,32 @@ describe('AppWizardComponent', () => {
});
});

it('submits form with hidden: true values as well since they should be a part of a request', async () => {
const form = await loader.getHarness(IxFormHarness);

await form.fillForm({
Version: '1.2.0',
});

spectator.component.onSubmit();

expect(spectator.inject(DialogService).jobDialog).toHaveBeenCalled();
expect(spectator.inject(WebSocketService).job).toHaveBeenCalledWith(
'app.create',
[{
app_name: 'ipfs',
catalog_app: 'ipfs',
train: 'stable',
values: {
hostNetworkDifferentVersion: true,
hostNetworkDifferentVersionHidden: true,
release_name: 'ipfs',
},
version: '1.2.0',
}],
);
});

it('shows Docker Hub Rate Limit Info Dialog when remaining_pull_limit is less then 5', () => {
expect(spectator.inject(MatDialog).open).toHaveBeenCalledWith(DockerHubRateInfoDialogComponent, {
data: {
Expand Down
10 changes: 6 additions & 4 deletions src/app/services/schema/app-schema.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,12 @@ export class AppSchemaService {
const { formGroup, chartSchemaNode } = payload;

const formField = (formGroup.controls[chartSchemaNode.variable] as CustomUntypedFormField);
if (!formField.hidden$) {
formField.hidden$ = new BehaviorSubject<boolean>(false);
}
formField.hidden$.next(true);

/**
* There's no need to emit it as hidden$ = true since it's static and cannot be changed.
* Reason: It will be removed during the "app.update" query, which is incorrect.
* We can just disable the field and don't emit hidden$.next(true).
*/
formField.disable();
}

Expand Down

0 comments on commit eaf41dc

Please sign in to comment.