import { window } from 'vscode' ; import { fluxTools } from '../flux/fluxTools' ; import { FluxSource } from '../flux/fluxTypes' ; import { KubernetesObjectKinds } from '../kubernetes/kubernetesTypes' ; import { BucketNode } from '../views/nodes/bucketNode' ; import { GitRepositoryNode } from '../views/nodes/gitRepositoryNode' ; import { HelmRepositoryNode } from '../views/nodes/helmRepositoryNode' ; import { refreshSourcesTreeView } from '../views/treeViews' ; param source export async function fluxReconcileSourceCommand ( source ) { const sourceType = source . resource . kind === KubernetesObjectKinds . GitRepository ? 'source git' : source . resource . kind === KubernetesObjectKinds . HelmRepository ? 'source helm' : source . resource . kind === KubernetesObjectKinds . Bucket ? 'source bucket' : 'unknown' ; if ( sourceType === 'unknown' ) { window . showErrorMessage ( `Unknown Flux Source resource kind ${ source . resource . kind }` ) ; return ; } await fluxTools . reconcile ( sourceType , source . resource . metadata . name || '' , source . resource . metadata . namespace || '' ) ; refreshSourcesTreeView ( ) ; }