using k8s;
using Microsoft.Extensions.Configuration;

namespace LazyBear.MCP.Services.Kubernetes;

public sealed class K8sClientProvider
{
    public IKubernetes? Client { get; }

    public string? InitializationError { get; }

    public K8sClientProvider(IConfiguration configuration)
    {
        try
        {
            Client = K8sClientFactory.CreateClient(configuration);
        }
        catch (Exception ex)
        {
            InitializationError = $"{ex.GetType().Name}: {ex.Message}";
        }
    }
}
