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

🐛 (helm/v1-alpha): Skip empty directories in chart generation #4586

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented Feb 28, 2025

Previously, the scaffolding process would create empty directories in the Helm chart even when the corresponding source directory was missing or contained no YAML files. This commit updates the logic to check for the existence of the source directory and its contents before attempting to copy files.

Changes:

  • Skip processing if the source directory does not exist.
  • Skip creating destination directories if no YAML files are found.
  • Ensure only relevant directories and files are included in the chart.

Motivation

If a user removes, for example, the network-policy directory from a project scaffolded with an old version, we do not create an empty directory.

Previously, the scaffolding process would create empty directories in the Helm chart even when the corresponding source directory was missing or contained no YAML files. This commit updates the logic to check for the existence of the source directory and its contents before attempting to copy files.

Changes:
- Skip processing if the source directory does not exist.
- Skip creating destination directories if no YAML files are found.
- Ensure only relevant directories and files are included in the chart.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 28, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 28, 2025
@camilamacedo86
Copy link
Member Author

It is too small; passing the tests helps ensure that all is fine within.
So I will not waste anybody's time on reviews.

@camilamacedo86 camilamacedo86 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 28, 2025
@k8s-ci-robot k8s-ci-robot merged commit c73f506 into kubernetes-sigs:master Feb 28, 2025
23 of 24 checks passed
@camilamacedo86 camilamacedo86 deleted the enhance-helm branch March 1, 2025 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants