vmware-archive / kubecfg

A tool for managing complex enterprise Kubernetes environments as code.
Apache License 2.0
727 stars 62 forks source link

Unstable key order within maps #301

Closed mkmik closed 3 years ago

mkmik commented 3 years ago

Some maps that contain alphanumerical sequences exhibit an unstable sort order:

{
    apiVersion: 'v1',
    kind: 'ConfigMap',
    metadata: {
      name: 'foo',
    },

    data: {
      '11': '',
      '1z': '',
      '2z': '',
    },
}

It's a well known bug in the gopkg.in/yaml.v2 library that has been fixed in v3 but not backported.

A pending backport PR is in https://github.com/go-yaml/yaml/pull/736

This issue is distinct from the "top level object" sort order in kubecfg show, such as #123