Skip to content

Unsafe HOME environment variable access in create_ci_badge.py #512

@brianredbeard

Description

@brianredbeard

Description

The create_ci_badge.py script assumes the HOME environment variable exists and directly accesses it without validation. This causes a
KeyError exception when HOME is not set (common in containerized CI environments).

Location

https://github.com/validatedpatterns/multicloud-gitops/blob/main/tests/interop/create_ci_badge.py#L29

oc = f"{os.environ['HOME']}/oc_client/oc"

Expected Behavior

Use os.environ.get("HOME", "/tmp") or similar fallback to handle missing environment variable gracefully.

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