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

Allow Helm in Yaml fragments #2689

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Jurrie
Copy link
Contributor

@Jurrie Jurrie commented Feb 16, 2024

Description

This PR contains preliminary support to allow users to have Helm in their Yaml fragments.

There are still things left to do, but I wanted to get an overall review before I continue:

  • Documentation needs updating
  • The Helm directives will be kept in the Yaml fragments. This breaks the inner-loop development cycle. (I have thought of a solution to this, but I'd like to discuss that first, and I am hoping that implementation can be done in a separate PR.)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • I have read the contributing guidelines
  • I signed-off my commit with a user that has signed the Eclipse Contributor Agreement
  • My code follows the style guidelines of this project
  • I Keep It Small and Simple: The smaller the PR is, the easier it is to review and have it merged
  • I use conventional commits in my commit messages
  • I have performed a self-review of my code
  • I Added CHANGELOG entry
  • I have updated the documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

@manusa
Copy link
Member

manusa commented Feb 16, 2024

Eclipse JKube CI Report

Started new GH workflow run for #2689 (2024-02-23T20:35:04Z)

⚙️ JKube E2E Tests (8024533426)

Test results

✔️ Test reports (Minikube v1.28.1-dockerfile)
[✓] DockerFileITCase - k8sBuild - k8s:build, should create image inferring contextDir from provided dockerFile configuration
[✓] ContextDirAndCustomAssemblyITCase - k8sBuild - k8s:build, should create image with docker file and files read from provided contextDir configuration (within Dockerfile, files are read from configured Assembly properties)
[✓] ContextDirAndDockerFileITCase - k8sBuild - k8s:build, should create image for configured special dockerFile with files added from provided contextDir
[✓] ContextDirITCase - k8sBuild - k8s:build, should create image with docker file and files read from provided contextDir configuration
[✓] SimpleK8sITCase - k8sBuild - k8s:build, should create image
[✓] SimpleK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] SimpleK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] SimpleK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (1) passed successfully!!!

✔️ Test reports (Minikube v1.25.13-dockerfile)
[✓] DockerFileITCase - k8sBuild - k8s:build, should create image inferring contextDir from provided dockerFile configuration
[✓] ContextDirAndCustomAssemblyITCase - k8sBuild - k8s:build, should create image with docker file and files read from provided contextDir configuration (within Dockerfile, files are read from configured Assembly properties)
[✓] ContextDirITCase - k8sBuild - k8s:build, should create image with docker file and files read from provided contextDir configuration
[✓] ContextDirAndDockerFileITCase - k8sBuild - k8s:build, should create image for configured special dockerFile with files added from provided contextDir
[✓] SimpleK8sITCase - k8sBuild - k8s:build, should create image
[✓] SimpleK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] SimpleK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] SimpleK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (1) passed successfully!!!

✔️ Test reports (Minikube v1.25.13-quarkus)
[✓] QuarkusK8sITCase - k8sBuild - k8s:build, should create image
[✓] QuarkusK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] QuarkusK8sITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] QuarkusK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] QuarkusK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (5) passed successfully!!!

