-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support local SDK generation (#1405)
Parameterization refers to the ability for a provider to vary its schema based on a parameter that is passed to a new `Parameterize` call on the provider interface. The package reference that is returned may then be used to interact with the bespoke schema/packages within. One use case for this kind of provider is Kubernetes _custom resource definitions_ (CRDs), which are custom types that Kubernetes users can define in their clusters. Parameterization enables a world in which the generic published Kubernetes provider can be parameterized with a set of CRD definitions, allowing Pulumi to offer the management of those CRDs as first-class resources. As part of this, users would generate an SDK whose types and functions would allow them to refer to their CRDs just as they would any other Pulumi entity, giving benefits such as static type checking, discovery and code completion, and so on. Today, SDK generation assumes that the package being generated will be published to a language-specific registry (e.g. NPM for NodeJS or PyPi for Python). This caters for the primary use case of e.g. Pulumi offering a set of general-purpose providers whose implementations and backing clouds are publicly available. In the case above however, it's likely that most users' CRD setups will be bespoke and/or private. It would be desirable therefore to be able to generate SDKs suitable for "local" consumption only -- that is, without the need for them to be published to a registry. This commit introduces the `--local` parameter to `bin/pulumi-java-gen` to do just that. When generating a "local" SDK, we omit build files (such as `build.gradle`) and materialize a `version.txt` directly into the generated source tree. This then yields a `src/main/...` tree that can be copied directly into an existing Pulumi program before being used like any other SDK. This commit does not cover this "linking" aspect, nor does it move Java to use the gRPC interface for SDK generation. Both of these are near-term future work that will be completed separately as we iterate upon and enhance the parameterized providers experience.
- Loading branch information
Showing
6 changed files
with
42 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters