// SPDX-License-Identifier: Apache-2.0
import { IllegalArgumentError } from '../../../../../core/errors/illegal-argument-error.js';
export class K8ClientClusters {
    kubeConfig;
    constructor(kubeConfig) {
        this.kubeConfig = kubeConfig;
        if (!kubeConfig) {
            throw new IllegalArgumentError('kubeConfig must not be null or undefined');
        }
    }
    list() {
        const clusters = [];
        for (const cluster of this.kubeConfig.getClusters()) {
            clusters.push(cluster.name);
        }
        return clusters;
    }
    readCurrent() {
        const currentCluster = this.kubeConfig.getCurrentCluster();
        return currentCluster ? currentCluster.name : '';
    }
}
//# sourceMappingURL=k8-client-clusters.js.map