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

feat (jkube-kit) : Initial draft for JKube Actions Summary (#1033) #1686

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rohanKanojia
Copy link
Member

@rohanKanojia rohanKanojia commented Aug 2, 2022

Description

Fixes #1033

Add summary for jkube build actions in order to improve ux. Summary is printed for build, push, resource, helm, helm-push, apply, and undeploy actions.

Added a Summary and SummaryService class which creates a temporary file storing state of Summary object as control goes from different parts of codebase. Both in case of maven and gradle, it's being checked whether current goal/task is last executing task and then only summary is being printed.

Right now basic details are printed after small jkube banner. This output can be changed as per requirements:

[INFO] k8s:  __ / / //_/ / / / _ )/ __/
[INFO] k8s: / // / ,< / /_/ / _  / _/  
[INFO] k8s: \___/_/|_|\____/____/___/  

[INFO] k8s: -------------------------------
[INFO] k8s:       SUMMARY
[INFO] k8s: -------------------------------
[INFO] k8s: Container images:
[INFO] k8s:  - maven/external-resources:latest
[INFO] k8s:     * Base image: quay.io/jkube/jkube-java:0.0.16
[INFO] k8s:     * SHA: sha256:f63f0
[INFO] k8s: 
[INFO] k8s: Build Strategy : Local Docker
[INFO] k8s: Generators applied: [spring-boot]
[INFO] k8s: 
[INFO] k8s: Enrichers applied: [jkube-dependency,jkube-controller,jkube-controller-from-configuration,jkube-service,jkube-image,jkube-portname,jkube-project-label,jkube-git,jkube-maven-scm,jkube-serviceaccount,jkube-configmap-file,jkube-healthcheck-spring-boot,jkube-prometheus,jkube-revision-history,jkube-name,jkube-metadata,jkube-pod-annotations,jkube-container-env-java-options]
[INFO] k8s: Generated resources:
[INFO] k8s:  - target/classes/META-INF/jkube/kubernetes/external-resources-service.yml
[INFO] k8s:  - target/classes/META-INF/jkube/kubernetes/game-config-env-file-configmap.yml
[INFO] k8s:  - target/classes/META-INF/jkube/kubernetes/second-configmap.yml
[INFO] k8s:  - target/classes/META-INF/jkube/kubernetes/external-resources-deployment.yml
[INFO] k8s:  - target/classes/META-INF/jkube/kubernetes.yml
[INFO] k8s: 
[INFO] k8s: Applied resources from https://api.sandbox.x8i5.p1.openshiftapps.com:6443/
[INFO] k8s:  - external-resources
[INFO] k8s:    * v1 Service
[INFO] k8s:    * Namespace: rokumar-dev
[INFO] k8s:  - game-config-env-file
[INFO] k8s:    * v1 ConfigMap
[INFO] k8s:    * Namespace: rokumar-dev
[INFO] k8s:  - second
[INFO] k8s:    * v1 ConfigMap
[INFO] k8s:    * Namespace: rokumar-dev
[INFO] k8s:  - external-resources
[INFO] k8s:    * apps/v1 Deployment
[INFO] k8s:    * Namespace: rokumar-dev
[INFO] k8s: 
[INFO] k8s: -------------------------------
[INFO] k8s: SUCCESS
[INFO] k8s: -------------------------------

Signed-off-by: Rohan Kumar rohaan@redhat.com

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 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 Aug 2, 2022

Eclipse JKube CI Report

Started new GH workflow run for #1686 (2023-03-01T05:25:50Z)

⚙️ JKube E2E Tests (4300228797)

Test results

✔️ Test reports (Minikube v1.22.17-dockerfile)
[✓] DockerFileITCase - k8sBuild - k8s:build, should create image inferring contextDir from provided dockerFile configuration
[✓] 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
[✓] 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)
[✓] 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 (4) passed successfully!!!

✔️ Test reports (Minikube v1.22.17-other)
[✓] KarafK8sITCase - k8sBuild - k8s:build, should create image
[✓] ThorntailK8sITCase - k8sBuild - k8s:build, should create image
[✓] VertxK8sITCase - k8sBuild - k8s:build, should create image
[✓] WildflyJarK8sITCase - k8sBuild - k8s:build, should create image
[✓] OpenLibertyK8sITCase - k8sBuild - k8s:build, should create image
[✓] KarafK8sITCase - k8sResource - k8s:resource, should create manifest for Kubernetes
[✓] VertxK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] ThorntailK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] OpenLibertyK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] WildflyJarK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] KarafK8sITCase - K8sApply - k8s:apply, should apply manifests on k8s cluster
[✓] KarafK8sITCase - k8sLog - k8s:log
[✓] DslK8sGradleITCase - k8sBuild - k8sBuild, should create image
[✓] VertxK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] DslK8sGradleITCase - k8sResource - k8sResource, should create manifests
[✓] DslK8sGradleITCase - k8sHelm - k8sHelm, should create Helm charts
[✓] KarafK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] VertxK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] VertxK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ThorntailK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ThorntailK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] OpenLibertyK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] OpenLibertyK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] OpenLibertyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] WildflyJarK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] DslK8sGradleITCase - k8sApply - k8sApply, should deploy pod and service
[✓] DslK8sGradleITCase - k8sLog - k8sLog, should retrieve log
[✓] DslK8sGradleITCase - k8sUndeploy - k8sUndeploy, should delete all applied resources
[✓] WildflyJarK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (4) passed successfully!!!

✔️ Test reports (Minikube v1.22.17-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.22.17-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.22.17-springboot)
[✓] ZeroConfigK8sITCase - k8sBuild - k8s:build, should create image
[✓] CustomResourceK8sITCase - k8sBuild - k8s:build, should create image
[✓] CompleteK8sITCase - k8sBuild - k8s:build, should create image
[✓] CompleteDockerITCase - k8sBuild - k8s:build, should create image and assembly files
[✓] CompleteK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteK8sJibITCase - k8sBuild - k8s:build, should create JIB image
[✓] CompleteDockerITCase - k8sResource - k8s:resource, should create manifests in specific directory
[✓] CompleteK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - k8sPush - k8s:push, should push image to remote registry
[✓] CustomResourceK8sITCase - k8sPush - k8s:push, should push image to remote registry
[✓] CompleteK8sJibITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] CompleteDockerITCase - k8sApply - k8s:apply, should deploy pod and service form manifests in specific directory
[✓] ZeroConfigK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] CustomResourceK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteK8sJibITCase - k8sPush - k8s:push, should push image to remote registry
[✓] ZeroConfigK8sITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] CompleteDockerITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sGradleITCase - k8sBuild - k8sBuild, should create image
[✓] CustomResourceK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sGradleITCase - k8sResource - k8sResource, should create manifests
[✓] ZeroConfigK8sGradleITCase - k8sHelm - k8sHelm, should create Helm charts
[✓] CustomResourceK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] CompleteK8sJibITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] CustomResourceK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sGradleITCase - k8sPush - k8sPush, should push image to remote registry
[✓] CompleteK8sJibITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] ZeroConfigK8sGradleITCase - k8sApply - k8sApply, should deploy pod and service
[✓] ZeroConfigK8sGradleITCase - k8sLog - k8sLog, should retrieve log
[✓] ZeroConfigK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sGradleITCase - k8sUndeploy - k8sUndeploy, should delete all applied resources
[✓] All tests (6) passed successfully!!!

✔️ Test reports (Minikube v1.22.17-webapp)
[✓] JettyK8sITCase - k8sBuild - k8s:build, should create image
[✓] ZeroConfigK8sITCase - k8sBuild - k8s:build, should create image
[✓] TomcatJavaeeK8sITCase - k8sBuild - k8s:build should display the Tomcat webapps dir hint by default
[✓] TomcatJakartaeeK8sITCase - 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
[✓] TomcatJavaeeK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] ZeroConfigK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] TomcatJakartaeeK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] WildFlyK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] JettyK8sWatchITCase - k8sWatchCopy - k8s:watch, with mode=copy, SHOULD hot deploy the application
[✓] JettyK8sWatchITCase - k8sWatchNone - k8s:watch, with mode=none, SHOULD NOT hot deploy the application
[✓] JettyK8sWatchITCase - 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
[✓] TomcatJavaeeK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] JettyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] 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`
[✓] TomcatJavaeeK8sITCase - k8sUndeployJavaEE - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] TomcatJavaeeK8sITCase - k8sBuildWithWebappEnv - k8s:build, with jkube.generator.webapp.env should not display the Tomcat webapps dir hint
[✓] ZeroConfigK8sITCase - testNodePortResponse - Service as NodePort response should return String
[✓] TomcatJakartaeeK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] WildFlyK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] WildFlyK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] TomcatJavaeeK8sITCase - k8sApplyWithNewDeployment - k8s:apply, should deploy pod and service with new image
[✓] WildFlyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] TomcatJavaeeK8sITCase - k8sLogWithoutJavaeeMigrationNotice - k8s:log, should retrieve log without JavaEE migration notice
[✓] TomcatJavaeeK8sITCase - testJavaEENodePortResponseError - JavaEE Service as NodePort response should return 500 and java.lang.NoClassDefFoundError message
[✓] 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`
[✓] TomcatJavaeeK8sITCase - finalK8sUndeploy - Final k8s:undeploy, should delete all applied resources
[✓] TomcatJakartaeeK8sITCase - k8sUndeployJakartaEE - k8s:undeploy, should delete all applied resources
[✓] TomcatJakartaeeK8sITCase - k8sBuildWithWebappEnv - k8s:build, with jkube.generator.webapp.env should not display the Tomcat webapps dir hint
[✓] TomcatJakartaeeK8sITCase - k8sApplyWithNewDeployment - k8s:apply, should deploy pod and service with new image
[✓] TomcatJakartaeeK8sITCase - testJakartaEENodePortResponse - JakartaEE Service as NodePort response should return String
[✓] TomcatJakartaeeK8sITCase - k8sLogWithoutJavaeeMigrationNotice - k8s:log, should retrieve log without JavaEE migration notice
[✓] TomcatJakartaeeK8sITCase - finalK8sUndeploy - Final k8s:undeploy, should delete all applied resources
[✓] All tests (3) passed successfully!!!

✔️ Test reports (Minikube v1.25.4-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.4-other)
[✓] KarafK8sITCase - k8sBuild - k8s:build, should create image
[✓] VertxK8sITCase - k8sBuild - k8s:build, should create image
[✓] ThorntailK8sITCase - k8sBuild - k8s:build, should create image
[✓] OpenLibertyK8sITCase - k8sBuild - k8s:build, should create image
[✓] WildflyJarK8sITCase - k8sBuild - k8s:build, should create image
[✓] KarafK8sITCase - k8sResource - k8s:resource, should create manifest for Kubernetes
[✓] VertxK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] ThorntailK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] OpenLibertyK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] WildflyJarK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] KarafK8sITCase - K8sApply - k8s:apply, should apply manifests on k8s cluster
[✓] KarafK8sITCase - k8sLog - k8s:log
[✓] VertxK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] DslK8sGradleITCase - k8sBuild - k8sBuild, should create image
[✓] DslK8sGradleITCase - k8sResource - k8sResource, should create manifests
[✓] DslK8sGradleITCase - k8sHelm - k8sHelm, should create Helm charts
[✓] KarafK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] VertxK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] VertxK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ThorntailK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ThorntailK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] OpenLibertyK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] OpenLibertyK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] OpenLibertyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] WildflyJarK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] DslK8sGradleITCase - k8sApply - k8sApply, should deploy pod and service
[✓] DslK8sGradleITCase - k8sLog - k8sLog, should retrieve log
[✓] DslK8sGradleITCase - k8sUndeploy - k8sUndeploy, should delete all applied resources
[✓] WildflyJarK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (4) passed successfully!!!

