Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

%k formatter does not work on scalar nodes #54

Open
scottd018 opened this issue May 26, 2021 · 1 comment
Open

%k formatter does not work on scalar nodes #54

scottd018 opened this issue May 26, 2021 · 1 comment
Labels
enhancement New feature or request question Further information is requested v0.6.0

Comments

@scottd018
Copy link
Contributor

Query (attempted in both yamlFiles and commonOverlays):

  - name: "adjust tanzu namespace spec values"
    query:
      - spec[*]
      # - spec.*     # also tried this 
    value: "%v" #+workload:%k:default="%v":type=string
    documentQuery:
      - conditions:
          - query: kind
            value: TanzuNamespace

Output (notice the missing key format input to the output manifest):

spec:
  tanzuNamespaceName: tanzu-identity #+workload::default="tanzu-identity":type=string
  tanzuLimitRangeDefaultCpuLimit: 50m #+workload::default="50m":type=string
  tanzuLimitRangeDefaultMemoryLimit: 64Mi #+workload::default="64Mi":type=string
  tanzuLimitRangeDefaultCpuRequest: 50m #+workload::default="50m":type=string
  tanzuLimitRangeDefaultMemoryRequest: 64Mi #+workload::default="64Mi":type=string
  tanzuLimitRangeMaxCpuLimit: 1000m #+workload::default="1000m":type=string
  tanzuLimitRangeMaxMemoryLimit: 1024Mi #+workload::default="1024Mi":type=string
  tanzuResourceQuotaCpuRequests: "6" #+workload::default="6":type=string
  tanzuResourceQuotaMemoryRequests: 8Gi #+workload::default="8Gi":type=string
  tanzuResourceQuotaCpuLimits: "6" #+workload::default="6":type=string
  tanzuResourceQuotaMemoryLimits: 8Gi #+workload::default="8Gi":type=string
@JefeDavis
Copy link
Contributor

%k is currently not supported on scalar nodes however the following would work for your use case

  - name: "adjust tanzu namespace spec values"
    query: spec
    value: 
      "%k": "%v" #+workload:%k:default="%v":type=string
    documentQuery:
      - conditions:
          - query: kind
            value: TanzuNamespace

@JefeDavis JefeDavis changed the title %k formatter is inoperable in v0.2.0 %k formatter does not work on scalar nodes May 26, 2021
@ahuffman ahuffman added enhancement New feature or request question Further information is requested defect v0.6.0 labels Jun 2, 2021
@ahuffman ahuffman removed the defect label Jul 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request question Further information is requested v0.6.0
Projects
None yet
Development

No branches or pull requests

3 participants