public TestCluster(IOptions <TestClusterOptions> options, IResourceSerializers serializers) { if (options is null) { throw new ArgumentNullException(nameof(options)); } _serializers = serializers ?? throw new ArgumentNullException(nameof(serializers)); foreach (var resource in options.Value.InitialResources) { Resources.Add(_serializers.Convert <ResourceObject>(resource)); } }
/// <summary> /// Initializes a new instance of the <see cref="OperatorReconciler{TResource}" /> class. /// </summary> /// <param name="resourceSerializers">The resource serializers.</param> /// <param name="resourcePatcher">The patch generator.</param> /// <param name="generator">The generator.</param> /// <param name="client">The client.</param> /// <param name="logger">The logger.</param> public OperatorReconciler( IResourceSerializers resourceSerializers, IKubernetes client, IOperatorGenerator <TResource> generator, IResourceKindManager resourceKindManager, IResourcePatcher resourcePatcher, ILogger <OperatorReconciler <TResource> > logger) { _resourceSerializers = resourceSerializers; _resourceClient = client.AnyResourceKind(); _generator = generator; _resourceKindManager = resourceKindManager; _resourcePatcher = resourcePatcher; _logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="Program"/> class. /// </summary> /// <param name="hostApplicationLifetime">The host application lifetime.</param> /// <param name="configuration">The configuration.</param> /// <param name="logger">The logger.</param> /// <param name="client">The client.</param> /// <param name="generator">The generator.</param> /// <param name="serializers">The serializers.</param> public Program( IHostApplicationLifetime hostApplicationLifetime, IConfiguration configuration, ILogger <Program> logger, IKubernetes client, ICustomResourceDefinitionGenerator generator, IResourceSerializers serializers) : base(hostApplicationLifetime, logger) { _hostApplicationLifetime = hostApplicationLifetime; _configuration = configuration; _client = client; _generator = generator; _serializers = serializers; }
public HelloWorldGenerator(IResourceSerializers serializers) { _serializers = serializers; _managedBy = typeof(HelloWorldGenerator).Assembly .GetCustomAttributes(typeof(AssemblyTitleAttribute)) .Cast <AssemblyTitleAttribute>() .Single() .Title; _version = typeof(HelloWorldGenerator).Assembly .GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute)) .Cast <AssemblyInformationalVersionAttribute>() .Single() .InformationalVersion; }