✔️ Test reports (Minikube v1.25.13-springboot)
[✓] HelmConfigITCase - k8sResource - k8s:resource, no specified profile, should create default resource manifests
[✓] CompleteDockerITCase - k8sBuild - k8s:build, should create image and assembly files
[✓] HelmConfigITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] ZeroConfigFatJarK8sITCase - k8sBuild - k8s:build, should create fat jar image
[✓] CustomResourceK8sITCase - k8sBuild - k8s:build, should create image
[✓] ZeroConfigK8sITCase - k8sBuild - k8s:build, should create layered jar image
[✓] CompleteK8sITCase - k8sBuild - k8s:build, should create image
[✓] HelmConfigITCase - k8sHelmPush - k8s:helm-push, should push the charts
[✓] CompleteDockerITCase - k8sResource - k8s:resource, should create manifests in specific directory
[✓] ZeroConfigFatJarK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteDockerITCase - k8sApply - k8s:apply, should deploy pod and service form manifests in specific directory
[✓] CompleteK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] ZeroConfigK8sITCase - k8sPush - k8s:push, should push image to remote registry
[✓] CustomResourceK8sITCase - k8sPush - k8s:push, should push image to remote registry
[✓] CompleteDockerITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigFatJarK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] CompleteK8sJibITCase - k8sBuild - k8s:build, should create JIB image
[✓] ZeroConfigK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] CustomResourceK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] ZeroConfigFatJarK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] ZeroConfigK8sITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] CompleteK8sJibITCase - k8sResource - k8s:resource, should create manifests
[✓] ZeroConfigK8sGradleITCase - k8sBuild - k8sBuild, should create image
[✓] CompleteK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sGradleITCase - k8sResource - k8sResource, should create manifests
[✓] ZeroConfigFatJarK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sGradleITCase - k8sHelm - k8sHelm, should create Helm charts
[✓] CompleteK8sJibITCase - k8sPush - k8s:push, should push image to remote registry
[✓] CompleteK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] CustomResourceK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] CustomResourceK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] ZeroConfigK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sGradleITCase - k8sPush - k8sPush, should push image to remote registry
[✓] CustomResourceK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] CompleteK8sJibITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sGradleITCase - k8sApply - k8sApply, should deploy pod and service
[✓] CompleteK8sJibITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sGradleITCase - k8sLog - k8sLog, should retrieve log
[✓] ZeroConfigK8sGradleITCase - k8sUndeploy - k8sUndeploy, should delete all applied resources
[✓] All tests (6) passed successfully!!!

✔️ Test reports (Minikube v1.28.1-springboot)
[✓] HelmConfigITCase - k8sResource - k8s:resource, no specified profile, should create default resource manifests
[✓] CompleteDockerITCase - k8sBuild - k8s:build, should create image and assembly files
[✓] ZeroConfigFatJarK8sITCase - k8sBuild - k8s:build, should create fat jar image
[✓] HelmConfigITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] ZeroConfigK8sITCase - k8sBuild - k8s:build, should create layered jar image
[✓] CustomResourceK8sITCase - k8sBuild - k8s:build, should create image
[✓] CompleteK8sITCase - k8sBuild - k8s:build, should create image
[✓] CompleteDockerITCase - k8sResource - k8s:resource, should create manifests in specific directory
[✓] ZeroConfigFatJarK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] HelmConfigITCase - k8sHelmPush - k8s:helm-push, should push the charts
[✓] CompleteK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteDockerITCase - k8sApply - k8s:apply, should deploy pod and service form manifests in specific directory
[✓] ZeroConfigK8sITCase - k8sPush - k8s:push, should push image to remote registry
[✓] CustomResourceK8sITCase - k8sPush - k8s:push, should push image to remote registry
[✓] CompleteDockerITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigFatJarK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteK8sJibITCase - k8sBuild - k8s:build, should create JIB image
[✓] CustomResourceK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] ZeroConfigK8sITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] ZeroConfigK8sGradleITCase - k8sBuild - k8sBuild, should create image
[✓] ZeroConfigFatJarK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] CompleteK8sJibITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sGradleITCase - k8sResource - k8sResource, should create manifests
[✓] ZeroConfigFatJarK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sGradleITCase - k8sHelm - k8sHelm, should create Helm charts
[✓] CompleteK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] CompleteK8sJibITCase - k8sPush - k8s:push, should push image to remote registry
[✓] CustomResourceK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] CustomResourceK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] ZeroConfigK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sGradleITCase - k8sPush - k8sPush, should push image to remote registry
[✓] CustomResourceK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] CompleteK8sJibITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] CompleteK8sJibITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sGradleITCase - k8sApply - k8sApply, should deploy pod and service
[✓] ZeroConfigK8sGradleITCase - k8sLog - k8sLog, should retrieve log
[✓] ZeroConfigK8sGradleITCase - k8sUndeploy - k8sUndeploy, should delete all applied resources
[✓] All tests (6) passed successfully!!!

