public ReplicationController getReplicationController(ResourceConfig config, List<ImageConfiguration> images) { return new ReplicationControllerBuilder() .withMetadata(createRcMetaData(config)) .withSpec(createRcSpec(config, images)) .build(); }
public ReplicationControllerBuilder(ReplicationController instance,Boolean validationEnabled){ this.fluent = this; this.withApiVersion(instance.getApiVersion()); this.withKind(instance.getKind()); this.withMetadata(instance.getMetadata()); this.withSpec(instance.getSpec()); this.withStatus(instance.getStatus()); this.validationEnabled = validationEnabled; }
public ReplicationControllerBuilder( ReplicationController instance ){ this.fluent = this; this.withApiVersion(instance.getApiVersion()); this.withKind(instance.getKind()); this.withMetadata(instance.getMetadata()); this.withSpec(instance.getSpec()); this.withStatus(instance.getStatus()); }
public ReplicationControllerBuilder( ReplicationController instance ){ this.fluent = this; this.withApiVersion(instance.getApiVersion()); this.withKind(instance.getKind()); this.withMetadata(instance.getMetadata()); this.withSpec(instance.getSpec()); this.withStatus(instance.getStatus()); }
@Override public HasMetadata convert(HasMetadata item, boolean trimImageInContainerSpec, boolean enableAutomaticTrigger) { ReplicaSet resource = (ReplicaSet) item; ReplicationControllerBuilder builder = new ReplicationControllerBuilder(); builder.withMetadata(resource.getMetadata()); ReplicaSetSpec spec = resource.getSpec(); if (spec != null) { ReplicationControllerFluent.SpecNested<ReplicationControllerBuilder> specBuilder = builder.withNewSpec(); Integer replicas = spec.getReplicas(); if (replicas != null) { specBuilder.withReplicas(replicas); } LabelSelector selector = spec.getSelector(); if (selector != null) { Map<String, String> matchLabels = selector.getMatchLabels(); if (matchLabels != null && !matchLabels.isEmpty()) { specBuilder.withSelector(matchLabels); } } PodTemplateSpec template = spec.getTemplate(); if (template != null) { specBuilder.withTemplate(template); } specBuilder.endSpec(); } return builder.build(); } }