Skip to content

Consider supporting specification of environment variables for test pods in scorecard config.yaml #3437

@tmckayus

Description

@tmckayus

Feature Request

Allow env vars to be specified for the test pod in config.yaml (because sometimes passing args is not convenient)

Example:
I've created a source-to-image (S2I) builder that takes a repository of tests as an input (written to use a version of the openshift commandline test suite) and produces a test image that is compatible with scorecard. The rest runner and the test function library are fixed, but the test repository itself is open-ended.

It would be nice to be able to set environment variables for the test pod in the scorecard config.yaml to control optional features or configure particular tests. The executable invoked by operator-sdk scorecard itself cannot really take these test-specific values as arguments, since the runner is general

The following seems to be a workaround, but it's a little messy and may interfere with a signal handler in PID 1 (still have to test that)

tests:
- name: "customtest1"
  image: quay.io/tmckayus/perceptilabs-test:latest
  entrypoint:
  - bash 
  - -c
  - "export STORAGE_CLASS=sam; scorecard -- -i"
  labels:
    suite: peak

Describe the solution you'd like

I would like to see something like this

tests:
- name: "customtest1"
  image: quay.io/tmckayus/perceptilabs-test:latest
  entrypoint:
  - scorecard
  env:
     STORAGE_CLASS: sam
  labels:
    suite: peak

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.needs discussionpriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.scorecardIssue relates to the scorecard subcomponent

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions