import { IScopedClusterClient } from 'src/core/server' ; export async function doesClusterExist ( clusterClient , clusterName ) { try { const { body : clusterInfoByName } = await clusterClient . asCurrentUser . cluster . remoteInfo ( ) ; return Boolean ( clusterInfoByName && clusterInfoByName [ clusterName ] ) ; } catch ( err ) { throw new Error ( 'Unable to check if cluster already exists.' ) ; } }