for (LabelSelectorRequirement req : matchExpressions) { String operator = req.getOperator(); String key = req.getKey(); switch (operator) { case "In":
@Override protected PodList listSelectedPods(StatefulSet obj) { FilterWatchListDeletable<Pod, PodList, Boolean, Watch, Watcher<Pod>> podLister = pods().inNamespace(namespace); if (obj.getSpec().getSelector().getMatchLabels() != null) { podLister.withLabels(obj.getSpec().getSelector().getMatchLabels()); } if (obj.getSpec().getSelector().getMatchExpressions() != null) { for (LabelSelectorRequirement req : obj.getSpec().getSelector().getMatchExpressions()) { switch (req.getOperator()) { case "In": podLister.withLabelIn(req.getKey(), req.getValues().toArray(new String[]{})); break; case "NotIn": podLister.withLabelNotIn(req.getKey(), req.getValues().toArray(new String[]{})); break; case "DoesNotExist": podLister.withoutLabel(req.getKey()); break; case "Exists": podLister.withLabel(req.getKey()); break; } } } return podLister.list(); }
@Override protected PodList listSelectedPods(ReplicaSet obj) { FilterWatchListDeletable<Pod, PodList, Boolean, Watch, Watcher<Pod>> podLister = pods().inNamespace(namespace); if (obj.getSpec().getSelector().getMatchLabels() != null) { podLister.withLabels(obj.getSpec().getSelector().getMatchLabels()); } if (obj.getSpec().getSelector().getMatchExpressions() != null) { for (LabelSelectorRequirement req : obj.getSpec().getSelector().getMatchExpressions()) { switch (req.getOperator()) { case "In": podLister.withLabelIn(req.getKey(), req.getValues().toArray(new String[]{})); break; case "NotIn": podLister.withLabelNotIn(req.getKey(), req.getValues().toArray(new String[]{})); break; case "DoesNotExist": podLister.withoutLabel(req.getKey()); break; case "Exists": podLister.withLabel(req.getKey()); break; } } } return podLister.list(); }
public LabelSelectorRequirementFluentImpl(LabelSelectorRequirement instance){ this.withKey(instance.getKey()); this.withOperator(instance.getOperator()); this.withValues(instance.getValues()); }
public LabelSelectorRequirementBuilder(LabelSelectorRequirementFluent<?> fluent,LabelSelectorRequirement instance,Boolean validationEnabled){ this.fluent = fluent; fluent.withKey(instance.getKey()); fluent.withOperator(instance.getOperator()); fluent.withValues(instance.getValues()); this.validationEnabled = validationEnabled; } public LabelSelectorRequirementBuilder(LabelSelectorRequirement instance){
public LabelSelectorRequirementBuilder(LabelSelectorRequirement instance,Boolean validationEnabled){ this.fluent = this; this.withKey(instance.getKey()); this.withOperator(instance.getOperator()); this.withValues(instance.getValues()); this.validationEnabled = validationEnabled; }
switch (req.getOperator()) { case "In": rsOper.withLabelIn(req.getKey(), req.getValues().toArray(new String[]{})); break; case "NotIn": rsOper.withLabelNotIn(req.getKey(), req.getValues().toArray(new String[]{})); break; case "DoesNotExist": rsOper.withoutLabel(req.getKey()); break; case "Exists": rsOper.withLabel(req.getKey()); break;
if (matchExpressions != null) { for (LabelSelectorRequirement expression : matchExpressions) { String key = expression.getKey(); List<String> values = expression.getValues(); if (StringUtils.isBlank(key)) {
@Override protected PodList listSelectedPods(ReplicaSet obj) { FilterWatchListDeletable<Pod, PodList, Boolean, Watch, Watcher<Pod>> podLister = pods().inNamespace(namespace); if (obj.getSpec().getSelector().getMatchLabels() != null) { podLister.withLabels(obj.getSpec().getSelector().getMatchLabels()); } if (obj.getSpec().getSelector().getMatchExpressions() != null) { for (LabelSelectorRequirement req : obj.getSpec().getSelector().getMatchExpressions()) { switch (req.getOperator()) { case "In": podLister.withLabelIn(req.getKey(), req.getValues().toArray(new String[]{})); break; case "NotIn": podLister.withLabelNotIn(req.getKey(), req.getValues().toArray(new String[]{})); break; case "DoesNotExist": podLister.withoutLabel(req.getKey()); break; case "Exists": podLister.withLabel(req.getKey()); break; } } } return podLister.list(); }