Code Monkey home page Code Monkey logo

Comments (8)

felixfontein avatar felixfontein commented on May 20, 2024

SOPS generally preserves the YAML key order, appends the sops key at the bottom of the first YAML document, and uses its internal order when serializing the value of the sops key. If you prefer keys to be ordered alphabetically, you need to postprocess the SOPS encrypted file with another tool to achieve this.

from sops.

Leekao avatar Leekao commented on May 20, 2024

SOPS generally preserves the YAML key order, appends the sops key at the bottom of the first YAML document, and uses its internal order when serializing the value of the sops key. If you prefer keys to be ordered alphabetically, you need to postprocess the SOPS encrypted file with another tool to achieve this.

But even Inside the "sops:" part the elements are not arranged alphabetically, kms appears before age or azure_kv, can you explain this behaviour?
I perosnally think SOPS should provide the option to arrange elements to be the same as they are in K8S, this is a K8S tool and this small ordering change will much improve the developer experience.

from sops.

felixfontein avatar felixfontein commented on May 20, 2024

I did:

and uses its internal order when serializing the value of the sops key

The internal ordering is not alphabetical.

Also: SOPS is not a K8S tool.

from sops.

Leekao avatar Leekao commented on May 20, 2024

I'm sorry for the misunderstanding, I understand that the internal order is not alphabetical what I meant to to ask was "why must it be like this?", is the change I'm requesting harmful to the process somehow? as a user of SOPS I would like it very much and it does not seem like a big hassle, what am I missing?

from sops.

felixfontein avatar felixfontein commented on May 20, 2024

It doesn't have to be like this for the sops key. But note that any change will lead to unnecessary git history changes anytime someone updates an already SOPS encrypted file. That's why changing the order is a bad idea, if there isn't an important reason.

I guess we could make it configurable, but that's something that needs to be implemented first. (It's also not that trivial since YAML keys don't have to be strings. So you need a total order that covers all possible key types.)

from sops.

Leekao avatar Leekao commented on May 20, 2024

I would have thought that having a fully symmetrical process would be a good solid reason, am I the only one who finds great value in being able to read the decrypted value straight from the K8S cluster without needing the original encrypted file that was applied?

from sops.

felixfontein avatar felixfontein commented on May 20, 2024

I guess you aren't the only one, but don't forget about non-K8S users which do not sort their YAML files alphabetically.

from sops.

Leekao avatar Leekao commented on May 20, 2024

I fail to see how non-K8S users would suffer from this change, all I see is benefit, maybe I'm missing something.

from sops.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.