Skip to content

Commit

Permalink
feat: add ability to specify a masquerade URL in the registry mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
blerko committed Jun 6, 2018
1 parent 1f52e8b commit 5c4ef31
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mirroroperator/registrymirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(self, event_type, namespace, hostess_docker_registry,
self.daemon_set_name = self.full_name + "-utils"
self.apiVersion = kwargs.get("apiVersion")
self.upstreamUrl = kwargs.get("spec", {}).get("upstreamUrl")
self.masqueradeUrl = kwargs.get("spec", {}).get("masqueradeUrl", "mirror-"+self.upstreamUrl)
self.credentials_secret_name = kwargs.get(
"spec", {}).get("credentialsSecret")
self.image_pull_secrets = kwargs["image_pull_secrets"] or ""
Expand Down Expand Up @@ -139,7 +140,7 @@ def generate_daemon_set(self, daemon_set):
value=self.namespace),
client.V1EnvVar(
name="SHADOW_FQDN",
value="mirror-"+self.upstreamUrl),
value=self.masqueradeUrl),
client.V1EnvVar(
name="HOSTS_FILE",
value="/etc/hosts_from_host"),
Expand Down Expand Up @@ -225,7 +226,7 @@ def generate_daemon_set(self, daemon_set):
client.V1Volume(
name="docker-certs",
host_path=client.V1HostPathVolumeSource(
path="/etc/docker/certs.d/mirror-{}".format(self.upstreamUrl)
path="/etc/docker/certs.d/{}".format(self.masqueradeUrl)
),
),
client.V1Volume(
Expand Down

0 comments on commit 5c4ef31

Please sign in to comment.