File tree 3 files changed +65
-0
lines changed
3 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 28
28
{% set _ = registry_list .append (r ) %}
29
29
{% endfor %}
30
30
unqualified-search-registries = {{ registry_list }}
31
+ {% for r , r_options in registry .items () if r_options .disable is not vyos_defined %}
32
+ [[registry]]
33
+ {% if r_options .mirror is vyos_defined %}
34
+ location = "{{ r_options.mirror.host_name if r_options.mirror.host_name is vyos_defined else r_options.mirror.address }}{{ ":" + r_options.mirror.port if r_options.mirror.port is vyos_defined }}{{ r_options.mirror.path if r_options.mirror.path is vyos_defined }}"
35
+ {% else %}
36
+ location = "{{ r }}"
37
+ {% endif %}
38
+ insecure = {{ 'true' if r_options.insecure is vyos_defined else 'false' }}
39
+ prefix = "{{ r }}"
40
+ {% endfor %}
31
41
{% endif %}
Original file line number Diff line number Diff line change 571
571
<children >
572
572
#include <include /interface/authentication.xml.i>
573
573
#include <include /generic-disable-node.xml.i>
574
+ <leafNode name =" insecure" >
575
+ <properties >
576
+ <help >Allow registry access over unencrypted HTTP or TLS connections with untrusted certificates</help >
577
+ <valueless />
578
+ </properties >
579
+ </leafNode >
580
+ <node name =" mirror" >
581
+ <properties >
582
+ <help >Registry mirror, use host-name|address[:port][/path]</help >
583
+ </properties >
584
+ <children >
585
+ <leafNode name =" address" >
586
+ <properties >
587
+ <help >IP address of container registry mirror</help >
588
+ <valueHelp >
589
+ <format >ipv4</format >
590
+ <description >IPv4 address of container registry mirror</description >
591
+ </valueHelp >
592
+ <valueHelp >
593
+ <format >ipv6</format >
594
+ <description >IPv6 address of container registry mirror</description >
595
+ </valueHelp >
596
+ <constraint >
597
+ <validator name =" ip-address" />
598
+ <validator name =" ipv6-link-local" />
599
+ </constraint >
600
+ </properties >
601
+ </leafNode >
602
+ <leafNode name =" host-name" >
603
+ <properties >
604
+ <help >Hostname of container registry mirror</help >
605
+ <valueHelp >
606
+ <format >hostname</format >
607
+ <description >FQDN of container registry mirror</description >
608
+ </valueHelp >
609
+ <constraint >
610
+ <validator name =" fqdn" />
611
+ </constraint >
612
+ </properties >
613
+ </leafNode >
614
+ #include <include /port-number.xml.i>
615
+ <leafNode name =" path" >
616
+ <properties >
617
+ <help >Path of container registry mirror, optional, must be start with '/' if not empty</help >
618
+ </properties >
619
+ </leafNode >
620
+ </children >
621
+ </node >
574
622
</children >
575
623
</tagNode >
576
624
</children >
Original file line number Diff line number Diff line change @@ -289,6 +289,13 @@ def verify(container):
289
289
290
290
if 'registry' in container :
291
291
for registry , registry_config in container ['registry' ].items ():
292
+ if 'mirror' in registry_config :
293
+ if 'host_name' in registry_config ['mirror' ] and 'address' in registry_config ['mirror' ]:
294
+ raise ConfigError (f'Container registry mirror address/host-name are mutually exclusive!' )
295
+
296
+ if 'path' in registry_config ['mirror' ] and not registry_config ['mirror' ]['path' ].startswith ('/' ):
297
+ raise ConfigError ('Container registry mirror path must start with "/"!' )
298
+
292
299
if 'authentication' not in registry_config :
293
300
continue
294
301
if not {'username' , 'password' } <= set (registry_config ['authentication' ]):
You can’t perform that action at this time.
0 commit comments