Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Racer159 opened this issue Jun 14, 2023 · 2 comments · Fixed by #2180
Closed
Labels
enhancement ✨ New feature or request
Milestone

Comments

@Racer159
Copy link
Contributor

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.

@Racer159 Racer159 added the enhancement ✨ New feature or request label Jun 14, 2023
@Racer159 Racer159 added this to the The Bucket milestone Jun 14, 2023
@robmcelvenny
Copy link

I would like to work on this issue.

@lucasrod16
Copy link
Contributor

Reopening this issue. See #2311 for more context

@lucasrod16 lucasrod16 reopened this Feb 17, 2024
Racer159 pushed a commit that referenced this issue Feb 19, 2024
## Description

#2180 introduced a bug and
this PR removes the cause of the bug.

Actions conditionals are being added to Zarf in
#2276 to allow these sort of
checks to account for various use cases in a more clean way.

Also reopened #1824

## Related Issue

Relates to #2273

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants