From 0b4fda758554efd3beab782862743be45d431103 Mon Sep 17 00:00:00 2001 From: Bikouo Aubin <79859644+abikouo@users.noreply.github.com> Date: Wed, 11 Jan 2023 08:54:56 +0100 Subject: [PATCH] add documentation for filter plugin kubernetes.core.k8s_config_resource_name (#559) k8s_config_resource_name filter plugin - add missing documentation SUMMARY Fixes #558 ISSUE TYPE Docs Pull Request COMPONENT NAME kubernetes.core.k8s_config_resource_name Reviewed-by: Jill R Reviewed-by: Mike Graves --- ...esource_name-add-missing-documentation.yml | 3 ++ plugins/filter/k8s_config_resource_name.yml | 36 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 changelogs/fragments/k8s_config_resource_name-add-missing-documentation.yml create mode 100644 plugins/filter/k8s_config_resource_name.yml diff --git a/changelogs/fragments/k8s_config_resource_name-add-missing-documentation.yml b/changelogs/fragments/k8s_config_resource_name-add-missing-documentation.yml new file mode 100644 index 00000000..1d3283cb --- /dev/null +++ b/changelogs/fragments/k8s_config_resource_name-add-missing-documentation.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - add missing documentation for filter plugin kubernetes.core.k8s_config_resource_name (https://github.com/ansible-collections/kubernetes.core/issues/558). diff --git a/plugins/filter/k8s_config_resource_name.yml b/plugins/filter/k8s_config_resource_name.yml new file mode 100644 index 00000000..c014ec25 --- /dev/null +++ b/plugins/filter/k8s_config_resource_name.yml @@ -0,0 +1,36 @@ +--- +# Copyright (c) Ansible Project +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +DOCUMENTATION: + name: k8s_config_resource_name + short_description: Generate resource name for the given resource of type ConfigMap, Secret + description: + - Generate resource name for the given resource of type ConfigMap, Secret. + - Resource must have a C(metadata.name) key to generate a resource name + options: + _input: + description: + - A valid YAML definition for a ConfigMap or a Secret. + type: dict + required: true + author: + - ansible cloud team + +EXAMPLES: | + # Dump generated name for a configmap into a variable + - set_fact: + generated_name: '{{ definition | kubernetes.core.k8s_config_resource_name }}' + vars: + definition: + apiVersion: v1 + kind: ConfigMap + metadata: + name: myconfigmap + namespace: mynamespace + +RETURN: + _value: + description: Generated resource name. + type: str