Skip to content

Commit

Permalink
Fix the save/load cluster configuration on disk and in memory
Browse files Browse the repository at this point in the history
Tekton Cluster configuration is not persisted on disk (save/load) and is
lost at next reboot. Moreover, configuration update are not properly
sotred in memory, preventing users to access to new configuration added
(other than the default one).

Fixes jenkinsci#106
  • Loading branch information
durandx committed Dec 8, 2021
1 parent 664ef98 commit b421216
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@Extension
public class TektonGlobalConfiguration extends GlobalConfiguration {
private static final Logger logger = Logger.getLogger(TektonGlobalConfiguration.class.getName());
private transient List<ClusterConfig> clusterConfigs = new ArrayList<>();
private List<ClusterConfig> clusterConfigs = new ArrayList<>();

public TektonGlobalConfiguration(){
load();
Expand All @@ -39,7 +39,8 @@ public static TektonGlobalConfiguration get() {
@Override
public boolean configure(final StaplerRequest req, final JSONObject formData) {
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
setClusterConfigs(req.bindJSONToList(ClusterConfig.class, formData.get("clusterConfigs")));
setClusterConfigs(req.bindJSONToList(ClusterConfig.class, formData.get("clusterConfigs")));
configChange();
save();
return true;
}
Expand Down

0 comments on commit b421216

Please sign in to comment.