Puppet Function: k8s::fetch_clusters

Defined in:
modules/k8s/functions/fetch_clusters.pp
Function type:
Puppet Language

Overview

k8s::fetch_clusters(Boolean $include_aliases = true)Hash[String, K8s::ClusterConfig]

SPDX-License-Identifier: Apache-2.0 This function returns the kubernetes cluster list from hiera Takes a Boolean parameter: include_aliases. If set to true, (default) cluster aliases will be returned If set to false, only real clusters will be returned (no aliases)

Parameters:

  • include_aliases (Boolean) (defaults to: true)

Returns:

  • (Hash[String, K8s::ClusterConfig])


6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'modules/k8s/functions/fetch_clusters.pp', line 6

function k8s::fetch_clusters (
    Boolean $include_aliases=true,
) >> Hash[String, K8s::ClusterConfig] {
  include k8s::clusters

  if $include_aliases {
    $k8s::clusters::by_cluster
  } else {
    $k8s::clusters::by_cluster.filter |$name, $config| {
      $config['cluster_alias'] != $name
    }
  }
}