public CustomResourceWatcher(ILogger <CustomResourceWatcher <TResource> > logger, ICustomResourceClient <TResource> client, CustomResourceNamespace <TResource> @namespace = null)
 {
     _logger    = logger;
     _crd       = new TResource().Definition;
     _client    = client;
     _namespace = @namespace?.Value ?? "";
 }
 protected CustomResource(CustomResourceDefinition definition, string @namespace, string name)
     : this(definition)
 {
     Metadata = new ObjectMetaV1
     {
         Namespace = @namespace,
         Name      = name
     };
 }
 protected CustomResource(CustomResourceDefinition definition)
 {
     Definition = definition;
     ApiVersion = Definition.ApiVersion;
     Kind       = Definition.Kind;
 }
Пример #4
0
 /// <summary>
 /// Creates a Kubernetes Custom Resources client.
 /// </summary>
 /// <param name="client">The kube api client to be used.</param>
 public CustomResourceClient(IKubeApiClient client)
     : base(client)
 {
     _crd = new TResource().Definition;
 }