Commit 241fe28b authored by David Johnson's avatar David Johnson

Add sitevar for local Docker registry.

Everybody's doing it!
parent 4cf3d8c5
......@@ -189,6 +189,7 @@ INSERT INTO sitevariables VALUES ('cnetwatch/bps_threshold',NULL,'500000000','Da
INSERT INTO sitevariables VALUES ('cnetwatch/mail_interval',NULL,'600','Interval in seconds at which to send email for all alerts logged during the interval (0 means do not send alert email)',0);
INSERT INTO sitevariables VALUES ('cnetwatch/mail_max',NULL,'1000','Maximum number of alert emails to send; after this alerts are only logged (0 means no limit to the emails)',0);
INSERT INTO sitevariables VALUES ('reservations/approval_threshold',NULL,'128','Maximum number of node hours for automatic approval of reservation requests (0 means no limit).',0);
INSERT INTO sitevariables VALUES ('docker/registry',NULL,'','The URL of the Docker registry where this Emulab stores its custom Docker images; the empty string signifies that users cannot create custom Docker images',0);
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
......
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
my $svar = 'docker/registry';
DBQueryFatal("INSERT INTO `sitevariables` VALUES ".
"('$svar',NULL,'',".
"'The URL of the Docker registry where this Emulab stores".
" its custom Docker images; the empty string signifies that".
" users cannot create custom Docker images',0)")
if (!TBSiteVarExists($svar));
return 0;
}
1;
# Local Variables:
# mode:perl
# End:
......@@ -124,22 +124,10 @@ sub GetLocalRegistryPathForImage($$;$$$) {
#
# Find the local cluster's registry, if any.
#
if ($OURDOMAIN eq 'utah.cloudlab.us') {
$registry = "ops.utah.cloudlab.us:5080";
}
elsif ($OURDOMAIN eq 'emulab.net') {
$registry = "ops.emulab.net:5080";
}
else {
$msg = "Site $OURDOMAIN does not have a local registry;".
" cannot capture image $image!";
if (!TBGetSiteVar("docker/registry",\$registry) || $registry eq "") {
$msg = "no local registry specified in sitevar general/docker_registry";
goto out;
}
#if (TBGetSiteVar("docker/registry",\$registry)
# || $registry eq "") {
# $msg = "no local registry specified in sitevar general/docker_registry";
# goto out;
#}
#
# Docker registry does not accept uppercase characters in repo names.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment