diff --git a/examples/concourse-overlay/expected.txt b/examples/concourse-overlay/expected.txt index 3753215c..c8a879e7 100644 --- a/examples/concourse-overlay/expected.txt +++ b/examples/concourse-overlay/expected.txt @@ -1,10 +1,10 @@ resources: -- name: booklit - type: git - source: - uri: https://github.com/vito/booklit + - name: booklit + type: git + source: + uri: https://github.com/vito/booklit jobs: -- name: unit - plan: - - get: booklit - trigger: true + - name: unit + plan: + - get: booklit + trigger: true diff --git a/examples/data-values-multiple-envs/expected.txt b/examples/data-values-multiple-envs/expected.txt index 07281c41..f8d1a8a5 100644 --- a/examples/data-values-multiple-envs/expected.txt +++ b/examples/data-values-multiple-envs/expected.txt @@ -1,19 +1,19 @@ app_config: version: "123" ports: - - 8080 + - 8080 *** app_config: version: v1alpha1 ports: - - 8080 + - 8080 *** app_config: version: v1beta1 ports: - - 8081 + - 8081 *** app_config: version: v1 ports: - - 80 + - 80 diff --git a/examples/data-values-required/expected.txt b/examples/data-values-required/expected.txt index b461dcb9..e2bc1db9 100644 --- a/examples/data-values-required/expected.txt +++ b/examples/data-values-required/expected.txt @@ -1,4 +1,4 @@ app_config: version: "123" ports: - - 8080 + - 8080 diff --git a/examples/eirini/config-result.yml b/examples/eirini/config-result.yml index 44bb7246..f1c1e870 100644 --- a/examples/eirini/config-result.yml +++ b/examples/eirini/config-result.yml @@ -11,8 +11,8 @@ metadata: app.kubernetes.io/version: chart-appver helm.sh/chart: chart-name-chart-ver subjects: -- kind: ServiceAccount - name: secret-generator + - kind: ServiceAccount + name: secret-generator roleRef: kind: Role name: configgin-role @@ -31,8 +31,8 @@ metadata: app.kubernetes.io/version: chart-appver helm.sh/chart: chart-name-chart-ver subjects: -- kind: ServiceAccount - name: secret-generator + - kind: ServiceAccount + name: secret-generator roleRef: kind: Role name: secrets-role @@ -51,9 +51,9 @@ metadata: app.kubernetes.io/version: chart-appver helm.sh/chart: chart-name-chart-ver subjects: -- kind: ServiceAccount - name: secret-generator - namespace: release-ns + - kind: ServiceAccount + name: secret-generator + namespace: release-ns roleRef: kind: ClusterRole name: release-ns-psp-role-nonprivileged @@ -72,15 +72,15 @@ metadata: app.kubernetes.io/version: chart-appver helm.sh/chart: chart-name-chart-ver rules: -- apiGroups: - - "" - resources: - - configmaps - - secrets - verbs: - - create - - get - - list - - patch - - update - - delete + - apiGroups: + - "" + resources: + - configmaps + - secrets + verbs: + - create + - get + - list + - patch + - update + - delete diff --git a/examples/k8s-config-map-files/expected.txt b/examples/k8s-config-map-files/expected.txt index 45e5cce1..415a1c88 100644 --- a/examples/k8s-config-map-files/expected.txt +++ b/examples/k8s-config-map-files/expected.txt @@ -11,9 +11,9 @@ data: config2.yml: | rules2a: 123 rules2b: - - a - - b - - c + - a + - b + - c config2.json: '{"rules2a":123,"rules2b":["a","b","c"]}' config3.yml: | config3a: config3a diff --git a/examples/k8s-overlay-all-containers/expected.txt b/examples/k8s-overlay-all-containers/expected.txt index efdde1d7..40ef4db9 100644 --- a/examples/k8s-overlay-all-containers/expected.txt +++ b/examples/k8s-overlay-all-containers/expected.txt @@ -6,34 +6,34 @@ spec: template: spec: volumes: - - name: shared-data - emptyDir: {} - containers: - - name: nginx-container - image: nginx - volumeMounts: - - name: shared-data - mountPath: /usr/share/nginx/html - resources: - limits: - cpu: 100m - requests: - cpu: 100m - - name: debian-container - image: debian - volumeMounts: - name: shared-data - mountPath: /pod-data - command: - - /bin/sh - args: - - -c - - echo Hello > /pod-data/index.html - resources: - limits: - cpu: 100m - requests: - cpu: 100m + emptyDir: {} + containers: + - name: nginx-container + image: nginx + volumeMounts: + - name: shared-data + mountPath: /usr/share/nginx/html + resources: + limits: + cpu: 100m + requests: + cpu: 100m + - name: debian-container + image: debian + volumeMounts: + - name: shared-data + mountPath: /pod-data + command: + - /bin/sh + args: + - -c + - echo Hello > /pod-data/index.html + resources: + limits: + cpu: 100m + requests: + cpu: 100m --- apiVersion: apps/v1 kind: Deployment @@ -43,22 +43,22 @@ spec: template: spec: containers: - - name: nginx-container - image: nginx - resources: - limits: - cpu: 100m - requests: - cpu: 100m - - name: debian-container - image: debian - command: - - /bin/sh - args: - - -c - - echo Hello - resources: - limits: - cpu: 100m - requests: - cpu: 100m + - name: nginx-container + image: nginx + resources: + limits: + cpu: 100m + requests: + cpu: 100m + - name: debian-container + image: debian + command: + - /bin/sh + args: + - -c + - echo Hello + resources: + limits: + cpu: 100m + requests: + cpu: 100m diff --git a/examples/k8s-overlay-remove-resources/expected.txt b/examples/k8s-overlay-remove-resources/expected.txt index 5cfbecd3..488a80e1 100644 --- a/examples/k8s-overlay-remove-resources/expected.txt +++ b/examples/k8s-overlay-remove-resources/expected.txt @@ -16,10 +16,10 @@ spec: sidecar.istio.io/proxyMemory: 0M spec: containers: - - name: nginx - image: nginx:1.14.2 - ports: - - containerPort: 80 + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 --- apiVersion: apps/v1 kind: Deployment @@ -39,17 +39,17 @@ spec: sidecar.istio.io/proxyMemory: 0M spec: initContainers: - - name: setup - image: ubuntu - command: - - /bin/bash - - -c - - echo 1 + - name: setup + image: ubuntu + command: + - /bin/bash + - -c + - echo 1 containers: - - name: nginx - image: nginx:1.14.2 - ports: - - containerPort: 80 + - name: nginx + image: nginx:1.14.2 + ports: + - containerPort: 80 --- apiVersion: apps/v1 kind: StatefulSet @@ -70,21 +70,21 @@ spec: spec: terminationGracePeriodSeconds: 10 containers: - - name: nginx - image: k8s.gcr.io/nginx-slim:0.8 - ports: - - containerPort: 80 - name: web - volumeMounts: - - name: www - mountPath: /usr/share/nginx/html + - name: nginx + image: k8s.gcr.io/nginx-slim:0.8 + ports: + - containerPort: 80 + name: web + volumeMounts: + - name: www + mountPath: /usr/share/nginx/html volumeClaimTemplates: - - metadata: - name: www - spec: - accessModes: - - ReadWriteOnce - storageClassName: my-storage-class - resources: - requests: - storage: 1Gi + - metadata: + name: www + spec: + accessModes: + - ReadWriteOnce + storageClassName: my-storage-class + resources: + requests: + storage: 1Gi diff --git a/examples/k8s-relative-rolling-update/expected.txt b/examples/k8s-relative-rolling-update/expected.txt index 0353e091..797d2de0 100644 --- a/examples/k8s-relative-rolling-update/expected.txt +++ b/examples/k8s-relative-rolling-update/expected.txt @@ -18,7 +18,7 @@ spec: app: nginx spec: containers: - - name: nginx - image: nginx:1.7.9 - ports: - - containerPort: 80 + - name: nginx + image: nginx:1.7.9 + ports: + - containerPort: 80 diff --git a/examples/k8s-update-env-var/expected.txt b/examples/k8s-update-env-var/expected.txt index 8a917a26..29882c20 100644 --- a/examples/k8s-update-env-var/expected.txt +++ b/examples/k8s-update-env-var/expected.txt @@ -6,11 +6,11 @@ spec: template: spec: containers: - - name: app - env: - - name: STRIMZI_RESOURCE_LABELS - value: strimzi.io/cluster=my-cluster - - name: STRIMZI_KAFKA_BOOTSTRAP_SERVERS - value: NEW-my-cluster-kafka-bootstrap:9092 - - name: STRIMZI_ZOOKEEPER_CONNECT - value: my-cluster-zookeeper-client:2181 + - name: app + env: + - name: STRIMZI_RESOURCE_LABELS + value: strimzi.io/cluster=my-cluster + - name: STRIMZI_KAFKA_BOOTSTRAP_SERVERS + value: NEW-my-cluster-kafka-bootstrap:9092 + - name: STRIMZI_ZOOKEEPER_CONNECT + value: my-cluster-zookeeper-client:2181 diff --git a/examples/overlay-files/expected.txt b/examples/overlay-files/expected.txt index ac0977e8..5f539f44 100644 --- a/examples/overlay-files/expected.txt +++ b/examples/overlay-files/expected.txt @@ -1,164 +1,164 @@ name: bosh releases: -- name: bosh - version: 268.6.0 - url: https://s3.amazonaws.com/... - sha1: 480b15380f446bcd6fb86511e1ad39b4f1019e37 -- name: bpm - version: 0.12.3 - url: https://s3.amazonaws.com/... - sha1: 54fbf8e2ecf14c69ee761ddde0624edd228ac478 -- name: os-conf - version: 18 - url: https://bosh.io/d/github.com/cloudfoundry/os-conf-release?v=18 - sha1: 78d79f08ff5001cc2a24f572837c7a9c59a0e796 + - name: bosh + version: 268.6.0 + url: https://s3.amazonaws.com/... + sha1: 480b15380f446bcd6fb86511e1ad39b4f1019e37 + - name: bpm + version: 0.12.3 + url: https://s3.amazonaws.com/... + sha1: 54fbf8e2ecf14c69ee761ddde0624edd228ac478 + - name: os-conf + version: 18 + url: https://bosh.io/d/github.com/cloudfoundry/os-conf-release?v=18 + sha1: 78d79f08ff5001cc2a24f572837c7a9c59a0e796 resource_pools: -- name: vms - network: default - env: - bosh: - password: '*' - mbus: - cert: ((mbus_bootstrap_ssl)) + - name: vms + network: default + env: + bosh: + password: '*' + mbus: + cert: ((mbus_bootstrap_ssl)) disk_pools: -- name: disks - disk_size: 65536 + - name: disks + disk_size: 65536 networks: -- name: default - type: manual - subnets: - - range: ((internal_cidr)) - gateway: ((internal_gw)) - static: - - ((internal_ip)) - dns: - - 8.8.8.8 + - name: default + type: manual + subnets: + - range: ((internal_cidr)) + gateway: ((internal_gw)) + static: + - ((internal_ip)) + dns: + - 8.8.8.8 instance_groups: -- name: bosh - instances: 1 - jobs: - - name: bpm - release: bpm - - name: nats - release: bosh - - name: postgres-10 - release: bosh - - name: blobstore - release: bosh - - name: director - release: bosh - - name: health_monitor - release: bosh - - name: user_add - release: os-conf + - name: bosh + instances: 1 + jobs: + - name: bpm + release: bpm + - name: nats + release: bosh + - name: postgres-10 + release: bosh + - name: blobstore + release: bosh + - name: director + release: bosh + - name: health_monitor + release: bosh + - name: user_add + release: os-conf + properties: + users: + - name: jumpbox + public_key: ((jumpbox_ssh.public_key)) + resource_pool: vms + persistent_disk_pool: disks + networks: + - name: default + static_ips: + - ((internal_ip)) properties: - users: - - name: jumpbox - public_key: ((jumpbox_ssh.public_key)) - resource_pool: vms - persistent_disk_pool: disks - networks: - - name: default - static_ips: - - ((internal_ip)) - properties: - agent: - mbus: nats://nats:((nats_password))@((internal_ip)):4222 - env: - bosh: - blobstores: - - provider: dav - options: - endpoint: https://((internal_ip)):25250 - user: agent - password: ((blobstore_agent_password)) - tls: - cert: - ca: ((blobstore_ca.certificate)) - nats: - address: ((internal_ip)) - user: nats - password: ((nats_password)) - tls: - ca: ((nats_server_tls.ca)) - client_ca: - certificate: ((nats_ca.certificate)) - private_key: ((nats_ca.private_key)) - server: - certificate: ((nats_server_tls.certificate)) - private_key: ((nats_server_tls.private_key)) - director: - certificate: ((nats_clients_director_tls.certificate)) - private_key: ((nats_clients_director_tls.private_key)) - health_monitor: - certificate: ((nats_clients_health_monitor_tls.certificate)) - private_key: ((nats_clients_health_monitor_tls.private_key)) - postgres: - listen_address: 127.0.0.1 - host: 127.0.0.1 - user: postgres - password: ((postgres_password)) - database: bosh - adapter: postgres - blobstore: - address: ((internal_ip)) - port: 25250 - provider: dav - director: - user: director - password: ((blobstore_director_password)) agent: - user: agent - password: ((blobstore_agent_password)) - tls: - cert: - ca: ((blobstore_ca.certificate)) - certificate: ((blobstore_server_tls.certificate)) - private_key: ((blobstore_server_tls.private_key)) - director: - address: 127.0.0.1 - name: ((director_name)) - db: + mbus: nats://nats:((nats_password))@((internal_ip)):4222 + env: + bosh: + blobstores: + - provider: dav + options: + endpoint: https://((internal_ip)):25250 + user: agent + password: ((blobstore_agent_password)) + tls: + cert: + ca: ((blobstore_ca.certificate)) + nats: + address: ((internal_ip)) + user: nats + password: ((nats_password)) + tls: + ca: ((nats_server_tls.ca)) + client_ca: + certificate: ((nats_ca.certificate)) + private_key: ((nats_ca.private_key)) + server: + certificate: ((nats_server_tls.certificate)) + private_key: ((nats_server_tls.private_key)) + director: + certificate: ((nats_clients_director_tls.certificate)) + private_key: ((nats_clients_director_tls.private_key)) + health_monitor: + certificate: ((nats_clients_health_monitor_tls.certificate)) + private_key: ((nats_clients_health_monitor_tls.private_key)) + postgres: listen_address: 127.0.0.1 host: 127.0.0.1 user: postgres password: ((postgres_password)) database: bosh adapter: postgres - flush_arp: true - enable_post_deploy: true - generate_vm_passwords: true - enable_dedicated_status_worker: true - enable_nats_delivered_templates: true - workers: 4 - local_dns: - enabled: true - events: - record_events: true - ssl: - key: ((director_ssl.private_key)) - cert: ((director_ssl.certificate)) - user_management: - provider: local - local: - users: - - name: admin - password: ((admin_password)) - - name: hm - password: ((hm_password)) - default_ssh_options: - gateway_user: jumpbox - hm: - director_account: - user: hm - password: ((hm_password)) - ca_cert: ((director_ssl.ca)) - resurrector_enabled: true - ntp: - - time1.google.com - - time2.google.com - - time3.google.com - - time4.google.com + blobstore: + address: ((internal_ip)) + port: 25250 + provider: dav + director: + user: director + password: ((blobstore_director_password)) + agent: + user: agent + password: ((blobstore_agent_password)) + tls: + cert: + ca: ((blobstore_ca.certificate)) + certificate: ((blobstore_server_tls.certificate)) + private_key: ((blobstore_server_tls.private_key)) + director: + address: 127.0.0.1 + name: ((director_name)) + db: + listen_address: 127.0.0.1 + host: 127.0.0.1 + user: postgres + password: ((postgres_password)) + database: bosh + adapter: postgres + flush_arp: true + enable_post_deploy: true + generate_vm_passwords: true + enable_dedicated_status_worker: true + enable_nats_delivered_templates: true + workers: 4 + local_dns: + enabled: true + events: + record_events: true + ssl: + key: ((director_ssl.private_key)) + cert: ((director_ssl.certificate)) + user_management: + provider: local + local: + users: + - name: admin + password: ((admin_password)) + - name: hm + password: ((hm_password)) + default_ssh_options: + gateway_user: jumpbox + hm: + director_account: + user: hm + password: ((hm_password)) + ca_cert: ((director_ssl.ca)) + resurrector_enabled: true + ntp: + - time1.google.com + - time2.google.com + - time3.google.com + - time4.google.com cloud_provider: mbus: https://mbus:((mbus_bootstrap_password))@((internal_ip)):6868 cert: ((mbus_bootstrap_ssl)) @@ -169,83 +169,83 @@ cloud_provider: provider: local path: /var/vcap/micro_bosh/data/cache ntp: - - time1.google.com - - time2.google.com - - time3.google.com - - time4.google.com + - time1.google.com + - time2.google.com + - time3.google.com + - time4.google.com variables: -- name: admin_password - type: password -- name: blobstore_director_password - type: password -- name: blobstore_agent_password - type: password -- name: hm_password - type: password -- name: mbus_bootstrap_password - type: password -- name: nats_password - type: password -- name: postgres_password - type: password -- name: default_ca - type: certificate - options: - is_ca: true - common_name: ca -- name: mbus_bootstrap_ssl - type: certificate - options: - ca: default_ca - common_name: ((internal_ip)) - alternative_names: - - ((internal_ip)) -- name: director_ssl - type: certificate - options: - ca: default_ca - common_name: ((internal_ip)) - alternative_names: - - ((internal_ip)) -- name: nats_ca - type: certificate - options: - is_ca: true - common_name: default.nats-ca.bosh-internal -- name: nats_server_tls - type: certificate - options: - ca: nats_ca - common_name: default.nats.bosh-internal - alternative_names: - - ((internal_ip)) - extended_key_usage: - - server_auth -- name: nats_clients_director_tls - type: certificate - options: - ca: nats_ca - common_name: default.director.bosh-internal - extended_key_usage: - - client_auth -- name: nats_clients_health_monitor_tls - type: certificate - options: - ca: nats_ca - common_name: default.hm.bosh-internal - extended_key_usage: - - client_auth -- name: blobstore_ca - type: certificate - options: - is_ca: true - common_name: default.blobstore-ca.bosh-internal -- name: blobstore_server_tls - type: certificate - options: - ca: blobstore_ca - common_name: ((internal_ip)) - alternative_names: - - ((internal_ip)) -- name: jumpbox_ssh - type: ssh + - name: admin_password + type: password + - name: blobstore_director_password + type: password + - name: blobstore_agent_password + type: password + - name: hm_password + type: password + - name: mbus_bootstrap_password + type: password + - name: nats_password + type: password + - name: postgres_password + type: password + - name: default_ca + type: certificate + options: + is_ca: true + common_name: ca + - name: mbus_bootstrap_ssl + type: certificate + options: + ca: default_ca + common_name: ((internal_ip)) + alternative_names: + - ((internal_ip)) + - name: director_ssl + type: certificate + options: + ca: default_ca + common_name: ((internal_ip)) + alternative_names: + - ((internal_ip)) + - name: nats_ca + type: certificate + options: + is_ca: true + common_name: default.nats-ca.bosh-internal + - name: nats_server_tls + type: certificate + options: + ca: nats_ca + common_name: default.nats.bosh-internal + alternative_names: + - ((internal_ip)) + extended_key_usage: + - server_auth + - name: nats_clients_director_tls + type: certificate + options: + ca: nats_ca + common_name: default.director.bosh-internal + extended_key_usage: + - client_auth + - name: nats_clients_health_monitor_tls + type: certificate + options: + ca: nats_ca + common_name: default.hm.bosh-internal + extended_key_usage: + - client_auth + - name: blobstore_ca + type: certificate + options: + is_ca: true + common_name: default.blobstore-ca.bosh-internal + - name: blobstore_server_tls + type: certificate + options: + ca: blobstore_ca + common_name: ((internal_ip)) + alternative_names: + - ((internal_ip)) + - name: jumpbox_ssh + type: ssh diff --git a/examples/overlay-regular-files/expected.txt b/examples/overlay-regular-files/expected.txt index ac0977e8..5f539f44 100644 --- a/examples/overlay-regular-files/expected.txt +++ b/examples/overlay-regular-files/expected.txt @@ -1,164 +1,164 @@ name: bosh releases: -- name: bosh - version: 268.6.0 - url: https://s3.amazonaws.com/... - sha1: 480b15380f446bcd6fb86511e1ad39b4f1019e37 -- name: bpm - version: 0.12.3 - url: https://s3.amazonaws.com/... - sha1: 54fbf8e2ecf14c69ee761ddde0624edd228ac478 -- name: os-conf - version: 18 - url: https://bosh.io/d/github.com/cloudfoundry/os-conf-release?v=18 - sha1: 78d79f08ff5001cc2a24f572837c7a9c59a0e796 + - name: bosh + version: 268.6.0 + url: https://s3.amazonaws.com/... + sha1: 480b15380f446bcd6fb86511e1ad39b4f1019e37 + - name: bpm + version: 0.12.3 + url: https://s3.amazonaws.com/... + sha1: 54fbf8e2ecf14c69ee761ddde0624edd228ac478 + - name: os-conf + version: 18 + url: https://bosh.io/d/github.com/cloudfoundry/os-conf-release?v=18 + sha1: 78d79f08ff5001cc2a24f572837c7a9c59a0e796 resource_pools: -- name: vms - network: default - env: - bosh: - password: '*' - mbus: - cert: ((mbus_bootstrap_ssl)) + - name: vms + network: default + env: + bosh: + password: '*' + mbus: + cert: ((mbus_bootstrap_ssl)) disk_pools: -- name: disks - disk_size: 65536 + - name: disks + disk_size: 65536 networks: -- name: default - type: manual - subnets: - - range: ((internal_cidr)) - gateway: ((internal_gw)) - static: - - ((internal_ip)) - dns: - - 8.8.8.8 + - name: default + type: manual + subnets: + - range: ((internal_cidr)) + gateway: ((internal_gw)) + static: + - ((internal_ip)) + dns: + - 8.8.8.8 instance_groups: -- name: bosh - instances: 1 - jobs: - - name: bpm - release: bpm - - name: nats - release: bosh - - name: postgres-10 - release: bosh - - name: blobstore - release: bosh - - name: director - release: bosh - - name: health_monitor - release: bosh - - name: user_add - release: os-conf + - name: bosh + instances: 1 + jobs: + - name: bpm + release: bpm + - name: nats + release: bosh + - name: postgres-10 + release: bosh + - name: blobstore + release: bosh + - name: director + release: bosh + - name: health_monitor + release: bosh + - name: user_add + release: os-conf + properties: + users: + - name: jumpbox + public_key: ((jumpbox_ssh.public_key)) + resource_pool: vms + persistent_disk_pool: disks + networks: + - name: default + static_ips: + - ((internal_ip)) properties: - users: - - name: jumpbox - public_key: ((jumpbox_ssh.public_key)) - resource_pool: vms - persistent_disk_pool: disks - networks: - - name: default - static_ips: - - ((internal_ip)) - properties: - agent: - mbus: nats://nats:((nats_password))@((internal_ip)):4222 - env: - bosh: - blobstores: - - provider: dav - options: - endpoint: https://((internal_ip)):25250 - user: agent - password: ((blobstore_agent_password)) - tls: - cert: - ca: ((blobstore_ca.certificate)) - nats: - address: ((internal_ip)) - user: nats - password: ((nats_password)) - tls: - ca: ((nats_server_tls.ca)) - client_ca: - certificate: ((nats_ca.certificate)) - private_key: ((nats_ca.private_key)) - server: - certificate: ((nats_server_tls.certificate)) - private_key: ((nats_server_tls.private_key)) - director: - certificate: ((nats_clients_director_tls.certificate)) - private_key: ((nats_clients_director_tls.private_key)) - health_monitor: - certificate: ((nats_clients_health_monitor_tls.certificate)) - private_key: ((nats_clients_health_monitor_tls.private_key)) - postgres: - listen_address: 127.0.0.1 - host: 127.0.0.1 - user: postgres - password: ((postgres_password)) - database: bosh - adapter: postgres - blobstore: - address: ((internal_ip)) - port: 25250 - provider: dav - director: - user: director - password: ((blobstore_director_password)) agent: - user: agent - password: ((blobstore_agent_password)) - tls: - cert: - ca: ((blobstore_ca.certificate)) - certificate: ((blobstore_server_tls.certificate)) - private_key: ((blobstore_server_tls.private_key)) - director: - address: 127.0.0.1 - name: ((director_name)) - db: + mbus: nats://nats:((nats_password))@((internal_ip)):4222 + env: + bosh: + blobstores: + - provider: dav + options: + endpoint: https://((internal_ip)):25250 + user: agent + password: ((blobstore_agent_password)) + tls: + cert: + ca: ((blobstore_ca.certificate)) + nats: + address: ((internal_ip)) + user: nats + password: ((nats_password)) + tls: + ca: ((nats_server_tls.ca)) + client_ca: + certificate: ((nats_ca.certificate)) + private_key: ((nats_ca.private_key)) + server: + certificate: ((nats_server_tls.certificate)) + private_key: ((nats_server_tls.private_key)) + director: + certificate: ((nats_clients_director_tls.certificate)) + private_key: ((nats_clients_director_tls.private_key)) + health_monitor: + certificate: ((nats_clients_health_monitor_tls.certificate)) + private_key: ((nats_clients_health_monitor_tls.private_key)) + postgres: listen_address: 127.0.0.1 host: 127.0.0.1 user: postgres password: ((postgres_password)) database: bosh adapter: postgres - flush_arp: true - enable_post_deploy: true - generate_vm_passwords: true - enable_dedicated_status_worker: true - enable_nats_delivered_templates: true - workers: 4 - local_dns: - enabled: true - events: - record_events: true - ssl: - key: ((director_ssl.private_key)) - cert: ((director_ssl.certificate)) - user_management: - provider: local - local: - users: - - name: admin - password: ((admin_password)) - - name: hm - password: ((hm_password)) - default_ssh_options: - gateway_user: jumpbox - hm: - director_account: - user: hm - password: ((hm_password)) - ca_cert: ((director_ssl.ca)) - resurrector_enabled: true - ntp: - - time1.google.com - - time2.google.com - - time3.google.com - - time4.google.com + blobstore: + address: ((internal_ip)) + port: 25250 + provider: dav + director: + user: director + password: ((blobstore_director_password)) + agent: + user: agent + password: ((blobstore_agent_password)) + tls: + cert: + ca: ((blobstore_ca.certificate)) + certificate: ((blobstore_server_tls.certificate)) + private_key: ((blobstore_server_tls.private_key)) + director: + address: 127.0.0.1 + name: ((director_name)) + db: + listen_address: 127.0.0.1 + host: 127.0.0.1 + user: postgres + password: ((postgres_password)) + database: bosh + adapter: postgres + flush_arp: true + enable_post_deploy: true + generate_vm_passwords: true + enable_dedicated_status_worker: true + enable_nats_delivered_templates: true + workers: 4 + local_dns: + enabled: true + events: + record_events: true + ssl: + key: ((director_ssl.private_key)) + cert: ((director_ssl.certificate)) + user_management: + provider: local + local: + users: + - name: admin + password: ((admin_password)) + - name: hm + password: ((hm_password)) + default_ssh_options: + gateway_user: jumpbox + hm: + director_account: + user: hm + password: ((hm_password)) + ca_cert: ((director_ssl.ca)) + resurrector_enabled: true + ntp: + - time1.google.com + - time2.google.com + - time3.google.com + - time4.google.com cloud_provider: mbus: https://mbus:((mbus_bootstrap_password))@((internal_ip)):6868 cert: ((mbus_bootstrap_ssl)) @@ -169,83 +169,83 @@ cloud_provider: provider: local path: /var/vcap/micro_bosh/data/cache ntp: - - time1.google.com - - time2.google.com - - time3.google.com - - time4.google.com + - time1.google.com + - time2.google.com + - time3.google.com + - time4.google.com variables: -- name: admin_password - type: password -- name: blobstore_director_password - type: password -- name: blobstore_agent_password - type: password -- name: hm_password - type: password -- name: mbus_bootstrap_password - type: password -- name: nats_password - type: password -- name: postgres_password - type: password -- name: default_ca - type: certificate - options: - is_ca: true - common_name: ca -- name: mbus_bootstrap_ssl - type: certificate - options: - ca: default_ca - common_name: ((internal_ip)) - alternative_names: - - ((internal_ip)) -- name: director_ssl - type: certificate - options: - ca: default_ca - common_name: ((internal_ip)) - alternative_names: - - ((internal_ip)) -- name: nats_ca - type: certificate - options: - is_ca: true - common_name: default.nats-ca.bosh-internal -- name: nats_server_tls - type: certificate - options: - ca: nats_ca - common_name: default.nats.bosh-internal - alternative_names: - - ((internal_ip)) - extended_key_usage: - - server_auth -- name: nats_clients_director_tls - type: certificate - options: - ca: nats_ca - common_name: default.director.bosh-internal - extended_key_usage: - - client_auth -- name: nats_clients_health_monitor_tls - type: certificate - options: - ca: nats_ca - common_name: default.hm.bosh-internal - extended_key_usage: - - client_auth -- name: blobstore_ca - type: certificate - options: - is_ca: true - common_name: default.blobstore-ca.bosh-internal -- name: blobstore_server_tls - type: certificate - options: - ca: blobstore_ca - common_name: ((internal_ip)) - alternative_names: - - ((internal_ip)) -- name: jumpbox_ssh - type: ssh + - name: admin_password + type: password + - name: blobstore_director_password + type: password + - name: blobstore_agent_password + type: password + - name: hm_password + type: password + - name: mbus_bootstrap_password + type: password + - name: nats_password + type: password + - name: postgres_password + type: password + - name: default_ca + type: certificate + options: + is_ca: true + common_name: ca + - name: mbus_bootstrap_ssl + type: certificate + options: + ca: default_ca + common_name: ((internal_ip)) + alternative_names: + - ((internal_ip)) + - name: director_ssl + type: certificate + options: + ca: default_ca + common_name: ((internal_ip)) + alternative_names: + - ((internal_ip)) + - name: nats_ca + type: certificate + options: + is_ca: true + common_name: default.nats-ca.bosh-internal + - name: nats_server_tls + type: certificate + options: + ca: nats_ca + common_name: default.nats.bosh-internal + alternative_names: + - ((internal_ip)) + extended_key_usage: + - server_auth + - name: nats_clients_director_tls + type: certificate + options: + ca: nats_ca + common_name: default.director.bosh-internal + extended_key_usage: + - client_auth + - name: nats_clients_health_monitor_tls + type: certificate + options: + ca: nats_ca + common_name: default.hm.bosh-internal + extended_key_usage: + - client_auth + - name: blobstore_ca + type: certificate + options: + is_ca: true + common_name: default.blobstore-ca.bosh-internal + - name: blobstore_server_tls + type: certificate + options: + ca: blobstore_ca + common_name: ((internal_ip)) + alternative_names: + - ((internal_ip)) + - name: jumpbox_ssh + type: ssh diff --git a/examples/overlay/expected.txt b/examples/overlay/expected.txt index ac0977e8..5f539f44 100644 --- a/examples/overlay/expected.txt +++ b/examples/overlay/expected.txt @@ -1,164 +1,164 @@ name: bosh releases: -- name: bosh - version: 268.6.0 - url: https://s3.amazonaws.com/... - sha1: 480b15380f446bcd6fb86511e1ad39b4f1019e37 -- name: bpm - version: 0.12.3 - url: https://s3.amazonaws.com/... - sha1: 54fbf8e2ecf14c69ee761ddde0624edd228ac478 -- name: os-conf - version: 18 - url: https://bosh.io/d/github.com/cloudfoundry/os-conf-release?v=18 - sha1: 78d79f08ff5001cc2a24f572837c7a9c59a0e796 + - name: bosh + version: 268.6.0 + url: https://s3.amazonaws.com/... + sha1: 480b15380f446bcd6fb86511e1ad39b4f1019e37 + - name: bpm + version: 0.12.3 + url: https://s3.amazonaws.com/... + sha1: 54fbf8e2ecf14c69ee761ddde0624edd228ac478 + - name: os-conf + version: 18 + url: https://bosh.io/d/github.com/cloudfoundry/os-conf-release?v=18 + sha1: 78d79f08ff5001cc2a24f572837c7a9c59a0e796 resource_pools: -- name: vms - network: default - env: - bosh: - password: '*' - mbus: - cert: ((mbus_bootstrap_ssl)) + - name: vms + network: default + env: + bosh: + password: '*' + mbus: + cert: ((mbus_bootstrap_ssl)) disk_pools: -- name: disks - disk_size: 65536 + - name: disks + disk_size: 65536 networks: -- name: default - type: manual - subnets: - - range: ((internal_cidr)) - gateway: ((internal_gw)) - static: - - ((internal_ip)) - dns: - - 8.8.8.8 + - name: default + type: manual + subnets: + - range: ((internal_cidr)) + gateway: ((internal_gw)) + static: + - ((internal_ip)) + dns: + - 8.8.8.8 instance_groups: -- name: bosh - instances: 1 - jobs: - - name: bpm - release: bpm - - name: nats - release: bosh - - name: postgres-10 - release: bosh - - name: blobstore - release: bosh - - name: director - release: bosh - - name: health_monitor - release: bosh - - name: user_add - release: os-conf + - name: bosh + instances: 1 + jobs: + - name: bpm + release: bpm + - name: nats + release: bosh + - name: postgres-10 + release: bosh + - name: blobstore + release: bosh + - name: director + release: bosh + - name: health_monitor + release: bosh + - name: user_add + release: os-conf + properties: + users: + - name: jumpbox + public_key: ((jumpbox_ssh.public_key)) + resource_pool: vms + persistent_disk_pool: disks + networks: + - name: default + static_ips: + - ((internal_ip)) properties: - users: - - name: jumpbox - public_key: ((jumpbox_ssh.public_key)) - resource_pool: vms - persistent_disk_pool: disks - networks: - - name: default - static_ips: - - ((internal_ip)) - properties: - agent: - mbus: nats://nats:((nats_password))@((internal_ip)):4222 - env: - bosh: - blobstores: - - provider: dav - options: - endpoint: https://((internal_ip)):25250 - user: agent - password: ((blobstore_agent_password)) - tls: - cert: - ca: ((blobstore_ca.certificate)) - nats: - address: ((internal_ip)) - user: nats - password: ((nats_password)) - tls: - ca: ((nats_server_tls.ca)) - client_ca: - certificate: ((nats_ca.certificate)) - private_key: ((nats_ca.private_key)) - server: - certificate: ((nats_server_tls.certificate)) - private_key: ((nats_server_tls.private_key)) - director: - certificate: ((nats_clients_director_tls.certificate)) - private_key: ((nats_clients_director_tls.private_key)) - health_monitor: - certificate: ((nats_clients_health_monitor_tls.certificate)) - private_key: ((nats_clients_health_monitor_tls.private_key)) - postgres: - listen_address: 127.0.0.1 - host: 127.0.0.1 - user: postgres - password: ((postgres_password)) - database: bosh - adapter: postgres - blobstore: - address: ((internal_ip)) - port: 25250 - provider: dav - director: - user: director - password: ((blobstore_director_password)) agent: - user: agent - password: ((blobstore_agent_password)) - tls: - cert: - ca: ((blobstore_ca.certificate)) - certificate: ((blobstore_server_tls.certificate)) - private_key: ((blobstore_server_tls.private_key)) - director: - address: 127.0.0.1 - name: ((director_name)) - db: + mbus: nats://nats:((nats_password))@((internal_ip)):4222 + env: + bosh: + blobstores: + - provider: dav + options: + endpoint: https://((internal_ip)):25250 + user: agent + password: ((blobstore_agent_password)) + tls: + cert: + ca: ((blobstore_ca.certificate)) + nats: + address: ((internal_ip)) + user: nats + password: ((nats_password)) + tls: + ca: ((nats_server_tls.ca)) + client_ca: + certificate: ((nats_ca.certificate)) + private_key: ((nats_ca.private_key)) + server: + certificate: ((nats_server_tls.certificate)) + private_key: ((nats_server_tls.private_key)) + director: + certificate: ((nats_clients_director_tls.certificate)) + private_key: ((nats_clients_director_tls.private_key)) + health_monitor: + certificate: ((nats_clients_health_monitor_tls.certificate)) + private_key: ((nats_clients_health_monitor_tls.private_key)) + postgres: listen_address: 127.0.0.1 host: 127.0.0.1 user: postgres password: ((postgres_password)) database: bosh adapter: postgres - flush_arp: true - enable_post_deploy: true - generate_vm_passwords: true - enable_dedicated_status_worker: true - enable_nats_delivered_templates: true - workers: 4 - local_dns: - enabled: true - events: - record_events: true - ssl: - key: ((director_ssl.private_key)) - cert: ((director_ssl.certificate)) - user_management: - provider: local - local: - users: - - name: admin - password: ((admin_password)) - - name: hm - password: ((hm_password)) - default_ssh_options: - gateway_user: jumpbox - hm: - director_account: - user: hm - password: ((hm_password)) - ca_cert: ((director_ssl.ca)) - resurrector_enabled: true - ntp: - - time1.google.com - - time2.google.com - - time3.google.com - - time4.google.com + blobstore: + address: ((internal_ip)) + port: 25250 + provider: dav + director: + user: director + password: ((blobstore_director_password)) + agent: + user: agent + password: ((blobstore_agent_password)) + tls: + cert: + ca: ((blobstore_ca.certificate)) + certificate: ((blobstore_server_tls.certificate)) + private_key: ((blobstore_server_tls.private_key)) + director: + address: 127.0.0.1 + name: ((director_name)) + db: + listen_address: 127.0.0.1 + host: 127.0.0.1 + user: postgres + password: ((postgres_password)) + database: bosh + adapter: postgres + flush_arp: true + enable_post_deploy: true + generate_vm_passwords: true + enable_dedicated_status_worker: true + enable_nats_delivered_templates: true + workers: 4 + local_dns: + enabled: true + events: + record_events: true + ssl: + key: ((director_ssl.private_key)) + cert: ((director_ssl.certificate)) + user_management: + provider: local + local: + users: + - name: admin + password: ((admin_password)) + - name: hm + password: ((hm_password)) + default_ssh_options: + gateway_user: jumpbox + hm: + director_account: + user: hm + password: ((hm_password)) + ca_cert: ((director_ssl.ca)) + resurrector_enabled: true + ntp: + - time1.google.com + - time2.google.com + - time3.google.com + - time4.google.com cloud_provider: mbus: https://mbus:((mbus_bootstrap_password))@((internal_ip)):6868 cert: ((mbus_bootstrap_ssl)) @@ -169,83 +169,83 @@ cloud_provider: provider: local path: /var/vcap/micro_bosh/data/cache ntp: - - time1.google.com - - time2.google.com - - time3.google.com - - time4.google.com + - time1.google.com + - time2.google.com + - time3.google.com + - time4.google.com variables: -- name: admin_password - type: password -- name: blobstore_director_password - type: password -- name: blobstore_agent_password - type: password -- name: hm_password - type: password -- name: mbus_bootstrap_password - type: password -- name: nats_password - type: password -- name: postgres_password - type: password -- name: default_ca - type: certificate - options: - is_ca: true - common_name: ca -- name: mbus_bootstrap_ssl - type: certificate - options: - ca: default_ca - common_name: ((internal_ip)) - alternative_names: - - ((internal_ip)) -- name: director_ssl - type: certificate - options: - ca: default_ca - common_name: ((internal_ip)) - alternative_names: - - ((internal_ip)) -- name: nats_ca - type: certificate - options: - is_ca: true - common_name: default.nats-ca.bosh-internal -- name: nats_server_tls - type: certificate - options: - ca: nats_ca - common_name: default.nats.bosh-internal - alternative_names: - - ((internal_ip)) - extended_key_usage: - - server_auth -- name: nats_clients_director_tls - type: certificate - options: - ca: nats_ca - common_name: default.director.bosh-internal - extended_key_usage: - - client_auth -- name: nats_clients_health_monitor_tls - type: certificate - options: - ca: nats_ca - common_name: default.hm.bosh-internal - extended_key_usage: - - client_auth -- name: blobstore_ca - type: certificate - options: - is_ca: true - common_name: default.blobstore-ca.bosh-internal -- name: blobstore_server_tls - type: certificate - options: - ca: blobstore_ca - common_name: ((internal_ip)) - alternative_names: - - ((internal_ip)) -- name: jumpbox_ssh - type: ssh + - name: admin_password + type: password + - name: blobstore_director_password + type: password + - name: blobstore_agent_password + type: password + - name: hm_password + type: password + - name: mbus_bootstrap_password + type: password + - name: nats_password + type: password + - name: postgres_password + type: password + - name: default_ca + type: certificate + options: + is_ca: true + common_name: ca + - name: mbus_bootstrap_ssl + type: certificate + options: + ca: default_ca + common_name: ((internal_ip)) + alternative_names: + - ((internal_ip)) + - name: director_ssl + type: certificate + options: + ca: default_ca + common_name: ((internal_ip)) + alternative_names: + - ((internal_ip)) + - name: nats_ca + type: certificate + options: + is_ca: true + common_name: default.nats-ca.bosh-internal + - name: nats_server_tls + type: certificate + options: + ca: nats_ca + common_name: default.nats.bosh-internal + alternative_names: + - ((internal_ip)) + extended_key_usage: + - server_auth + - name: nats_clients_director_tls + type: certificate + options: + ca: nats_ca + common_name: default.director.bosh-internal + extended_key_usage: + - client_auth + - name: nats_clients_health_monitor_tls + type: certificate + options: + ca: nats_ca + common_name: default.hm.bosh-internal + extended_key_usage: + - client_auth + - name: blobstore_ca + type: certificate + options: + is_ca: true + common_name: default.blobstore-ca.bosh-internal + - name: blobstore_server_tls + type: certificate + options: + ca: blobstore_ca + common_name: ((internal_ip)) + alternative_names: + - ((internal_ip)) + - name: jumpbox_ssh + type: ssh diff --git a/examples/schema-arrays/expected.txt b/examples/schema-arrays/expected.txt index 979a2dbe..76d89b8a 100644 --- a/examples/schema-arrays/expected.txt +++ b/examples/schema-arrays/expected.txt @@ -1,22 +1,22 @@ resources: -- name: cf-for-k8s-develop - source: - private_key: ((cf_for_k8s_readwrite_deploy_key.private_key)) - branch: develop - uri: git@github.com:cloudfoundry/cf-for-k8s - type: git - icon: github -- name: cf-for-k8s-ci - type: git - icon: github - source: - branch: develop - uri: git@github.com:cloudfoundry/cf-for-k8s - private_key: ((cf_for_k8s_readonly_deploy_key.private_key)) -- name: cf-acceptance-tests - source: - uri: git@github.com:cloudfoundry/cf-acceptance-tests - branch: develop - private_key: ((cf_for_k8s_readonly_deploy_key.private_key)) - type: git - icon: github + - name: cf-for-k8s-develop + source: + private_key: ((cf_for_k8s_readwrite_deploy_key.private_key)) + branch: develop + uri: git@github.com:cloudfoundry/cf-for-k8s + type: git + icon: github + - name: cf-for-k8s-ci + type: git + icon: github + source: + branch: develop + uri: git@github.com:cloudfoundry/cf-for-k8s + private_key: ((cf_for_k8s_readonly_deploy_key.private_key)) + - name: cf-acceptance-tests + source: + uri: git@github.com:cloudfoundry/cf-acceptance-tests + branch: develop + private_key: ((cf_for_k8s_readonly_deploy_key.private_key)) + type: git + icon: github diff --git a/go.mod b/go.mod index 633c56b5..dc36595c 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( github.com/spf13/cobra v1.4.0 github.com/stretchr/testify v1.7.2 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 + gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -23,5 +24,4 @@ require ( github.com/kr/text v0.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/cmd/template/cmd_data_values_file_test.go b/pkg/cmd/template/cmd_data_values_file_test.go index c1172c72..e9877fe1 100644 --- a/pkg/cmd/template/cmd_data_values_file_test.go +++ b/pkg/cmd/template/cmd_data_values_file_test.go @@ -81,7 +81,7 @@ array: map: a: 123 array: - - str + - str ` filesToProcess := files.NewSortedFiles([]*files.File{ diff --git a/pkg/cmd/template/cmd_data_values_test.go b/pkg/cmd/template/cmd_data_values_test.go index e6496f69..f6cee7a5 100644 --- a/pkg/cmd/template/cmd_data_values_test.go +++ b/pkg/cmd/template/cmd_data_values_test.go @@ -546,15 +546,15 @@ Files_in_schema: schema.yml: schema.yml values.yml: values.yml Files_in_root_values: -- name: /config.yml -- name: /other -- name: /schema.yml -- name: /values.yml + - name: /config.yml + - name: /other + - name: /schema.yml + - name: /values.yml Files_in_values: -- name: config.yml -- name: other -- name: schema.yml -- name: values.yml + - name: config.yml + - name: other + - name: schema.yml + - name: values.yml ` yamlSchemaData := []byte(` @@ -632,17 +632,17 @@ func TestDataValues_data_list_relative_to_library_root(t *testing.T) { Files_in_schema: schema.yml: schema.yml Files_in_root_values: -- name: /other -- name: /config.yml -- name: /schema/schema.yml -- name: /values/values.yml + - name: /other + - name: /config.yml + - name: /schema/schema.yml + - name: /values/values.yml Files_in_values: -- name: values.yml + - name: values.yml Files_in_template: -- name: /other -- name: /config.yml -- name: /schema/schema.yml -- name: /values/values.yml + - name: /other + - name: /config.yml + - name: /schema/schema.yml + - name: /values/values.yml ` yamlSchemaData := []byte(` diff --git a/pkg/cmd/template/cmd_library_module_test.go b/pkg/cmd/template/cmd_library_module_test.go index cf71e3c8..b5982e5b 100644 --- a/pkg/cmd/template/cmd_library_module_test.go +++ b/pkg/cmd/template/cmd_library_module_test.go @@ -367,9 +367,9 @@ int: 100`) #@ def vals(arg1): return [arg1, data.values]`) expectedYAMLTplData := `vals: -- arg1 -- int: 124 - str: string + - arg1 + - int: 124 + str: string ` filesToProcess := files.NewSortedFiles([]*files.File{ diff --git a/pkg/cmd/template/cmd_overlays_test.go b/pkg/cmd/template/cmd_overlays_test.go index 16d74d20..4038de4b 100644 --- a/pkg/cmd/template/cmd_overlays_test.go +++ b/pkg/cmd/template/cmd_overlays_test.go @@ -35,11 +35,11 @@ array: `) expectedYAMLTplData := `array: -- name: item1 - subarray: - - item1 - subarray2: - - yamlfunc: yamlfunc + - name: item1 + subarray: + - item1 + subarray2: + - yamlfunc: yamlfunc ` yamlFuncsData := []byte(` @@ -100,9 +100,9 @@ array: // subarray2 is not present because it was removed // by overlay1 that comes after overlay2 expectedYAMLTplData := `array: -- name: item1 - subarray: - - item1 + - name: item1 + subarray: + - item1 ` yamlFuncsData := []byte(` diff --git a/pkg/cmd/template/cmd_test.go b/pkg/cmd/template/cmd_test.go index 42539140..13a2f0f3 100644 --- a/pkg/cmd/template/cmd_test.go +++ b/pkg/cmd/template/cmd_test.go @@ -42,15 +42,14 @@ loaddata: #@ data.read("funcs/funcs.star")`) yamlfunc: yamlfunc textfunc: textfunc starfunc: -- 1 -- 2 + - 1 + - 2 listdata: -- tpl.yml -- funcs/funcs.lib.yml -- funcs/funcs.lib.txt -- funcs/funcs.star + - tpl.yml + - funcs/funcs.lib.yml + - funcs/funcs.lib.txt + - funcs/funcs.star loaddata: |2- - def starfunc(): return [1,2] end @@ -100,16 +99,16 @@ nestedlist: #@ nested_data_list() nesteddata: #@ nested_data_read()`) expectedYAMLTplData := `rootlist: -- tpl.yml -- funcs/funcs.lib.yml -- funcs/data + - tpl.yml + - funcs/funcs.lib.yml + - funcs/data rootdata: |- data data nestedlist: list: - - funcs.lib.yml - - data + - funcs.lib.yml + - data nesteddata: data: |- data @@ -169,19 +168,19 @@ nesteddata: #@ nested_data_read() `) expectedYAMLTplData := `rootlist: -- /tpl.yml -- /funcs/funcs.lib.yml -- /funcs/tpl.yml -- /funcs/data + - /tpl.yml + - /funcs/funcs.lib.yml + - /funcs/tpl.yml + - /funcs/data rootdata: |- data data nestedlist: list: - - /tpl.yml - - /funcs/funcs.lib.yml - - /funcs/tpl.yml - - /funcs/data + - /tpl.yml + - /funcs/funcs.lib.yml + - /funcs/tpl.yml + - /funcs/data nesteddata: data: |- data @@ -231,10 +230,10 @@ libdata: #@ lib_data_read()`) expectedYAMLTplData := `liblist: liblist1: - - funcs.lib.yml + - funcs.lib.yml liblist2: - - /other - - /funcs/funcs.lib.yml + - /other + - /funcs/funcs.lib.yml libdata: libdata2: |- lib1 @@ -347,11 +346,11 @@ localstarfunc: #@ localstarfunc()`) yamlfunc: textfunc textfunc: textfunc starfunc: -- 1 -- 2 + - 1 + - 2 localstarfunc: -- 3 -- 4 + - 3 + - 4 ` yamlFuncsData := []byte(` @@ -402,8 +401,8 @@ end`) func TestRelativeLoadInLibrariesForNonRootTemplates(t *testing.T) { expectedYAMLTplData := `libstarfunc: -- 1 -- 2 + - 1 + - 2 ` nonTopLevelYmlTplData := []byte(` @@ -543,29 +542,29 @@ func TestPlainYAMLNoTemplateProcessing(t *testing.T) { annotation: 5 #@ 1 + 2 text_template: (@= "string" @) versions: -- &version - name: v1alpha1 - served: true -- << : *version - name: v1beta1 -- << : *version - name: v1 - storage: true -- << : *version + - &version + name: v1alpha1 + served: true + - << : *version + name: v1beta1 + - << : *version + name: v1 + storage: true + - << : *version `) expectedYAMLTplData := `annotation: 5 text_template: (@= "string" @) versions: -- name: v1alpha1 - served: true -- name: v1beta1 - served: true -- name: v1 - served: true - storage: true -- name: v1alpha1 - served: true + - name: v1alpha1 + served: true + - name: v1beta1 + served: true + - name: v1 + served: true + storage: true + - name: v1alpha1 + served: true ` filesToProcess := []*files.File{ diff --git a/pkg/cmd/template/regular_input.go b/pkg/cmd/template/regular_input.go index 69df63b4..95cccdc1 100644 --- a/pkg/cmd/template/regular_input.go +++ b/pkg/cmd/template/regular_input.go @@ -110,6 +110,7 @@ func (s *RegularFilesSource) Output(out Output) error { } } + // out.DocSet.Items[1].Comments = []*yamlmeta.Comment{{Data: "@ load(\"@ytt:overlay\", \"overlay\")"}, {Data: "@overlay/match by=overlay.all"}} combinedDocBytes, err := out.DocSet.AsBytesWithPrinter(printerFunc) if err != nil { return fmt.Errorf("Marshaling combined template result: %s", err) diff --git a/pkg/cmd/template/schema_author_test.go b/pkg/cmd/template/schema_author_test.go index 3d723b2e..c8287cc0 100644 --- a/pkg/cmd/template/schema_author_test.go +++ b/pkg/cmd/template/schema_author_test.go @@ -1157,13 +1157,13 @@ foo: #@ data.values.foo bar: #@ data.values.bar ` expected := `foo: -- new -- array -- strings + - new + - array + - strings bar: -- 1 -- 2 -- 3 + - 1 + - 2 + - 3 ` filesToProcess := files.NewSortedFiles([]*files.File{ @@ -1193,8 +1193,8 @@ databases: #@ data.values.databases users: #@ data.values.users ` expected := `databases: -- name: null_db - host: "" + - name: null_db + host: "" users: admin: admin user: [] @@ -1221,8 +1221,8 @@ databases: databases: #@ data.values.databases ` expected := `databases: -- name: default - host: localhost + - name: default + host: localhost ` filesToProcess := files.NewSortedFiles([]*files.File{ diff --git a/pkg/cmd/template/schema_consumer_test.go b/pkg/cmd/template/schema_consumer_test.go index 25f28572..c8f856c9 100644 --- a/pkg/cmd/template/schema_consumer_test.go +++ b/pkg/cmd/template/schema_consumer_test.go @@ -57,14 +57,14 @@ rendered: #@ data.values expected := `rendered: db_conn: - - hostname: server.example.com - port: 5432 - username: sa - password: changeme - metadata: - run: ./build.sh - timeout: 7.5 - ttl: 1 + - hostname: server.example.com + port: 5432 + username: sa + password: changeme + metadata: + run: ./build.sh + timeout: 7.5 + ttl: 1 top_level: key ` @@ -91,8 +91,8 @@ rendered: #@ data.values rendered: #@ data.values ` expected := `rendered: -- first -- second + - first + - second ` filesToProcess := files.NewSortedFiles([]*files.File{ @@ -212,9 +212,9 @@ rendered: #@ data.values expected := `rendered: db_conn: - - hostname: server.example.com - metadata: - run: ./build.sh + - hostname: server.example.com + metadata: + run: ./build.sh top_level: key ` @@ -952,12 +952,12 @@ vpc: #@ data.values.vpc expected := `vpc: name: name value subnet_config: - - id: 2 - mask: 255.255.0.0 - private: true - - id: 3 - mask: 255.255.255.0 - private: true + - id: 2 + mask: 255.255.0.0 + private: true + - id: 3 + mask: 255.255.255.0 + private: true ` filesToProcess := files.NewSortedFiles([]*files.File{ @@ -985,7 +985,7 @@ clients: dataValuesYAML := `#@data/values --- clients: -- name: foo + - name: foo ` templateYAML := `#@ load("@ytt:data", "data") --- @@ -994,10 +994,10 @@ rendered: #@ data.values expected := `rendered: clients: - - name: foo - config: - args: [] - options: null + - name: foo + config: + args: [] + options: null ` filesToProcess := files.NewSortedFiles([]*files.File{ @@ -1162,8 +1162,8 @@ overriden: #@ data.values.overriden contains_array: null overriden: contains_array: - - a: 20 - b: 0 + - a: 20 + b: 0 ` filesToProcess := files.NewSortedFiles([]*files.File{ @@ -1194,10 +1194,10 @@ array: array: #@ data.values.array ` expected := `array: -- one -- null -- two -- null + - one + - null + - two + - null ` filesToProcess := files.NewSortedFiles([]*files.File{ @@ -1349,9 +1349,9 @@ foo: ["bar", 7, ~] foo: #@ data.values.foo ` expected := `foo: -- bar -- 7 -- null + - bar + - 7 + - null ` filesToProcess := files.NewSortedFiles([]*files.File{ @@ -1376,9 +1376,9 @@ foo: foo: #@ data.values.foo ` expected := `foo: -- bar: - - 1 - - baz + - bar: + - 1 + - baz ` filesToProcess := files.NewSortedFiles([]*files.File{ @@ -1454,11 +1454,11 @@ baz: #@ data.values.baz expected := `foo: ball: red bar: -- newMap: - - "" - - 8 + - newMap: + - "" + - 8 baz: -- newArray: foobar + - newArray: foobar ` filesToProcess := files.NewSortedFiles([]*files.File{ @@ -1951,8 +1951,8 @@ bar: from_library_schema foo: from_library_dv `) expectedYAMLTplData := `key: -- from_library_schema -- from_library_dv + - from_library_schema + - from_library_dv ` filesToProcess := files.NewSortedFiles([]*files.File{ diff --git a/pkg/cmd/template/schema_inspect_test.go b/pkg/cmd/template/schema_inspect_test.go index 53839439..2836a0c2 100644 --- a/pkg/cmd/template/schema_inspect_test.go +++ b/pkg/cmd/template/schema_inspect_test.go @@ -152,9 +152,9 @@ components: type: integer default: 0 default: - - 1 - - 2 - - 3 + - 1 + - 2 + - 3 array_of_maps: type: array items: @@ -168,12 +168,12 @@ components: type: string default: default default: - - bar: thing 1 - ree: default - - bar: thing 2 - ree: default - - bar: thing 3 - ree: default + - bar: thing 1 + ree: default + - bar: thing 2 + ree: default + - bar: thing 3 + ree: default ` filesToProcess := files.NewSortedFiles([]*files.File{ @@ -308,10 +308,10 @@ components: foo: int_key: 0 array_of_scalars: - - "" + - "" array_of_maps: - - foo: "" - bar: "" + - foo: "" + bar: "" ` filesToProcess := files.NewSortedFiles([]*files.File{ files.MustNewFileFromSource(files.NewBytesSource("schema.yml", []byte(schemaYAML))), @@ -351,10 +351,10 @@ components: default: int_key: 0 array_of_scalars: - - "" + - "" array_of_maps: - - foo: "" - bar: "" + - foo: "" + bar: "" ` filesToProcess := files.NewSortedFiles([]*files.File{ files.MustNewFileFromSource(files.NewBytesSource("schema.yml", []byte(schemaYAML))), @@ -508,9 +508,9 @@ components: type: integer default: 0 default: - - 1 - - 2 - - 3 + - 1 + - 2 + - 3 array_of_maps: type: array nullable: true @@ -527,12 +527,12 @@ components: nullable: true default: null default: - - bar: thing 1 - ree: null - - bar: thing 2 - ree: null - - bar: thing 3 - ree: null + - bar: thing 1 + ree: null + - bar: thing 2 + ree: null + - bar: thing 3 + ree: null ` filesToProcess := files.NewSortedFiles([]*files.File{ @@ -798,21 +798,21 @@ components: x-example-description: schema example description example: db_conn: - - hostname: localhost - port: 8080 - timeout: 4.2 - any_key: anything - null_key: null - properties: - db_conn: - type: array - x-example-description: db_conn example description - example: - hostname: localhost port: 8080 timeout: 4.2 any_key: anything null_key: null + properties: + db_conn: + type: array + x-example-description: db_conn example description + example: + - hostname: localhost + port: 8080 + timeout: 4.2 + any_key: anything + null_key: null items: type: object additionalProperties: false diff --git a/pkg/validations/filetests/success.tpltest b/pkg/validations/filetests/success.tpltest index b2fadec6..70905445 100644 --- a/pkg/validations/filetests/success.tpltest +++ b/pkg/validations/filetests/success.tpltest @@ -36,8 +36,8 @@ my_map: bool: true nil: null my_array: - - abc - - 12345 - - 3.14 - - true - - null + - abc + - 12345 + - 3.14 + - true + - null diff --git a/pkg/yamlmeta/convert.go b/pkg/yamlmeta/convert.go index 73399b59..95d76cd9 100644 --- a/pkg/yamlmeta/convert.go +++ b/pkg/yamlmeta/convert.go @@ -5,10 +5,12 @@ package yamlmeta import ( "fmt" + "strings" "github.com/vmware-tanzu/carvel-ytt/pkg/filepos" "github.com/vmware-tanzu/carvel-ytt/pkg/orderedmap" "github.com/vmware-tanzu/carvel-ytt/pkg/yamlmeta/internal/yaml.v2" + yaml3 "gopkg.in/yaml.v3" ) func NewASTFromInterface(val interface{}) interface{} { @@ -27,6 +29,76 @@ func NewGoFromAST(val interface{}) interface{} { return convertToGo(val) } +func convertToYAML3Node(val interface{}) *yaml3.Node { + switch typedVal := val.(type) { + case *Document: + // head, inline := convertYAML3Comments(typedVal) + return &yaml3.Node{ + Kind: yaml3.DocumentNode, + Content: []*yaml3.Node{convertToYAML3Node(typedVal.Value)}, + // HeadComment: head.String(), + // LineComment: inline.String(), + } + case *Map: + yamlMap := &yaml3.Node{Kind: yaml3.MappingNode} + for _, item := range typedVal.Items { + key := convertToYAML3Node(item.Key) + value := convertToYAML3Node(item.Value) + yamlMap.Content = append(yamlMap.Content, key, value) + } + return yamlMap + case *orderedmap.Map: + yamlMap := &yaml3.Node{Kind: yaml3.MappingNode} + typedVal.Iterate(func(k, v interface{}) { + key := convertToYAML3Node(k) + value := convertToYAML3Node(v) + yamlMap.Content = append(yamlMap.Content, key, value) + }) + return yamlMap + case *Array: + yamlArray := &yaml3.Node{Kind: yaml3.SequenceNode} + for _, item := range typedVal.Items { + yamlArray.Content = append(yamlArray.Content, convertToYAML3Node(item.Value)) + } + return yamlArray + case []interface{}: + yamlArray := &yaml3.Node{Kind: yaml3.SequenceNode} + for _, item := range typedVal { + yamlArray.Content = append(yamlArray.Content, convertToYAML3Node(item)) + } + return yamlArray + case bool: + return &yaml3.Node{Kind: yaml3.ScalarNode, Value: fmt.Sprintf("%t", val)} + case int, int32, int64, uint, uint32, uint64: + return &yaml3.Node{Kind: yaml3.ScalarNode, Value: fmt.Sprintf("%d", val)} + case float32, float64: + return &yaml3.Node{Kind: yaml3.ScalarNode, Value: fmt.Sprintf("%g", val)} + case nil: + return &yaml3.Node{Kind: yaml3.ScalarNode, Value: "null"} + case string: + if val == "" { + return &yaml3.Node{Kind: yaml3.ScalarNode, Value: "", Style: yaml3.DoubleQuotedStyle} + } else { + return &yaml3.Node{Kind: yaml3.ScalarNode, Value: fmt.Sprintf("%s", val), Tag: "!!str"} + } + default: + panic(fmt.Sprintf("Unexpected type %T = %#v", val, val)) + } +} + +func convertYAML3Comments(typedVal Node) (strings.Builder, strings.Builder) { + head := strings.Builder{} + inline := strings.Builder{} + for _, comment := range typedVal.GetComments() { + if comment.Position.IsNextTo(typedVal.GetPosition()) { + inline.WriteString(comment.Data) + } else { + head.WriteString(comment.Data) + } + } + return head, inline +} + func convertToLowYAML(val interface{}) interface{} { switch typedVal := val.(type) { case map[interface{}]interface{}: diff --git a/pkg/yamlmeta/document.go b/pkg/yamlmeta/document.go index 0e206457..a4d7a80c 100644 --- a/pkg/yamlmeta/document.go +++ b/pkg/yamlmeta/document.go @@ -4,7 +4,9 @@ package yamlmeta import ( - "github.com/vmware-tanzu/carvel-ytt/pkg/yamlmeta/internal/yaml.v2" + "bytes" + + yaml3 "gopkg.in/yaml.v3" ) func (d *Document) IsEmpty() bool { @@ -22,7 +24,22 @@ func (d *Document) IsEmpty() bool { } func (d *Document) AsYAMLBytes() ([]byte, error) { - return yaml.Marshal(convertToLowYAML(convertToGo(d.Value))) + out := bytes.Buffer{} + // TODO: re-enable including comments after all tests are verified working, as is. + // if len(d.Comments) > 0 { + // for _, comment := range d.Comments { + // out.WriteString(fmt.Sprintf("#%s\n", comment.Data)) + // } + // out.WriteString("---\n") + // } + + encoder := yaml3.NewEncoder(&out) + encoder.SetIndent(2) + err := encoder.Encode(convertToYAML3Node(d)) + if err != nil { + return nil, err + } + return out.Bytes(), nil } func (d *Document) AsInterface() interface{} { diff --git a/pkg/yamltemplate/filetests/annotation-for.tpltest b/pkg/yamltemplate/filetests/annotation-for.tpltest index a382a2a1..92ebde6e 100644 --- a/pkg/yamltemplate/filetests/annotation-for.tpltest +++ b/pkg/yamltemplate/filetests/annotation-for.tpltest @@ -16,13 +16,13 @@ test2: +++ test1: -- 0 -- 1 -- 1 -- 2 -- 2 -- 3 + - 0 + - 1 + - 1 + - 2 + - 2 + - 3 test2: -- 0 -- 1 -- 2 + - 0 + - 1 + - 2 diff --git a/pkg/yamltemplate/filetests/datatypes.tpltest b/pkg/yamltemplate/filetests/datatypes.tpltest index 75b59caf..a7ad84df 100644 --- a/pkg/yamltemplate/filetests/datatypes.tpltest +++ b/pkg/yamltemplate/filetests/datatypes.tpltest @@ -32,6 +32,6 @@ metadata: map: a: 123 list: - - a - - 123 - - a: 123 + - a + - 123 + - a: 123 diff --git a/pkg/yamltemplate/filetests/def-across-docs.tpltest b/pkg/yamltemplate/filetests/def-across-docs.tpltest index ac966a81..23e609c3 100644 --- a/pkg/yamltemplate/filetests/def-across-docs.tpltest +++ b/pkg/yamltemplate/filetests/def-across-docs.tpltest @@ -12,5 +12,5 @@ test1: #@ tpl() array: [] --- test1: -- item1 -- item2 + - item1 + - item2 diff --git a/pkg/yamltemplate/filetests/def-recursive.tpltest b/pkg/yamltemplate/filetests/def-recursive.tpltest index 53ba9427..14a73f6d 100644 --- a/pkg/yamltemplate/filetests/def-recursive.tpltest +++ b/pkg/yamltemplate/filetests/def-recursive.tpltest @@ -18,9 +18,9 @@ test: +++ test: -- label1: 123 - label2: 124 - label3: 12 - label4: 13 -- label3: 12 - label4: 13 + - label1: 123 + label2: 124 + label3: 12 + label4: 13 + - label3: 12 + label4: 13 diff --git a/pkg/yamltemplate/filetests/def-return.tpltest b/pkg/yamltemplate/filetests/def-return.tpltest index 74a03767..30be7ccd 100644 --- a/pkg/yamltemplate/filetests/def-return.tpltest +++ b/pkg/yamltemplate/filetests/def-return.tpltest @@ -34,8 +34,8 @@ test: +++ test: -- label1: 123 -- label3: 12 - label4: 13 -- a: 123 -- label1: 123 + - label1: 123 + - label3: 12 + label4: 13 + - a: 123 + - label1: 123 diff --git a/pkg/yamltemplate/filetests/def.tpltest b/pkg/yamltemplate/filetests/def.tpltest index cb6945ac..d3152ec1 100644 --- a/pkg/yamltemplate/filetests/def.tpltest +++ b/pkg/yamltemplate/filetests/def.tpltest @@ -33,8 +33,8 @@ parent1: label3: 12 label4: 13 parent2: -- label1: 123 - label2: 124 -- label3: 12 - label4: 13 + - label1: 123 + label2: 124 + - label3: 12 + label4: 13 parent3: 123 diff --git a/pkg/yamltemplate/filetests/for-break.tpltest b/pkg/yamltemplate/filetests/for-break.tpltest index a75f4abe..469ea14d 100644 --- a/pkg/yamltemplate/filetests/for-break.tpltest +++ b/pkg/yamltemplate/filetests/for-break.tpltest @@ -27,7 +27,7 @@ kind: Deployment metadata: labels: array: - - i: 0 + - i: 0 another: - - i: 1 - - i: 2 + - i: 1 + - i: 2 diff --git a/pkg/yamltemplate/filetests/for-continue.tpltest b/pkg/yamltemplate/filetests/for-continue.tpltest index 32b90ae7..1f06ea70 100644 --- a/pkg/yamltemplate/filetests/for-continue.tpltest +++ b/pkg/yamltemplate/filetests/for-continue.tpltest @@ -17,5 +17,5 @@ kind: Deployment metadata: labels: array: - - i: 0 - - i: 2 + - i: 0 + - i: 2 diff --git a/pkg/yamltemplate/filetests/for.tpltest b/pkg/yamltemplate/filetests/for.tpltest index 8fcf178e..42534cc7 100644 --- a/pkg/yamltemplate/filetests/for.tpltest +++ b/pkg/yamltemplate/filetests/for.tpltest @@ -15,9 +15,9 @@ kind: Deployment metadata: labels: array: - - 0 - - 1 - - 1 - - 2 - - 2 - - 3 + - 0 + - 1 + - 1 + - 2 + - 2 + - 3 diff --git a/pkg/yamltemplate/filetests/fragment/array.tpltest b/pkg/yamltemplate/filetests/fragment/array.tpltest index b04de76f..af0f2365 100644 --- a/pkg/yamltemplate/filetests/fragment/array.tpltest +++ b/pkg/yamltemplate/filetests/fragment/array.tpltest @@ -28,21 +28,21 @@ test6a: #@ 3 in array() +++ test1: -- str -- string -- true + - str + - string + - true test2: -- 123 -- int -- true + - 123 + - int + - true test3: -- key: 123 -- yamlfragment -- false + - key: 123 + - yamlfragment + - false test4: -- str -- 123 -- key: 123 + - str + - 123 + - key: 123 test5: 3 test6: true test6a: false diff --git a/pkg/yamltemplate/filetests/fragment/docset.tpltest b/pkg/yamltemplate/filetests/fragment/docset.tpltest index 6927c7ab..9eee8507 100644 --- a/pkg/yamltemplate/filetests/fragment/docset.tpltest +++ b/pkg/yamltemplate/filetests/fragment/docset.tpltest @@ -33,17 +33,17 @@ test6a: #@ 3 in docs() +++ test1: -- str -- string -- true + - str + - string + - true test2: -- 123 -- int -- true + - 123 + - int + - true test3: -- key: 123 -- yamlfragment -- false + - key: 123 + - yamlfragment + - false --- test4 --- diff --git a/pkg/yamltemplate/filetests/fragment/map.tpltest b/pkg/yamltemplate/filetests/fragment/map.tpltest index 1b585502..87f9a97c 100644 --- a/pkg/yamltemplate/filetests/fragment/map.tpltest +++ b/pkg/yamltemplate/filetests/fragment/map.tpltest @@ -36,26 +36,26 @@ test7a: #@ "test3" in map() +++ test1: -- str -- string -- true + - str + - string + - true test2: -- sub_key: 123 -- yamlfragment -- false + - sub_key: 123 + - yamlfragment + - false test3: -- 123 -- int -- true + - 123 + - int + - true test4: -- key: test1 - value: str -- key: test2 - value: - sub_key: 123 + - key: test1 + value: str + - key: test2 + value: + sub_key: 123 test5: -- str -- sub_key: 123 + - str + - sub_key: 123 test5a: test1: str test2: diff --git a/pkg/yamltemplate/filetests/if.tpltest b/pkg/yamltemplate/filetests/if.tpltest index 3600dd80..19aa5637 100644 --- a/pkg/yamltemplate/filetests/if.tpltest +++ b/pkg/yamltemplate/filetests/if.tpltest @@ -39,7 +39,7 @@ metadata: t: 456 t2: 456 test2: -- item1 -- item2 + - item1 + - item2 test3: -- item2 + - item2 diff --git a/pkg/yamltemplate/filetests/node-sugar/node-for-nested.tpltest b/pkg/yamltemplate/filetests/node-sugar/node-for-nested.tpltest index 8ce186c2..531a9238 100644 --- a/pkg/yamltemplate/filetests/node-sugar/node-for-nested.tpltest +++ b/pkg/yamltemplate/filetests/node-sugar/node-for-nested.tpltest @@ -28,30 +28,30 @@ kind: Deployment metadata: labels: array1: - - nested: - - 0 - - 1 - - 2 - - nested: - - 0 - - 1 - - 2 - - nested: - - 0 - - 1 - - 2 + - nested: + - 0 + - 1 + - 2 + - nested: + - 0 + - 1 + - 2 + - nested: + - 0 + - 1 + - 2 array2: - - 0,0 - - 0,1 - - 0,2 - - 1,0 - - 1,1 - - 1,2 - - 2,0 - - 2,1 - - 2,2 + - 0,0 + - 0,1 + - 0,2 + - 1,0 + - 1,1 + - 1,2 + - 2,0 + - 2,1 + - 2,2 array3: - - 0,0 - - 0,1 - - 1,0 - - 1,1 + - 0,0 + - 0,1 + - 1,0 + - 1,1 diff --git a/pkg/yamltemplate/filetests/node-sugar/node-for.tpltest b/pkg/yamltemplate/filetests/node-sugar/node-for.tpltest index 559c75b0..2152c60a 100644 --- a/pkg/yamltemplate/filetests/node-sugar/node-for.tpltest +++ b/pkg/yamltemplate/filetests/node-sugar/node-for.tpltest @@ -13,6 +13,6 @@ kind: Deployment metadata: labels: array: - - 0 - - 1 - - 2 + - 0 + - 1 + - 2 diff --git a/pkg/yamltemplate/filetests/yaml-map-item-in-array-item.tpltest b/pkg/yamltemplate/filetests/yaml-map-item-in-array-item.tpltest index 551657c8..349abff3 100644 --- a/pkg/yamltemplate/filetests/yaml-map-item-in-array-item.tpltest +++ b/pkg/yamltemplate/filetests/yaml-map-item-in-array-item.tpltest @@ -52,18 +52,18 @@ test5: +++ test1: -- value + - value test1a: -- value + - value test2: -- value + - value test3: -- key: value + - key: value test4: -- key: valuea -- key: valueb -- key: valueb -- {} + - key: valuea + - key: valueb + - key: valueb + - {} test5: -- key: a -- {} + - key: a + - {} diff --git a/pkg/yamltemplate/filetests/ytt-library/assert/not_null/err-args-too-many.tpltest b/pkg/yamltemplate/filetests/ytt-library/assert/not_null/err-args-too-many.tpltest index 5dc665d4..19e5c194 100644 --- a/pkg/yamltemplate/filetests/ytt-library/assert/not_null/err-args-too-many.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/assert/not_null/err-args-too-many.tpltest @@ -6,8 +6,8 @@ check: #@ assert.try_to(lambda: assert.not_null().check(1,2)) +++ not_null: -- null -- 'assert.not_null: got 2 arguments, want at most 1' + - null + - 'assert.not_null: got 2 arguments, want at most 1' check: -- null -- function lambda accepts 1 positional argument (2 given) + - null + - function lambda accepts 1 positional argument (2 given) diff --git a/pkg/yamltemplate/filetests/ytt-library/assert/not_null/short-hand.tpltest b/pkg/yamltemplate/filetests/ytt-library/assert/not_null/short-hand.tpltest index f76fc1c6..f10852cf 100644 --- a/pkg/yamltemplate/filetests/ytt-library/assert/not_null/short-hand.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/assert/not_null/short-hand.tpltest @@ -15,8 +15,8 @@ short_hand: short_hand: when_not_null: true when_none: - - null - - 'assert.not_null: fail: value is null' + - null + - 'assert.not_null: fail: value is null' when_null: - - null - - 'assert.not_null: fail: value is null' + - null + - 'assert.not_null: fail: value is null' diff --git a/pkg/yamltemplate/filetests/ytt-library/assert/one_not_null/main.tpltest b/pkg/yamltemplate/filetests/ytt-library/assert/one_not_null/main.tpltest index 85e3e49e..e9a1a1da 100644 --- a/pkg/yamltemplate/filetests/ytt-library/assert/one_not_null/main.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/assert/one_not_null/main.tpltest @@ -51,30 +51,30 @@ keys_are_specified: when_keys_are_not_given: one_value_not_null_is_ok: true all_values_are_null: - - null - - 'check: all values are null' + - null + - 'check: all values are null' multiple_values_are_not_null: - - null - - 'check: multiple values are not null ["foo" "qux"]' + - null + - 'check: multiple values are not null ["foo" "qux"]' value_is_empty: - - null - - 'check: value is empty' + - null + - 'check: value is empty' value_is_not_a_map: - - null - - 'check: value must be a map or dict, but was ''list''' + - null + - 'check: value must be a map or dict, but was ''list''' too_many_values: - - null - - 'check: got 2 arguments, want 1' + - null + - 'check: got 2 arguments, want 1' keys_are_specified: true_is_same_as_all: true one_value_not_null_is_ok: true non_string_keys_are_ok: true spec_is_not_a_sequence: - - null - - 'assert.one_not_null: expected a sequence of keys, but was a ''int''' + - null + - 'assert.one_not_null: expected a sequence of keys, but was a ''int''' key_not_found: - - null - - 'check: "not-a-key" is not present in value' + - null + - 'check: "not-a-key" is not present in value' too_args: - - null - - 'assert.one_not_null: got 2 arguments, want 1' + - null + - 'assert.one_not_null: got 2 arguments, want 1' diff --git a/pkg/yamltemplate/filetests/ytt-library/assert/one_not_null/works-with-structs.tpltest b/pkg/yamltemplate/filetests/ytt-library/assert/one_not_null/works-with-structs.tpltest index fb89d9d7..ed4f9417 100644 --- a/pkg/yamltemplate/filetests/ytt-library/assert/one_not_null/works-with-structs.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/assert/one_not_null/works-with-structs.tpltest @@ -17,7 +17,7 @@ keys_are_specified: when_keys_are_not_given: multiple_values_are_not_null: - - null - - 'check: multiple values are not null ["foo" "qux"]' + - null + - 'check: multiple values are not null ["foo" "qux"]' keys_are_specified: one_value_not_null_is_ok: true diff --git a/pkg/yamltemplate/filetests/ytt-library/assert/try_to/success.tpltest b/pkg/yamltemplate/filetests/ytt-library/assert/try_to/success.tpltest index 464f7bff..1fef5929 100644 --- a/pkg/yamltemplate/filetests/ytt-library/assert/try_to/success.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/assert/try_to/success.tpltest @@ -44,12 +44,12 @@ test_try_to_succeed_tuple: #@ try_to_succeed_tuple() +++ test_try_to_fail_data_error: -- null -- 'json.decode: invalid character ''}'' looking for beginning of value' + - null + - 'json.decode: invalid character ''}'' looking for beginning of value' test_try_to_fail_bad_ref: NoneType has no .foo field or method test_try_to_succeed_lambda: ytt: rules test_try_to_succeed_function: foo test_try_to_succeed_tuple: -- 1 -- 2 + - 1 + - 2 diff --git a/pkg/yamltemplate/filetests/ytt-library/data-values-struct.tpltest b/pkg/yamltemplate/filetests/ytt-library/data-values-struct.tpltest index 324eb447..0f39df0d 100644 --- a/pkg/yamltemplate/filetests/ytt-library/data-values-struct.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/data-values-struct.tpltest @@ -43,38 +43,38 @@ test1: map: a: 123 list: - - a - - 123 - - a: 123 + - a + - 123 + - a: 123 test2: a: 123 test3: -- a -- 123 -- a: 123 + - a + - 123 + - a: 123 test4: -- value: a -- value: 123 -- value: - a: 123 + - value: a + - value: 123 + - value: + a: 123 test5: -- key: a - value: 123 + - key: a + value: 123 is_mapping: test1: 123 test2: 123 test3: 123 is_iterable: test1: - - int = 123 - - intNeg = -49 - - float = 123.123 - - t = True - - f = False - - nullz = None - - string = string - - map = struct(...) - - list = ["a", 123, struct(...)] + - int = 123 + - intNeg = -49 + - float = 123.123 + - t = True + - f = False + - nullz = None + - string = string + - map = struct(...) + - list = ["a", 123, struct(...)] is_sequence: test1: 9 test2: 1 diff --git a/pkg/yamltemplate/filetests/ytt-library/data-values.tpltest b/pkg/yamltemplate/filetests/ytt-library/data-values.tpltest index b460b9a3..937d4860 100644 --- a/pkg/yamltemplate/filetests/ytt-library/data-values.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/data-values.tpltest @@ -35,10 +35,10 @@ metadata: map: a: 123 list: - - a - - 123 - - a: 123 + - a + - 123 + - a: 123 list_for: - - a - - 123 - - a: 123 + - a + - 123 + - a: 123 diff --git a/pkg/yamltemplate/filetests/ytt-library/json.tpltest b/pkg/yamltemplate/filetests/ytt-library/json.tpltest index 3e09c2fb..2a2a254d 100644 --- a/pkg/yamltemplate/filetests/ytt-library/json.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/json.tpltest @@ -44,8 +44,8 @@ decode: test1: {} test2: a: - - 1 - - 2 - - 3 - - c: 456 + - 1 + - 2 + - 3 + - c: 456 b: str diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/append-to-array.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/append-to-array.tpltest index 4797e4b5..5b20e9b4 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/append-to-array.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/append-to-array.tpltest @@ -35,12 +35,12 @@ test2: #@ overlay.apply(test2_left(), test2_right()) +++ test1: -- item1 -- item2 -- item3 + - item1 + - item2 + - item3 --- test2: list1: - - item1 + - item1 list2: - - item1 + - item1 diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/array-by-key.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/array-by-key.tpltest index 29fbc185..56f8cf1e 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/array-by-key.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/array-by-key.tpltest @@ -43,15 +43,15 @@ test2 test1 --- clients: -- secret: ree -- secret: bar - needsSecret: false -- secret: ree + - secret: ree + - secret: bar + needsSecret: false + - secret: ree --- test2 --- clients: -- secret: ree -- secret: bar - needsSecret: false -- secret: ree + - secret: ree + - secret: bar + needsSecret: false + - secret: ree diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/assert-nested.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/assert-nested.tpltest index 027e05d1..d90d9af7 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/assert-nested.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/assert-nested.tpltest @@ -46,13 +46,13 @@ test1: key2a: key2aa: val2 keys: - - 1 - - 2 + - 1 + - 2 test2: key1: key1a: val1 key2a: key2aa: val2 keys: - - 1 - - 2 + - 1 + - 2 diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/assert.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/assert.tpltest index dd70bf38..a68d0f65 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/assert.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/assert.tpltest @@ -91,12 +91,12 @@ test1b: key2: true key3: string key4: - - abc - - null + - abc + - null --- test2: -- val1 -- val11 + - val1 + - val11 --- val1 --- diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/doc-subset.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/doc-subset.tpltest index c8b02232..8ddac0b1 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/doc-subset.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/doc-subset.tpltest @@ -111,13 +111,13 @@ test1 metadata: name: test1 key1: -- name: foo + - name: foo --- metadata: name: test1 other: key key1: -- name: foo + - name: foo --- metadata: other: key @@ -125,18 +125,18 @@ metadata: test2 --- metadata: -- name: test2 + - name: test2 key1: -- name: foo + - name: foo --- metadata: -- name: test2 -- other: key + - name: test2 + - other: key key1: -- name: foo + - name: foo --- metadata: -- other: key + - other: key --- test3 --- diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/insert-into-array.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/insert-into-array.tpltest index 99e33a1b..b3b36d7d 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/insert-into-array.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/insert-into-array.tpltest @@ -43,18 +43,18 @@ test1: #@ overlay.apply(test1_left(), test1_right()) +++ test1: -- for_item: 1 - before: true -- item: 1 -- for_item: 1 - after: true -- for_item: 2 - before: true -- item: 2 -- for_item: 2 - after: true -- for_item: 3 - before: true -- item: 3 -- for_item: 3 - after: true + - for_item: 1 + before: true + - item: 1 + - for_item: 1 + after: true + - for_item: 2 + before: true + - item: 2 + - for_item: 2 + after: true + - for_item: 3 + before: true + - item: 3 + - for_item: 3 + after: true diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/logical-ops.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/logical-ops.tpltest index 3f4f3e61..6f6a3454 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/logical-ops.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/logical-ops.tpltest @@ -59,36 +59,36 @@ test3a: #@ overlay.apply(test_left(), test3a_right()) +++ test1: -- name: first -- name: second -- name: third -- found: true + - name: first + - name: second + - name: third + - found: true test1a: -- name: first - found: true -- name: second -- name: third + - name: first + found: true + - name: second + - name: third test1b: -- name: first - found: true -- name: second - found: true -- name: third - found: true + - name: first + found: true + - name: second + found: true + - name: third + found: true test2: -- name: first - found: true -- name: second -- name: third - found: true + - name: first + found: true + - name: second + - name: third + found: true test3: -- name: first -- name: second - found: true -- name: third - found: true + - name: first + - name: second + found: true + - name: third + found: true test3a: -- name: first -- name: second -- name: third -- found: true + - name: first + - name: second + - name: third + - found: true diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/match-child-defaults.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/match-child-defaults.tpltest index f59ec794..aa2e5adc 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/match-child-defaults.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/match-child-defaults.tpltest @@ -92,15 +92,15 @@ test1: --- test2: key2: - - name: val1 - - name: val2 - - name: val3 - - name: val4 - - name: val5 + - name: val1 + - name: val2 + - name: val3 + - name: val4 + - name: val5 --- key2: -- name: val1 -- name: val3 + - name: val1 + - name: val3 --- key3: -- name: val3 + - name: val3 diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/merge-over-nil.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/merge-over-nil.tpltest index 61b17610..82e2c076 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/merge-over-nil.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/merge-over-nil.tpltest @@ -50,6 +50,6 @@ test1: bar: 42 --- test2: -- - bar 42 + - - bar 42 --- test3: foo bar diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/overlay.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/overlay.tpltest index fa4fbdeb..8031ca92 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/overlay.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/overlay.tpltest @@ -95,20 +95,20 @@ test2: key2: val2 test3: key1: - - item1 - - item3 + - item1 + - item3 test3a: key1: - - item3 - - item3 + - item3 + - item3 test4: key1: - - item4 - - item4 + - item4 + - item4 key2: [] test5: key1: - - name: blah - - name: foo - other: key - - name: foo2 + - name: blah + - name: foo + other: key + - name: foo2 diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/replace-func.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/replace-func.tpltest index 5a9dcd3c..eb760aa5 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/replace-func.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/replace-func.tpltest @@ -82,8 +82,8 @@ test1b: key1: val1val2 --- test2: -- prefix-val1-val2 -- prefix-val11-val2 + - prefix-val1-val2 + - prefix-val11-val2 --- test3-prefix-val1-val2 --- diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/replace-or-add.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/replace-or-add.tpltest index 49429f16..b32a618b 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/replace-or-add.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/replace-or-add.tpltest @@ -65,13 +65,13 @@ test1: test1a: key1: val1 key2: - - null - - val2 + - null + - val2 --- test2: -- val1 -- val11 -- val2 + - val1 + - val11 + - val2 --- val1 --- diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/required-nested.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/required-nested.tpltest index db2d2f73..c303533e 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/required-nested.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/required-nested.tpltest @@ -41,8 +41,8 @@ test1: key1: val1 key2: val2 key2: - - name: foo - other: key + - name: foo + other: key test2: key1: key1: val1 diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/when.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/when.tpltest index fcd8d1bc..53d4d97d 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/when.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/when.tpltest @@ -105,11 +105,11 @@ test1: input_func: func input_list: list array: - - input_string + - input_string array2: - - input_int + - input_int array3: - - input_func + - input_func --- input_string: string input_int: int diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/yaml-array-over-yaml-map.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/yaml-array-over-yaml-map.tpltest index 2ce35f61..40c65967 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/yaml-array-over-yaml-map.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/yaml-array-over-yaml-map.tpltest @@ -19,5 +19,5 @@ test1: #@ overlay.apply(test1_left(), test1_right()) test1: key1: - - name: foo - other: key + - name: foo + other: key diff --git a/pkg/yamltemplate/filetests/ytt-library/overlay/yaml-over-map.tpltest b/pkg/yamltemplate/filetests/ytt-library/overlay/yaml-over-map.tpltest index f59f7d1c..cc1cfee7 100644 --- a/pkg/yamltemplate/filetests/ytt-library/overlay/yaml-over-map.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/overlay/yaml-over-map.tpltest @@ -18,6 +18,6 @@ test1: #@ overlay.apply(test1_left(), test1_right()) test1: key1: - - name: foo - another: key - other: key + - name: foo + another: key + other: key diff --git a/pkg/yamltemplate/filetests/ytt-library/struct-sort.tpltest b/pkg/yamltemplate/filetests/ytt-library/struct-sort.tpltest index f12d8185..3d117e75 100644 --- a/pkg/yamltemplate/filetests/ytt-library/struct-sort.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/struct-sort.tpltest @@ -7,9 +7,9 @@ test1: #@ struct.decode(struct.make(a=[1,2,3], b="str", c=struct.make(d=123))) test1: a: - - 1 - - 2 - - 3 + - 1 + - 2 + - 3 b: str c: d: 123 diff --git a/pkg/yamltemplate/filetests/ytt-library/struct.tpltest b/pkg/yamltemplate/filetests/ytt-library/struct.tpltest index 813e0409..65181e19 100644 --- a/pkg/yamltemplate/filetests/ytt-library/struct.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/struct.tpltest @@ -106,10 +106,10 @@ make_and_bind: --- encode: test1: - - 1 - - 2 - - 3 - - c: 456 + - 1 + - 2 + - 3 + - c: 456 test2: str test3: 123 is_mapping: @@ -120,30 +120,30 @@ encode: test5: true is_iterable: test1: - - a = [1, 2, 3, struct(...)] - - b = str - - c = struct(...) + - a = [1, 2, 3, struct(...)] + - b = str + - c = struct(...) test2: - - a = [1, 2, 3, struct(...)] - - b = str - - c = struct(...) + - a = [1, 2, 3, struct(...)] + - b = str + - c = struct(...) is_sequence: test1: 3 --- decode: test1: a: - - 1 - - 2 - - 3 + - 1 + - 2 + - 3 b: str c: d: 123 test2: a: - - 1 - - 2 - - 3 + - 1 + - 2 + - 3 b: str c: d: 123 diff --git a/pkg/yamltemplate/filetests/ytt-library/toml.tpltest b/pkg/yamltemplate/filetests/ytt-library/toml.tpltest index 24b7a6f4..e28274e8 100644 --- a/pkg/yamltemplate/filetests/ytt-library/toml.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/toml.tpltest @@ -59,12 +59,12 @@ decode: test1: {} test2: a: - - 1 - - 2 - - 3 - - 456 + - 1 + - 2 + - 3 + - 456 b: str test3: stuff: - - a: 1 - - b: 2 + - a: 1 + - b: 2 diff --git a/pkg/yamltemplate/filetests/ytt-library/url/url.tpltest b/pkg/yamltemplate/filetests/ytt-library/url/url.tpltest index 7e252f60..e7f0e3c7 100644 --- a/pkg/yamltemplate/filetests/ytt-library/url/url.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/url/url.tpltest @@ -36,11 +36,11 @@ query_params: test1: x=1&y=2&y=3&z= test2: x: - - "1" - "y": - - "2" - - "3" + - "1" + y: + - "2" + - "3" z: - - "" + - "" test3: "" test4: {} diff --git a/pkg/yamltemplate/filetests/ytt-library/yaml.tpltest b/pkg/yamltemplate/filetests/ytt-library/yaml.tpltest index dc45eb4c..442b013c 100644 --- a/pkg/yamltemplate/filetests/ytt-library/yaml.tpltest +++ b/pkg/yamltemplate/filetests/ytt-library/yaml.tpltest @@ -54,28 +54,28 @@ test5 test1: | a: - - 1 - - 2 - - 3 - - c: 456 + - 1 + - 2 + - 3 + - c: 456 b: str test1a: | fragment: - - piece1 - - piece2: true + - piece1 + - piece2: true test1b: | inside_map: fragment: - - piece1 - - piece2: true + - piece1 + - piece2: true inside_array: - - fragment: - - piece1 - - piece2: true + - fragment: + - piece1 + - piece2: true test1c: | fragment: - - piece1 - - piece2: true + - piece1 + - piece2: true --- doc2 test2: | @@ -83,10 +83,10 @@ test2: | test3: {} test4: a: - - 1 - - 2 - - 3 - - c: 456 + - 1 + - 2 + - 3 + - c: 456 b: str --- test5 diff --git a/pkg/yamltemplate/filetests/ytt-replace/array-item.tpltest b/pkg/yamltemplate/filetests/ytt-replace/array-item.tpltest index f6474c6d..2c0a73ec 100644 --- a/pkg/yamltemplate/filetests/ytt-replace/array-item.tpltest +++ b/pkg/yamltemplate/filetests/ytt-replace/array-item.tpltest @@ -33,27 +33,27 @@ empty: +++ start: -- a: 123 -- b: 124 -- item1 -- item2 -- c: 126 + - a: 123 + - b: 124 + - item1 + - item2 + - c: 126 middle: -- a: 127 -- b: 123 -- c: 124 -- test4: more-than-one-item -- item1 -- item2 -- d: 126 + - a: 127 + - b: 123 + - c: 124 + - test4: more-than-one-item + - item1 + - item2 + - d: 126 end: -- a: 126 -- b: 123 -- c: 124 -- item1 -- item2 + - a: 126 + - b: 123 + - c: 124 + - item1 + - item2 empty: -- b: 123 -- c: 124 -- item1 -- item2 + - b: 123 + - c: 124 + - item1 + - item2 diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 3be73059..5080a2f3 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -90,13 +90,13 @@ float: 123.123 } actualOutput := runYtt(t, testInputFiles{"../../examples/data-values/config.yml", "../../examples/data-values/values.yml"}, "", flags, envs) expectedOutput := `nothing: -- 1 -- 2 -- 3 + - 1 + - 2 + - 3 string: -- 1 -- 2 -- 4 + - 1 + - 2 + - 4 bool: true int: 123 float: 123.123 @@ -168,7 +168,7 @@ float: 0 expectedOutput := `app_config: version: "123" ports: - - 8080 + - 8080 ` require.Equal(t, expectedOutput, actualOutput) }) @@ -177,7 +177,7 @@ float: 0 expectedOutput := `app_config: version: v1alpha1 ports: - - 8080 + - 8080 ` require.Equal(t, expectedOutput, actualOutput) }) @@ -186,7 +186,7 @@ float: 0 expectedOutput := `app_config: version: v1beta1 ports: - - 8081 + - 8081 ` require.Equal(t, expectedOutput, actualOutput) }) @@ -195,7 +195,7 @@ float: 0 expectedOutput := `app_config: version: v1 ports: - - 80 + - 80 ` require.Equal(t, expectedOutput, actualOutput) })