list-setters

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

list-setters

Overview

Lists information about [setters] like setter name, values and count.

Refer to the create-setters function documentation for information about creating new setters or apply-setters function documentation for information about updating the field values parameterized by setters.

Usage

list-setters function is expected to be executed imperatively like

$ kpt fn eval -i list-setters:v0.1

list-setters function performs the following steps:

  1. Searches for setter comments in input list of resources.
  2. Lists discovered setters and related information.

Examples

Listing setters in a package

Let's start with the input resource in a package

# resources.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-nginx
spec:
  replicas: 4 # kpt-set: ${nginx-replicas}
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: "nginx:1.16.1" # kpt-set: nginx:${tag}
        ports:
        - protocol: TCP
          containerPort: 80

Invoke the function:

$ kpt fn eval --image gcr.io/kpt-fn/list-setters:v0.1

Output looks like the following:

  Results:
    [INFO] Name: nginx-replicas, Value: 4, Type: int, Count: 1
    [INFO] Name: tag, Value: 1.16.1, Type: str, Count: 1

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Code generated by "mdtogo"; DO NOT EDIT.
Code generated by "mdtogo"; DO NOT EDIT.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL