// SPDX-License-Identifier: Apache-2.0
import { InjectTokens } from '../../src/core/dependency-injection/inject-tokens.js';
import { container } from 'tsyringe-neo';
import { NamespaceName } from '../../src/types/namespace/namespace-name.js';
export class HelmMetricsServer {
    static NAMESPACE = NamespaceName.of('kube-system');
    static CHART_RELEASE_NAME = 'metrics-server';
    static CHART_NAME = 'metrics-server';
    static REPOSITORY_NAME = 'metrics-server';
    static REPOSITORY_URL = 'https://kubernetes-sigs.github.io/metrics-server/';
    static INSTALL_ARGS = '--set "args[0]=--kubelet-insecure-tls"';
    static VERSION = ''; // latest version
    static async installMetricsServer(testName) {
        try {
            const k8Factory = container.resolve(InjectTokens.K8Factory);
            const chartManager = container.resolve(InjectTokens.ChartManager);
            await chartManager.addRepo(this.REPOSITORY_NAME, this.REPOSITORY_URL, true);
            await chartManager.install(this.NAMESPACE, this.CHART_RELEASE_NAME, this.CHART_NAME, this.REPOSITORY_NAME, this.VERSION, this.INSTALL_ARGS, k8Factory.default().contexts().readCurrent());
        }
        catch (error) {
            throw new Error(`${testName}: failed to install metrics-server: ${error.message}`);
        }
    }
}
//# sourceMappingURL=helm-metrics-server.js.map