Skip to content

Transform "Kind: List" into a more idiomatic yaml #125

@PierreR

Description

@PierreR

Would it make sense to integrate a tool that would transform:

---
apiVersion: v1
items:
  - apiVersion: v1
    kind: Namespace
    metadata:
      annotations:
        openshift.io/display-name: cicd KB technical documentation site
        openshift.io/requester: cicd_cicd
      name: cicd-doc-dev
  - apiVersion: v1
    kind: ResourceQuota
    metadata:
      name: cicd-doc-dev-quota
      namespace: cicd-doc-dev
    spec:
      hard:
        limits.cpu: '2'
        limits.memory: "2Gi"
        requests.cpu: '1'
        requests.memory: "1Gi"
kind: List

into the more idiomatic/readable yaml:

---
apiVersion: v1
kind: Namespace
metadata:
  annotations:
    openshift.io/display-name: cicd KB technical documentation site
    openshift.io/requester: cicd_cicd
  name: cicd-doc-dev
---  
apiVersion: v1
kind: ResourceQuota
metadata:
  name: cicd-doc-dev-quota
  namespace: cicd-doc-dev
spec:
  hard:
    limits.cpu: '2'
    limits.memory: "2Gi"
    requests.cpu: '1'
    requests.memory: "1Gi"

I fear the solution described in https://github.com/dhall-lang/dhall-kubernetes#can-i-generate-a-yaml-file-with-many-objects-in-it works fine but does no provide a compelling solution. It might be something that prevent adoption.
What do you think ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions