// SPDX-License-Identifier: Apache-2.0
import { container } from 'tsyringe-neo';
import { NamespaceName } from '../../src/types/namespace/namespace-name.js';
import { InjectTokens } from '../../src/core/dependency-injection/inject-tokens.js';
export class HelmMetalLoadBalancer {
    static NAMESPACE = NamespaceName.of('metallb-system');
    static CHART_RELEASE_NAME = 'metallb';
    static CHART_NAME = 'metallb';
    static REPOSITORY_NAME = 'metallb';
    static REPOSITORY_URL = 'https://metallb.github.io/metallb/';
    static INSTALL_ARGS = '--set speaker.frr.enabled=true';
    static VERSION = ''; // latest version
    static async installMetalLoadBalancer(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(), true, true);
        }
        catch (error) {
            throw new Error(`${testName}: failed to install metallb: ${error.message}`);
        }
    }
}
//# sourceMappingURL=helm-metal-load-balancer.js.map