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

feat(cli): import from crds.dev #378

Merged
merged 2 commits into from
Nov 19, 2020
Merged

Conversation

prasek
Copy link
Contributor

@prasek prasek commented Nov 16, 2020

Introduce crds.dev import shortcut: cdk8s import github:account/repo[@VERSION]

Example:
cdk8s import github:crossplane/[email protected]

Resolves #377

In a future PR would like to generate a single module per k8s API group with all CRDs for that API group, so you could:

import { CompositeResourceDefinition, Composition } from './imports/apiextensions.crossplane.io';

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@prasek prasek changed the title crds.dev import shortcut like cdk8s import crossplane/[email protected] feat(cli): crds.dev import shortcut like cdk8s import crossplane/[email protected] Nov 16, 2020
@prasek prasek force-pushed the import-crds-dev branch 4 times, most recently from 21565e6 to a5346fc Compare November 16, 2020 12:00
@prasek
Copy link
Contributor Author

prasek commented Nov 16, 2020

@eladb @iliapolo how does this look?

Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Feels like we should add some form of unit test?

packages/cdk8s-cli/src/cli/cmds/import.ts Outdated Show resolved Hide resolved
packages/cdk8s-cli/src/import/dispatch.ts Outdated Show resolved Hide resolved
packages/cdk8s-cli/test/import/fixtures/crossplane.yaml Outdated Show resolved Hide resolved
@eladb eladb changed the title feat(cli): crds.dev import shortcut like cdk8s import crossplane/[email protected] feat(cli): import from crds.dev Nov 16, 2020
@eladb
Copy link
Contributor

eladb commented Nov 18, 2020

@prasek any updates? Also, make sure to re-request a review when ready for another round.

@prasek prasek force-pushed the import-crds-dev branch 3 times, most recently from 418fa05 to 6ce96e5 Compare November 18, 2020 20:23
@prasek prasek requested a review from eladb November 18, 2020 21:07
@prasek
Copy link
Contributor Author

prasek commented Nov 18, 2020

@eladb should be good to go, thx.

packages/cdk8s-cli/src/import/crds-dev.ts Outdated Show resolved Hide resolved
packages/cdk8s-cli/src/import/crds-dev.ts Outdated Show resolved Hide resolved
Introduce crds.dev import shortcut: `cdk8s import github:account/repo[@Version]`

Example:
`cdk8s import github:crossplane/[email protected]`

Resolves cdk8s-team#377

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*

Signed-off-by: Phil Prasek <[email protected]>
@prasek prasek requested a review from eladb November 19, 2020 10:50
@prasek
Copy link
Contributor Author

prasek commented Nov 19, 2020

@eladb test coverage is 100% should be good to go, thx.

@mergify
Copy link
Contributor

mergify bot commented Nov 19, 2020

Your pull request will be updated and merged automatically (do not update manually).

@mergify mergify bot merged commit c62d0a4 into cdk8s-team:master Nov 19, 2020
@prasek prasek deleted the import-crds-dev branch November 19, 2020 16:52
mergify bot pushed a commit that referenced this pull request Dec 3, 2020
Follow-on to #378 

Emit a single module per API group for all imports:
```sh
cdk8s import github:account/repo[@Version]
```
you can use a single line import statement for multiple API types:
```ts
import { CompositeResourceDefinition, Composition } from './imports/apiextensions.crossplane.io';
```

Here's some sample output:
https://github.com/prasek/crossplane-cdk/tree/cross-pkg/test/imports/provider-aws

Resolves #401

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
campionfellin pushed a commit to campionfellin/cdk8s that referenced this pull request Dec 11, 2020
Follow-on to cdk8s-team#378 

Emit a single module per API group for all imports:
```sh
cdk8s import github:account/repo[@Version]
```
you can use a single line import statement for multiple API types:
```ts
import { CompositeResourceDefinition, Composition } from './imports/apiextensions.crossplane.io';
```

Here's some sample output:
https://github.com/prasek/crossplane-cdk/tree/cross-pkg/test/imports/provider-aws

Resolves cdk8s-team#401

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add crds.dev import shortcut like cdk8s import crossplane/[email protected]
4 participants