✔️ Test reports (Minikube v1.25.13-webapp)
[✓] JettyK8sITCase - k8sBuild - k8s:build, should create image
[✓] TomcatJavaeeWithWebappsDirK8sITCase - k8sBuild - k8s:build, with jkube.generator.webapp.env should not display the Tomcat webapps dir hint
[✓] TomcatJakartaeeK8sITCase - k8sBuild - k8s:build should display the Tomcat webapps dir hint by default
[✓] ZeroConfigK8sITCase - k8sBuild - k8s:build, should create image
[✓] TomcatJakartaeeWithWebappsDirK8sITCase - k8sBuild - k8s:build, with jkube.generator.webapp.env should not display the Tomcat webapps dir hint
[✓] TomcatJavaeeK8sITCase - k8sBuild - k8s:build should display the Tomcat webapps dir hint by default
[✓] WildFlyK8sITCase - k8sBuild - k8s:build, should create image
[✓] JettyK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] TomcatJakartaeeK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] ZeroConfigK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] TomcatJavaeeK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] TomcatJakartaeeWithWebappsDirK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] TomcatJavaeeWithWebappsDirK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] WildFlyK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] JettyK8sWatchNoneITCase - k8sWatchNone - k8s:watch, with mode=none, SHOULD NOT hot deploy the application
[✓] JettyK8sWatchCopyITCase - k8sWatchCopy - k8s:watch, with mode=copy, SHOULD hot deploy the application
[✓] JettyK8sWatchBothITCase - k8sWatchBuildAndRun - k8s:watch, with mode=both, SHOULD hot deploy the application
[✓] JettyK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] JettyK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] TomcatJakartaeeK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] JettyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] TomcatJakartaeeK8sITCase - k8sLog - k8s:log, should retrieve log with migration notice
[✓] TomcatJakartaeeK8sITCase - testJakartaeeNodePortResponse - The JakartaEE servlet, exposed as a NodePort Service, should return a string and contain `Hello World`
[✓] TomcatJakartaeeK8sITCase - k8sUndeployJakartaEE - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] TomcatJavaeeK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] TomcatJavaeeK8sITCase - k8sLog - k8s:log, should retrieve log with migration notice
[✓] TomcatJavaeeK8sITCase - testJavaeeNodePortResponse - The JavaEE servlet, exposed as a NodePort Service, should return a string and contain `Hello World`
[✓] ZeroConfigK8sITCase - testNodePortResponse - Service as NodePort response should return String
[✓] TomcatJavaeeK8sITCase - k8sUndeployJavaEE - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] TomcatJakartaeeWithWebappsDirK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] TomcatJavaeeWithWebappsDirK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] TomcatJavaeeWithWebappsDirK8sITCase - k8sLogWithoutJavaeeMigrationNotice - k8s:log, should retrieve log without JavaEE migration notice
[✓] TomcatJavaeeWithWebappsDirK8sITCase - testJavaEENodePortResponseError - JavaEE Service as NodePort response should return 500 and java.lang.NoClassDefFoundError message
[✓] TomcatJavaeeWithWebappsDirK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] WildFlyK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] TomcatJakartaeeWithWebappsDirK8sITCase - testJakartaEENodePortResponse - JakartaEE Service as NodePort response should return String
[✓] WildFlyK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] TomcatJakartaeeWithWebappsDirK8sITCase - k8sLogWithoutJavaeeMigrationNotice - k8s:log, should retrieve log without JavaEE migration notice
[✓] WildFlyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] TomcatJakartaeeWithWebappsDirK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (1) passed successfully!!!

