Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]::Can we replace and Remove yaml keys with single configuration ? #827

Open
UPADHYA28 opened this issue Apr 10, 2023 · 2 comments
Labels
helping with an issue Debugging happening to identify the problem

Comments

@UPADHYA28
Copy link

UPADHYA28 commented Apr 10, 2023

Hi Team,

This question might seem very basic, but i am a new user of ytt and still in exploration mode.

I have following templates.
Base Template:

`---
apiVersion: 1
specification: 
  versions:
    - name: v1
      schema:
        openAPIV3Schema:
          properties:
            spec:
              myConfiguration:
                description: Customized Configuration
`

Key Replace Template:

`
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")
#@overlay/match by=overlay.all
---
apiVersion: 1
specification: 
  versions:
  #@overlay/match by=overlay.all, expects="1+"
    - schema:
        #@overlay/replace via=lambda left, right: {"properties": right}
        openAPIV3Schema:
            spec:
              new_myConfiguration:
              #@overlay/replace via=lambda left, right: {"properties": right}
                new_description: Modified Configuration
              new_key: avinash
`

Key_Remove_Template:

#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")
#@overlay/match by=overlay.all
---
apiVersion: 1
specification: 
  versions:
  #@overlay/match by=overlay.all, missing_ok=True
    - schema:
        openAPIV3Schema:
          properties:
            spec:
              #@overlay/match when=lambda right: data.values.client == "local_client"
              #@overlay/remove
              new_myConfiguration:

So basically i am trying to rename myConfiguration provided client !="local_client", and if then remove myConfiguration altogether.

@UPADHYA28 UPADHYA28 added the carvel triage This issue has not yet been triaged for relevance label Apr 10, 2023
@UPADHYA28 UPADHYA28 changed the title Can we replace and Remove yaml keys with single configuration ? [Question]::Can we replace and Remove yaml keys with single configuration ? Apr 10, 2023
@github-actions
Copy link

This issue is being marked as stale due to a long period of inactivity and will be closed in 5 days if there is no response.

@github-actions github-actions bot added the stale This issue has had no activity for a while and will be closed soon label May 21, 2023
@renuy renuy removed the stale This issue has had no activity for a while and will be closed soon label May 23, 2023
@100mik 100mik added helping with an issue Debugging happening to identify the problem and removed carvel triage This issue has not yet been triaged for relevance labels Jun 7, 2023
@vmunishwar
Copy link
Contributor

@UPADHYA28 Sorry for the late response. We would like to know if you are still blocked on this issue or you were able to find the solution. Thanks for reaching out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
helping with an issue Debugging happening to identify the problem
Projects
Status: No status
Development

No branches or pull requests

4 participants