2020-01-10 13:59:37 -08:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using k8s;
|
|
|
|
|
using k8s.Models;
|
|
|
|
|
|
|
|
|
|
namespace yaml
|
|
|
|
|
{
|
|
|
|
|
internal class Program
|
|
|
|
|
{
|
|
|
|
|
private async static Task Main(string[] args)
|
|
|
|
|
{
|
|
|
|
|
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
|
|
|
|
|
|
|
|
var objects = await Yaml.LoadAllFromFileAsync(args[0], typeMap);
|
|
|
|
|
|
|
|
|
|
foreach (var obj in objects) {
|
|
|
|
|
Console.WriteLine(obj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|