-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Live update for all flux types and UI fixes (#479)
* status bar for loading stuff * live update for all flux types * treeview icons fixes * submenus * kubectl context commands
- Loading branch information
Showing
14 changed files
with
172 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as shell from 'cli/shell/exec'; | ||
import { Uri } from 'vscode'; | ||
|
||
export async function kubectlApplyPath(uri?: Uri) { | ||
if(uri) { | ||
return await shell.execWithOutput(`kubectl apply -f ${uri.fsPath}`); | ||
} | ||
} | ||
export async function kubectlDeletePath(uri?: Uri) { | ||
if(uri) { | ||
return await shell.execWithOutput(`kubectl delete -f ${uri.fsPath}`); | ||
} | ||
} | ||
|
||
export async function kubectlApplyKustomization(uri?: Uri) { | ||
if(uri) { | ||
return await shell.execWithOutput(`kubectl apply -k ${uri.fsPath}`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { KubernetesObject } from '@kubernetes/client-node'; | ||
import { Kind } from 'types/kubernetes/kubernetesTypes'; | ||
import { AnyResourceNode } from './anyResourceNode'; | ||
import { GitOpsTemplateNode } from './gitOpsTemplateNode'; | ||
import { NamespaceNode } from './namespaceNode'; | ||
import { BucketNode } from './source/bucketNode'; | ||
import { GitRepositoryNode } from './source/gitRepositoryNode'; | ||
import { HelmRepositoryNode } from './source/helmRepositoryNode'; | ||
import { OCIRepositoryNode } from './source/ociRepositoryNode'; | ||
import { TreeNode } from './treeNode'; | ||
import { HelmReleaseNode } from './workload/helmReleaseNode'; | ||
import { KustomizationNode } from './workload/kustomizationNode'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
const nodeConstructors = { | ||
'Bucket': BucketNode, | ||
'GitRepository': GitRepositoryNode, | ||
'OCIRepository': OCIRepositoryNode, | ||
'HelmRepository': HelmRepositoryNode, | ||
'HelmRelease': HelmReleaseNode, | ||
'Kustomization': KustomizationNode, | ||
'GitOpsTemplate': GitOpsTemplateNode, | ||
|
||
'Namespace': NamespaceNode, | ||
|
||
'Deployment': AnyResourceNode, | ||
'Node': AnyResourceNode, | ||
'Pod': AnyResourceNode, | ||
'ConfigMap': AnyResourceNode, | ||
}; | ||
|
||
export function makeTreeNode(object: KubernetesObject): TreeNode | undefined { | ||
if(!object.kind) { | ||
return; | ||
} | ||
|
||
const constructor = nodeConstructors[object.kind as Kind]; | ||
if(constructor) { | ||
return new constructor(object as any); | ||
} | ||
} |
Oops, something went wrong.