Skip to content

Commit

Permalink
add DSPA Secret provision
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeAlonso committed Jul 23, 2024
1 parent d06be9c commit ff27d23
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
kind: Secret
apiVersion: v1
metadata:
name: dashboard-dspa-secret
namespace: {{NAMESPACE}}
labels:
opendatahub.io/dashboard: 'true'
managedFields:
- manager: unknown
operation: Update
apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
'f:data':
.: {}
'f:AWS_ACCESS_KEY_ID': {}
'f:AWS_SECRET_ACCESS_KEY': {}
'f:metadata':
'f:labels':
.: {}
'f:opendatahub.io/dashboard': {}
'f:type': {}
data:
AWS_ACCESS_KEY_ID: {{AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: {{AWS_SECRET_ACCESS_KEY}}
type: Opaque
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ describe('An admin user can import and run a pipeline', { testIsolation: false }
stdout: ${result.stdout}
stderr: ${result.stderr}`);

Check failure on line 14 in frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Replace `);` with `,`

Check failure on line 15 in frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Replace `·⏎····})` with `···);`

})

Check failure on line 17 in frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Insert `});⏎`
// Create a pipeline compatible Data Connection
const replacements = {
const dataConnectionReplacements = {
NAMESPACE: projectName,
AWS_ACCESS_KEY_ID: Buffer.from(AWS_PIPELINES_BUCKET.AWS_ACCESS_KEY_ID).toString('base64'),
AWS_DEFAULT_REGION: Buffer.from(AWS_PIPELINES_BUCKET.AWS_REGION).toString('base64'),
Expand All @@ -25,12 +25,29 @@ describe('An admin user can import and run a pipeline', { testIsolation: false }
AWS_SECRET_ACCESS_KEY: Buffer.from(AWS_PIPELINES_BUCKET.AWS_SECRET_ACCESS_KEY).toString('base64')

Check failure on line 25 in frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Replace `'base64')` with `⏎········'base64',⏎······),`
};
cy.fixture('resources/yaml/data_connection.yml').then((yamlContent) => {
const modifiedYamlContent = replacePlaceholdersInYaml(yamlContent, replacements);
const modifiedYamlContent = replacePlaceholdersInYaml(yamlContent, dataConnectionReplacements);

Check failure on line 28 in frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Replace `yamlContent,·dataConnectionReplacements` with `⏎········yamlContent,⏎········dataConnectionReplacements,⏎······`
const tempFilePath = 'cypress/temp_data_connection.yaml';
applyOpenShiftYaml(modifiedYamlContent, tempFilePath).then((result) => {
expect(result.code).to.eq(0, `ERROR applying YAML content\nstdout: ${result.stdout}\nstderr: ${result.stderr}`);

Check failure on line 31 in frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Replace `0,·`ERROR·applying·YAML·content\nstdout:·${result.stdout}\nstderr:·${result.stderr}`` with `⏎··········0,⏎··········`ERROR·applying·YAML·content\nstdout:·${result.stdout}\nstderr:·${result.stderr}`,⏎········`
});
});

// Configure Pipeline server
// Create DSPA Secret
const dspaSecretReplacements = {

Check failure on line 37 in frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

'dspaSecretReplacements' is assigned a value but never used
NAMESPACE: projectName,
AWS_ACCESS_KEY_ID: Buffer.from(AWS_PIPELINES_BUCKET.AWS_ACCESS_KEY_ID).toString('base64'),
AWS_SECRET_ACCESS_KEY: Buffer.from(AWS_PIPELINES_BUCKET.AWS_SECRET_ACCESS_KEY).toString('base64')

Check failure on line 40 in frontend/src/__tests__/cypress/cypress/tests/e2e/pipelines/pipelines.cy.ts

View workflow job for this annotation

GitHub Actions / Tests (18.x)

Replace `'base64')` with `⏎········'base64',⏎······),`
};
cy.fixture('resources/yaml/dspa_secret.yml').then((yamlContent) => {
const modifiedYamlContent = replacePlaceholdersInYaml(yamlContent, dataConnectionReplacements);
const tempFilePath = 'cypress/dspa_secret.yaml';
applyOpenShiftYaml(modifiedYamlContent, tempFilePath).then((result) => {
expect(result.code).to.eq(0, `ERROR applying YAML content\nstdout: ${result.stdout}\nstderr: ${result.stderr}`);
});
});

// Create DSPA
});

after(() => {
Expand Down

0 comments on commit ff27d23

Please sign in to comment.