Skip to content

Commit

Permalink
DONT MERGE
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Nuri <marc@marcnuri.com>
  • Loading branch information
manusa committed Dec 3, 2024
1 parent 4ad83f7 commit 377dca9
Show file tree
Hide file tree
Showing 50 changed files with 402 additions and 1,098 deletions.
18 changes: 9 additions & 9 deletions .jenkins/pipelines/java-8.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pipeline {
tools {
maven 'apache-maven-latest'
// https://wiki.eclipse.org/Jenkins#JDK
jdk 'temurin-jdk8-latest'
jdk 'temurin-jdk11-latest'
}
options {
disableConcurrentBuilds(abortPrevious: true)
Expand All @@ -14,14 +14,14 @@ pipeline {
stage('Build & Test (Java 8)') {
steps {
sh 'echo "Building Project with Java 8"'
sh '''
if [[ `javac -version 2>&1` == *"1.8.0"* ]]; then
echo "Java 8 Present."
else
echo "Java 8 Not Present."
exit 1
fi
'''
// sh '''
// if [[ `javac -version 2>&1` == *"1.8.0"* ]]; then
// echo "Java 8 Present."
// else
// echo "Java 8 Not Present."
// exit 1
// fi
// '''
sh './mvnw -V -B -e install'
}
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ static Stream<Arguments> data() {
return Stream.of(
arguments("zero-config-no-host", "", "", "", "false"),
arguments("zero-config-host-enricher-config", "test.example.com", "", "", "false"),
arguments("zero-config-extensionsv1beta1-enricher-config", "", "extensions/v1beta1", "", "false"),
arguments("zero-config-extensionsv1beta1-host-enricher-config", "test.example.com", "extensions/v1beta1", "", "false"),
arguments("groovy-dsl-config", "", "", "org.eclipse.jkube.quickstart", "true")
);
}
Expand Down
2 changes: 1 addition & 1 deletion gradle-plugin/kubernetes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>openshift-server-mock</artifactId>
<artifactId>kubernetes-server-mock</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
2 changes: 1 addition & 1 deletion gradle-plugin/openshift/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>openshift-server-mock</artifactId>
<artifactId>kubernetes-server-mock</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ void pullImageWithPolicy_whenPullFailure_thenThrowException() throws IOException
// When
assertThatExceptionOfType(DockerAccessException.class)
.isThrownBy(() -> registryService.pullImageWithPolicy("example.org/foo/bar:latest", imagePullManager, registryConfig, buildConfiguration))
.withMessage("Unable to pull 'example.org/foo/bar:latest' from registry 'example.org' : {\"message\":\"ERROR\"} (Server Error: 500)");
.withMessage("Unable to pull 'example.org/foo/bar:latest' from registry 'example.org' : {\"message\":\"ERROR\"} (Internal Server Error: 500)");
}

private RegistryConfig createNewRegistryConfig(String registry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void pushImage_whenPushFailed_thenThrowException() throws IOException {
// When
assertThatExceptionOfType(DockerAccessException.class)
.isThrownBy(() -> registryService.pushImage(imageConfiguration, 0, registryConfig, false))
.withMessage("Unable to push 'example.org/foo/bar:latest' to registry 'example.org' : {\"message\":\"ERROR\"} (Server Error: 500)");
.withMessage("Unable to push 'example.org/foo/bar:latest' to registry 'example.org' : {\"message\":\"ERROR\"} (Internal Server Error: 500)");
}

@Test
Expand Down
11 changes: 6 additions & 5 deletions jkube-kit/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
<artifactId>openshift-client</artifactId>
</dependency>

<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-model-validator</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down Expand Up @@ -133,7 +138,7 @@
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>openshift-server-mock</artifactId>
<artifactId>kubernetes-server-mock</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
Expand All @@ -143,10 +148,6 @@
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>json-schema-validator</artifactId>
</dependency>
<dependency>
<groupId>com.marcnuri.helm-java</groupId>
<artifactId>helm-java</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ public static Path exportKubernetesClientConfigToFile(io.fabric8.kubernetes.clie
kubeConfigBuilder.addToContexts(kubernetesClientConfig.getCurrentContext());
kubeConfigBuilder.withCurrentContext(kubernetesClientConfig.getCurrentContext().getName());
kubeConfigBuilder.addToUsers(createKubeConfigUserFromClient(kubernetesClientConfig));
KubeConfigUtils.persistKubeConfigIntoFile(kubeConfigBuilder.build(), targetKubeConfig.toString());
KubeConfigUtils.persistKubeConfigIntoFile(kubeConfigBuilder.build(), targetKubeConfig.toFile());
return targetKubeConfig;
} catch (IOException ioException) {
throw new JKubeException("Failure in exporting KubernetesClient config : " + ioException.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

import io.fabric8.kubernetes.api.model.HasMetadata;
Expand Down Expand Up @@ -53,7 +54,7 @@ public static boolean isOpenShift(KubernetesClient client) {


public static KubernetesList processTemplatesLocally(Template entity, boolean failOnMissingParameterValue) {
List<HasMetadata> objects = null;
List<?> objects = null;
if (entity != null) {
objects = entity.getObjects();
if (objects == null || objects.isEmpty()) {
Expand Down Expand Up @@ -86,7 +87,8 @@ public static KubernetesList processTemplatesLocally(Template entity, boolean fa
return Serialization.unmarshal(json, KubernetesList.class);
} else {
KubernetesList answer = new KubernetesList();
answer.setItems(objects);
Objects.requireNonNull(objects).stream().filter(o -> o instanceof HasMetadata)
.forEach(o -> answer.getItems().add((HasMetadata) o));
return answer;
}
}
Expand All @@ -109,9 +111,9 @@ public static boolean isFinished(String status) {
}

public static Template combineTemplates(Template firstTemplate, Template template) {
List<HasMetadata> objects = template.getObjects();
List<?> objects = template.getObjects();
if (objects != null) {
for (HasMetadata object : objects) {
for (Object object : objects) {
addTemplateObject(firstTemplate, object);
}
}
Expand Down Expand Up @@ -156,8 +158,8 @@ private static void combineParameters(List<Parameter> parameters, List<Parameter
}
}

private static void addTemplateObject(Template template, HasMetadata object) {
List<HasMetadata> objects = template.getObjects();
private static void addTemplateObject(Template template, Object object) {
List<Object> objects = template.getObjects();
objects.add(object);
template.setObjects(objects);
}
Expand Down
Loading

0 comments on commit 377dca9

Please sign in to comment.