fix: 接入 dsflash-go model catalog
This commit is contained in:
@@ -267,13 +267,19 @@ function credentialProjections(run: RunRecord, namespace: string): CredentialPro
|
||||
const credentials = (policy.secretScope.providerCredentials ?? []).filter((item) => item.profile === run.backendProfile);
|
||||
return credentials.map((item, index) => ({
|
||||
profile: item.profile,
|
||||
secretRef: item.secretRef.namespace ? item.secretRef : { ...item.secretRef, namespace },
|
||||
secretRef: credentialSecretRef(item.profile, item.secretRef, namespace),
|
||||
volumeName: sanitizeVolumeName(`${String(item.profile)}-${index}`),
|
||||
runtimeMountPath: normalizeMountPath(item.secretRef.mountPath, String(item.profile)),
|
||||
projectionMountPath: `/var/run/agentrun/secrets/${sanitizeVolumeName(`${String(item.profile)}-${index}`)}`,
|
||||
}));
|
||||
}
|
||||
|
||||
function credentialSecretRef(profile: string, secretRef: SecretRef, namespace: string): SecretRef {
|
||||
const spec = backendProfileSpec(profile);
|
||||
const keys = [...new Set([...(secretRef.keys ?? []), ...(spec?.requiredSecretKeys ?? [])])];
|
||||
return { ...secretRef, namespace: secretRef.namespace ?? namespace, ...(keys.length > 0 ? { keys } : {}) };
|
||||
}
|
||||
|
||||
function toolCredentialProjections(run: RunRecord, namespace: string): ToolCredentialProjection[] {
|
||||
const policy: ExecutionPolicy = run.executionPolicy;
|
||||
const credentials = policy.secretScope.toolCredentials ?? [];
|
||||
|
||||
Reference in New Issue
Block a user