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

TriggersAnnotationEnricher generates wrong image.openshift.io/triggers annotation on windows #3591

Open
rohanKanojia opened this issue Dec 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rohanKanojia
Copy link
Member

Describe the bug

Related to #3477

When I'm trying to generate image.openshift.io/triggers annotation using TriggersAnnotationEnricher, I'm getting a malformed annotation with platform specific line breaks.

This is the configuration I'm using for OpenShift Maven Plugin:

			<configuration>
			   <enricher>
			      <config>
			         <jkube-triggers-annotation>
                                     <containers>quarkus</containers>
                                  </jkube-triggers-annotation>
			      </config>
			    </enricher>
	                 </configuration>

However, this generates annotation like this on windows:

- apiVersion: apps/v1
  kind: ReplicaSet
  metadata:
    annotations:
      jkube.eclipse.org/git-branch: main
      image.openshift.io/triggers: "[ {\r\n  \"from\" : {\r\n    \"kind\" : \"ImageStreamTag\"\
        ,\r\n    \"name\" : \"jkube-triggers-annotation-demo:latest\"\r\n  },\r\n\
        \  \"fieldPath\" : \"spec.template.spec.containers[?(@.name==\\\"quarkus\\\
        \")].image\"\r\n} ]"

Eclipse JKube version

1.17.0

Component

OpenShift Maven Plugin

Apache Maven version

other (please specify in additional context)

Gradle version

None

Steps to reproduce

  1. Add configuration as described in issue description
  2. Run oc:resource
  3. Inspect target/classes/META-INF/jkube/openshift.yml for image.openshift.io/triggers annotation

Expected behavior

Generated openshift.yml should not have windows line breaks in annotation

Runtime

OpenShift

Kubernetes API Server version

1.25.3

Environment

Windows

Eclipse JKube Logs

No response

Sample Reproducer Project

jkube-triggers-annotation-demo-reproducer.zip

Additional context

Apache Maven Version : 3.9.9

@rohanKanojia rohanKanojia added the bug Something isn't working label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant