From 9272bd862ec0608bf63c2a6b45134662149e434b Mon Sep 17 00:00:00 2001 From: Wissem BEN CHAABANE Date: Thu, 7 Oct 2021 06:17:32 +0200 Subject: [PATCH] [REVIEW] Revert k8s docs files --- .../kubernetes.core.k8s_json_patch_module.rst | 2 +- docs/kubernetes.core.k8s_log_module.rst | 17 ++++++++++++++++ docs/kubernetes.core.k8s_lookup.rst | 20 ++++++++++++------- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/docs/kubernetes.core.k8s_json_patch_module.rst b/docs/kubernetes.core.k8s_json_patch_module.rst index 575466fd36c..dad68d7b4e1 100644 --- a/docs/kubernetes.core.k8s_json_patch_module.rst +++ b/docs/kubernetes.core.k8s_json_patch_module.rst @@ -18,7 +18,7 @@ Version added: 2.0.0 Synopsis -------- - This module is used to apply RFC 6902 JSON patch operations only. -- Use the :ref:`k8s ` module for strategic merge or JSON merge operations. +- Use the :ref:`kubernetes.core.k8s ` module for strategic merge or JSON merge operations. - The jsonpatch library is required for check mode. diff --git a/docs/kubernetes.core.k8s_log_module.rst b/docs/kubernetes.core.k8s_log_module.rst index 22119d2b605..964c1527959 100644 --- a/docs/kubernetes.core.k8s_log_module.rst +++ b/docs/kubernetes.core.k8s_log_module.rst @@ -384,6 +384,22 @@ Parameters + + +
+ since_seconds + +
+ string +
+
added in 2.2.0
+ + + + +
A relative time in seconds before the current time from which to show logs.
+ +
@@ -458,6 +474,7 @@ Examples kind: Deployment namespace: testing name: example + since_seconds: "4000" register: log # This will get the log from a single Pod managed by this DeploymentConfig diff --git a/docs/kubernetes.core.k8s_lookup.rst b/docs/kubernetes.core.k8s_lookup.rst index 9337796acd4..9e428c8beae 100644 --- a/docs/kubernetes.core.k8s_lookup.rst +++ b/docs/kubernetes.core.k8s_lookup.rst @@ -381,6 +381,12 @@ Parameters
+Notes +----- + +.. note:: + - While querying, please use ``query`` or ``lookup`` format with ``wantlist=True`` to provide an easier and more consistent interface. For more details, see https://docs.ansible.com/ansible/latest/plugins/lookup.html#forcing-lookups-to-return-lists-query-and-wantlist-true. + Examples @@ -390,23 +396,23 @@ Examples - name: Fetch a list of namespaces set_fact: - projects: "{{ lookup('kubernetes.core.k8s', api_version='v1', kind='Namespace') }}" + projects: "{{ query('kubernetes.core.k8s', api_version='v1', kind='Namespace') }}" - name: Fetch all deployments set_fact: - deployments: "{{ lookup('kubernetes.core.k8s', kind='Deployment') }}" + deployments: "{{ query('kubernetes.core.k8s', kind='Deployment') }}" - name: Fetch all deployments in a namespace set_fact: - deployments: "{{ lookup('kubernetes.core.k8s', kind='Deployment', namespace='testing') }}" + deployments: "{{ query('kubernetes.core.k8s', kind='Deployment', namespace='testing') }}" - name: Fetch a specific deployment by name set_fact: - deployments: "{{ lookup('kubernetes.core.k8s', kind='Deployment', namespace='testing', resource_name='elastic') }}" + deployments: "{{ query('kubernetes.core.k8s', kind='Deployment', namespace='testing', resource_name='elastic') }}" - name: Fetch with label selector set_fact: - service: "{{ lookup('kubernetes.core.k8s', kind='Service', label_selector='app=galaxy') }}" + service: "{{ query('kubernetes.core.k8s', kind='Service', label_selector='app=galaxy') }}" # Use parameters from a YAML config @@ -416,11 +422,11 @@ Examples - name: Using the config (loaded from a file in prior task), fetch the latest version of the object set_fact: - service: "{{ lookup('kubernetes.core.k8s', resource_definition=config) }}" + service: "{{ query('kubernetes.core.k8s', resource_definition=config) }}" - name: Use a config from the local filesystem set_fact: - service: "{{ lookup('kubernetes.core.k8s', src='service.yml') }}" + service: "{{ query('kubernetes.core.k8s', src='service.yml') }}"