Support update site warnings with Configuration as Code
@@ -39,6 +39,7 @@ import jenkins.model.Jenkins;
import net.sf.json.JSONObject;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
+import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.StaplerRequest;
/**
@@ -64,6 +65,11 @@ public class UpdateSiteWarningsConfiguration extends GlobalConfiguration impleme
return Collections.unmodifiableSet(ignoredWarnings);
}
+ @DataBoundSetter // unused; for CasC support only
+ public void setIgnoredWarnings(Set<String> ignoredWarnings) {
+ this.ignoredWarnings = new HashSet<>(ignoredWarnings);
+ }
+
public boolean isIgnored(@NonNull UpdateSite.Warning warning) {
return ignoredWarnings.contains(warning.id);
}
