Azure / bicep

Bicep is a declarative language for describing and deploying Azure resources
MIT License
3.26k stars 754 forks source link

Kubernetes resource types of the kubernetes provider are not updated in between releases of Bicep #11597

Open asilverman opened 1 year ago

asilverman commented 1 year ago

Describe the bug

The type definitions for the Kubernetes extensibility provider are updated to Kubernetes v1.25.3. The current Kubernetes version is v1.28.

If I as a user want to deploy a kubernetes resource that is only available in v1.28 onto a v1.28 cluster, the kubernetes provider type definition will flag it as an unknown type.

To Reproduce Lets use an example, in v1.28, consider https://github.com/kubernetes/kubernetes/blob/07f47d8b407ace1cf85f814b787718ba1e65ef6a/CHANGELOG/CHANGELOG-1.28.md?plain=1#L263

We see the changelog reflects there was an addition to the StorageVersion API a new field ServedVersions was added

image

Notice how the Bicep compiler warns on this field below: image

Additional context We likely want to trigger an automated CI pipeline to publish on each patch version being released by Kubernetes and generate a package with the corresponding types.

In the meantime, it would be useful to add a manual step to release Bicep with the types corresponding to the latest Kubernetes minor version that was released at the time Bicep is released

majastrz commented 1 year ago

@shenglol Do we need to update the release checklist to also include K8s type updates?

shenglol commented 1 year ago

@shenglol Shenglong Li FTE Do we need to update the release checklist to also include K8s type updates?

No, this requires dynamic type loading to be implemented. A k8s version bump can deprecate certain resource API, so we cannot always bundle the latest k8s version into the Bicep compiler.