Skip to content

fix: resolve superlinter failures and require --recreate for RHDP cluster idempotency - #128

Merged
butler54 merged 2 commits into
validatedpatterns:mainfrom
butler54:fix/superlinter-and-rhdp-idempotency
Aug 30, 2026
Merged

fix: resolve superlinter failures and require --recreate for RHDP cluster idempotency#128
butler54 merged 2 commits into
validatedpatterns:mainfrom
butler54:fix/superlinter-and-rhdp-idempotency

Conversation

@butler54

Copy link
Copy Markdown
Collaborator

Summary

Super linter has failed on every push/PR for weeks (100% failure rate across the last 50 runs). This PR fixes the recurring failures and, to make it a substantive change, also resolves #110.

1. Superlinter fixes

Checked the vendored kyverno chart (charts/vendor/kyverno/*) first — it's already excluded via FILTER_REGEX_EXCLUDE in superlinter.yml and contributes zero lint errors. All actual failures were in first-party files:

  • markdownlint: fixed real formatting issues (missing blank lines around headings/lists/fences, bad ordered-list numbering, a missing table cell) in the issue templates, README.md, airgap/DEPLOY-RUNBOOK.md, docs/disconnected-deployment.md, and the kubevirtvm chart README. Two were genuine content bugs, not just style: a skipped step number in README.md (4.6., now 5.) and a status table row in DEPLOY-RUNBOOK.md missing its third (empty) cell.
  • textlint (NATURAL_LANGUAGE): fixed all 14 flagged terminology instances (gitGit, reporepository, unixUnix, indexesindices, READMEsreadmes) across 5 files.
  • isort: fixed import ordering in scripts/git-http-server.py.
  • Pyink: disabled VALIDATE_PYTHON_PYINK in superlinter.yml. It conflicts with Black (which already passes, and matches this repo's own .flake8 comment "match black default"); super-linter itself warns against enabling both. No other validatedpatterns/* repo enables Pyink — utilities and industrial-edge explicitly disable it.

Verified locally against the exact tool versions/config super-linter uses (isort 6.0.1, black 25.1.0, flake8 7.2.0, mypy 1.15.0 — all pass; markdownlint and textlint's default terminology rule — zero remaining issues on all touched files).

2. Fixes #110 — RHDP wrapper scripts are not idempotent

Root cause: rhdp/rhdp-cluster-define.py's cleanup() unconditionally wiped the install directory (and ~/.azure) on every run, before openshift-install ever got a chance to run its own built-in refusal-to-overwrite check. Re-running any rhdp/wrapper*.sh script against a directory that already had a cluster installed silently discarded that cluster's local state and provisioned a new one on top — with no destroy step, orphaning any still-live Azure resources.

Fix: add a --recreate flag, threaded through wrapper.sh, wrapper-cluster-only.sh, wrapper-multicluster.sh, and rhdp-cluster-define.py.

  • By default, if an install directory already contains cluster state (metadata.json), the tool now exits with an error before touching anything, listing the affected directories and instructing the user to either destroy the existing cluster first (openshift-install destroy cluster --dir=<dir>) or pass --recreate.
  • --recreate only wipes the local install directory. It deliberately does not call openshift-install destroy cluster (kept minimal in scope), and prints an explicit warning every time it's used that cloud resources from a previous install may be orphaned if they weren't destroyed manually first.
  • rhdp/README.md documents the new default-safe behavior and the --recreate caveat.

Verified with scenario tests (fresh directory, existing state without --recreate, existing state with --recreate) and an end-to-end CLI run of rhdp-cluster-define.py exercising all three paths — see commit message for details. No live Azure access was available to test the wrapper scripts end-to-end against a real cluster.

Test plan

  • isort/black/flake8/mypy pass on scripts/git-http-server.py
  • markdownlint (matching .github/linters/.markdown-lint.yml) reports 0 issues on all touched markdown files
  • textlint with super-linter's default terminology config reports 0 issues on all touched markdown files
  • rhdp-cluster-define.py scenario tests: fresh dir / existing state blocked / existing state + --recreate wipes
  • bash -n syntax check on all three wrapper scripts
  • Super Linter GitHub Action passes on this PR (final confirmation)

…, and python

Super linter has failed on every push/PR for weeks (100% failure rate on
the last 50 runs). None of the failures came from vendored code
(charts/vendor/kyverno/* is already excluded via FILTER_REGEX_EXCLUDE and
was verified to contribute zero lint errors).

- markdownlint: fix real formatting issues (missing blank lines around
  headings/lists/fences, bad list-item numbering, a missing table cell)
  across issue templates, README.md, airgap/DEPLOY-RUNBOOK.md,
  docs/disconnected-deployment.md, and the kubevirtvm chart README. Two
  of these were genuine content bugs: a skipped step number in README.md
  and a missing empty cell in a DEPLOY-RUNBOOK.md status table.
- textlint (NATURAL_LANGUAGE): fix the 14 flagged terminology instances
  (git/repo/unix/indexes/READMEs) across 5 files to match the rule's
  suggested terms.
- isort: fix import ordering in scripts/git-http-server.py.
- pyink: disable VALIDATE_PYTHON_PYINK in superlinter.yml. It actively
  conflicts with Black (which already passes and matches the project's
  .flake8 comment 'match black default'); super-linter itself warns
  against enabling both. No other validatedpatterns/* repo enables
  Pyink; two explicitly disable it alongside Black.

Verified locally against the exact tool versions super-linter pins
(markdownlint 0.44.0-equivalent ruleset, textlint default terminology
config, isort 6.0.1, black 25.1.0, flake8 7.2.0, mypy 1.15.0) with zero
remaining issues.
Fixes validatedpatterns#110

rhdp-cluster-define.py unconditionally wiped the install directory (and
~/.azure) on every run, before openshift-install ever got a chance to
run its own built-in refusal-to-overwrite check. Re-running any of the
rhdp/wrapper*.sh scripts against a directory that already had a cluster
installed silently discarded that cluster's local install state and
provisioned a new one on top, with no destroy step -- orphaning any
still-live Azure resources from the previous run.

Add a --recreate flag, threaded through wrapper.sh,
wrapper-cluster-only.sh, wrapper-multicluster.sh, and
rhdp-cluster-define.py's run()/cleanup(). By default, if an install
directory already contains cluster state (metadata.json), the tool now
exits with an error before touching anything, and prints instructions
to either destroy the existing cluster first or pass --recreate.

--recreate only wipes the local install directory -- it deliberately
does NOT call 'openshift-install destroy cluster' (scope kept minimal
per review), and prints an explicit warning to that effect each time
it's used, so cloud resources from a previous install aren't destroyed
or silently orphaned without the operator's awareness.

Verified with unit-level scenario tests (fresh dir, existing state
without --recreate, existing state with --recreate) and an end-to-end
CLI run of rhdp-cluster-define.py exercising all three paths.
@butler54
butler54 requested a review from a team August 30, 2026 14:11
@butler54
butler54 merged commit 9bfb953 into validatedpatterns:main Aug 30, 2026
5 checks passed
@butler54
butler54 deleted the fix/superlinter-and-rhdp-idempotency branch August 30, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Ensure RHDP wrapper scripts are idempotent

1 participant