-
Notifications
You must be signed in to change notification settings - Fork 480
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
k8s:watch uses default namespace even if other namespace is configured #1180
Comments
@petergarnaes : Thanks a lot for reporting. I can reproduce this issue. Looks like instead of reading contexts:
- context:
cluster: minikube
namespace: default
user: minikube
name: minikube |
@rohanKanojia you are correct, don't know why i did not think of that! Thanks for helping me move on in the current version of the plugin. |
… if other namespace is configured No namespace is specified to Watcher while delegating watch task from Mojos/Tasks to JKube Kit. Right now Watcher was just picking namespace from `clusterAccess.getNamespace()` (namespace provided in current context in `.kube/config`). Add an additional namespace parameter in Watcher.watch(...) method for providing configured namespace. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
I've created a fix for this issue. I think now watch should pick correct configured namespace Using Kubernetes Maven Plugin, I tested this via adding a namespace in plugin configuration which was not equal to the one in kubeconfig current context: <plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>${jkube.version}</version>
<configuration>
<namespace>development</namespace>
</configuration>
</plugin> Using Kubernetes Gradle Plugin, I specified namespace in Groovy configuration: plugins {
id 'org.eclipse.jkube.kubernetes' version '1.5.1'
}
kubernetes {
namespace = 'development'
} |
… if other namespace is configured No namespace is specified to Watcher while delegating watch task from Mojos/Tasks to JKube Kit. Right now Watcher was just picking namespace from `clusterAccess.getNamespace()` (namespace provided in current context in `.kube/config`). Add an additional namespace parameter in Watcher.watch(...) method for providing configured namespace. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
… if other namespace is configured No namespace is specified to Watcher while delegating watch task from Mojos/Tasks to JKube Kit. Right now Watcher was just picking namespace from `clusterAccess.getNamespace()` (namespace provided in current context in `.kube/config`). Add an additional namespace parameter in Watcher.watch(...) method for providing configured namespace. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
… if other namespace is configured No namespace is specified to Watcher while delegating watch task from Mojos/Tasks to JKube Kit. Right now Watcher was just picking namespace from `clusterAccess.getNamespace()` (namespace provided in current context in `.kube/config`). Add an additional namespace parameter in Watcher.watch(...) method for providing configured namespace. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…espace is configured No namespace is specified to Watcher while delegating watch task from Mojos/Tasks to JKube Kit. Right now Watcher was just picking namespace from `clusterAccess.getNamespace()` (namespace provided in current context in `.kube/config`). Add an additional namespace parameter in Watcher.watch(...) method for providing configured namespace. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
Description
Info
mvn -v
) :Issue
I am working on a Rancher cluster
Since it involves a Rancher cluster, I can't give a good guide on how to reproduce, but the issue is pretty straight forward. When I am trying to run
mvn k8s:resource k8s:build k8s:push k8s:watch
, my docker image is built, pushed and deployed correctly (I can find the deployment in the cluster) but I get the following error:Not providing access to the default namespace is by design in Rancher clusters. I do have the namespace configured in my
pom.xml
:I would expect
k8s:watch
to use the configured namespace.Full stack trace
The text was updated successfully, but these errors were encountered: