Right now, autocompletion for CRDs is based on the cluster one is currently connected to. If a CRD is not available on that cluster, there won't be any autocompletion and no tooltips.
I'm working in a platform team, and we manage dozens of clusters. Since we're doing GitOps we edit lots of manifests in VS Code and then push them to git in order for them to get applied.
When I'm not connected to a cluster, or connected to a cluster that doesn't have a specific CRD installed (we're using cluster-api for example, which is only available on management clusters) I do not get completions and tooltips.
Proposal
If CRDs were cached/stored offline, completion and tooltips could be provided at any time. It could also reduce the time between opening a yaml file and getting assistance.
Since CR(D)s are versioned, it should be possible to just store the CRDs indefinitely, automatically refreshing or sending a notification if the version used in the file is not available. There also shouldn't be any conflicts as CRDs usally have a unique name/namespace identifier.
The following behaviour and features would be very convenient for our use-case:
When the extension notices a CRD that it doesn't have in its cache, it will query the connected API server and check if that CRD is available. If it is, it downloads and stores it.
When it does have the CRD in its cache, but not the correct version, it also contacts the API server to update the CRD. If the API server doesn't have a matching version, a banner could be shown.
It should be possible to import CRDs form a URL, e.g. when no API server with the necessary CRDs can be accessed.
There should be a context menu option that allows to refresh a CRD from the server (maybe also from the code lens at the top of the file). This is useful for CRD development, where fields might change without the version changing as well.
An action to download and store all CRDs from a server would also be useful.
Right now, autocompletion for CRDs is based on the cluster one is currently connected to. If a CRD is not available on that cluster, there won't be any autocompletion and no tooltips.
I'm working in a platform team, and we manage dozens of clusters. Since we're doing GitOps we edit lots of manifests in VS Code and then push them to git in order for them to get applied. When I'm not connected to a cluster, or connected to a cluster that doesn't have a specific CRD installed (we're using cluster-api for example, which is only available on management clusters) I do not get completions and tooltips.
Proposal
If CRDs were cached/stored offline, completion and tooltips could be provided at any time. It could also reduce the time between opening a yaml file and getting assistance.
Since CR(D)s are versioned, it should be possible to just store the CRDs indefinitely, automatically refreshing or sending a notification if the version used in the file is not available. There also shouldn't be any conflicts as CRDs usally have a unique name/namespace identifier.
The following behaviour and features would be very convenient for our use-case: