Closed FWiesner closed 4 years ago
final var resourceClient = istioClient.v1beta1ServiceEntry();
final var se = resourceClient.inNamespace("istio-trials").list().getItems().get(0);
resourceClient.inNamespace("istio-trials").createOrReplace(se);
I'm btw on Istio 1.6.2 with Kubernetes 1.18.4
I tried with DestinationRule
as well. Namespaces don't properly work there as well (here the inNamespace
is fully ignored):
var istioClient = k8sClient.adapt(IstioClient.class);
var rule = istioClient.v1beta1DestinationRule().inNamespace("istio-trials").list().getItems().get(0);
log.atInfo().log("DestinationRule: %s", rule);
istioClient.v1beta1DestinationRule().inNamespace("istio-trials").createOrReplace(rule);
This throws Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: io.fabric8.kubernetes.client.KubernetesClientException: Namespace mismatch. Item namespace:istio-system. Operation namespace:istio-trials. at io.fabric8.kubernetes.client.dsl.base.OperationSupport.checkNamespace(OperationSupport.java:184) at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleCreate(OperationSupport.java:250) at io.fabric8.kubernetes.client.dsl.base.BaseOperation.handleCreate(BaseOperation.java:844) at io.fabric8.kubernetes.client.dsl.base.BaseOperation.create(BaseOperation.java:352) at io.fabric8.kubernetes.client.dsl.base.BaseOperation.createOrReplace(BaseOperation.java:413) at io.fabric8.kubernetes.client.dsl.base.BaseOperation.createOrReplace(BaseOperation.java:79) at io.fabric8.kubernetes.client.dsl.base.BaseOperation.createOrReplace(BaseOperation.java:410) at io.fabric8.kubernetes.client.dsl.base.BaseOperation.createOrReplace(BaseOperation.java:79)
makes no difference whether I use v1alpha3 or v1beta1 alternatives
Another update: it seems this is caused because of recent changes in the fabric8.io client integrating a new interface io.fabric8.kubernetes.api.model.Namespaced
that all model elements seem to have to implement
switching back to 4.9.0 solves the problem
Thank you for the investigation and fix! I will also address the TLS enum issue as this is actually an error that got through the go-to-java conversion process…
Hi,
when trying to creating
ServiceEntry
, the code fails as the Istio client seems to treatServiceEntry
as non-namespaced resource type:I'm using the latest master code