Search in sources :

Example 1 with RollingOperationContext

use of io.fabric8.kubernetes.client.dsl.internal.RollingOperationContext in project kubernetes-client by fabric8io.

the class DeploymentOperationsImpl method doGetLog.

private List<RollableScalableResource<ReplicaSet>> doGetLog() {
    List<RollableScalableResource<ReplicaSet>> rcs = new ArrayList<>();
    Deployment deployment = requireFromServer();
    String rcUid = deployment.getMetadata().getUid();
    ReplicaSetOperationsImpl rsOperations = new ReplicaSetOperationsImpl(new RollingOperationContext(rollingOperationContext.getContainerId(), false, 0, null, rollingOperationContext.getLogWaitTimeout()), context.withName(null));
    ReplicaSetList rcList = rsOperations.withLabels(getDeploymentSelectorLabels(deployment)).list();
    for (ReplicaSet rs : rcList.getItems()) {
        OwnerReference ownerReference = KubernetesResourceUtil.getControllerUid(rs);
        if (ownerReference != null && ownerReference.getUid().equals(rcUid)) {
            rcs.add(rsOperations.withName(rs.getMetadata().getName()));
        }
    }
    return rcs;
}
Also used : RollingOperationContext(io.fabric8.kubernetes.client.dsl.internal.RollingOperationContext) OwnerReference(io.fabric8.kubernetes.api.model.OwnerReference) ReplicaSetList(io.fabric8.kubernetes.api.model.apps.ReplicaSetList) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) ArrayList(java.util.ArrayList) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) ReplicaSet(io.fabric8.kubernetes.api.model.apps.ReplicaSet)

Example 2 with RollingOperationContext

use of io.fabric8.kubernetes.client.dsl.internal.RollingOperationContext in project kubernetes-client by fabric8io.

the class DeploymentOperationsImpl method doGetLog.

private List<RollableScalableResource<ReplicaSet>> doGetLog() {
    List<RollableScalableResource<ReplicaSet>> rcs = new ArrayList<>();
    Deployment deployment = requireFromServer();
    String rcUid = deployment.getMetadata().getUid();
    ReplicaSetOperationsImpl rsOperations = new ReplicaSetOperationsImpl(new RollingOperationContext(rollingOperationContext.getContainerId(), false, 0, null, rollingOperationContext.getLogWaitTimeout()), context.withName(null));
    ReplicaSetList rcList = rsOperations.withLabels(getDeploymentSelectorLabels(deployment)).list();
    for (ReplicaSet rs : rcList.getItems()) {
        OwnerReference ownerReference = KubernetesResourceUtil.getControllerUid(rs);
        if (ownerReference != null && ownerReference.getUid().equals(rcUid)) {
            rcs.add(rsOperations.withName(rs.getMetadata().getName()));
        }
    }
    return rcs;
}
Also used : RollingOperationContext(io.fabric8.kubernetes.client.dsl.internal.RollingOperationContext) OwnerReference(io.fabric8.kubernetes.api.model.OwnerReference) ReplicaSetList(io.fabric8.kubernetes.api.model.extensions.ReplicaSetList) RollableScalableResource(io.fabric8.kubernetes.client.dsl.RollableScalableResource) ArrayList(java.util.ArrayList) Deployment(io.fabric8.kubernetes.api.model.extensions.Deployment) ReplicaSet(io.fabric8.kubernetes.api.model.extensions.ReplicaSet)

Aggregations

OwnerReference (io.fabric8.kubernetes.api.model.OwnerReference)2 RollableScalableResource (io.fabric8.kubernetes.client.dsl.RollableScalableResource)2 RollingOperationContext (io.fabric8.kubernetes.client.dsl.internal.RollingOperationContext)2 ArrayList (java.util.ArrayList)2 Deployment (io.fabric8.kubernetes.api.model.apps.Deployment)1 ReplicaSet (io.fabric8.kubernetes.api.model.apps.ReplicaSet)1 ReplicaSetList (io.fabric8.kubernetes.api.model.apps.ReplicaSetList)1 Deployment (io.fabric8.kubernetes.api.model.extensions.Deployment)1 ReplicaSet (io.fabric8.kubernetes.api.model.extensions.ReplicaSet)1 ReplicaSetList (io.fabric8.kubernetes.api.model.extensions.ReplicaSetList)1