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

ConfigMapIT is failing on windows #3479

Open
1 task
rohanKanojia opened this issue Oct 20, 2024 · 2 comments
Open
1 task

ConfigMapIT is failing on windows #3479

rohanKanojia opened this issue Oct 20, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@rohanKanojia
Copy link
Member

Component

None

Task description

Description

Related to #3406

⚠️ A windows machine is required to reproduce and fix problems in this issue

ConfigMapIT is failing on windows with this error message:

Error:  Errors: 
Error:    ConfigMapIT.k8sResource_whenRun_generatesK8sManifestsContainingConfigMap:37 � IllegalArgument Values not equal for entry: 'application.properties', expected 'environment = test
foo = bar' but was 'environment = test
foo = bar'
Error:    ConfigMapIT.ocResource_whenRun_generatesOpenShiftManifestsContainingConfigMap:56 � IllegalArgument Values not equal for entry: 'application.properties', expected 'environment = test
foo = bar' but was 'environment = test
foo = bar'

This issue looks related to one issue I had fixed #3014

This issue looks similar to #3477 and #3478 but the code responsible for adding ConfigMap entries from file resides in fabric8 Kubernetes Client. Not sure whether to add handling for windows line breaks there or to add it in ConfigMapEnricher.

I think we need to debug here :

Path filePath = Paths.get(entry.getValue());
addEntriesFromDirOrFileToConfigMap(configMapBuilder, getOutput(key), filePath);
it.remove();
}

When I checked it I saw that configmap entries contain windows specific line breaks
Screenshot 2024-10-20 202300

Expected Behavior

ConfigMapIT passes on windows and Linux

Acceptance Criteria

  • ConfigMapIT should pass on windows and Linux
@rexrk
Copy link
Contributor

rexrk commented Oct 22, 2024

@rohanKanojia since the configMapBuilder is from fabric8 client, i cant find any way to change the content of map from here directly as no direct setters implementation. There are some addToMap() method on configMapBuilder, can something be done by that?
image
image

@rexrk
Copy link
Contributor

rexrk commented Oct 22, 2024

I guess following code worked :
image
and now the generated yml looks like :
image

but now facing the same issue with another property :

java.lang.IllegalArgumentException: Values not equal for entry: 'test-configmap.properties', expected 'server.port = 8080
spring.application.name = configmap
' but was 'server.port = 8080
spring.application.name = configmap'

plese review it and tell me if I am going in right direction..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants