diff --git a/CHANGELOG.md b/CHANGELOG.md index 89d458ef1b8..1e474e1132a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ #### Improvements * Fix: CustomResourceDefinitionContext.fromCrd support for v1 CustomResourceDefinition +* Fix #2642: Update kubernetes-examples to use apps/v1 Deployment rather than extensions/v1beta1 #### Dependency Upgrade diff --git a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/LoadMultipleDocumentsFromFileExample.java b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/LoadMultipleDocumentsFromFileExample.java index dbb741af239..fdab6e48687 100644 --- a/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/LoadMultipleDocumentsFromFileExample.java +++ b/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/LoadMultipleDocumentsFromFileExample.java @@ -23,24 +23,27 @@ import io.fabric8.kubernetes.client.DefaultKubernetesClient; import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.kubernetes.client.utils.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.List; import java.util.Map; public class LoadMultipleDocumentsFromFileExample { + private static final Logger logger = LoggerFactory.getLogger(LoadMultipleDocumentsFromFileExample.class); - public static void main(String[] args) throws InterruptedException { + public static void main(String[] args) { String master = "https://localhost:8443/"; if (args.length == 1) { master = args[0]; } Config config = new ConfigBuilder().withMasterUrl(master).build(); - try (KubernetesClient client = new DefaultKubernetesClient(config)) { + try (final KubernetesClient client = new DefaultKubernetesClient(config)) { List list = client.load(LoadMultipleDocumentsFromFileExample.class.getResourceAsStream("/multiple-document-template.yml")).get(); - System.out.println("Found in file:" + list.size() + " items."); + logger.info("Found in file: {} items.", list.size()); for (HasMetadata meta : list) { - System.out.println(display(meta)); + logger.info(display(meta)); } list = client.load(LoadMultipleDocumentsFromFileExample.class.getResourceAsStream("/multiple-document-template.yml")) @@ -51,9 +54,9 @@ public void visit(ObjectMetaBuilder item) { } }).get(); - System.out.println("Visited:" + list.size() + " items."); + logger.info("Visited: {} items.", list.size()); for (HasMetadata meta : list) { - System.out.println(display(meta)); + logger.info(display(meta)); } } } diff --git a/kubernetes-examples/src/main/resources/multiple-document-template.yml b/kubernetes-examples/src/main/resources/multiple-document-template.yml index e193cf4ecbe..edb7814b226 100644 --- a/kubernetes-examples/src/main/resources/multiple-document-template.yml +++ b/kubernetes-examples/src/main/resources/multiple-document-template.yml @@ -31,7 +31,7 @@ spec: tier: backend role: master --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: redis---master--- @@ -70,7 +70,7 @@ spec: tier: backend role: slave --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: redis-slave @@ -118,7 +118,7 @@ spec: app: guestbook tier: frontend --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: frontend