-
Notifications
You must be signed in to change notification settings - Fork 230
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
gcr.io/kpt-fn/set-namespace deletes comments in file #1815
Comments
@mengqiy can you please take a look? |
Looks like function |
I am not 100% sure but with some brief testing it seems like it may happen with any function, or at least another function (https://github.com/mgoltzsche/khelm) has the same issue. |
I think this has been fixed in GoogleContainerTools/kpt-functions-catalog#222. |
gcr.io/kpt-fn/set-namespace:v0.1 seems to have an even more critical issue - it deletes all my files with It also seems a lot more destructive, completely re-ordering the YAML which has the side effect of massive diffs and some removed comments (when the comment is on the same line as yaml, like |
A work around is separate the sources and fn configs by directories. And then use The docs related to
It's not very clear to me what is the desired behavior for If the function config object is in @frankfarzan We should standardize if functions should drop its fn config from
This formatting issue may happen. We are working on a "format" function in GoogleContainerTools/kpt-functions-catalog#242. We will recommend our users to always use it as the last one in the mutators.
@howardjohn Can you please provide steps to reproduce this? e.g. example resources. |
pipeline-validate example is a good repro of disappearing files:
|
We have found the root cause of why pipeline-validate package is not working as expected: |
I didn't find any existing functions deleting comments in the catalog. I created some test cases to ensure that in GoogleContainerTools/kpt-functions-catalog#324 |
thanks for taking a look and adding tests to make sure we don't have these problems in the future! |
Currently all of our mutator functions are written in golang. They works fine. |
The work about functions should not drop resources with local-config is tracked in #1933 |
|
With #2169 merged, we can close this. |
Start with file:
Run:
kpt fn run --image gcr.io/kpt-functions/set-namespace .
Results:
Run again:
kpt version is
0.39.2`.I am not sure if this is a bug with set-namespaces or kpt in general.
The text was updated successfully, but these errors were encountered: