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

oc:build does not update labels and annotations in Openshift Build resource #2500

Closed
MimerPlusPlus opened this issue Dec 13, 2023 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@MimerPlusPlus
Copy link

Describe the bug

(As discussed with @rohanKanojia on Gitter)
jKube does not update pom version and git information in labels (.metadata.labels.version) and annotations (jkube.io/git-branch and kube.io/git-commit) with current information from the Maven build. Instead the information is just copied from the BuildConfig.

Tested on OpenShift 4.12 with Maven 3.9.4 and jKube 1.3.0 (from Red Hat Fuse)

Eclipse JKube version

1.3.0

Component

Kubernetes Maven Plugin

Apache Maven version

other (please specify in additional context)

Gradle version

None

Steps to reproduce

  1. Build and apply a project to OpenShift (creating a BuildConfig and a Build)
  2. Update to new GitBranch and commit a new POM version.
  3. Do a mvn oc:build
  4. Verify that latest OpenShift Build has updated to POM version and Git commit/branch in labels and annotations.

Expected behavior

Latest OpenShift Build should be updated with latest POM version and Git information (branch and commit key)

Runtime

OpenShift

Kubernetes API Server version

other (please specify in additional context)

Environment

macOS

Eclipse JKube Logs

No response

Sample Reproducer Project

No response

Additional context

No response

@MimerPlusPlus MimerPlusPlus added the bug Something isn't working label Dec 13, 2023
@rohanKanojia
Copy link
Member

@manusa
Copy link
Member

manusa commented Dec 19, 2023

Suggested changes:

  • Git issues
    • GitEnricher should implement enrich instead of create
    • GitEnricherTest should verify that the current supported Kubernetes objects get enriched (use of KubernetesListBuilder and test overall behavior)
    • GitEnricherTest should contain a new clause for the OpenShift build-related resources (Build, BuildConfig...)
    • GitEnricher should be modified to use a generic visitor instead of providing specific visitors.
  • Project label
    • Doesn't update the version number (or any other project-related info) on subsequent builds.
    • OpenShiftBuildService might need to consider the changes in metadata (such as labels and annotations) -- evaluate possible side-effects

@rohanKanojia
Copy link
Member

@manusa : Shall we close this issue? I had moved BuildConfig's version label related behavior into #2561 .

@manusa manusa closed this as completed Jan 25, 2024
@github-project-automation github-project-automation bot moved this from Review to Done in Eclipse JKube Jan 25, 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

3 participants