✔️ Test reports (Minikube v1.25.4-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.4-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.25.4-springboot)
[✓] CustomResourceK8sITCase - k8sBuild - k8s:build, should create image
[✓] ZeroConfigK8sITCase - k8sBuild - k8s:build, should create image
[✓] CompleteK8sITCase - k8sBuild - k8s:build, should create image
[✓] CompleteDockerITCase - k8sBuild - k8s:build, should create image and assembly files
[✓] CompleteK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteK8sJibITCase - k8sBuild - k8s:build, should create JIB image
[✓] CustomResourceK8sITCase - k8sPush - k8s:push, should push image to remote registry
[✓] ZeroConfigK8sITCase - k8sPush - k8s:push, should push image to remote registry
[✓] CompleteK8sJibITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteDockerITCase - k8sResource - k8s:resource, should create manifests in specific directory
[✓] CompleteK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - k8sResource - k8s:resource, should create manifests
[X] CompleteK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] CompleteDockerITCase - k8sApply - k8s:apply, should deploy pod and service form manifests in specific directory
[✓] CustomResourceK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteK8sJibITCase - k8sPush - k8s:push, should push image to remote registry
[✓] ZeroConfigK8sITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] CompleteDockerITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sGradleITCase - k8sBuild - k8sBuild, should create image
[✓] CustomResourceK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sGradleITCase - k8sResource - k8sResource, should create manifests
[✓] ZeroConfigK8sGradleITCase - k8sHelm - k8sHelm, should create Helm charts
[✓] CustomResourceK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] CompleteK8sJibITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] CustomResourceK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sGradleITCase - k8sPush - k8sPush, should push image to remote registry
[✓] CompleteK8sJibITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] ZeroConfigK8sGradleITCase - k8sApply - k8sApply, should deploy pod and service
[✓] ZeroConfigK8sGradleITCase - k8sLog - k8sLog, should retrieve log
[✓] ZeroConfigK8sGradleITCase - k8sUndeploy - k8sUndeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (6) passed successfully!!!

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

✔️ Test reports (OpenShift v3.11.0-other)
[✓] KarafOcITCase - ocBuild - oc:build, should create image
[✓] KarafOcITCase - ocResource - oc:resource, should create resource manifests
[✓] ThorntailOcITCase - ocBuild - oc:build, should create image
[✓] ThorntailOcITCase - ocResource - oc:resource, should create manifests
[✓] DslOcGradleITCase - ocBuild - ocBuild, should create image
[✓] DslOcGradleITCase - ocResource - ocResource, should create manifests
[✓] WildflyJarOcITCase - ocBuild - oc:build, should create image
[✓] WildflyJarOcITCase - ocResource - oc:resource, should create manifests
[✓] OpenLibertyOcITCase - ocBuild - oc:build, should create image
[✓] OpenLibertyOcITCase - ocResource - oc:resource, should create manifests
[✓] VertxOcITCase - ocBuild - oc:build, should create image
[✓] VertxOcITCase - ocResource - oc:resource, should create manifests
[✓] KarafOcITCase - ocApply - oc:apply, should create pod, service and route
[✓] KarafOcITCase - ocLog - oc:log, should retrieve log
[✓] KarafOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] ThorntailOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ThorntailOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] DslOcGradleITCase - ocApply - ocApply, should deploy pod and service
[✓] DslOcGradleITCase - ocHelm - ocHelm, should create Helm charts
[✓] DslOcGradleITCase - ocLog - ocLog, should retrieve log
[✓] DslOcGradleITCase - ocUndeploy - ocUndeploy, should delete all applied resources
[✓] WildflyJarOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] WildflyJarOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] OpenLibertyOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] OpenLibertyOcITCase - ocLog - oc:log, should retrieve log
[✓] VertxOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] OpenLibertyOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] VertxOcITCase - k8sLog - oc:log, should retrieve log
[✓] VertxOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] All tests (5) passed successfully!!!

