kubectl/pkg
Tim Hockin 02042ef887 Add KYAML support to kubectl
KYAML is a strict subset of YAML, which is sort of halfway between YAML
and JSON.  It has the following properties:
* Does not depend on whitespace (easier to text-patch and template).
* Always quotes value strings (no ambiguity aroud things like "no").
* Allows quoted keys, but does not require them, and only quotes them if
  they are not obviously safe (e.g. "no" would always be quoted).
* Always uses {} for structs and maps (no more obscure errors about
  mapping values).
* Always uses [] for lists (no more trying to figure out if a dash
  changes the meaning).
* When printing, it includes a header which makes it clear this is YAML
  and not ill-formed JSON.
* Allows trailing commas
* Allows comments,
* Tries to economize on vertical space by "cuddling" some kinds of
  brackets together.
* Retains comments.

Examples:

A struct:

```yaml
metadata: {
  creationTimestamp: "2024-12-11T00:10:11Z",
  labels: {
    app: "hostnames",
  },
  name: "hostnames",
  namespace: "default",
  resourceVersion: "15231643",
  uid: "f64dbcba-9c58-40b0-bbe7-70495efb5202",
}
```

A list of primitves:

```yaml
ipFamilies: [
  "IPv4",
  "IPv6",
]
```

A list of structs:

```yaml
ports: [{
  port: 80,
  protocol: "TCP",
  targetPort: 80,
}, {
  port: 443,
  protocol: "TCP",
  targetPort: 443,
}]
```

A multi-document stream:

```yaml
---
{
  foo: "bar",
}
---
{
  qux: "zrb",
}
```

Kubernetes-commit: 2cb955d8ccae30167b9610bfe51c2f86e83a1958
2025-07-14 09:24:18 -07:00
..
apps Remove `newlineReporter` custom report 2022-06-01 13:09:47 +08:00
cmd Add KYAML support to kubectl 2025-07-14 09:24:18 -07:00
config kuberc: introduce fuzzing for kuberc types 2025-05-16 13:45:37 +02:00
describe kubectl: add port names to describe pod output 2025-07-16 22:47:06 -07:00
drain kubectl: add test coverage for cordon command (#129202) 2024-12-17 06:34:43 +00:00
explain Fix dup word in API doc 2025-02-19 16:51:11 -08:00
generate cleanup: omit comparison with bool constants 2023-09-04 16:59:23 +08:00
kuberc kuberc: add tests for DefaultGetPreferences 2025-06-02 16:47:02 +02:00
metricsutil [KEP-2400] kubectl top: add a --show-swap option (#129458) 2025-06-04 17:10:38 +03:00
polymorphichelpers Drop null creationTimestamp from test fixtures 2025-03-24 09:37:26 -04:00
proxy Remove ioutil from kubectl 2022-07-30 22:31:16 +09:00
rawhttp Migrate genericclioptions.IOStreams usage to genericiooptions 2023-04-05 14:07:46 +03:00
scale Replace PollImmediate with PollUntilContextTimeout (#128147) 2024-11-07 16:57:29 +02:00
scheme vac support ResourceDescriber 2024-01-08 18:45:06 +08:00
util JSON & YAML output for kubectl api-resources (#132604) 2025-07-24 15:35:50 +00:00
validation OpenAPIResourcesGetter allows lazy-loading OpenAPI V2 2023-03-13 20:28:40 -07:00