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)); }
public DeploymentReplicationController(V1ReplicationController controller, uint versionNum) { Controller = controller; Version = versionNum; }
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}"); }