✔️ Test reports (Minikube v1.28.1-webapp)
[✓] JettyK8sITCase - k8sBuild - k8s:build, should create image
[✓] TomcatJakartaeeK8sITCase - k8sBuild - k8s:build should display the Tomcat webapps dir hint by default
[✓] TomcatJavaeeWithWebappsDirK8sITCase - k8sBuild - k8s:build, with jkube.generator.webapp.env should not display the Tomcat webapps dir hint
[✓] TomcatJakartaeeWithWebappsDirK8sITCase - k8sBuild - k8s:build, with jkube.generator.webapp.env should not display the Tomcat webapps dir hint
[✓] TomcatJavaeeK8sITCase - k8sBuild - k8s:build should display the Tomcat webapps dir hint by default
[✓] ZeroConfigK8sITCase - k8sBuild - k8s:build, should create image
[✓] JettyK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] WildFlyK8sITCase - k8sBuild - k8s:build, should create image
[✓] TomcatJakartaeeK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] ZeroConfigK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] TomcatJakartaeeWithWebappsDirK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] TomcatJavaeeWithWebappsDirK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] TomcatJavaeeK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] WildFlyK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] JettyK8sWatchNoneITCase - k8sWatchNone - k8s:watch, with mode=none, SHOULD NOT hot deploy the application
[✓] JettyK8sWatchCopyITCase - k8sWatchCopy - k8s:watch, with mode=copy, SHOULD hot deploy the application
[✓] JettyK8sWatchBothITCase - k8sWatchBuildAndRun - k8s:watch, with mode=both, SHOULD hot deploy the application
[✓] JettyK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] JettyK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] TomcatJakartaeeK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] JettyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] TomcatJakartaeeK8sITCase - k8sLog - k8s:log, should retrieve log with migration notice
[✓] TomcatJakartaeeK8sITCase - testJakartaeeNodePortResponse - The JakartaEE servlet, exposed as a NodePort Service, should return a string and contain `Hello World`
[✓] TomcatJakartaeeK8sITCase - k8sUndeployJakartaEE - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] TomcatJakartaeeWithWebappsDirK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] TomcatJakartaeeWithWebappsDirK8sITCase - testJakartaEENodePortResponse - JakartaEE Service as NodePort response should return String
[✓] TomcatJavaeeWithWebappsDirK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - testNodePortResponse - Service as NodePort response should return String
[✓] TomcatJavaeeWithWebappsDirK8sITCase - k8sLogWithoutJavaeeMigrationNotice - k8s:log, should retrieve log without JavaEE migration notice
[✓] TomcatJavaeeWithWebappsDirK8sITCase - testJavaEENodePortResponseError - JavaEE Service as NodePort response should return 500 and java.lang.NoClassDefFoundError message
[✓] ZeroConfigK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] TomcatJavaeeWithWebappsDirK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] TomcatJavaeeK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] WildFlyK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] TomcatJakartaeeWithWebappsDirK8sITCase - k8sLogWithoutJavaeeMigrationNotice - k8s:log, should retrieve log without JavaEE migration notice
[✓] WildFlyK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] TomcatJavaeeK8sITCase - k8sLog - k8s:log, should retrieve log with migration notice
[✓] TomcatJavaeeK8sITCase - testJavaeeNodePortResponse - The JavaEE servlet, exposed as a NodePort Service, should return a string and contain `Hello World`
[✓] TomcatJakartaeeWithWebappsDirK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] WildFlyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] TomcatJavaeeK8sITCase - k8sUndeployJavaEE - k8s:undeploy, should delete all applied resources
[✓] All tests (1) passed successfully!!!

✔️ Test reports (Minikube v1.28.1-quarkus)
[✓] QuarkusK8sITCase - k8sBuild - k8s:build, should create image
[✓] QuarkusK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] QuarkusK8sITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] QuarkusK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] QuarkusK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (5) passed successfully!!!

✔️ Test reports (Windows)
[✓] WindowsITCase - k8sBuild - k8s:build, should create image
[✓] WindowsITCase - k8sPush - k8s:push, should push image to remote registry
[✓] WindowsITCase - k8sResource - k8s:resource, should create manifests
[✓] WindowsITCase - ocResource - oc:resource, should create manifests
[✓] WindowsITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] WindowsITCase - ocHelm - oc:helm, should create Helm charts
[✓] All tests (6) passed successfully!!!

