Skip to content

Commit

Permalink
Merge pull request #342 from opendatahub-io/v2.24.0-fixes
Browse files Browse the repository at this point in the history
V2.24.0 fixes catchup
  • Loading branch information
andrewballantyne authored Jun 21, 2024
2 parents ef1f2f0 + 5299e20 commit 26d4c00
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe('Pipelines', () => {
dspVersion: 'v2',
objectStorage: {
externalStorage: {
host: 's3.amazonaws.com/',
host: 's3.amazonaws.com',
scheme: 'https',
bucket: 'sdsd',
region: 'us-east-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ describe('configure pipeline server utils', () => {
expect(spec.objectStorage.externalStorage?.host).toBe('s3.amazonaws.com');
});

it('should cleanup S3 endpoint host', () => {
const secretsResponse = createSecretsResponse();
const config = createPipelineServerConfig();
config.objectStorage.newValue = [
{ key: AwsKeys.S3_ENDPOINT, value: 'https://s3.amazonaws.com/' },
];
const spec = createDSPipelineResourceSpec(config, secretsResponse);
expect(spec.objectStorage.externalStorage?.host).toBe('s3.amazonaws.com');
});

it('should parse S3 endpoint without scheme', () => {
const secretsResponse = createSecretsResponse();
const config = createPipelineServerConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export const createDSPipelineResourceSpec = (
dspVersion: 'v2',
objectStorage: {
externalStorage: {
host: externalStorageHost,
host: cleanupEndpointHost(externalStorageHost),
scheme: externalStorageScheme || 'https',
bucket: awsRecord.AWS_S3_BUCKET || '',
region: externalStorageRegion,
Expand Down Expand Up @@ -157,3 +157,5 @@ export const getLabelName = (index: string): string => {
const field = PIPELINE_AWS_FIELDS.find((currentField) => currentField.key === index);
return field ? field.label : '';
};

const cleanupEndpointHost = (endpoint: string): string => endpoint.replace(/\/$/, '') || '';

0 comments on commit 26d4c00

Please sign in to comment.