Skip to content

Commit

Permalink
chore (jkube-kit/common) : Remove workaround added for Fabric8 Kubern…
Browse files Browse the repository at this point in the history
…etes Mock Server empty context

fabric8io/kubernetes-client#6068 has been
fixed and we've upgraded to KubernetesClient v6.13.1 which already
contains fix for the abovementioned issue.

We don't need to have this method anymore.

Signed-off-by: Rohan Kumar <[email protected]>
  • Loading branch information
rohanKanojia committed Jul 11, 2024
1 parent 1868f35 commit 43a4a0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -470,17 +470,17 @@ void exportKubernetesClientConfigToFile_whenInvalidFileProvided_thenThrowExcepti
@DisplayName("should work with KubernetesClient config provided by KubernetesMockServer")
void exportKubernetesClientConfigToFile_worksWithKubernetesMockServer(@TempDir Path temporaryFolder) throws IOException {
// When
final Path result = KubernetesMockServerUtil.exportKubernetesClientConfigToFile(mockServer, temporaryFolder.resolve("config"));
final Path result = KubernetesHelper.exportKubernetesClientConfigToFile(mockClient.getConfiguration(), temporaryFolder.resolve("config"));
// Then
final io.fabric8.kubernetes.api.model.Config kc = Serialization
.unmarshal(result.toFile(), io.fabric8.kubernetes.api.model.Config.class);
assertThat(kc)
.hasFieldOrPropertyWithValue("currentContext", "mock-server")
.hasFieldOrPropertyWithValue("currentContext", "fabric8-mock-server-context")
.satisfies(c -> assertThat(c.getContexts())
.singleElement(InstanceOfAssertFactories.type(NamedContext.class))
.hasFieldOrPropertyWithValue("name", "mock-server")
.hasFieldOrPropertyWithValue("name", "fabric8-mock-server-context")
.hasFieldOrPropertyWithValue("context.namespace", "test")
.hasFieldOrPropertyWithValue("context.user", "mock-server-user")
.hasFieldOrPropertyWithValue("context.user", "fabric8-mock-server-user")
.extracting("context.cluster").asString()
.matches("localhost:\\d+")
)
Expand All @@ -492,7 +492,7 @@ void exportKubernetesClientConfigToFile_worksWithKubernetesMockServer(@TempDir P
)
.satisfies(c -> assertThat(c.getUsers())
.singleElement(InstanceOfAssertFactories.type(NamedAuthInfo.class))
.hasFieldOrPropertyWithValue("name", "mock-server-user"));
.hasFieldOrPropertyWithValue("name", "fabric8-mock-server-user"));
}

@Test
Expand Down

This file was deleted.

0 comments on commit 43a4a0c

Please sign in to comment.