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

Pulumi considers objects different depending on what Platform (Windows/Linux) you use #1208

Closed
Tracked by #1971
NArnott opened this issue Jul 17, 2020 · 3 comments
Closed
Tracked by #1971
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec mro2 Monica's list of 2st tier overlay related issues

Comments

@NArnott
Copy link

NArnott commented Jul 17, 2020

Problem description

It looks like Pulumi considers certain objects different depending on what platform you run on.

I used Linux to run a DotNet Pulumi program. I then used Windows, and it wants to make changes that aren't really changes and shouldn't happen.

For example, it considered whitespace different. For example, windows will write a K8s ConfigMap using \r\n, while Linux writes using just \n. Pulumi considers this different. Also, using the K8s ConfigGroup to apply several yaml files, windows using back slash, while Linux uses forward slash in the name/path, causing Pulumi to consider them different as well.

Affected product version(s)

CLI 2.6.1
Pulumi.Kubernetes: 2.4.0

Suggestions for a fix

Assuming a goal for Pulumi should be to be platform agnostic, change detection should ignore certain differences created by using different platforms. For example, \r\n and \n should be considered the same thing. And ConfigGroup should use the same forwardslash or backslash regardless of platform.

@leezen leezen added this to the current milestone Jul 27, 2020
@leezen leezen removed this from the current milestone Nov 2, 2020
@D3-LucaPiombino
Copy link

D3-LucaPiombino commented Feb 15, 2022

This is still a problem.
It's particularly problematic when you have team members that use different OS.
An alternative is to at least provide something similar to transformations but that is executed BEFORE the resource name is assigned and the file is loaded so either the name or the content can be manipulated.

@D3-LucaPiombino
Copy link

D3-LucaPiombino commented Feb 27, 2022

For the time being, we created an alternative ConfigGroup implementation that normalize paths before creating the child ConfigFile resources.
I believe a simple solution would be to allow the user to provide a callback/hook that is invoked for each file path resolved from globbing expression/s before the sub ConfigFile resources are instantiated.
This would have to work for all supported languages though (we are using dotnet ATM).

With the current implementation we need to replicate the entire functionality (we didn't, we just support files right now) since there is no way to extend the existing logic.

The issue with config map values is also annoying but it has some solutions that could be solved without duplicating
the built-in implementation:

  • Simply by having some utility that "normalize" the values directly on the callsite where the resource
    is created. (we are doing this right now)
  • Through resource transformations by post processing values.
    We did not actually tried or implement this ATM.

    NOTE: Ideally it would be nice to have the ability to provide transformations functions globally (for example on the
    parent provider), so this can be solved as an orthogonal concern.
    This would probably provide the most flexible solution, as it avoid the need for the user to remember to specify this
    for every resource but also allow to tune the behavior based on the user requirements.

@lblackstone lblackstone removed their assignment Feb 28, 2022
@mnlumi mnlumi added the mro2 Monica's list of 2st tier overlay related issues label Mar 28, 2023
@lblackstone lblackstone added the kind/bug Some behavior is incorrect or out of spec label Jul 14, 2023
@EronWright
Copy link
Contributor

I was unable to repro the problem with newlines; I tried changing the line endings on a ConfigMap to no effect. If someone has a repro, please re-open the issue.

The resource naming issue has been resolved in the new v2.ConfigGroup resource, because it doesn't use the manifest file name as a resource name, as some of the v1 implementations did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec mro2 Monica's list of 2st tier overlay related issues
Projects
None yet
Development

No branches or pull requests

6 participants