vscode-kubernetes-tools / vscode-kubernetes-tools

Kubernetes extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-kubernetes-tools.vscode-kubernetes-tools
Apache License 2.0
685 stars 247 forks source link

Feature Request: Offline Support for CRD Completions #1106

Open schrej opened 2 years ago

schrej commented 2 years ago

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:

lstocchi commented 2 years ago

It looks to me a good idea. +1 As we don't have much time we can split this in various steps and work by priority. Caching first imo

Thoughts about this? @itowlson @squillace