Skip to content

draft: clean up environment variables#79

Open
killianmuldoon wants to merge 7 commits intorh-ecosystem-edge:mainfrom
killianmuldoon:pr-update-env-clean
Open

draft: clean up environment variables#79
killianmuldoon wants to merge 7 commits intorh-ecosystem-edge:mainfrom
killianmuldoon:pr-update-env-clean

Conversation

@killianmuldoon
Copy link
Copy Markdown
Contributor

@killianmuldoon killianmuldoon commented Feb 27, 2026

This PR cleans up some unused variables and improves the handling of HOSTED_CONTROL_PLANE_NAMESPACE and the catalog version workaround.

Built on top of #78 - and needs that one to merge first.

Summary by CodeRabbit

  • New Features

    • Expanded configuration options for deployments, including support for custom catalog sources, network settings, and operator versions.
    • Added flexibility to skip storage deployment and configure VM static IP addresses.
  • Bug Fixes

    • Removed unnecessary environment variable requirements, streamlining configuration.
  • Documentation

    • Updated guides to reflect removed configuration variables and revised deployment instructions.
  • Chores

    • Refactored configuration management to centralize defaults and improve maintainability.

move the remaining and overlapping defaulted variables to the env.defaults template

Signed-off-by: Killian Muldoon <kmuldoon@nvidia.com>
Signed-off-by: Killian Muldoon <kmuldoon@nvidia.com>
Signed-off-by: Killian Muldoon <kmuldoon@nvidia.com>
Signed-off-by: Killian Muldoon <kmuldoon@nvidia.com>
Drop unused variable from the environment and scripts

Signed-off-by: Killian Muldoon <kmuldoon@nvidia.com>
Signed-off-by: Killian Muldoon <kmuldoon@nvidia.com>
Signed-off-by: Killian Muldoon <kmuldoon@nvidia.com>
@openshift-ci openshift-ci Bot requested review from szigmon and tsorya February 27, 2026 11:19
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Feb 27, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: killianmuldoon
Once this PR has been reviewed and has the lgtm label, please assign tsorya for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Feb 27, 2026

Hi @killianmuldoon. Thanks for your PR.

I'm waiting for a rh-ecosystem-edge 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
Copy link
Copy Markdown

coderabbitai Bot commented Feb 27, 2026

Walkthrough

The PR centralizes environment variable defaults from scripts/env.sh to ci/env.defaults, removes the DPU_INTERFACE configuration variable across all references, updates catalog source deployment logic, and refactors node naming conventions to use WORKER_*_NAME instead of HBN_HOSTNAME_NODE references.

Changes

Cohort / File(s) Summary
Environment Defaults Centralization
ci/env.defaults, Makefile, scripts/env.sh
Migrates ~25 environment variable defaults from scripts/env.sh (177 lines removed) to ci/env.defaults, adds validate-env-files Makefile target to ensure validation before generation, and adds HOSTED_CONTROL_PLANE_NAMESPACE and HELM_CHARTS_DIR computed variables.
DPU_INTERFACE Variable Removal
ci/env.required, docs/user-guide/configuration.md, docs/user-guide/deployment-scenarios.md, docs/user-guide/troubleshooting.md
Removes DPU_INTERFACE from required environment variable checks and all documentation, eliminating references to physical DPU interface configuration.
Template and Manifest Configuration
ci/env.template, manifests/cluster-installation/custom-catalogsource.yaml
Restructures ci/env.template with new variable groups (DPF HCP provisioner, DMS/DTS, NFD, NFS, etc.), replaces legacy USE_V419_WORKAROUND with catalog source settings, and parameterizes CatalogSource resource with placeholders for name and image.
Catalog Source Deployment Refactoring
scripts/manifests.sh
Updates deploy_core_operator_sources to conditionally generate custom-catalogsource.yaml when CATALOG_SOURCE_IMAGE is set, replacing previous workaround-based v4.19 catalog source logic and removing 4.19-specific exclusion from prepare_cluster_manifests.
Node Naming Convention Updates
scripts/traffic-flow-tests.sh
Updates TFT_SERVER_NODE and TFT_CLIENT_NODE defaults to fallback to WORKER_1_NAME and WORKER_2_NAME instead of HBN_HOSTNAME_NODE1/NODE2, updating error messages and help text accordingly.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

