rancher / charts-build-scripts

Apache License 2.0
9 stars 32 forks source link

`prepare` submommand applies patches, but not excluded files #74

Closed vadorovsky closed 1 year ago

vadorovsky commented 2 years ago

I'm using charts-build-scripts on the rke2-charts repo. Let's assume that we have a rke2-xxx package/chart with the following structure:

packages/rke2-xxx/
├── generated-changes
│   ├── exclude
│   └──  patch
└── package.yaml

I have a "clean" state of my repo and some files both in exclude/ and path/ directories.

Then I'm doing:

make prepare

The chart structure changes to:

packages/rke2-xxx/
├── charts
├── generated-changes
│   ├── exclude
│   └──  patch
└── package.yaml

My expectation would be that charts content:

  1. Has the patches applied (which is true, that happens)
  2. Doesn't have exluded files (which is not true, that doesn't happen and the files are still there)

I would expect the condition 2 to be also true. To make my patches correct again, I need to manually remove files I want to exclude.

aiyengar2 commented 2 years ago

This is currently functional in rancher/charts. Example:

https://github.com/rancher/charts/tree/dev-v2.6/packages/rancher-monitoring/rancher-monitoring/generated-changes/exclude

https://github.com/rancher/charts/tree/dev-v2.6/charts/rancher-monitoring/100.1.0%2Bup19.0.3

I'd be interested in understanding what the edge case that does not result in the excluded files being removed since the logic for that part has not changed in a while: https://github.com/rancher/charts-build-scripts/blob/b21b7fdd58cdb8e4403404a8ecc3c2d74c972604/pkg/change/apply.go#L46-L54

@vadorovsky Can you provide more details on the specific chart where you encountered this issue? (feel free to ping me on Slack otherwise)

MKlimuszka commented 1 year ago

Closing as stale since Arvind asked for more info from the reporter and hasn't gotten it. This can be reopened with more info.