Skip to content

KubernetesMockServer provides incomplete Configuration while creating test Config for KubernetesClient #6068

Closed
@rohanKanojia

Description

Describe the bug

Kubernetes Mock Server initializes KubernetesClient with this opinionated Config during initialization

protected Config initConfig() {
return new ConfigBuilder(Config.empty())
.withMasterUrl(url("/"))
.withTrustCerts(true)
.withTlsVersions(TlsVersion.TLS_1_2)
.withNamespace("test")
.withHttp2Disable(true)
.build();
}

However, we don't set important attributes like :

  • Current Kubernetes Context being used
  • Test username
  • Test OAuthToken

This makes it difficult to use Kubernetes Mock Server with other clients (see #1601)

Fabric8 Kubernetes Client version

SNAPSHOT

Steps to reproduce

Create a test project and inspect kubernetesClient.getConfiguration() to see missing elements.

Expected behavior

KubernetesMockServer should create a valid opinionated Config so that it can be used by other clients.

Runtime

Kubernetes (vanilla)

Kubernetes API Server version

1.25.3@latest

Environment

Linux

Fabric8 Kubernetes Client Logs

No response

Additional context

No response

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions