Comments (9)
Kubernetes tools extension implements custom fs (filesystem) to load those documents on k8s tools explorer node clicks:
https://github.com/Azure/vscode-kubernetes-tools/blob/master/src/extension.ts#L740
async function loadKubernetes(explorerNode?: ClusterExplorerResourceNode) {
if (explorerNode) {
loadKubernetesCore(explorerNode.namespace, explorerNode.kindName);
} else {
const value = await promptKindName(kuberesources.commonKinds, "load", { nameOptional: true });
if (value) {
loadKubernetesCore(null, value);
}
}
}
The actual config document loading is done via kubefsUri()
construction and standard vscode document open setup:
function loadKubernetesCore(namespace: string | null, value: string) {
const outputFormat = config.getOutputFormat();
const uri = kubefsUri(namespace, value, outputFormat);
vscode.workspace.openTextDocument(uri).then((doc) => {
if (doc) {
vscode.window.showTextDocument(doc);
}
},
(err) => vscode.window.showErrorMessage(`Error loading document: ${err}`));
}
We just need to construct the URI they use for those documents to have k8s tools extension open them for us in vscode Editor.
Here is where they construct their custom kubefs uri: https://github.com/Azure/vscode-kubernetes-tools/blob/master/src/kuberesources.virtualfs.ts#L19
export function kubefsUri(namespace: string | null | undefined /* TODO: rationalise null and undefined */, value: string, outputFormat: string, action?: string): Uri {
const docname = `${value.replace('/', '-')}${outputFormat !== '' ? '.' + outputFormat : ''}`;
const nonce = new Date().getTime();
const nsquery = namespace ? `ns=${namespace}&` : '';
const scheme = action === 'describe' ? K8S_RESOURCE_SCHEME_READONLY : K8S_RESOURCE_SCHEME;
const authority = action === 'describe' ? KUBECTL_DESCRIBE_AUTHORITY : KUBECTL_RESOURCE_AUTHORITY;
const uri = `${scheme}://${authority}/${docname}?${nsquery}value=${value}&_=${nonce}`;
return Uri.parse(uri);
}
from vscode-gitops-tools.
Kustomization and Helm Release config views in vscode editor wired to those Deployment node clicks:
from vscode-gitops-tools.
Git/Helm repos and Bucket yaml config loading and display:
from vscode-gitops-tools.
@usernamehw see if you can figure out why resource uri is not passed to the cluster context menu item. That's the only part left to close this ticket.
from vscode-gitops-tools.
@RandomFractals Kubernetes extension doesn't do anything when clicking on the cluster.
- You are passing cluster name in place of the first argument (namespace)
- As a second argument - a string
namespace/${cluster.name}
which doesn't make sense.
I don't know what's your goal in all this... What do you expect to open as a result of this?
vscode-gitops-tools/src/views/clusterTreeViewDataProvider.ts
Lines 70 to 73 in 6e27284
from vscode-gitops-tools.
Tree view icons now look weird:
Since we only need uri as an argument to command
maybe it would be best to use any other name for that property (NOT the this.resourceUri
that affects appearance).
from vscode-gitops-tools.
@usernamehw try opening default namespace node under namespaces in k8s tools explorer.
The goal here is to show configs for all of our tree nodes. We will be setting standard resourceUri
on all of our tree view items to open config files via k8s tools api by default. That part was intentional.
I am pretty sure I have the correct params set for us to load that config document for a cluster.
The disconnect is in passing uri via viewItem in View Config menu item for a cluster.
Icons should show yaml for now vs nothing before. They will change to indicator icons later. Let's focus on getting all configs in editor first.
from vscode-gitops-tools.
@murillodigital just an fyi, the new flux-system namespace deployments show this config in vscode editor when you open them from the Clusters tree view:
This is from changes in #36.
from vscode-gitops-tools.
This ticket handles open config for all of the node types we support, except for the cluster info.
This is what k8s tools does for the cluster info:
I suggest @murillodigital and @usernamehw review that functionality in k8s tools explorer and create new feature request or enhancement to do something similar for our cluster nodes.
from vscode-gitops-tools.
Related Issues (20)
- Create secret checkbox not working
- Not implemented on AKS/ARC HOT 1
- Prerelease - v0.24.1690210418 reconcile action folds up the treeview HOT 2
- The `flux check` is too aggressive HOT 3
- Performance: still struggles on larger clusters HOT 4
- HelmReleases sometimes pick the wrong API group HOT 1
- Kubectl proxy is run again for multiple extension instances HOT 2
- Release Plan for v0.25.1 patch release
- Editor window can hang on first load HOT 1
- Telemetry collection has been broken since 2-3 weeks ago HOT 5
- Transient states show an error icon HOT 3
- The "Create Source/Kustomization" workflow appears to hang
- Flux binary not found if installed with Brew HOT 2
- Extensions causes lots of kubectl processes to spawn that never finish HOT 10
- Support more Weave GitOps Enterprise features HOT 1
- It's much too easy to accidentally trigger `flux install` HOT 4
- Reorganize and refactor all treeviews HOT 1
- Workload section items overlapping on VScode HOT 11
- different flux namespace HOT 1
- The extension is broken since December HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-gitops-tools.