pulumi/tests/testdata/codegen/kubernetes20/python/pulumi_kubernetes
Will Jones 271553d462
Generate `@deprecated` decorators in Python SDKs (#16436)
The latest version of the core Pulumi SDK contains a decorator,
`@deprecated`, that is used when generating SDK code in order to signify
deprecated properties in a way that can be recognised by other SDK code.
This is useful when writing generic Python code that e.g. traverses
class properties without triggering deprecation warnings for those not
explicitly mentioned in user code. The [original pull
request](https://github.com/pulumi/pulumi/pull/16400) has more details.

Alas, we can't rely on the fact that a user will upgrade _both_ a
particular (generated) provider SDK and the core Pulumi SDK at the same
time. Thus, it's entirely possible that a user bumps their version of
(say) `pulumi_aws`, whilst leaving their `pulumi` library at the same
(compatible, according to specified bounds) version. In doing so they'd
hit errors when the new SDK tried to import the `@deprecated` decorator,
which doesn't exist in the old core SDK.

This commit thus fixes this by altering code generation so that each SDK
receives its own inlined copy of the `@deprecated` decorator, which it
can reference regardless of the version of the core SDK. This decorator
applies the same `_pulumi_deprecated_callable` tag to functions it
decorates, which a sufficiently modern SDK will recognise to avoid
triggering e.g. https://github.com/pulumi/pulumi/issues/15894. Later on,
we can hopefully find a way to avoid doing this and use only a version
of `@deprecated` specified in the core SDK.

Codegen tests have been updated and the inlined decorator has manually
been tested using the AWS Classic SDK.

Addresses
https://github.com/pulumi/pulumi/pull/16400#discussion_r1646562455
2024-06-21 11:34:29 +00:00
..
core Move codegen testdata (#15549) 2024-03-06 20:36:50 +00:00
helm Move codegen testdata (#15549) 2024-03-06 20:36:50 +00:00
meta Move codegen testdata (#15549) 2024-03-06 20:36:50 +00:00
yaml Move codegen testdata (#15549) 2024-03-06 20:36:50 +00:00
README.md Move codegen testdata (#15549) 2024-03-06 20:36:50 +00:00
__init__.py Move codegen testdata (#15549) 2024-03-06 20:36:50 +00:00
_inputs.py Move codegen testdata (#15549) 2024-03-06 20:36:50 +00:00
_utilities.py Generate `@deprecated` decorators in Python SDKs (#16436) 2024-06-21 11:34:29 +00:00
provider.py Move codegen testdata (#15549) 2024-03-06 20:36:50 +00:00
pulumi-plugin.json Move codegen testdata (#15549) 2024-03-06 20:36:50 +00:00
py.typed Move codegen testdata (#15549) 2024-03-06 20:36:50 +00:00

README.md

The Kubernetes provider package offers support for all Kubernetes resources and their properties. Resources are exposed as types from modules based on Kubernetes API groups such as 'apps', 'core', 'rbac', and 'storage', among many others. Additionally, support for deploying Helm charts ('helm') and YAML files ('yaml') is available in this package. Using this package allows you to programmatically declare instances of any Kubernetes resources and any supported resource version using infrastructure as code, which Pulumi then uses to drive the Kubernetes API.

If this is your first time using this package, these two resources may be helpful: