getAsArgs() {
"Ignoring containerTemplate option as containerTemplates is also defined");
}
}
- if (containerTemplates != null && !containerTemplates.isEmpty()) {
+ if (!containerTemplates.isEmpty()) {
argMap.put("containers", containerTemplates);
}
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/NamespaceAction.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/NamespaceAction.java
index 43e9ef6b09..3efa952046 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/NamespaceAction.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/NamespaceAction.java
@@ -8,13 +8,12 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.BulkChange;
import hudson.model.Run;
-import jenkins.model.RunAction2;
/**
* Use getContext().get(PodTemplateContext.class)
instead.
*/
@Deprecated
-public class NamespaceAction extends AbstractInvisibleRunAction2 implements RunAction2 {
+public class NamespaceAction extends AbstractInvisibleRunAction2 {
private static final Logger LOGGER = Logger.getLogger(NamespaceAction.class.getName());
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/PodTemplateAction.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/PodTemplateAction.java
index b8eede2d0a..062c8cd641 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/PodTemplateAction.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/PodTemplateAction.java
@@ -9,13 +9,12 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.BulkChange;
import hudson.model.Run;
-import jenkins.model.RunAction2;
/**
* Use getContext().get(PodTemplateContext.class)
instead.
*/
@Deprecated
-public class PodTemplateAction extends AbstractInvisibleRunAction2 implements RunAction2 {
+public class PodTemplateAction extends AbstractInvisibleRunAction2 {
private static final Logger LOGGER = Logger.getLogger(PodTemplateAction.class.getName());
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/PodTemplateStepExecution.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/PodTemplateStepExecution.java
index 22a8b81ee6..065a9b4d9d 100755
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/PodTemplateStepExecution.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/PodTemplateStepExecution.java
@@ -43,7 +43,7 @@ public class PodTemplateStepExecution extends AbstractStepExecutionImpl {
private static final long serialVersionUID = -6139090518333729333L;
- private static final transient String NAME_FORMAT = "%s-%s";
+ private static final String NAME_FORMAT = "%s-%s";
private static /* almost final */ boolean VERBOSE = Boolean.parseBoolean(System.getProperty(PodTemplateStepExecution.class.getName() + ".verbose"));
@@ -61,7 +61,7 @@ public class PodTemplateStepExecution extends AbstractStepExecutionImpl {
@Override
public boolean start() throws Exception {
- KubernetesCloud cloud = resolveCloud();
+ KubernetesCloud cloud = resolveCloud(cloudName);
Run, ?> run = getContext().get(Run.class);
if (cloud.isUsageRestricted()) {
@@ -150,7 +150,8 @@ public boolean start() throws Exception {
listener.getLogger().println("Registering template with id=" + newTemplate.getId() + ",label="+ newTemplate.getLabel());
}
cloud.addDynamicTemplate(newTemplate);
- BodyInvoker invoker = getContext().newBodyInvoker().withContexts(step, new PodTemplateContext(namespace, name)).withCallback(new PodTemplateCallback(newTemplate));
+ BodyInvoker invoker =
+ getContext().newBodyInvoker().withContexts(step, new PodTemplateContext(namespace, name)).withCallback(new PodTemplateCallback(newTemplate, cloudName));
if (step.getLabel() == null) {
invoker.withContext(EnvironmentExpander.merge(getContext().get(EnvironmentExpander.class), EnvironmentExpander.constant(Collections.singletonMap("POD_LABEL", label))));
}
@@ -160,7 +161,7 @@ public boolean start() throws Exception {
}
@NonNull
- private KubernetesCloud resolveCloud() throws AbortException {
+ private static KubernetesCloud resolveCloud(final String cloudName) throws AbortException {
KubernetesCloud cloud;
if (cloudName == null) {
cloud = Jenkins.get().clouds.get(KubernetesCloud.class);
@@ -230,7 +231,7 @@ private String checkNamespace(KubernetesCloud kubernetesCloud, @CheckForNull Pod
@Override
public void onResume() {
try {
- KubernetesCloud cloud = resolveCloud();
+ KubernetesCloud cloud = resolveCloud(cloudName);
TaskListener listener = getContext().get(TaskListener.class);
newTemplate.setListener(listener);
LOGGER.log(Level.FINE, "Re-registering template with id=" + newTemplate.getId() + " after resume");
@@ -245,14 +246,16 @@ public void onResume() {
}
}
- private class PodTemplateCallback extends BodyExecutionCallback.TailCall {
+ private static class PodTemplateCallback extends BodyExecutionCallback.TailCall {
private static final long serialVersionUID = 6043919968776851324L;
private final PodTemplate podTemplate;
+ private final String cloudName;
- private PodTemplateCallback(PodTemplate podTemplate) {
+ private PodTemplateCallback(PodTemplate podTemplate, final String cloudName) {
this.podTemplate = podTemplate;
+ this.cloudName = cloudName;
}
@Override
@@ -261,7 +264,7 @@ private PodTemplateCallback(PodTemplate podTemplate) {
*/
protected void finished(StepContext context) throws Exception {
try {
- KubernetesCloud cloud = resolveCloud();
+ KubernetesCloud cloud = resolveCloud(cloudName);
LOGGER.log(Level.FINE, () -> "Removing pod template " + podTemplate.getName()
+ " from cloud " + cloud.name);
cloud.removeDynamicTemplate(podTemplate);
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pod/retention/OnFailure.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pod/retention/OnFailure.java
index 594b572f01..8f3d8c090c 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pod/retention/OnFailure.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pod/retention/OnFailure.java
@@ -8,6 +8,8 @@
import hudson.Extension;
import io.fabric8.kubernetes.api.model.Pod;
+
+import java.util.Locale;
import java.util.function.Supplier;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -34,7 +36,7 @@ public boolean shouldDeletePod(KubernetesCloud cloud, Supplier podS) {
if (pod == null || pod.getStatus() == null) {
return false;
}
- boolean hasErrors = pod.getStatus().getPhase().toLowerCase().matches("(failed|unknown)");
+ boolean hasErrors = pod.getStatus().getPhase().toLowerCase(Locale.getDefault()).matches("(failed|unknown)");
return !hasErrors;
}
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pod/retention/Reaper.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pod/retention/Reaper.java
index 2606a33f7e..07e7919e14 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pod/retention/Reaper.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pod/retention/Reaper.java
@@ -45,6 +45,7 @@
import io.fabric8.kubernetes.client.WatcherException;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -64,7 +65,6 @@
import org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud;
import org.csanchez.jenkins.plugins.kubernetes.KubernetesComputer;
import org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave;
-import org.csanchez.jenkins.plugins.kubernetes.PodTemplate;
import org.csanchez.jenkins.plugins.kubernetes.PodUtils;
import org.jenkinsci.plugins.kubernetes.auth.KubernetesAuthException;
@@ -78,7 +78,7 @@
*/
@Extension
public class Reaper extends ComputerListener {
-
+
private static final Logger LOGGER = Logger.getLogger(Reaper.class.getName());
/**
@@ -106,8 +106,8 @@ public static Reaper getInstance() {
private final Map watchers = new ConcurrentHashMap<>();
private final LoadingCache> terminationReasons = Caffeine.newBuilder().
- expireAfterAccess(1, TimeUnit.DAYS).
- build(k -> new ConcurrentSkipListSet<>());
+ expireAfterAccess(1, TimeUnit.DAYS).
+ build(k -> new ConcurrentSkipListSet<>());
@Override
public void preLaunch(Computer c, TaskListener taskListener) throws IOException, InterruptedException {
@@ -174,7 +174,7 @@ private void reapAgents() {
} else {
LOGGER.fine(() -> ns + "/" + name + " still seems to exist, OK");
}
- } catch (Exception x) {
+ } catch (KubernetesAuthException | IOException | RuntimeException x) {
LOGGER.log(Level.WARNING, x, () -> "failed to do initial reap check for " + ns + "/" + name);
}
}
@@ -197,12 +197,12 @@ private void watchClouds() {
// close any cloud watchers that have been removed
cloudNames.stream()
- .map(this.watchers::get)
- .filter(Objects::nonNull)
- .forEach(cpw -> {
- LOGGER.info(() -> "stopping pod watcher for deleted kubernetes cloud " + cpw.cloudName);
- cpw.stop();
- });
+ .map(this.watchers::get)
+ .filter(Objects::nonNull)
+ .forEach(cpw -> {
+ LOGGER.info(() -> "stopping pod watcher for deleted kubernetes cloud " + cpw.cloudName);
+ cpw.stop();
+ });
}
}
@@ -225,7 +225,7 @@ private void watchCloud(@NonNull KubernetesCloud kc) {
old.stop();
}
LOGGER.info(() -> "set up watcher on " + kc.getDisplayName());
- } catch (Exception x) {
+ } catch (KubernetesAuthException | IOException | RuntimeException x) {
LOGGER.log(Level.WARNING, x, () -> "failed to set up watcher on " + kc.getDisplayName());
}
}
@@ -253,10 +253,10 @@ private boolean isCloudPodWatcherActive(@NonNull CloudPodWatcher watcher) {
private static Optional resolveNode(@NonNull Jenkins jenkins, String namespace, String name) {
return new ArrayList<>(jenkins.getNodes()).stream()
- .filter(KubernetesSlave.class::isInstance)
- .map(KubernetesSlave.class::cast)
- .filter(ks -> Objects.equals(ks.getNamespace(), namespace) && Objects.equals(ks.getPodName(), name))
- .findFirst();
+ .filter(KubernetesSlave.class::isInstance)
+ .map(KubernetesSlave.class::cast)
+ .filter(ks -> Objects.equals(ks.getNamespace(), namespace) && Objects.equals(ks.getPodName(), name))
+ .findFirst();
}
/**
@@ -316,7 +316,8 @@ public void eventReceived(Action action, Pod pod) {
Listeners.notify(Listener.class, true, listener -> {
try {
- listener.onEvent(action, optionalNode.get(), pod, terminationReasons.get(optionalNode.get().getNodeName()));
+ Set terminationReasons = Reaper.this.terminationReasons.get(optionalNode.get().getNodeName());
+ listener.onEvent(action, optionalNode.get(), pod, terminationReasons != null ? terminationReasons : Collections.emptySet());
} catch (Exception x) {
LOGGER.log(Level.WARNING, "Listener " + listener + " failed for " + ns + "/" + name, x);
}
@@ -528,4 +529,4 @@ public void onChange(Saveable o, XmlFile file) {
}
}
}
-}
+}
\ No newline at end of file
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/ConfigMapVolume.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/ConfigMapVolume.java
index 3863895225..3fdc98d4c2 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/ConfigMapVolume.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/ConfigMapVolume.java
@@ -33,8 +33,9 @@
import io.fabric8.kubernetes.api.model.Volume;
import io.fabric8.kubernetes.api.model.VolumeBuilder;
import org.kohsuke.stapler.DataBoundSetter;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-
+@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.")
public class ConfigMapVolume extends PodVolume {
private String mountPath;
private String subPath;
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/DynamicPVCVolume.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/DynamicPVCVolume.java
index 48db86a244..aa48b5e6cc 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/DynamicPVCVolume.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/DynamicPVCVolume.java
@@ -12,6 +12,7 @@
import java.util.Objects;
import java.util.UUID;
import edu.umd.cs.findbugs.annotations.NonNull;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.jenkinsci.Symbol;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.DoNotUse;
@@ -22,6 +23,7 @@
/**
* Implements a dynamic PVC volume, that is created before the agent pod is created, and terminated afterwards.
*/
+@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.")
public class DynamicPVCVolume extends PodVolume implements DynamicPVC {
private String id;
private String storageClassName;
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/EmptyDirVolume.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/EmptyDirVolume.java
index 86e8e0f2f3..79e807a5dc 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/EmptyDirVolume.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/EmptyDirVolume.java
@@ -26,6 +26,7 @@
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -34,6 +35,7 @@
import io.fabric8.kubernetes.api.model.Volume;
import io.fabric8.kubernetes.api.model.VolumeBuilder;
+@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.")
public class EmptyDirVolume extends PodVolume {
private static final String DEFAULT_MEDIUM = "";
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/HostPathVolume.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/HostPathVolume.java
index cd6e39361b..76ef260866 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/HostPathVolume.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/HostPathVolume.java
@@ -26,6 +26,7 @@
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -34,6 +35,7 @@
import io.fabric8.kubernetes.api.model.Volume;
import io.fabric8.kubernetes.api.model.VolumeBuilder;
+@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.")
public class HostPathVolume extends PodVolume {
private String mountPath;
private String hostPath;
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/NfsVolume.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/NfsVolume.java
index 2d6b2488bb..dea04db571 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/NfsVolume.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/NfsVolume.java
@@ -26,6 +26,7 @@
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -34,6 +35,7 @@
import io.fabric8.kubernetes.api.model.Volume;
import io.fabric8.kubernetes.api.model.VolumeBuilder;
+@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.")
public class NfsVolume extends PodVolume {
private String mountPath;
private String serverAddress;
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/PersistentVolumeClaim.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/PersistentVolumeClaim.java
index 7c8378e3b2..a4a656c27b 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/PersistentVolumeClaim.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/PersistentVolumeClaim.java
@@ -26,6 +26,7 @@
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -34,6 +35,7 @@
import io.fabric8.kubernetes.api.model.Volume;
import io.fabric8.kubernetes.api.model.VolumeBuilder;
+@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.")
public class PersistentVolumeClaim extends PodVolume {
private String mountPath;
private String claimName;
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/SecretVolume.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/SecretVolume.java
index 150eb93f27..12b18053a5 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/SecretVolume.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/SecretVolume.java
@@ -28,12 +28,15 @@
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
import hudson.Extension;
import hudson.model.Descriptor;
import io.fabric8.kubernetes.api.model.SecretVolumeSource;
import io.fabric8.kubernetes.api.model.Volume;
import io.fabric8.kubernetes.api.model.VolumeBuilder;
+@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.")
public class SecretVolume extends PodVolume {
private String mountPath;
private String secretName;
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/DynamicPVCWorkspaceVolume.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/DynamicPVCWorkspaceVolume.java
index e359f9ffbc..e67f0faded 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/DynamicPVCWorkspaceVolume.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/DynamicPVCWorkspaceVolume.java
@@ -11,6 +11,7 @@
import io.fabric8.kubernetes.client.KubernetesClient;
import java.util.Objects;
import edu.umd.cs.findbugs.annotations.NonNull;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.csanchez.jenkins.plugins.kubernetes.volumes.DynamicPVC;
import org.csanchez.jenkins.plugins.kubernetes.volumes.PVCVolumeUtils;
import org.jenkinsci.Symbol;
@@ -23,6 +24,7 @@
/**
* @author runzexia
*/
+@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.")
public class DynamicPVCWorkspaceVolume extends WorkspaceVolume implements DynamicPVC {
private String storageClassName;
private String requestsSize;
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/EmptyDirWorkspaceVolume.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/EmptyDirWorkspaceVolume.java
index a7bb544002..a0138e302c 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/EmptyDirWorkspaceVolume.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/EmptyDirWorkspaceVolume.java
@@ -26,6 +26,7 @@
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -36,6 +37,7 @@
import java.util.Objects;
+@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.")
public class EmptyDirWorkspaceVolume extends WorkspaceVolume {
private static final String DEFAULT_MEDIUM = "";
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/HostPathWorkspaceVolume.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/HostPathWorkspaceVolume.java
index 533dfd28b4..d4ebcc207d 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/HostPathWorkspaceVolume.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/HostPathWorkspaceVolume.java
@@ -34,6 +34,9 @@
import java.util.Objects;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
+@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.")
public class HostPathWorkspaceVolume extends WorkspaceVolume {
private String hostPath;
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/NfsWorkspaceVolume.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/NfsWorkspaceVolume.java
index a1a0c09c2e..3137991c88 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/NfsWorkspaceVolume.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/NfsWorkspaceVolume.java
@@ -26,6 +26,7 @@
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -36,6 +37,7 @@
import java.util.Objects;
+@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.")
public class NfsWorkspaceVolume extends WorkspaceVolume {
private String serverAddress;
private String serverPath;
diff --git a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/PersistentVolumeClaimWorkspaceVolume.java b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/PersistentVolumeClaimWorkspaceVolume.java
index ce478f5012..abea9a0e7f 100644
--- a/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/PersistentVolumeClaimWorkspaceVolume.java
+++ b/src/main/java/org/csanchez/jenkins/plugins/kubernetes/volumes/workspace/PersistentVolumeClaimWorkspaceVolume.java
@@ -26,6 +26,7 @@
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;
@@ -36,6 +37,7 @@
import java.util.Objects;
+@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.")
public class PersistentVolumeClaimWorkspaceVolume extends WorkspaceVolume {
private String claimName;
@CheckForNull