2022-09-16 01:21:21 +02:00
|
|
|
using k8s;
|
|
|
|
|
using k8s.Models;
|
2020-01-10 13:59:37 -08:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace yaml
|
|
|
|
|
{
|
|
|
|
|
internal class Program
|
|
|
|
|
{
|
2022-09-16 01:21:21 +02:00
|
|
|
private static async Task Main(string[] args)
|
2020-01-10 13:59:37 -08:00
|
|
|
{
|
|
|
|
|
var typeMap = new Dictionary<String, Type>();
|
|
|
|
|
typeMap.Add("v1/Pod", typeof(V1Pod));
|
|
|
|
|
typeMap.Add("v1/Service", typeof(V1Service));
|
2022-03-07 10:06:55 -08:00
|
|
|
typeMap.Add("apps/v1/Deployment", typeof(V1Deployment));
|
2020-01-10 13:59:37 -08:00
|
|
|
|
2022-03-28 16:57:12 -07:00
|
|
|
var objects = await KubernetesYaml.LoadAllFromFileAsync(args[0], typeMap);
|
2020-01-10 13:59:37 -08:00
|
|
|
|
2022-09-16 01:21:21 +02:00
|
|
|
foreach (var obj in objects)
|
|
|
|
|
{
|
2020-01-10 13:59:37 -08:00
|
|
|
Console.WriteLine(obj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|