Files
csharp/examples/yaml/Program.cs

27 lines
682 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.IO;
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));
typeMap.Add("apps/v1beta1/Deployment", typeof(Appsv1beta1Deployment));
var objects = await Yaml.LoadAllFromFileAsync(args[0], typeMap);
foreach (var obj in objects) {
Console.WriteLine(obj);
}
}
}
}