✔️ Test reports (Minikube v1.25.13-quarkus-native)
[✓] QuarkusNativeK8sITCase - k8sBuild - k8s:build, should create image
[✓] QuarkusNativeK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] QuarkusNativeK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] QuarkusNativeK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (4) passed successfully!!!

✔️ Test reports (Minikube v1.28.1-quarkus-native)
[✓] QuarkusNativeK8sITCase - k8sBuild - k8s:build, should create image
[✓] QuarkusNativeK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] QuarkusNativeK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] QuarkusNativeK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (4) passed successfully!!!

✔️ Test reports (OpenShift v3.10.0-webapp)
[✓] ZeroConfigOcITCase - ocBuild - oc:build, should create image
[✓] ZeroConfigOcITCase - ocResource - oc:resource, should create manifests
[✓] JettyOcITCase - ocBuild - oc:build, should create image
[✓] JettyOcITCase - ocResource - oc:resource, should create manifests
[✓] WildFlyOcITCase - ocBuild - oc:build, should create image
[✓] WildFlyOcITCase - ocResource - oc:resource, should create manifests
[✓] WildFlyOcDockerModeITCase - ocBuild - oc:build, should create image using docker
[✓] WildFlyOcDockerModeITCase - ocResource - k8s:resource, should create manifests
[✓] ZeroConfigOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ZeroConfigOcITCase - testNodePortResponse - Service as NodePort response should return String
[✓] ZeroConfigOcITCase - ocLog - oc:log, should retrieve log
[✓] JettyOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ZeroConfigOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] JettyOcITCase - ocLog - oc:log, should retrieve log
[✓] JettyOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] WildFlyOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] WildFlyOcITCase - ocLog - oc:log, should retrieve logs
[✓] WildFlyOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] WildFlyOcDockerModeITCase - ocApply - oc:apply, should deploy pod and service
[✓] WildFlyOcDockerModeITCase - ocLog - oc:log, should retrieve logs
[✓] WildFlyOcDockerModeITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] All tests (5) passed successfully!!!

✔️ Test reports (OpenShift v3.10.0-springboot)
[✓] HelmConfigITCase - ocResource - oc:resource, no specified profile, should create default resource manifests
[✓] HelmConfigITCase - ocHelm - oc:helm, should create Helm charts
[✓] HelmConfigITCase - ocHelmPush - oc:helm-push, should push the charts
[✓] CompleteOcDockerITCase - ocBuild - oc:build, with jkube.build.strategy=docker, should create image
[✓] CompleteOcDockerITCase - ocResource - oc:resource, should create manifests
[✓] CompleteOcDockerLayersDisabledITCase - ocBuild - oc:build, with jkube.build.strategy=docker, should create image
[✓] CompleteOcDockerLayersDisabledITCase - ocResource - oc:resource, should create manifests
[✓] WatchOcITCase - watch_whenSourceModified_shouldLiveReloadChanges - watch, SHOULD hot reload application on changes
[✓] ZeroConfigOcITCase - ocBuild - oc:build, should create image
[✓] ZeroConfigOcITCase - ocResource - oc:resource, should create manifests
[✓] ZeroConfigOcGradleITCase - ocBuild - ocBuild, should create image
[✓] ZeroConfigOcGradleITCase - ocResource - ocResource, should create manifests
[✓] CompleteOcDockerITCase - ocApply - oc:apply, should deploy pod and service
[✓] CompleteOcDockerITCase - ocLog - oc:log, should retrieve log
[✓] CompleteOcDockerLayersDisabledITCase - ocApply - oc:apply, should deploy pod and service
[✓] CompleteOcDockerITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] CompleteOcDockerLayersDisabledITCase - ocLog - oc:log, should retrieve log
[✓] ZeroConfigOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] CompleteOcDockerLayersDisabledITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] ZeroConfigOcITCase - ocHelm - oc:helm, should create Helm charts
[✓] ZeroConfigOcGradleITCase - ocApply - ocApply, should deploy pod and service
[✓] ZeroConfigOcGradleITCase - ocHelm - ocHelm, should create Helm charts
[✓] ZeroConfigOcITCase - ocLog - oc:log, should retrieve log
[✓] ZeroConfigOcGradleITCase - ocLog - ocLog, should retrieve log
[✓] ZeroConfigOcGradleITCase - ocUndeploy - ocUndeploy, should delete all applied resources
[✓] ZeroConfigOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] All tests (6) passed successfully!!!

