Search in sources :

Example 41 with AuthConfig

use of org.eclipse.jkube.kit.build.api.auth.AuthConfig in project jkube by eclipse.

the class DockerRegistryAuthHandlerTest method testDockerLoginNoConfig.

@Test
public void testDockerLoginNoConfig() throws IOException {
    executeWithTempHomeDir(dir -> {
        AuthConfig config = handler.create(RegistryAuthConfig.Kind.PUSH, "roland", null, s -> s);
        assertNull(config);
    });
}
Also used : AuthConfig(org.eclipse.jkube.kit.build.api.auth.AuthConfig) RegistryAuthConfig(org.eclipse.jkube.kit.build.api.auth.RegistryAuthConfig) Test(org.junit.Test)

Example 42 with AuthConfig

use of org.eclipse.jkube.kit.build.api.auth.AuthConfig in project jkube by eclipse.

the class DockerRegistryAuthHandlerTest method testDockerLoginNoAuthConfigFoundWhenCredentialHelperDoesNotMatchDomainOrAuth.

@Test
public void testDockerLoginNoAuthConfigFoundWhenCredentialHelperDoesNotMatchDomainOrAuth() throws IOException {
    executeWithTempHomeDir(homeDir -> {
        writeDockerConfigJson(createDockerConfig(homeDir), null, singletonMap("registry1", "credHelper1-does-not-exist"));
        AuthConfig config = handler.create(RegistryAuthConfig.Kind.PUSH, "roland", "does-not-exist-either:5000", s -> s);
        assertNull(config);
    });
}
Also used : AuthConfig(org.eclipse.jkube.kit.build.api.auth.AuthConfig) RegistryAuthConfig(org.eclipse.jkube.kit.build.api.auth.RegistryAuthConfig) Test(org.junit.Test)

Aggregations

AuthConfig (org.eclipse.jkube.kit.build.api.auth.AuthConfig)42 Test (org.junit.Test)34 RegistryAuthConfig (org.eclipse.jkube.kit.build.api.auth.RegistryAuthConfig)10 JsonObject (com.google.gson.JsonObject)6 Expectations (mockit.Expectations)6 IOException (java.io.IOException)4 HashMap (java.util.HashMap)4 Date (java.util.Date)3 MockUp (mockit.MockUp)3 ImageName (org.eclipse.jkube.kit.config.image.ImageName)3 ArrayList (java.util.ArrayList)2 HttpPost (org.apache.http.client.methods.HttpPost)2 StringEntity (org.apache.http.entity.StringEntity)2 AuthConfigFactory (org.eclipse.jkube.kit.build.service.docker.auth.AuthConfigFactory)2 RegistryServerConfiguration (org.eclipse.jkube.kit.common.RegistryServerConfiguration)2 SystemMock (org.eclipse.jkube.kit.common.SystemMock)2 Credential (com.google.cloud.tools.jib.api.Credential)1 Gson (com.google.gson.Gson)1 JsonPrimitive (com.google.gson.JsonPrimitive)1 KubernetesList (io.fabric8.kubernetes.api.model.KubernetesList)1