✔️ Test reports (OpenShift v3.11.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!!!

✔️ Test reports (OpenShift v3.11.0-springboot)
[✓] 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
[✓] ZeroConfigOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ZeroConfigOcITCase - ocHelm - oc:helm, should create Helm charts
[✓] ZeroConfigOcGradleITCase - ocApply - ocApply, should deploy pod and service
[✓] ZeroConfigOcGradleITCase - ocHelm - ocHelm, should create Helm charts
[✓] ZeroConfigOcGradleITCase - ocLog - ocLog, should retrieve log
[✓] ZeroConfigOcITCase - ocLog - oc:log, 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.11.0-webapp)
[✓] JettyOcITCase - ocBuild - oc:build, should create image
[✓] JettyOcITCase - ocResource - oc:resource, should create manifests
[✓] ZeroConfigOcITCase - ocBuild - oc:build, should create image
[✓] JettyOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ZeroConfigOcITCase - ocResource - oc:resource, should create manifests
[✓] JettyOcITCase - ocLog - oc:log, should retrieve log
[✓] JettyOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] ZeroConfigOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ZeroConfigOcITCase - testNodePortResponse - Service as NodePort response should return String
[✓] WildFlyOcDockerModeITCase - ocBuild - oc:build, should create image using docker
[✓] ZeroConfigOcITCase - ocLog - oc:log, should retrieve log
[✓] WildFlyOcDockerModeITCase - ocResource - k8s:resource, should create manifests
[✓] ZeroConfigOcITCase - 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
[✓] WildFlyOcITCase - ocBuild - oc:build, should create image
[✓] WildFlyOcITCase - ocResource - oc:resource, should create manifests
[✓] 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
[✓] All tests (6) passed successfully!!!

✔️ Test reports (OpenShift v3.9.0-other)
[✓] KarafOcITCase - ocBuild - oc:build, should create image
[✓] KarafOcITCase - ocResource - oc:resource, should create resource manifests
[✓] ThorntailOcITCase - ocBuild - oc:build, should create image
[✓] ThorntailOcITCase - ocResource - oc:resource, should create manifests
[✓] WildflyJarOcITCase - ocBuild - oc:build, should create image
[✓] WildflyJarOcITCase - ocResource - oc:resource, should create manifests
[✓] DslOcGradleITCase - ocBuild - ocBuild, should create image
[✓] DslOcGradleITCase - ocResource - ocResource, should create manifests
[✓] VertxOcITCase - ocBuild - oc:build, should create image
[✓] VertxOcITCase - ocResource - oc:resource, should create manifests
[✓] OpenLibertyOcITCase - ocBuild - oc:build, should create image
[✓] OpenLibertyOcITCase - ocResource - oc:resource, should create manifests
[✓] KarafOcITCase - ocApply - oc:apply, should create pod, service and route
[✓] KarafOcITCase - ocLog - oc:log, should retrieve log
[✓] KarafOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] ThorntailOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ThorntailOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] WildflyJarOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] WildflyJarOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] DslOcGradleITCase - ocApply - ocApply, should deploy pod and service
[✓] DslOcGradleITCase - ocHelm - ocHelm, should create Helm charts
[✓] DslOcGradleITCase - ocLog - ocLog, should retrieve log
[✓] DslOcGradleITCase - ocUndeploy - ocUndeploy, should delete all applied resources
[✓] VertxOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] VertxOcITCase - k8sLog - oc:log, should retrieve log
[✓] OpenLibertyOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] VertxOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] OpenLibertyOcITCase - ocLog - oc:log, should retrieve log
[✓] OpenLibertyOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] All tests (5) passed successfully!!!

✔️ Test reports (OpenShift v3.9.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!!!

✔️ Test reports (OpenShift v3.9.0-springboot)
[✓] ZeroConfigOcGradleITCase - ocBuild - ocBuild, should create image
[✓] ZeroConfigOcGradleITCase - ocResource - ocResource, should create manifests
[✓] WatchOcITCase - watch_whenSourceModified_shouldLiveReloadChanges - watch, SHOULD hot reload application on changes
[✓] ZeroConfigOcITCase - ocBuild - oc:build, should create image
[✓] ZeroConfigOcGradleITCase - ocApply - ocApply, should deploy pod and service
[✓] ZeroConfigOcITCase - ocResource - oc:resource, should create manifests
[✓] ZeroConfigOcGradleITCase - ocHelm - ocHelm, should create Helm charts
[✓] ZeroConfigOcGradleITCase - ocLog - ocLog, should retrieve log
[✓] ZeroConfigOcGradleITCase - ocUndeploy - ocUndeploy, should delete all applied resources
[✓] ZeroConfigOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ZeroConfigOcITCase - ocHelm - oc:helm, should create Helm charts
[✓] ZeroConfigOcITCase - ocLog - oc:log, should retrieve log
[✓] ZeroConfigOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] All tests (6) passed successfully!!!

✔️ Test reports (OpenShift v3.9.0-webapp)
[✓] JettyOcITCase - ocBuild - oc:build, should create image
[✓] JettyOcITCase - ocResource - oc:resource, should create manifests
[✓] ZeroConfigOcITCase - ocBuild - oc:build, should create image
[✓] JettyOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] JettyOcITCase - ocLog - oc:log, should retrieve log
[✓] ZeroConfigOcITCase - ocResource - oc:resource, should create manifests
[✓] JettyOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] ZeroConfigOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ZeroConfigOcITCase - testNodePortResponse - Service as NodePort response should return String
[✓] WildFlyOcDockerModeITCase - ocBuild - oc:build, should create image using docker
[✓] ZeroConfigOcITCase - ocLog - oc:log, should retrieve log
[✓] WildFlyOcDockerModeITCase - ocResource - k8s:resource, should create manifests
[✓] ZeroConfigOcITCase - 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
[✓] WildFlyOcITCase - ocBuild - oc:build, should create image
[✓] WildFlyOcITCase - ocResource - oc:resource, should create manifests
[✓] 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
[✓] 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!!!

@rohanKanojia rohanKanojia force-pushed the pr/issue1033 branch 2 times, most recently from 5fc47fa to da09ca9 Compare August 2, 2022 11:24
@sonarcloud
Copy link

sonarcloud bot commented Aug 2, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

87.1% 87.1% Coverage
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Aug 2, 2022

Codecov Report

Merging #1686 (6a5284e) into master (fed7f07) will increase coverage by 1.25%.
The diff coverage is 83.25%.

@@             Coverage Diff              @@
##             master    #1686      +/-   ##
============================================
+ Coverage     55.77%   57.02%   +1.25%     
- Complexity     4287     4470     +183     
============================================
  Files           481      486       +5     
  Lines         21212    21751     +539     
  Branches       2841     2868      +27     
============================================
+ Hits          11831    12404     +573     
+ Misses         8173     8109      -64     
- Partials       1208     1238      +30     
Impacted Files Coverage Δ
...jkube/kit/build/service/docker/ArchiveService.java 0.00% <0.00%> (ø)
...e/jkube/kit/build/service/docker/WatchService.java 23.88% <0.00%> (-0.27%) ⬇️
...clipse/jkube/kit/enricher/api/EnricherContext.java 0.00% <ø> (ø)
...rg/eclipse/jkube/enricher/generic/GitEnricher.java 19.29% <0.00%> (-0.35%) ⬇️
...it/enricher/specific/KarafHealthCheckEnricher.java 0.00% <0.00%> (ø)
...se/jkube/springboot/watcher/SpringBootWatcher.java 13.33% <ø> (ø)
...clipse/jkube/maven/plugin/mojo/build/PushMojo.java 0.00% <0.00%> (ø)
...pse/jkube/maven/plugin/mojo/develop/WatchMojo.java 32.83% <0.00%> (-1.54%) ⬇️
.../jkube/gradle/plugin/task/KubernetesWatchTask.java 87.27% <25.00%> (-3.12%) ⬇️
...ube/gradle/plugin/task/KubernetesResourceTask.java 58.57% <50.00%> (-0.85%) ⬇️
... and 95 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rohanKanojia rohanKanojia marked this pull request as ready for review August 2, 2022 11:45
@sunix
Copy link
Member

