forked from fabric8io/kubernetes-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix fabric8io#3972: taking the changes further to remove overloaded load
all parameter operations are now localized to template logic (overloaded get and load) also fixes kubernetesclientbuilder.withconfig
- Loading branch information
Showing
15 changed files
with
86 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
import io.fabric8.kubernetes.client.Config; | ||
import io.fabric8.kubernetes.client.ConfigBuilder; | ||
import io.fabric8.kubernetes.client.KubernetesClient; | ||
import io.fabric8.kubernetes.client.KubernetesClientBuilder; | ||
import io.fabric8.kubernetes.client.KubernetesClientException; | ||
import io.fabric8.kubernetes.client.dsl.ParameterNamespaceListVisitFromServerGetDeleteRecreateWaitApplicable; | ||
import io.fabric8.kubernetes.client.http.BasicBuilder; | ||
|
@@ -52,7 +53,6 @@ | |
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; | ||
import static org.junit.jupiter.api.Assertions.assertArrayEquals; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.fail; | ||
|
||
/** | ||
* @author [email protected] | ||
|
@@ -117,21 +117,19 @@ void loadWithWindowsLineSeparatorsString() throws Exception { | |
} | ||
|
||
@Test | ||
void shouldInstantiateClientUsingYaml() { | ||
void shouldInstantiateClientUsingYaml() throws Exception { | ||
File configYml = new File(TEST_CONFIG_YML_FILE); | ||
try (InputStream is = new FileInputStream(configYml)) { | ||
KubernetesClient client = KubernetesClientImpl.fromConfig(is); | ||
KubernetesClient client = new KubernetesClientBuilder().withConfig(is).build(); | ||
assertEquals("http://some.url/", client.getMasterUrl().toString()); | ||
} catch (Exception e) { | ||
fail(); | ||
} | ||
} | ||
|
||
@Test | ||
void shouldInstantiateClientUsingSerializeDeserialize() { | ||
KubernetesClientImpl original = new KubernetesClientImpl(); | ||
String json = Serialization.asJson(original.getConfiguration()); | ||
KubernetesClientImpl copy = KubernetesClientImpl.fromConfig(json); | ||
KubernetesClient copy = new KubernetesClientBuilder().withConfig(json).build(); | ||
|
||
assertEquals(original.getConfiguration().getMasterUrl(), copy.getConfiguration().getMasterUrl()); | ||
assertEquals(original.getConfiguration().getOauthToken(), copy.getConfiguration().getOauthToken()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.