Skip to content

Select namespace in oc tasks #192

@dnperfors

Description

@dnperfors

I use these oc tasks in a pipeline that deploys to different namespaces in different stages, so first to my_project-dev, my_project_test, etc.
It would be great if it would be possible to select the namespace in the different tasks, this is especially useful in the OcConditionalCmd:
Current situation:

- task: OcConditionalCommand@2
  inputs:
    openshiftService: 'my_connection'
    cmd: 'rollout restart deployment/my_service --namespace my_project-dev'
    condition: 'exists'
    resource: 'deployment/my_service --namespace my_project-dev'

Desired situation:

- task: OcConditionalCommand@2
  inputs:
    openshiftService: 'my_connection'
    namespace: 'my_project-dev'
    cmd: 'rollout restart deployment/my_service'
    condition: 'exists'
    resource: 'deployment/my_service'

In this case especially I basically make use of a command injection issue to inject the namespace for the conditional check.

Other solutions would be to select the project in the oc-setup task

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions