import { flow } from 'lodash' ; import { addContextMiddleware , ContextArgv , switchToContextCluster } from 'src/lib/context-utils' ; import { exitIfCelotoolHelmDryRun } from 'src/lib/helm_deploy' ; import { CurrencyPair } from 'src/lib/k8s-oracle/base' ; import { addCurrencyPairMiddleware , getOracleDeployerForContext } from 'src/lib/oracle' ; import yargs from 'yargs' ; import { DestroyArgv } from '../../deploy/destroy' ; export const command = 'oracle' ; export const describe = 'destroy the oracle package' ; type OracleDestroyArgv = DestroyArgv & ContextArgv & { currencyPair : CurrencyPair ; } ; export const builder = ( argv ) => { return flow ( [ addContextMiddleware , addCurrencyPairMiddleware ] ) ( argv ) ; } ; export const handler = async ( argv ) => { exitIfCelotoolHelmDryRun ( ) ; const clusterManager = await switchToContextCluster ( argv . celoEnv , argv . context ) ; const deployer = getOracleDeployerForContext ( argv . celoEnv , argv . context , argv . currencyPair , false , clusterManager ) ; await deployer . removeChart ( ) ; } ;