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

Generated custom mappings #395

Merged
merged 5 commits into from
Nov 18, 2020
Merged

Conversation

jsteinich
Copy link
Collaborator

@jsteinich jsteinich commented Oct 1, 2020

Initial goal is to fix #235 but I may expand to pick up #223, #234, #282.

The representation of attribute types and how that applies to the generation and dependencies is definitely a bit messy and brittle, but I don't have any suggestions at this point on how to improve.

@jsteinich
Copy link
Collaborator Author

Going to put any additional fixes in follow up PRs.
Also holding off on doing any refactoring.

@jsteinich jsteinich marked this pull request as ready for review October 3, 2020 21:38
@jsteinich
Copy link
Collaborator Author

Realized this already picks up a fix for #282.

@skorfmann
Copy link
Contributor

I may expand to pick up #223, #234, #282.
Realized this already picks up a fix for #282.

Have you started to work on #223 / #234 already?

@jsteinich
Copy link
Collaborator Author

Have you started to work on #223 / #234 already?

I have not. Feel free to work on them if you'd like.

@kaisellgren
Copy link

This does not work:

new CloudRunService(s, 'a', {
  template: [
    {
      metadata: [
        {
          annotations: {
            'autoscaling.knative.dev/maxScale': '1000',
            'run.googleapis.com/cloudsql-instances': 'name',
            'run.googleapis.com/sandbox': 'gvisor',
          }
        }
      ]
    },
  ],
})

Those annotations will be converted to:

{
  "metadata": [
    {
      "annotations": {
        "autoscaling_knative_dev_max_scale": "1000",
        "run_googleapis_com_cloudsql_instances": "name",
        "run_googleapis_com_sandbox": "gvisor"
      }
    }
  ]
}

How do I prevent it from converting dots to underscores? The only way I can seem to do it is by using the escape hatch:

gcr.addOverride("template.0.metadata", [
  {
    annotations: {
      "autoscaling.knative.dev/maxScale": "1000",
      "run.googleapis.com/cloudsql-instances": 'name',
      "run.googleapis.com/sandbox": "gvisor",
    },
  },
])

It would be great if this worked without the escape hatch, but I can live with this for now.

@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keys of user supplied input objects should keep character casing
3 participants