sunix commented Aug 18, 2022

Nice work,

  1. I am not a big fan of the singleton. Would it be possible to inject it like the log object?
  2. I was wondering if it was possible to list the enrichers being used for resource goal/task.

@rohanKanojia rohanKanojia added the WIP Work in Progress label Oct 13, 2022
@rohanKanojia rohanKanojia force-pushed the pr/issue1033 branch 14 times, most recently from efc8c66 to 78c26b6 Compare October 18, 2022 13:12
@rohanKanojia rohanKanojia removed the WIP Work in Progress label Oct 18, 2022
@rohanKanojia rohanKanojia force-pushed the pr/issue1033 branch 3 times, most recently from bfe7405 to 7e5c93a Compare October 19, 2022 10:07
@sunix
Copy link
Member

sunix commented Nov 21, 2022

@rohanKanojia when you have some times, would it be possible to rebase this PR ?

@rohanKanojia rohanKanojia force-pushed the pr/issue1033 branch 2 times, most recently from 404ffbf to 6f4a574 Compare November 22, 2022 16:49
@sonarcloud
Copy link

sonarcloud bot commented Nov 22, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

81.5% 81.5% Coverage
0.0% 0.0% Duplication

@sunix
Copy link
Member

sunix commented Nov 23, 2022

@rohanKanojia
I am quite confuse of the result:
With this output we cannot see clearly see which task/goal have been executed the result (fail/success)

@sunix
Copy link
Member

sunix commented Nov 23, 2022

also when I run k8s:resource, it is displaying

[INFO] k8s: -------------------------------
[INFO] k8s:       SUMMARY
[INFO] k8s: -------------------------------
[INFO] k8s: Container images:
[INFO] k8s:  - sunix/hello-tomcat:latest
[INFO] k8s:     * Base image: quay.io/jkube/jkube-tomcat:0.0.17
[INFO] k8s:     * SHA: sha256:f875d
[INFO] k8s: 
[INFO] k8s: Build Strategy : Local Docker
[INFO] k8s: Generators applied: [webapp]
[INFO] k8s: 
[INFO] k8s: Enrichers applied: [jkube-controller,jkube-controller-from-configuration,jkube-service,jkube-image,jkube-portname,jkube-project-label,jkube-git,jkube-serviceaccount,jkube-ingress,jkube-revision-history,jkube-name,jkube-metadata,jkube-pod-annotations,jkube-container-env-java-options,jkube-replicas]
[INFO] k8s: Generated resources:
[INFO] k8s:  - target/classes/META-INF/jkube/kubernetes/hello-tomcat-service.yml
[INFO] k8s:  - target/classes/META-INF/jkube/kubernetes/hello-tomcat-deployment.yml
[INFO] k8s:  - target/classes/META-INF/jkube/kubernetes/hello-tomcat-ingress.yml
[INFO] k8s:  - target/classes/META-INF/jkube/kubernetes.yml

Are generators used in k8s:resource ? I am not sure, but if not, it should not be displayed right ?

@sunix
Copy link
Member

sunix commented Nov 23, 2022

OK but

Build Strategy : Local Docker

doesn't make sense right ?

@rohanKanojia
Copy link
Member Author

@sunix : What goal did you run for this output? I tried running mvn k8s:resource but I'm not able to see Build Strategy element in summary.

[[summary]]
= Summary

{plugin} can print a brief summary of the task it performed in order to give better idea of what's going on to the user. At the moment, most of the build related actions (build, push, resource, apply etc.) print summary. It can be disabled with `jkube.summaryEnabled` property.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{plugin} can print a brief summary of the task it performed in order to give better idea of what's going on to the user. At the moment, most of the build related actions (build, push, resource, apply etc.) print summary. It can be disabled with `jkube.summaryEnabled` property.
{plugin} prints a brief summary of the task it performed in order to give better idea of what's going on to the user. At the moment, most of the build related actions (build, push, resource, apply etc.) print summary. It can be disabled with `jkube.summaryEnabled` property.


private void printApplySummary(Summary summary) {
if (StringUtils.isNotBlank(summary.getAppliedClusterUrl())) {
logger.info("Applied resources from %s", summary.getAppliedClusterUrl());
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
logger.info("Applied resources from %s", summary.getAppliedClusterUrl());
logger.info("Applied resources to %s", summary.getAppliedClusterUrl());

private void printKubernetesResourceSummary(List<KubernetesResourceSummary> kubernetesResourceSummaries) {
if (kubernetesResourceSummaries != null && !kubernetesResourceSummaries.isEmpty()) {
for (KubernetesResourceSummary kubernetesResourceSummary : kubernetesResourceSummaries) {
logger.info(LIST_ELEMENT, kubernetesResourceSummary.getResourceName());
Copy link
Member

@sunix sunix Feb 16, 2023

Choose a reason for hiding this comment

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

This is what I have

[INFO] k8s: Applied resources from https://192.168.49.2:8443/
[INFO] k8s:  - quarkus
[INFO] k8s:    * v1 Service
[INFO] k8s:    * Namespace: default
[INFO] k8s:  - quarkus
[INFO] k8s:    * apps/v1 Deployment
[INFO] k8s:    * Namespace: default

I would try to be minimalist here and only display kind/name:

[INFO] k8s: Applied resources from https://192.168.49.2:8443/:  [ Service/quarkus, Deployment/quarkus ]

What do you think ?

Copy link
Member Author

Choose a reason for hiding this comment

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

okay, I've modified it as per your suggestion. Where should be specify deployed namespace?

Copy link
Member

Choose a reason for hiding this comment

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

I am unsure: are we always applying resources in the same namespace?

private void printResourceSummary(Summary summary, File baseDir) {
if (summary.getGeneratedResourceFiles() != null && !summary.getGeneratedResourceFiles().isEmpty()) {
if (summary.getEnrichersApplied() != null && summary.getEnrichersApplied().size() < 20) {
logger.info("Enrichers applied: [%s]", String.join(",", summary.getEnrichersApplied()));
Copy link
Member

Choose a reason for hiding this comment

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

Minor:
At the moment I have

[INFO] k8s: Enrichers applied: [jkube-dependency,jkube-controller,jkube-controller-from-configuration,jkube-service,jkube-image,jkube-portname,jkube-project-label,jkube-git,jkube-serviceaccount,jkube-prometheus,jkube-revision-history,jkube-name,jkube-metadata,jkube-pod-annotations,jkube-container-env-java-options]

Maybe it would be better with spaces

[INFO] k8s: Enrichers applied: [ jkube-dependency, jkube-controller, jkube-controller-from-configuration, jkube-service, jkube-image, jkube-portname, jkube-project-label, jkube-git, jkube-serviceaccount, jkube-prometheus, jkube-revision-history, jkube-name, jkube-metadata, jkube-pod-annotations, jkube-container-env-java-options ]

Copy link
Member

@sunix sunix left a comment

Choose a reason for hiding this comment

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

LGTM !!!

…kube#1033)

Add summary for jkube build actions in order to improve ux.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
@sonarcloud
Copy link

sonarcloud bot commented Mar 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

82.5% 82.5% Coverage
0.0% 0.0% Duplication

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.

Summary should be printed after JKube actions
3 participants