Skip to content

Commit

Permalink
change the rickshaw-settings.json handling of the refresh-timestamps …
Browse files Browse the repository at this point in the history
…object

- switch from the object (and it's sub properties) being optional to
  being required with null values

- the intent is to make source code management of the file (via git)
  more straightforward since there will be easier to integrate
  upstream changes
  • Loading branch information
k-rister committed Jun 29, 2024
1 parent 83f296f commit d6542f5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
36 changes: 20 additions & 16 deletions rickshaw-run
Original file line number Diff line number Diff line change
Expand Up @@ -1831,25 +1831,29 @@ sub load_settings_info() {

($rc, $workshop_refresh_timestamps_token_file) = get_json_setting("workshop.refresh-timestamps.token-file", $jsonsettings);
if ($rc != 0) {
debug_log("load_settings_info(): failed to load workshop refresh-timestamps token-file\n");
print "load_settings_info(): failed to load workshop refresh-timestamps token-file\n";
exit 1;
} else {
if (open(TOKEN, "<", $workshop_refresh_timestamps_token_file)) {
$workshop_refresh_timestamps_token = <TOKEN>;
chomp($workshop_refresh_timestamps_token);
close TOKEN;
} else {
printf "load_settings_file(): failed to load token from workshop refresh-timestamps token-file\n";
exit 1;
}

printf "load_settings_info(): loaded workshop refresh-timestamps token-file: %s\n", $workshop_refresh_timestamps_token_file;
if (defined $workshop_refresh_timestamps_token_file) {
if (open(TOKEN, "<", $workshop_refresh_timestamps_token_file)) {
$workshop_refresh_timestamps_token = <TOKEN>;
chomp($workshop_refresh_timestamps_token);
close TOKEN;
} else {
printf "load_settings_file(): failed to load token from workshop refresh-timestamps token-file\n";
exit 1;
}

($rc, $workshop_refresh_timestamps_api_url) = get_json_setting("workshop.refresh-timestamps.api-url", $jsonsettings);
printf "load_settings_info(): loaded workshop refresh-timestamps token-file: %s\n", $workshop_refresh_timestamps_token_file;
}
}

if ($rc != 0) {
print "load_settings_info(): failed to load workshop refresh-timestamps api-url\n";
exit 1;
} else {
($rc, $workshop_refresh_timestamps_api_url) = get_json_setting("workshop.refresh-timestamps.api-url", $jsonsettings);
if ($rc != 0) {
print "load_settings_info(): failed to load workshop refresh-timestamps api-url\n";
exit 1;
} else {
if (defined $workshop_refresh_timestamps_api_url) {
printf "load_settings_info(): loaded workshop refresh-timestamps api-url: %s\n", $workshop_refresh_timestamps_api_url;
}
}
Expand Down
6 changes: 5 additions & 1 deletion rickshaw-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
}
},
"workshop": {
"force-builds": "false"
"force-builds": "false",
"refresh-timestamps": {
"token-file": null,
"api-url": null
}
},
"quay": {
"image-expiration": "2w"
Expand Down

0 comments on commit d6542f5

Please sign in to comment.