import { Kubectl } from "../../kubectl" ; import * as activeValueTracker from "./active-value-tracker" ; import { ActiveValueTracker } from "./active-value-tracker" ; import { getCurrentContext } from "../../kubectlUtils" ; const ACTIVE_CONTEXT_POLL_INTERVAL_MS = 60000 ; export function create ( kubectl ) { return activeValueTracker . create ( ( ) => getActiveContextName ( kubectl ) , ACTIVE_CONTEXT_POLL_INTERVAL_MS ) ; } async function getActiveContextName ( kubectl ) { const currentContext = await getCurrentContext ( kubectl , { silent : true } ) ; if ( ! currentContext ) { return null ; } return currentContext . contextName ; }