needs-ok-to-test

Suggested reviewers

  • szigmon
  • tsorya
  • wabouhamad
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'draft: clean up environment variables' is vague and generic, using non-descriptive terms that don't convey meaningful information about the specific changes. Replace with a more specific title that highlights the main change, such as 'Move environment variable defaults to centralized config files and remove unused vars' or 'Centralize env defaults and remove DPU_INTERFACE/HBN_HOSTNAME variables'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Makefile`:
- Around line 1-2: The Makefile conditional mistakenly uses filter to decide
when to skip loading .env, causing .env to be skipped whenever any exempt goal
appears; change the conditional to use filter-out so it only skips .env when ALL
goals are exempt (i.e., replace the filter-based test with a filter-out-based
test), updating the existing conditional block that checks "$(filter
generate-env validate-env-files help,$(MAKECMDGOALS))" to use "$(filter-out
generate-env validate-env-files help,$(MAKECMDGOALS))" so mixed-goal invocations
like "make validate-env-files deploy-dpf" will still load the .env for the
non-exempt targets.

In `@scripts/manifests.sh`:
- Line 137: The script currently always appends "custom-catalogsource.yaml" to
excluded_files, causing the custom catalog source to never be prepared even when
CATALOG_SOURCE_IMAGE is set and deploy_core_operator_sources would deploy it;
update the logic in scripts/manifests.sh so that the exclusion is conditional:
only add "custom-catalogsource.yaml" to the excluded_files array when
CATALOG_SOURCE_IMAGE is unset/empty (check the CATALOG_SOURCE_IMAGE env var),
leaving it included when CATALOG_SOURCE_IMAGE is provided; locate the exclusion
site that mutates excluded_files and adjust the conditional there (reference:
excluded_files, "custom-catalogsource.yaml", CATALOG_SOURCE_IMAGE, and
deploy_core_operator_sources/_all) so prepared manifests match deployment
behavior.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1dbfadc and d4b593e.

📒 Files selected for processing (11)
  • Makefile
  • ci/env.defaults
  • ci/env.required
  • ci/env.template
  • docs/user-guide/configuration.md
  • docs/user-guide/deployment-scenarios.md
  • docs/user-guide/troubleshooting.md
  • manifests/cluster-installation/custom-catalogsource.yaml
  • scripts/env.sh
  • scripts/manifests.sh
  • scripts/traffic-flow-tests.sh
💤 Files with no reviewable changes (3)
  • ci/env.required
  • docs/user-guide/configuration.md
  • docs/user-guide/deployment-scenarios.md

Comment thread Makefile
Comment on lines +1 to +2
# Include environment variables (skip for targets that don't need a .env)
ifeq ($(filter generate-env validate-env-files help,$(MAKECMDGOALS)),)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -name "Makefile" -type f | head -20

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 85


🏁 Script executed:

cat -n Makefile | head -30

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 1494


🏁 Script executed:

# Search for uses of MAKECMDGOALS and .env handling
rg "MAKECMDGOALS|\.env|generate-env|validate-env" -A 2 -B 2

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 21268


🏁 Script executed:

# Check if there are test files or documentation about Makefile usage
find . -type f \( -name "*test*" -o -name "*README*" -o -name "*.md" \) -exec grep -l "make.*validate-env\|make.*generate-env\|make.*deploy" {} \; | head -10

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 329


🏁 Script executed:

# Search for CI/CD configs and test patterns
find . -type f \( -name "*.yml" -o -name "*.yaml" -o -name "*.sh" \) -path "*/ci/*" -o -path "*/.github/*" | head -20

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 57


🏁 Script executed:

# Look for any shell scripts or docs that show example make invocations
rg "make\s+\w+\s+\w+" --type md --type sh | grep -E "make\s+[a-z-]+\s+[a-z-]+" | head -20

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 57


🏁 Script executed:

# Check if there's a .github directory or CI configuration
find . -type d \( -name ".github" -o -name "ci" -o -name ".gitlab-ci" \) 2>/dev/null

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 79


🏁 Script executed:

# Look at the actual Makefile targets and see which ones are typically run together
rg "^[a-z].*:" Makefile | head -30

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 685


🏁 Script executed:

# Check if there are any scripts that invoke make with multiple targets
rg "make\s+" --type sh --type bash | head -20

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 103


🏁 Script executed:

# Look for make invocations in shell scripts
rg "make\s+" --type sh | head -20

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 339


🏁 Script executed:

# Check the ci directory structure
ls -la ci/

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 446


🏁 Script executed:

# Look at ci scripts and configs
find ci -type f | head -20

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 150


🏁 Script executed:

# Check if generate-env is ever called with other targets
rg "generate-env|validate-env-files" --type md --type sh | grep -v "\.env" | head -15

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 57


🏁 Script executed:

# Verify the exact filter/filter-out logic behavior with a simple test
cat > /tmp/test_make_logic.mk << 'EOF'
EXEMPT := a b c
GOALS1 := a d
GOALS2 := a
GOALS3 := d
GOALS4 :=

test:
	`@echo` "Test 1: GOALS='a d' - should include .env"
	`@echo` "filter result: $(filter a b c,a d)"
	`@echo` "filter-out result: $(filter-out a b c,a d)"
	`@echo` ""
	`@echo` "Test 2: GOALS='a' - should skip .env"
	`@echo` "filter result: $(filter a b c,a)"
	`@echo` "filter-out result: $(filter-out a b c,a)"
	`@echo` ""
	`@echo` "Test 3: GOALS='d' - should include .env"
	`@echo` "filter result: $(filter a b c,d)"
	`@echo` "filter-out result: $(filter-out a b c,d)"
	`@echo` ""
	`@echo` "Test 4: GOALS='' - should include .env"
	`@echo` "filter result: $(filter a b c,)"
	`@echo` "filter-out result: $(filter-out a b c,)"
EOF
make -f /tmp/test_make_logic.mk test

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 120


🏁 Script executed:

# Let me verify the logic conceptually by examining how the filter function works
# Check if there are actual examples of how targets depend on each other
rg "^(generate-env|validate-env-files|deploy-dpf|all):" -A 5 Makefile

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 997


🏁 Script executed:

# Check for any documentation or comments about the include guard intention
rg -B2 -A2 "Include environment variables" Makefile

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 232


🏁 Script executed:

# Verify what variables deploy-dpf and other targets actually need
rg "\$\(.*\)" Makefile | grep -E "CLUSTER|API|BASE|DOMAIN|KUBECONFIG" | head -10

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 57


Fix .env loading for mixed-goal invocations.

Line 2 currently skips .env if any exempt goal is present. Example: make validate-env-files deploy-dpf will skip .env for deploy-dpf, breaking runtime variables that scripts expect.

The filter function returns only matching goals; when non-empty, the condition is false and .env is excluded. The solution uses filter-out to detect non-exempt goals instead—only skip .env if all goals are exempt.

