コード例 #1
0
        public static DeploymentReplicationController ValidateAndCreate(V1ReplicationController cont)
        {
            _validateLog.Debug("Validating rc " + cont.Metadata.Name + "...");
            // The replication controller name should be _rcName-version
            var  parts = cont.Metadata.Name.Split('-');
            uint version;

            if (!uint.TryParse(parts[parts.Length - 1], out version))
            {
                _validateLog.Warn("Replication controller " + cont.Metadata.Name + " name not formatted correctly.");
                return(null);
            }
            return(new DeploymentReplicationController(cont, version));
        }
コード例 #2
0
 public DeploymentReplicationController(V1ReplicationController controller, uint versionNum)
 {
     Controller = controller;
     Version    = versionNum;
 }
コード例 #3
0
        private async Task <string> DescribeObject(Kubernetes client, V1Namespace ns, V1ReplicationController o, StringBuilder buffer)
        {
            var fetched = await client.ReadNamespacedReplicationControllerAsync(o.Metadata.Name, ns.Metadata.Name).ConfigureAwait(false);

            buffer.AppendLine($"API Veresion: {fetched.ApiVersion}");
            buffer.AppendLine($"Kind: {fetched.Kind}");
            buffer.AppendLine(DescribeMetadata(fetched.Metadata));
            return($"Replication Controller - {fetched.Metadata.Name}");
        }