diff --git a/crd-generator/api-v2/src/main/java/io/fabric8/crdv2/generator/CRDGenerator.java b/crd-generator/api-v2/src/main/java/io/fabric8/crdv2/generator/CRDGenerator.java index 62b010abac..d791efbfa1 100644 --- a/crd-generator/api-v2/src/main/java/io/fabric8/crdv2/generator/CRDGenerator.java +++ b/crd-generator/api-v2/src/main/java/io/fabric8/crdv2/generator/CRDGenerator.java @@ -16,7 +16,6 @@ package io.fabric8.crdv2.generator; import com.fasterxml.jackson.databind.ObjectMapper; - import io.fabric8.crdv2.generator.v1.CustomResourceHandler; import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.client.utils.ApiVersionUtil; @@ -71,10 +70,10 @@ public CRDGenerator withImplicitPreserveUnknownFields(boolean implicitPreserveUn this.implicitPreserveUnknownFields = implicitPreserveUnknownFields; return this; } - + public CRDGenerator withMinQuotes(boolean minQuotes) { - this.minQuotes = minQuotes; - return this; + this.minQuotes = minQuotes; + return this; } public CRDGenerator withParallelGenerationEnabled(boolean parallel) { diff --git a/crd-generator/maven-plugin/src/main/java/io/fabric8/crd/generator/maven/plugin/CrdGeneratorMojo.java b/crd-generator/maven-plugin/src/main/java/io/fabric8/crd/generator/maven/plugin/CrdGeneratorMojo.java index 5009b0b64c..bef3b6e372 100644 --- a/crd-generator/maven-plugin/src/main/java/io/fabric8/crd/generator/maven/plugin/CrdGeneratorMojo.java +++ b/crd-generator/maven-plugin/src/main/java/io/fabric8/crd/generator/maven/plugin/CrdGeneratorMojo.java @@ -128,7 +128,7 @@ public class CrdGeneratorMojo extends AbstractMojo { */ @Parameter(property = "fabric8.crd-generator.skip", defaultValue = "false") boolean skip; - + /** * If {@code true}, quotes will only be included where necessary */ diff --git a/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/utils/KubernetesSerialization.java b/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/utils/KubernetesSerialization.java index a05f9947a6..9e89598d3c 100644 --- a/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/utils/KubernetesSerialization.java +++ b/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/utils/KubernetesSerialization.java @@ -174,7 +174,7 @@ public String asJson(T object) { throw KubernetesClientException.launderThrowable(e); } } - + /** * Returns a YAML representation of the given object. * @@ -188,7 +188,7 @@ public String asJson(T object) { * @return a String containing a JSON representation of the provided object. */ public String asYaml(T object) { - return asYaml(object, false); + return asYaml(object, false); } /** diff --git a/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/utils/KubernetesSerializationTest.java b/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/utils/KubernetesSerializationTest.java index 159e398996..6dc8f26f0f 100644 --- a/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/utils/KubernetesSerializationTest.java +++ b/kubernetes-client-api/src/test/java/io/fabric8/kubernetes/client/utils/KubernetesSerializationTest.java @@ -70,30 +70,30 @@ void withRegisteredKubernetesResourceShouldDeserializeToPod() { assertThat(kubernetesSerialization. unmarshal("{\"kind\":\"Pod\", \"apiVersion\":\"v1\"}")) .isInstanceOf(io.fabric8.kubernetes.api.model.Pod.class); } - + @Test void asYaml() throws Exception { final String input = readYamlToString("/serialization/test-crd-schema.yml"); final CustomResourceDefinition crd = Serialization.unmarshal(input, CustomResourceDefinition.class); - + String result = kubernetesSerialization.asYaml(crd); assertThat(result).asString().contains("\"widgets.test.fabric8.io\""); result = kubernetesSerialization.asYaml(crd, false); assertThat(result).asString().contains("\"widgets.test.fabric8.io\""); - + result = kubernetesSerialization.asYaml(crd, true); assertThat(result).asString().doesNotContain("\"widgets.test.fabric8.io\""); assertThat(result).asString().contains("widgets.test.fabric8.io"); } - + private String readYamlToString(String path) throws IOException { - return Files.readAllLines( - new File(KubernetesSerializationTest.class.getResource(path).getFile()).toPath(), StandardCharsets.UTF_8) - .stream() - .filter(line -> !line.startsWith("#")) - .collect(Collectors.joining("\n")); - } + return Files.readAllLines( + new File(KubernetesSerializationTest.class.getResource(path).getFile()).toPath(), StandardCharsets.UTF_8) + .stream() + .filter(line -> !line.startsWith("#")) + .collect(Collectors.joining("\n")); + } @ParameterizedTest(name = "{index}: {0} {1} deserializes to {2}") @MethodSource("sameGVK")