Files
csharp/examples/yaml/Program.cs
Boshi Lian 57037f0070 move kubectl config and yaml related to model module (#806)
* move yaml and config to models module

* better naming

* address comments
2022-03-28 16:57:12 -07:00

26 lines
661 B
C#

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));
typeMap.Add("apps/v1/Deployment", typeof(V1Deployment));
var objects = await KubernetesYaml.LoadAllFromFileAsync(args[0], typeMap);
foreach (var obj in objects) {
Console.WriteLine(obj);
}
}
}
}