# redhat-developer/openshift-vsts architecture

> Architecture diagram of the GitHub repository redhat-developer/openshift-vsts, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/redhat-developer/openshift-vsts
- Repository: https://github.com/redhat-developer/openshift-vsts

## Overview

This is an Azure DevOps extension that runs OpenShift tasks in build and release pipelines. The main workflow is task input → `oc` CLI discovery or installation → kubeconfig setup → command execution; the conditional-command task checks a resource condition before executing. Separate task paths provide ConfigMap updates and CLI setup. The graph follows calls visible in the supplied excerpts and references in the source index; unsampled task internals and external cluster wiring are not assumed.

Main entry points: [`src/oc-install.ts`](https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-install.ts) (CLI installer), [`src/oc-conditional-exec-task.ts`](https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-conditional-exec-task.ts) (Conditional command), [`src/config-map-task.ts`](https://github.com/redhat-developer/openshift-vsts/blob/master/src/config-map-task.ts) (ConfigMap task), [`src/oc-auth.ts`](https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-auth.ts) (Kubeconfig and auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tasks["Pipeline tasks"]
  node_command_task["Run oc command<br/>[oc-exec-task.ts]"]
  node_conditional_task["Conditional command"]
  node_config_task["ConfigMap task<br/>[config-map-task.ts]"]
  node_setup_task["CLI setup task<br/>[oc-setup-task.ts]"]
end

subgraph group_runtime["OpenShift runtime"]
  node_installer["CLI installer<br/>[oc-install.ts]"]
  node_authentication["Kubeconfig and auth<br/>[oc-auth.ts]"]
  node_command_runner["oc command runner<br/>[oc-exec.ts]"]
  node_condition["Resource condition<br/>[oc-condition.ts]"]
  node_config_map["ConfigMap command<br/>[config-map.ts]"]
end

subgraph group_support["Execution support"]
  node_exec_support["Execution helpers<br/>[exec_helper.ts]"]
  node_archive_support["Archive extraction<br/>[zip_helper.ts]"]
  node_constants["CLI constants<br/>[constants.ts]"]
end

node_pipeline(("Azure DevOps pipeline"))
node_cluster{{"OpenShift cluster"}}

node_pipeline -->|"invokes task"| node_command_task
node_pipeline -->|"invokes task"| node_conditional_task
node_pipeline -->|"invokes task"| node_config_task
node_pipeline -->|"invokes task"| node_setup_task
node_command_task -->|"installs CLI"| node_installer
node_command_task -->|"sets up auth"| node_authentication
node_command_task -->|"runs command"| node_command_runner
node_conditional_task -->|"installs CLI"| node_installer
node_conditional_task -->|"sets up auth"| node_authentication
node_conditional_task -->|"checks condition"| node_condition
node_conditional_task -->|"runs command"| node_command_runner
node_config_task -->|"installs CLI"| node_installer
node_config_task -->|"sets up auth"| node_authentication
node_config_task -->|"builds patch"| node_config_map
node_config_task -->|"runs patch"| node_command_runner
node_setup_task -->|"installs CLI"| node_installer
node_setup_task -->|"sets up auth"| node_authentication
node_installer -->|"extracts archive"| node_archive_support
node_condition -->|"checks resource"| node_command_runner
node_authentication -->|"runs login"| node_command_runner
node_installer -->|"uses binary status"| node_exec_support
node_command_task -->|"parses inputs"| node_exec_support
node_conditional_task -->|"parses inputs"| node_exec_support
node_config_task -->|"parses inputs"| node_exec_support
node_authentication -->|"uses auth options"| node_constants
node_installer -.->|"downloads CLI"| node_cluster
node_command_runner -.->|"sends oc commands"| node_cluster

click node_command_task "https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-exec-task.ts"
click node_conditional_task "https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-conditional-exec-task.ts"
click node_config_task "https://github.com/redhat-developer/openshift-vsts/blob/master/src/config-map-task.ts"
click node_setup_task "https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-setup-task.ts"
click node_installer "https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-install.ts"
click node_authentication "https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-auth.ts"
click node_command_runner "https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-exec.ts"
click node_condition "https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-condition.ts"
click node_config_map "https://github.com/redhat-developer/openshift-vsts/blob/master/src/config-map.ts"
click node_exec_support "https://github.com/redhat-developer/openshift-vsts/blob/master/src/utils/exec_helper.ts"
click node_archive_support "https://github.com/redhat-developer/openshift-vsts/blob/master/src/utils/zip_helper.ts"
click node_constants "https://github.com/redhat-developer/openshift-vsts/blob/master/src/constants.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_command_task,node_conditional_task,node_config_task,node_setup_task toneBlue
class node_installer,node_authentication,node_command_runner,node_condition,node_config_map toneAmber
class node_exec_support,node_archive_support,node_constants toneMint
class node_pipeline,node_cluster toneIndigo
```

## Components

### Pipeline tasks

- [Run oc command](https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-exec-task.ts): `src/oc-exec-task.ts`
- [Conditional command](https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-conditional-exec-task.ts): `src/oc-conditional-exec-task.ts`
- [ConfigMap task](https://github.com/redhat-developer/openshift-vsts/blob/master/src/config-map-task.ts): `src/config-map-task.ts`
- [CLI setup task](https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-setup-task.ts): `src/oc-setup-task.ts`

### OpenShift runtime

- [CLI installer](https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-install.ts): `src/oc-install.ts`
- [Kubeconfig and auth](https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-auth.ts): `src/oc-auth.ts`
- [oc command runner](https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-exec.ts): `src/oc-exec.ts`
- [Resource condition](https://github.com/redhat-developer/openshift-vsts/blob/master/src/oc-condition.ts): `src/oc-condition.ts`
- [ConfigMap command](https://github.com/redhat-developer/openshift-vsts/blob/master/src/config-map.ts): `src/config-map.ts`

### Execution support

- [Execution helpers](https://github.com/redhat-developer/openshift-vsts/blob/master/src/utils/exec_helper.ts): `src/utils/exec_helper.ts`
- [Archive extraction](https://github.com/redhat-developer/openshift-vsts/blob/master/src/utils/zip_helper.ts): `src/utils/zip_helper.ts`
- [CLI constants](https://github.com/redhat-developer/openshift-vsts/blob/master/src/constants.ts): `src/constants.ts`

### Other components

- **Azure DevOps pipeline**
- **OpenShift cluster**

## Connections

- Azure DevOps pipeline → Run oc command: invokes task (evidence: `README.md`)
- Azure DevOps pipeline → Conditional command: invokes task (evidence: `README.md`)
- Azure DevOps pipeline → ConfigMap task: invokes task (evidence: `README.md`)
- Azure DevOps pipeline → CLI setup task: invokes task (evidence: `README.md`)
- Run oc command → CLI installer: installs CLI (evidence: `src/oc-exec-task.ts`)
- Run oc command → Kubeconfig and auth: sets up auth (evidence: `src/oc-exec-task.ts`)
- Run oc command → oc command runner: runs command (evidence: `src/oc-exec-task.ts`)
- Conditional command → CLI installer: installs CLI (evidence: `src/oc-conditional-exec-task.ts`)
- Conditional command → Kubeconfig and auth: sets up auth (evidence: `src/oc-conditional-exec-task.ts`)
- Conditional command → Resource condition: checks condition (evidence: `src/oc-conditional-exec-task.ts`)
- Conditional command → oc command runner: runs command (evidence: `src/oc-conditional-exec-task.ts`)
- ConfigMap task → CLI installer: installs CLI (evidence: `src/config-map-task.ts`)
- ConfigMap task → Kubeconfig and auth: sets up auth (evidence: `src/config-map-task.ts`)
- ConfigMap task → ConfigMap command: builds patch (evidence: `src/config-map-task.ts`)
- ConfigMap task → oc command runner: runs patch (evidence: `src/config-map-task.ts`)
- CLI setup task → CLI installer: installs CLI (evidence: `src/oc-setup-task.ts`)
- CLI setup task → Kubeconfig and auth: sets up auth (evidence: `src/oc-setup-task.ts`)
- CLI installer → Archive extraction: extracts archive (evidence: `src/oc-install.ts`)
- Resource condition → oc command runner: checks resource (evidence: `src/oc-condition.ts`)
- Kubeconfig and auth → oc command runner: runs login (evidence: `src/oc-auth.ts`)
- CLI installer → Execution helpers: uses binary status (evidence: `src/oc-install.ts`)
- Run oc command → Execution helpers: parses inputs (evidence: `src/oc-exec-task.ts`)
- Conditional command → Execution helpers: parses inputs (evidence: `src/oc-conditional-exec-task.ts`)
- ConfigMap task → Execution helpers: parses inputs (evidence: `src/config-map-task.ts`)
- Kubeconfig and auth → CLI constants: uses auth options (evidence: `src/oc-auth.ts`)
- CLI installer → OpenShift cluster: downloads CLI
- oc command runner → OpenShift cluster: sends oc commands
