Skip to content

Check for the existence of the correct storage class prior to registry / gitea initialization #1824

@Racer159

Description

@Racer159

Is your feature request related to a problem? Please describe.

The registry / gitea packages require a storage class / pvc to operate and it would be nice to have them check for the existence of such a storage class before they try to run.

Describe the solution you'd like

  • Given I have a cluster configured without a storage class
  • When I initialize Zarf with the registry or gitea
  • Then I receive an error telling me that the storage class is misconfigured (instead of a permanent pending pod)

Additional context

This would be the equivalent of the following action:

    actions:
      onDeploy:
        before:
          - description: Check that the cluster has the correct storage class
            maxRetries: 0
            cmd: |
              CLUSTER_STORAGE_CLASSES=$(./zarf tools kubectl get -A StorageClass -o jsonpath={$.items[*].metadata.name})
              if [ -n "${CLUSTER_STORAGE_CLASSES}" && -n "${CLUSTER_STORAGE_CLASSES##*${ZARF_STORAGE_CLASS}*}" ]; then echo "the Zarf init registry package requires a configured storage class to function"; fi

Though it may be worth considering a more expressive "assert" syntax that wraps these kinds of checks like wait does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions