File tree 1 file changed +4
-6
lines changed
src/main/java/org/csanchez/jenkins/plugins/kubernetes
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ public class KubernetesCloud extends Cloud implements PodTemplateGroup {
148
148
public KubernetesCloud (String name ) {
149
149
super (name );
150
150
setMaxRequestsPerHost (DEFAULT_MAX_REQUESTS_PER_HOST );
151
- setPodLabels (PodLabel . fromMap ( DEFAULT_POD_LABELS ) );
151
+ setPodLabels (null );
152
152
}
153
153
154
154
/**
@@ -466,9 +466,7 @@ public List<PodLabel> getPodLabels() {
466
466
@ DataBoundSetter
467
467
public void setPodLabels (@ CheckForNull List <PodLabel > labels ) {
468
468
this .podLabels = new ArrayList <>();
469
- if (labels != null ) {
470
- this .podLabels .addAll (labels );
471
- }
469
+ this .podLabels .addAll (labels == null || labels .isEmpty () ? PodLabel .fromMap (DEFAULT_POD_LABELS ) : labels );
472
470
}
473
471
474
472
/**
@@ -999,8 +997,8 @@ private Object readResolve() {
999
997
if (waitForPodSec == null ) {
1000
998
waitForPodSec = DEFAULT_WAIT_FOR_POD_SEC ;
1001
999
}
1002
- if (podLabels == null && labels != null ) {
1003
- setPodLabels (PodLabel .fromMap (labels ));
1000
+ if (podLabels == null ) {
1001
+ setPodLabels (labels == null ? null : PodLabel .fromMap (labels ));
1004
1002
}
1005
1003
if (containerCap != null && containerCap == 0 ) {
1006
1004
containerCap = null ;
You can’t perform that action at this time.
0 commit comments