File: delete-setter.md

package info (click to toggle)
golang-k8s-sigs-kustomize-cmd-config 0.20.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 996 kB
  • sloc: makefile: 198; sh: 50
file content (65 lines) | stat: -rw-r--r-- 1,158 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
## delete-setter

[Alpha] Delete a custom setter for a Resource field

### Synopsis

Delete a custom setter for a Resource field.

  DIR

    A directory containing Resource configuration.

  NAME

    The name of the setter to create.

### Deleting a Custom Setter

**Given the YAML:**

    # resource.yaml
    apiVersion: v1
    kind: Service
    metadata:
      ...
    spec:
      ...
      ports:
        ...
      - name: http
        port: 8080  # {"type":"integer","x-kustomize":{"partialFieldSetters":[{"name":"http-port","value":"8080"}]}}
        ...

**Delete setter:**

    # delete a setter for ports
    $ kustomize cfg set create DIR/ http-port

comment will be removed for this field is not settable any more.

**Newly modified YAML:**

    # resource.yaml
    apiVersion: v1
    kind: Service
    metadata:
      ...
    spec:
      ...
      ports:
        ...
      - name: http
        port: 8080
        ...


### Deleting a setter used in substitution

If the setter is also used in substitution, it will ask you to delete the substitution first.


### Examples

    # delete a setter for port
    kustomize cfg create-setter DIR/ port