Skip to content

Commit e14d958

Browse files
committed
Update kuberc example with finalized version
1 parent e1d4725 commit e14d958

File tree

1 file changed

+27
-31
lines changed

1 file changed

+27
-31
lines changed

keps/sig-cli/3104-introduce-kuberc/README.md

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -311,41 +311,37 @@ Three initial top level keys are proposed.
311311

312312
* `apiVersion` to determine the version of the config.
313313
* `kind` to keep consistency with Kubernetes resources.
314-
* `command`
315-
* `aliases` for users to declare their own aliases for commands with flags and values.
316-
* `overrides` for users to set default flags to apply to commands.
314+
* `aliases` for users to declare their own aliases for commands with flags and values.
315+
* `overrides` for users to set default flags to apply to commands.
317316

318-
`command.aliases` will not be allowed to override builtins but take precedence of plugins i.e. builtins -> aliases -> plugins. Additional flags and values will be appended to the end of the aliased command. It is the responsibility of the user to define aliases with this in mind.
317+
`aliases` will not be allowed to override builtins but take precedence of plugins i.e. builtins -> aliases -> plugins. Additional flags and values will be appended to the end of the aliased command. It is the responsibility of the user to define aliases with this in mind.
319318

320-
`command.overrides` is modeled after all configurable behavior being implemented as flags first. This is a design decision that was made after modeling out the intended behavior and realizing that targeting flags filled the use cases. A merge will be done in the execution of the command for flags with inline overrides taking precedence.
319+
`overrides` is modeled after all configurable behavior being implemented as flags first. This is a design decision that was made after modeling out the intended behavior and realizing that targeting flags filled the use cases. A merge will be done in the execution of the command for flags with inline overrides taking precedence.
321320

322321
```
323-
apiVersion: v1alpha1
324-
kind: Preferences
325-
326-
command:
327-
aliases:
328-
- alias: getdbprod
329-
command: get pods
330-
flags:
331-
- name: labels
332-
default: what=database
333-
- name: namespace
334-
default: us-2-production
335-
336-
overrides:
337-
- command: apply
338-
flags:
339-
- name: server-side
340-
default: "true"
341-
- command: delete
342-
flags:
343-
- name: interactive
344-
default: "true"
345-
- command: "*"
346-
flags:
347-
- name: exec-auth-allowlist
348-
default: /var/kubectl/exec/...
322+
apiVersion: kubectl.config.k8s.io/v1alpha1
323+
kind: Preference
324+
325+
aliases:
326+
- name: getdbprod
327+
command: get
328+
prependArgs:
329+
- pods
330+
flags:
331+
- name: labels
332+
default: what=database
333+
- name: namespace
334+
default: us-2-production
335+
336+
overrides:
337+
- command: apply
338+
flags:
339+
- name: server-side
340+
default: "true"
341+
- command: delete
342+
flags:
343+
- name: interactive
344+
default: "true"
349345
350346
```
351347

0 commit comments

Comments
 (0)