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

Create a KubernetesDevServiceInfoBuildItem #46386

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

cmoulliard
Copy link
Contributor

  • Produce a KubernetesDevServiceInfoBuildItem when a kubernetes testContainer is created to allow to get cluster information (id, kubeConfig in YAML string format) and use use such information part of a DevService consuming it (example: quarkus-argocd, quarkus-tekton, etc)
// We produce it
...
            container.start();

            KubeConfig kubeConfig = KubeConfigUtils.parseKubeConfig(container.getKubeconfig());

            devServicesKube
                    .produce(new KubernetesDevServiceInfoBuildItem(container.getKubeconfig(), container.getContainerId()));

// DevService consuming it
    @BuildStep
    public DevServicesResultBuildItem deployArgocd(
            ArgocdBuildTimeConfig config,
            Optional<KubernetesDevServiceInfoBuildItem> kubeServiceInfo) {
...
        // Create the Kubernetes client using the Kube YAML Config
        KubernetesClient client = new KubernetesClientBuilder()
                .withConfig(io.fabric8.kubernetes.client.Config.fromKubeconfig(kubeServiceInfo.get().getKubeConfig()))
                .build();

Copy link
Contributor

@iocanel iocanel left a comment

Choose a reason for hiding this comment

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

LGMT

@iocanel iocanel added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Feb 20, 2025
Copy link

quarkus-bot bot commented Feb 20, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit d695154.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@iocanel iocanel merged commit d0768d3 into quarkusio:main Feb 20, 2025
28 checks passed
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Feb 20, 2025
@quarkus-bot quarkus-bot bot added this to the 3.21 - main milestone Feb 20, 2025
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Feb 20, 2025

import io.quarkus.builder.item.SimpleBuildItem;

public final class KubernetesDevServiceInfoBuildItem extends SimpleBuildItem {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to have some Javadoc for this

@gsmet gsmet modified the milestones: 3.21 - main, 3.19.2 Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Produce a KubernetesDevServiceInfoBuildItem forDevServices requiring to use a Kubernetes cluster
4 participants