Skip to content

Commit a036a4b

Browse files
committed
Update to be just the yaml change
1 parent fe23d6c commit a036a4b

File tree

4 files changed

+4
-54
lines changed

4 files changed

+4
-54
lines changed

frontend/src/concepts/connectionTypes/utils.ts

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -333,28 +333,9 @@ export const assembleConnectionSecret = (
333333
[key: string]: ConnectionTypeValueType;
334334
},
335335
): Connection => {
336-
const isOCI =
337-
connectionTypeName ===
338-
modelServingCompatibleTypesMetadata[ModelServingCompatibleTypes.OCI].resource;
339-
const valuesWithDefaults = isOCI
340-
? {
341-
...values,
342-
'.dockerconfigjson': values['.dockerconfigjson'] ?? '',
343-
OCI_HOST: values.OCI_HOST ?? '',
344-
}
345-
: values;
346-
347336
const connectionValuesAsStrings = Object.fromEntries(
348-
Object.entries(valuesWithDefaults)
337+
Object.entries(values)
349338
.map(([key, value]) => {
350-
// For OCI connections, convert empty .dockerconfigjson and OCI_HOST to '{}'
351-
if (
352-
isOCI &&
353-
(key === '.dockerconfigjson' || key === 'OCI_HOST') &&
354-
(!value || value === '')
355-
) {
356-
return [key, '{}'];
357-
}
358339
if (Array.isArray(value)) {
359340
return [key, JSON.stringify(value)]; // multi select
360341
}
@@ -396,22 +377,13 @@ export const parseConnectionSecretValues = (
396377
connectionType?: ConnectionTypeConfigMapObj,
397378
): { [key: string]: ConnectionTypeValueType } => {
398379
const response: { [key: string]: ConnectionTypeValueType } = {};
399-
const isOCI = connectionType
400-
? isModelServingCompatible(connectionType, ModelServingCompatibleTypes.OCI)
401-
: false;
402380

403381
for (const [key, value] of Object.entries(connection.data ?? {})) {
404382
const decodedString = window.atob(value);
405383
const matchingField = connectionType?.data?.fields?.find(
406384
(f) => isConnectionTypeDataField(f) && f.envVar === key,
407385
);
408386

409-
// For OCI connections, convert '{}' back to empty string for display in edit forms
410-
if (isOCI && (key === '.dockerconfigjson' || key === 'OCI_HOST') && decodedString === '{}') {
411-
response[key] = '';
412-
continue;
413-
}
414-
415387
if (matchingField?.type === ConnectionTypeFieldType.Boolean) {
416388
response[key] = decodedString === 'true';
417389
} else if (matchingField?.type === ConnectionTypeFieldType.Numeric) {

frontend/src/pages/modelServing/screens/projects/InferenceServiceModal/__tests__/ConnectionSection.spec.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,7 @@ describe('ConnectionsFormSection', () => {
313313
},
314314
},
315315
stringData: {
316-
'.dockerconfigjson': '{}',
317316
ACCESS_TYPE: '["Push"]',
318-
OCI_HOST: '{}',
319317
},
320318
}),
321319
);

packages/model-serving/src/components/deploymentWizard/fields/ModelLocationInputFields.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -230,21 +230,7 @@ const hasRequiredConnectionTypeFields = (modelLocationData: ModelLocationData):
230230
(field): field is ConnectionTypeDataField => 'envVar' in field && 'required' in field,
231231
) || [];
232232

233-
const isOCI = isModelServingCompatible(
234-
modelLocationData.connectionTypeObject,
235-
ModelServingCompatibleTypes.OCI,
236-
);
237-
238-
const requiredFields = dataFields
239-
.filter((field) => {
240-
if (!field.required) return false;
241-
if (isOCI && (field.envVar === '.dockerconfigjson' || field.envVar === 'OCI_HOST')) {
242-
return false;
243-
}
244-
return true;
245-
})
246-
.map((field) => field.envVar);
247-
233+
const requiredFields = dataFields.filter((field) => field.required).map((field) => field.envVar);
248234
if (
249235
isModelServingCompatible(
250236
modelLocationData.connectionTypeObject,

packages/model-serving/src/components/deploymentWizard/fields/modelLocationFields/ExistingConnectionField.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
getConnectionTypeRef,
1515
isModelServingCompatible,
1616
ModelServingCompatibleTypes,
17-
parseConnectionSecretValues,
1817
} from '@odh-dashboard/internal/concepts/connectionTypes/utils';
1918
import {
2019
Connection,
@@ -112,7 +111,6 @@ export const ExistingConnectionField: React.FC<ExistingConnectionFieldProps> = (
112111

113112
if (newConnectionType) {
114113
const additionalFields: { modelPath?: string; modelUri?: string } = {};
115-
const fieldValues = parseConnectionSecretValues(newConnection, newConnectionType);
116114

117115
if (
118116
isModelServingCompatible(
@@ -135,7 +133,7 @@ export const ExistingConnectionField: React.FC<ExistingConnectionFieldProps> = (
135133
type: ModelLocationType.EXISTING,
136134
connectionTypeObject: newConnectionType,
137135
connection: getResourceNameFromK8sResource(newConnection),
138-
fieldValues,
136+
fieldValues: {},
139137
additionalFields,
140138
});
141139
}
@@ -182,11 +180,7 @@ export const ExistingConnectionField: React.FC<ExistingConnectionFieldProps> = (
182180
selectedConnectionType?.metadata.name === ConnectionTypeRefs.OCI) && (
183181
<StackItem>
184182
<ConnectionOciPathField
185-
ociHost={
186-
isExistingModelLocation(modelLocationData)
187-
? String(modelLocationData.fieldValues.OCI_HOST ?? '')
188-
: window.atob(selectedConnection?.data?.OCI_HOST ?? '')
189-
}
183+
ociHost={window.atob(selectedConnection?.data?.OCI_HOST ?? '')}
190184
modelUri={
191185
isExistingModelLocation(modelLocationData)
192186
? modelLocationData.additionalFields.modelUri ?? ''

0 commit comments

Comments
 (0)