Skip to content

chore: shellcheck add-host-alias - #24523

Draft
NginxL wants to merge 1 commit into
stackrox:masterfrom
NginxL:fix/3544-add-host-alias-shellcheck
Draft

NginxL wants to merge 1 commit into
stackrox:masterfrom
NginxL:fix/3544-add-host-alias-shellcheck

Conversation

@NginxL

@NginxL NginxL commented Dec 5, 2026

Copy link
Copy Markdown

Description

Quote the Go template passed to kubectl get svc in dev-tools/add-host-alias.sh and remove this file from the shellcheck skip list.

Refs #3544. This addresses one file, as suggested by that issue.

User-facing documentation

  • CHANGELOG and user documentation updates are not needed; this is a developer-tool quoting fix.

Validation

  • bash -n dev-tools/add-host-alias.sh passed.
  • shellcheck --norc -P SCRIPTDIR -x dev-tools/add-host-alias.sh passed with the repository's invocation flags.
  • A fake kubectl fixture verified that --template={{.spec.clusterIP}} is passed as one argument and that the generated deployment patch contains the resolved IP and requested hostname.
  • git diff --check passed.

Gaps

  • No live Kubernetes cluster or real service was patched.
  • The full repository-wide shellcheck target was not run because the remaining skipped files are outside this one-file change. CI is pending.

AI disclosure

AI assistance was used to make the quoting fix and build the local fixture. The diff and captured kubectl arguments were reviewed.

The commit includes a DCO Signed-off-by trailer.

Signed-off-by: NginxL <8777777+NginxL@users.noreply.github.com>
@openshift-ci

openshift-ci Bot commented Dec 5, 2026

Copy link
Copy Markdown

Hi @NginxL. Thanks for your PR.

I'm waiting for a stackrox member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of Kubernetes service lookups by ensuring command arguments are handled correctly. Existing IP detection, DNS parsing, failure handling, and deployment updates remain unchanged.
  • Chores
    • Updated shell script linting coverage to include the host-alias setup script. These changes do not alter the feature’s behavior or add user-facing functionality.

The service lookup in dev-tools/add-host-alias.sh now quotes the kubectl template argument. The script was removed from the ShellCheck skip list.

Changes: Host Alias Service Lookup

Layer / File(s) Summary
Update lookup quoting and ShellCheck coverage
dev-tools/add-host-alias.sh, scripts/style/shellcheck_skip.txt
The service lookup passes the template expression as a quoted argument. The script was removed from the ShellCheck skip list.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: porridge

Merge Risk: Minimal · up to 45a83

This is a small quoting fix in a dev-tools script, plus enabling ShellCheck for it. It has no user-facing runtime impact and is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "chore: shellcheck add-host-alias" matches the main change: the PR quotes the kubectl Go template in dev-tools/add-host-alias.sh and removes that file from the ShellCheck skip list. It is sh…
Description check Passed The description follows the repository template's main sections: a Description, a User-facing documentation section, and a Validation section that lists the commands run and their results. It explains…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "chore: shellcheck add-host-alias" matches the main change: the PR quotes the kubectl Go template in dev-tools/add-host-alias.sh and removes that file from the ShellCheck skip list. It is short and specific, though it uses a conventional-commit prefix and does not state the quoting fix itself.

Full details: Description check

Explanation

The description follows the repository template's main sections: a Description, a User-facing documentation section, and a Validation section that lists the commands run and their results. It explains the change and its scope (one file, refs #3544) and lists gaps. It does not complete the template's Testing and quality checklist (production-readiness, CI inspection, automated test boxes) and omits the template's 'How I validated my change' heading, using 'Validation' instead. These are non-critical gaps for a small shell-quoting change.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9bba6aa4-bea4-4a6d-bd0b-256b4ad14622
Commits

Reviewing files that changed from the base of the PR and between af8182d and 45a83e7.

Files selected for processing: 2

  • dev-tools/add-host-alias.sh
  • scripts/style/shellcheck_skip.txt
Files with no reviewable changes: 1

  • scripts/style/shellcheck_skip.txt

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant