kubernetes-client icon indicating copy to clipboard operation
kubernetes-client copied to clipboard

Pod uid not set as specified when creating it with Kubernetes Mock Server

Open Goshoy opened this issue 1 year ago • 2 comments

Describe the bug

Hi,

I am using io.fabric8.kubernetes.client.server.mock.KubernetesServer in CRUD mode. When I try to create a Pod using the KubernetesClient from the server and specify uid for the pod it is not taken into account and different one is assigned.

I am not completely sure if this is possible to work at all, so my question is if this is expected to work? If setting random uids is possible I would highly appreciate a little help to find what I am missing.

I am using version 6.13.0 of kubernetes-server-mock.

Best Regards, Georgi

Fabric8 Kubernetes Client version

SNAPSHOT

Steps to reproduce

First create server and obtain the client: KubernetesServer kubernetesServer = new KubernetesServer(false, true); KubernetesClient kubernetesClient = kubernetesServer.getKubernetesClient();

Then using the client try to create a Pod: kubernetesClient.pods().inNamespace("test").resource(newPodBuilder().withNewMetadata().withName("test").withUid("someUid").endMetadata().build()).create();

Check the pods to see that the uid of the pod is not set to "someUid": System.out.println(kubernetesClient.pods().list());

Expected behavior

The created Pod to have as uid the specified one.

Runtime

Kubernetes (vanilla)

Kubernetes API Server version

1.25.3@latest

Environment

macOS

Fabric8 Kubernetes Client Logs

No response

Additional context

No response

Goshoy avatar Jul 01 '24 15:07 Goshoy