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

kubernetes gradle plugin: Should k8sBuild require kubernetes cluster to be configured ? #1156

Closed
sunix opened this issue Dec 1, 2021 · 1 comment · Fixed by #1652
Closed
Assignees
Labels
component/gradle-plugin Related to the Gradle Plugins
Milestone

Comments

@sunix
Copy link
Member

sunix commented Dec 1, 2021

Description

I am trying to run k8sBuild and get this error with podman:

$ ./gradlew k8sBuild

> Task :k8sBuild
k8s: Cannot access cluster for detecting mode: Failure executing: GET at: https://XX.XX.XX.XX/apis. Message: Forbidden! User gke_eclipse-che-1-XXXXXX_europe-west1-b_eclipse-che-XXXXXX doesn't have permission. forbidden: User "system:anonymous" cannot get path "/apis".
k8s: Running in Kubernetes mode
k8s: Building container image in Kubernetes mode

BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed

$ podman images
REPOSITORY  TAG         IMAGE ID    CREATED     SIZE
  1. this is strange that it is requiring kubernetes to be configured to work.
  2. it is marked as successful but no image has been built.

Info

  • Eclipse JKube version : 1.6.0-SNAPSHOT

  • Sample Reproducer Project : testing with a gradle project generated from https://code.quarkus.io/

@manusa manusa added component/gradle-plugin Related to the Gradle Plugins and removed component/gradle-plugin Related to the Gradle Plugins labels Dec 21, 2021
@manusa
Copy link
Member

manusa commented Dec 21, 2021

One option could be to make the client and clusterAccess fields in JKubeServiceHub lazy.

They would only be initialized provided that we are not offline and only when they are needed.

@manusa manusa added the component/gradle-plugin Related to the Gradle Plugins label Jan 12, 2022
@rohanKanojia rohanKanojia self-assigned this Jul 12, 2022
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Jul 13, 2022
…en when it's not required (eclipse-jkube#1156)

Rather than directly initializing ClusterAccess and KubernetesClient
while initializing JKubeServiceHub, do lazy initialization instead. This
way ClusterAccess would only created when it's required.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Aug 2, 2022
…en when it's not required (eclipse-jkube#1156)

Rather than directly initializing ClusterAccess and KubernetesClient
while initializing JKubeServiceHub, do lazy initialization instead. This
way ClusterAccess would only created when it's required.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
manusa pushed a commit to rohanKanojia/jkube that referenced this issue Aug 4, 2022
…en when it's not required (eclipse-jkube#1156)

Rather than directly initializing ClusterAccess and KubernetesClient
while initializing JKubeServiceHub, do lazy initialization instead. This
way ClusterAccess would only created when it's required.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
@manusa manusa added this to the 1.9.0 milestone Aug 4, 2022
manusa pushed a commit that referenced this issue Aug 4, 2022
…en when it's not required (#1156)

Rather than directly initializing ClusterAccess and KubernetesClient
while initializing JKubeServiceHub, do lazy initialization instead. This
way ClusterAccess would only created when it's required.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/gradle-plugin Related to the Gradle Plugins
Projects
None yet
3 participants