Skip to content

Commit

Permalink
[Security Solution][Serverless Quality Gate] Restoring overrides func…
Browse files Browse the repository at this point in the history
…tionality (#196536)

## Summary

Due to a bug introduced in a previous PR, the `override` value was never
using the `process.env.KIBANA_MKI_IMAGE_COMMIT` environment variable.

The reason is that in the command line arguments argparse, commit value
had the default of `''` so the commit was never null or undefined.

```
    .option('commit', {
          alias: 'c',
          type: 'string',
          default: '',
        })
```

Restored the check to see if the string is also empty.

(cherry picked from commit cbe5d9a)
  • Loading branch information
dkirchan committed Oct 16, 2024
1 parent cb19b02 commit e2dc86a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class CloudHandler extends ProjectHandler {
// no kibana image override. The tests will be executed against the commit which is already promoted to QA.
const qualityGate =
process.env.KIBANA_MKI_QUALITY_GATE && process.env.KIBANA_MKI_QUALITY_GATE === '1';
const override = commit ?? process.env.KIBANA_MKI_IMAGE_COMMIT;
const override = commit && commit !== '' ? commit : process.env.KIBANA_MKI_IMAGE_COMMIT;
if (override && !qualityGate) {
const kibanaOverrideImage = `${override?.substring(0, 12)}`;
this.log.info(`Kibana Image Commit under test: ${process.env.KIBANA_MKI_IMAGE_COMMIT}!`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class ProxyHandler extends ProjectHandler {
// no kibana image override. The tests will be executed against the commit which is already promoted to QA.
const qualityGate =
process.env.KIBANA_MKI_QUALITY_GATE && process.env.KIBANA_MKI_QUALITY_GATE === '1';
const override = commit ?? process.env.KIBANA_MKI_IMAGE_COMMIT;
const override = commit && commit !== '' ? commit : process.env.KIBANA_MKI_IMAGE_COMMIT;
if (override && !qualityGate) {
const kibanaOverrideImage = `${override?.substring(0, 12)}`;
this.log.info(`Kibana Image Commit under test: ${process.env.KIBANA_MKI_IMAGE_COMMIT}!`);
Expand Down

0 comments on commit e2dc86a

Please sign in to comment.