Proposed fix
-ifeq ($(filter generate-env validate-env-files help,$(MAKECMDGOALS)),)
-include .env
-export
-endif
+EXEMPT_ENV_GOALS := generate-env validate-env-files help
+ifeq ($(MAKECMDGOALS),)
+include .env
+export
+else ifneq ($(filter-out $(EXEMPT_ENV_GOALS),$(MAKECMDGOALS)),)
+include .env
+export
+endif
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` around lines 1 - 2, The Makefile conditional mistakenly uses filter
to decide when to skip loading .env, causing .env to be skipped whenever any
exempt goal appears; change the conditional to use filter-out so it only skips
.env when ALL goals are exempt (i.e., replace the filter-based test with a
filter-out-based test), updating the existing conditional block that checks
"$(filter generate-env validate-env-files help,$(MAKECMDGOALS))" to use
"$(filter-out generate-env validate-env-files help,$(MAKECMDGOALS))" so
mixed-goal invocations like "make validate-env-files deploy-dpf" will still load
the .env for the non-exempt targets.

Comment thread scripts/manifests.sh
if [ "${USE_V419_WORKAROUND}" != "true" ]; then
excluded_files+=("4.19-cataloguesource.yaml")
fi
excluded_files+=("custom-catalogsource.yaml")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Make target wiring =="
rg -nP '^_all:|^deploy-core-operator-sources:|^deploy-dpf:' Makefile -C2

echo
echo "== Catalog source deployment call sites =="
rg -nP 'deploy_core_operator_sources|custom-catalogsource\.yaml|CATALOG_SOURCE_IMAGE' scripts/manifests.sh -C3
rg -nP 'deploy-core-operator-sources|manifests\.sh' Makefile scripts -C2

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 4562


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Search for CATALOG_SOURCE_IMAGE usage/documentation =="
rg -i 'CATALOG_SOURCE_IMAGE' . --type md --type txt --type sh -C2

echo
echo "== Check if deploy-core-operator-sources is documented for mandatory invocation =="
rg -i 'deploy-core-operator-sources|deploy_core_operator_sources' . --type md --type txt -C2

echo
echo "== Check initialization/defaults of CATALOG_SOURCE_IMAGE =="
rg -nP 'CATALOG_SOURCE_IMAGE.*=' scripts -C1

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 1062


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Check how CATALOG_SOURCE_IMAGE is initialized/sourced =="
rg -nP 'CATALOG_SOURCE_IMAGE.*=' scripts

echo
echo "== Check env file or config sourcing =="
rg -nP '(source|\..*env|config)' scripts/manifests.sh | head -20

echo
echo "== Full context of deploy-core-operator-sources function =="
sed -n '204,226p' scripts/manifests.sh

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 134


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Full deploy_core_operator_sources function context =="
sed -n '204,227p' scripts/manifests.sh

echo
echo "== Check if CATALOG_SOURCE_IMAGE is exported or documented elsewhere =="
rg -i 'catalog' . --type md --type sh -l | head -10

Repository: rh-ecosystem-edge/openshift-dpf

Length of output: 1311


Unguaranteed deployment of custom catalog source when CATALOG_SOURCE_IMAGE is set.

Line 137 unconditionally excludes custom-catalogsource.yaml from prepared manifests, while the custom catalog source is only deployed in deploy_core_operator_sources (lines 216-224) when CATALOG_SOURCE_IMAGE is set. Since deploy-core-operator-sources is not in the _all Make target chain, if a user sets CATALOG_SOURCE_IMAGE and runs make or make _all, the subscriptions will reference a catalog source that was never created. Either add deploy-core-operator-sources to the _all dependency chain, make the exclusion conditional on CATALOG_SOURCE_IMAGE being unset, or ensure this requirement is clearly documented.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/manifests.sh` at line 137, The script currently always appends
"custom-catalogsource.yaml" to excluded_files, causing the custom catalog source
to never be prepared even when CATALOG_SOURCE_IMAGE is set and
deploy_core_operator_sources would deploy it; update the logic in
scripts/manifests.sh so that the exclusion is conditional: only add
"custom-catalogsource.yaml" to the excluded_files array when
CATALOG_SOURCE_IMAGE is unset/empty (check the CATALOG_SOURCE_IMAGE env var),
leaving it included when CATALOG_SOURCE_IMAGE is provided; locate the exclusion
site that mutates excluded_files and adjust the conditional there (reference:
excluded_files, "custom-catalogsource.yaml", CATALOG_SOURCE_IMAGE, and
deploy_core_operator_sources/_all) so prepared manifests match deployment
behavior.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 18, 2026

PR needs rebase.

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.

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