✔️ Test reports (OpenShift v3.10.0-quarkus)
[✓] QuarkusOcITCase - ocBuild - oc:build, should create image
[✓] QuarkusOcITCase - ocResource - oc:resource, should create manifests
[✓] QuarkusOcITCase - ocHelm - oc:helm, should create Helm charts
[✓] QuarkusOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] QuarkusOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] All tests (5) passed successfully!!!

@Jurrie Jurrie force-pushed the feature/Allow_plain_Helm_in_yaml_fragments branch 2 times, most recently from 9ab8fdb to fe84181 Compare February 16, 2024 22:29
@Jurrie Jurrie changed the title Do not order all Yaml maps by keys, only the Helm values file Allow Helm in Yaml fragments Feb 16, 2024

private TemplateUtil() {
}

/**
* Ported from https://github.com/fabric8io/fabric8-maven-plugin/commit/d6bdaa37e06863677bc01cefa31f7d23c6d5f0f9
* This function will replace all Helm directives with a valid Yaml line containing the base64 encoded Helm directive.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@manusa
Copy link
Member

manusa commented Feb 19, 2024

Thanks a lot for looking into this 🙌

Didn't give a thorough look, but it seems that with this PR we could finally mix in invalid Helm/Go template syntax withing the JKube-processed Kubernetes resources (those stored at src/main/jkube).

I'm not sure if we're considering here corner cases such as {{ include "}}something{{}}}}{{" . }}.
Relying on regex for this kind of processing is always dangerous, so considering these scenarios in a specific test-suite is needed.

Regarding the PR, I think it probably needs proper breaking down so that it's easier to evaluate each of the things addressed here:

  • Serialiation/Deserialization of common-resources and Helm
  • values.yaml sorting without modifying the global Jackson configuration
  • Inclusion of Helm syntax on regular yaml fragments

@Jurrie
Copy link
Contributor Author

Jurrie commented Feb 20, 2024

Hi @manusa, thanks for your reply.

Didn't give a thorough look, but it seems that with this PR we could finally mix in invalid Helm/Go template syntax withing the JKube-processed Kubernetes resources (those stored at src/main/jkube).

That's the intention at least 😉

I'm not sure if we're considering here corner cases such as {{ include "}}something{{}}}}{{" . }}. Relying on regex for this kind of processing is always dangerous, so considering these scenarios in a specific test-suite is needed.

I agree on the regex part. Also, in my opinion regex's are less maintainable than regular code. I'll see what I can do to convert this to use regular string parsing.

The corner case that you mention - is that even valid? I'll try to include such a corner case in the unit test.

Regarding the PR, I think it probably needs proper breaking down so that it's easier to evaluate each of the things addressed here:

* Serialiation/Deserialization of common-resources and Helm

* values.yaml sorting without modifying the global Jackson configuration

* Inclusion of Helm syntax on regular yaml fragments

Fine by me to break this down. The part "values.yaml sorting without modifying the global Jackson configuration" is already merged as PR #2702.

As for the other two parts: I'm not sure if they stand on their own. In my opinion that should be a single PR. If you disagree, could you explain how you would like to see those two PRs?

Also, I noted in the description:

The Helm directives will be kept in the Yaml fragments. This breaks the inner-loop development cycle. (I have thought of a solution to this, but I'd like to discuss that first, and I am hoping that implementation can be done in a separate PR.)

Do you feel comfortable to merge this feature anyway?

@Jurrie Jurrie marked this pull request as ready for review February 21, 2024 10:51
@Jurrie Jurrie marked this pull request as draft February 21, 2024 10:51
Signed-off-by: Jurrie Overgoor <eclipse.org@jurr.org>
Signed-off-by: Jurrie Overgoor <eclipse.org@jurr.org>
@Jurrie Jurrie force-pushed the feature/Allow_plain_Helm_in_yaml_fragments branch from fe84181 to 0bfaf28 Compare February 21, 2024 10:54
@manusa
Copy link
Member

manusa commented Feb 21, 2024

As for the other two parts: I'm not sure if they stand on their own. In my opinion that should be a single PR. If you disagree, could you explain how you would like to see those two PRs?

Once this PR is rebased I'll probably have a clear view. During my initial review, I saw you changed and added methods to the generic Serialization tools, this is what I properly need to understand.

The Helm directives will be kept in the Yaml fragments. This breaks the inner-loop development cycle. (I have thought of a solution to this, but I'd like to discuss that first, and I am hoping that implementation can be done in a separate PR.)

Do you feel comfortable to merge this feature anyway?

Haven't checked your implementation yet, but the idea for the inner-loop (k8s:resource) would be to ignore the helm-specific sections and warn the user about it.

@Jurrie
Copy link
Contributor Author

Jurrie commented Feb 21, 2024

As for the other two parts: I'm not sure if they stand on their own. In my opinion that should be a single PR. If you disagree, could you explain how you would like to see those two PRs?

Once this PR is rebased I'll probably have a clear view. During my initial review, I saw you changed and added methods to the generic Serialization tools, this is what I properly need to understand.

The PR is rebased. The basic idea behind the changes in Serialization is to reroute all methods that have different type inputs to a single method that does marshalling / unmarshalling. That's the point where I do the "mask the Helm directives" / "unmask the Helm directives".

The Helm directives will be kept in the Yaml fragments. This breaks the inner-loop development cycle. (I have thought of a solution to this, but I'd like to discuss that first, and I am hoping that implementation can be done in a separate PR.)

Do you feel comfortable to merge this feature anyway?

Haven't checked your implementation yet, but the idea for the inner-loop (k8s:resource) would be to ignore the helm-specific sections and warn the user about it.

That is not what is happening in this pull request currently. The Helm directives will still be there in the final output. k8s:resource will keep them in. I don't see a way around this, as Helm directives can (and probably will) change the way that the Yaml files are applied to Kubernetes / OpenShift. If you would ignore them, you would end up with totally different behavior for the inner-loop and the outer-loop.

I do have a solution to this though. Maybe it's best to first introduce the goals helm-install and helm-uninstall. When a user has Helm directives in the Yaml files, the user would need to use k8s:helm-install instead of k8s:deploy and k8s:helm-uninstall instead of k8s:undeploy.

@Jurrie
Copy link
Contributor Author

Jurrie commented Feb 23, 2024

I agree on the regex part. Also, in my opinion regex's are less maintainable than regular code. I'll see what I can do to convert this to use regular string parsing.

In 0087d30 the escaping logic is rewritten. I tried to use as little regex as possible. Hopefully the new code is better maintainable and more robust.

The corner case that you mention - is that even valid? I'll try to include such a corner case in the unit test.

The corner case you mentioned ({{ include "}}something{{}}}}{{" . }}) is included in TemplateUtilTest. (I still don't think it's valid though 😉)
Note that placing Helm in more exotic Yaml constructions (like mapping between sequences) is currently not supported. This is to keep the code readable and maintainable. For the same reason, multi-line Helm blocks are not supported. The latter will trigger a warning, and I think multi-line Helm blocks can always be rewritten to multiple single-line Helm blocks.

Another note is that sometimes the Helm lines are re-ordered and appear on the bottom of a Yaml block. This seems to be because of the builders that are used to parse the Yaml files. The builders differentiate between Yaml directives they know in their context, and additionalProperties. Helm lines are placed in the additionalProperties list, and are then rendered last. This severely impacts current usefulness, and I'm not sure how to circumvent this sadly.

Signed-off-by: Jurrie Overgoor <eclipse.org@jurr.org>
@Jurrie Jurrie force-pushed the feature/Allow_plain_Helm_in_yaml_fragments branch from 88d310e to 0087d30 Compare February 23, 2024 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants