question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

document aliased imports

See original GitHub issue

When importing two CRD’s that share the same group id, one needs to use aliased imports, otherwise the imports will override one another.

See https://github.com/prometheus-operator/kube-prometheus/tree/main/manifests/setup for an example of CRD’s that share group id.

That is, instead of having:

imports:
  - https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/setup/0alertmanagerConfigCustomResourceDefinition.yaml
  - https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/setup/0alertmanagerCustomResourceDefinition.yaml

We need to alias the imports like so:

imports:
  - alertmanagerconfig:=https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/setup/0alertmanagerConfigCustomResourceDefinition.yaml
  - alertmanager:=https://raw.githubusercontent.com/prometheus-operator/kube-prometheus/main/manifests/setup/0alertmanagerCustomResourceDefinition.yaml

This functionality is not documented. We should add to our CRD’s section.

Side Note

It would be nice if the CLI could warn before overriding an import and suggest an alias import with a link to the new documentation section.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
iliapolocommented, Jul 12, 2022

@gkarthiks

@iliapolo do you think is this what happening there -> cdk8s-team/cdk8s-cli#386

I don’t think it’s related actually. I need to a closer look into what’s happening there.

0reactions
mcouthoncommented, Jul 12, 2022

Sure: cdk8s-team/cdk8s#885 🙇

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Import aliases in JavaScript | by Greg Byrne - Medium
Import aliases are where you take your standard import, but instead of using a pre-defined name by the exporting module, you use a...
Read more >
Import-Alias - PowerShell - Microsoft Learn
The Import-Alias cmdlet imports an alias list from a file. Beginning in Windows PowerShell 3.0, as a security feature, Import-Alias does not overwrite ......
Read more >
How can I alias a default import in JavaScript? - Stack Overflow
Import aliases are where you take your standard import, but instead of using a pre-defined name by the exporting module, you use a...
Read more >
Module Resolution or Import Alias: The Final Guide - Raul Melo
Module resolution or import alias is a way we can emulate the same way we import node_modules but with our internal code.
Read more >
About Alias Table Import and Export Files - Oracle Help Center
Alias table import files contain information that associates aliases with outline members. You can create an alias table import file in the following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found