-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1629 from etungsten/image-registry-cache
docker, containerd: image registry mirrors
- Loading branch information
Showing
35 changed files
with
492 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{{~#if settings.container-registry.mirrors}} | ||
{{~#each settings.container-registry.mirrors}} | ||
[mirrors."{{@key}}"] | ||
endpoints = [{{join_array ", " this }}] | ||
{{~/each}} | ||
{{~/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ Source3: eni-max-pods | |
|
||
Source5: updog-toml | ||
Source6: metricdog-toml | ||
Source7: host-ctr-toml | ||
|
||
# 1xx sources: systemd units | ||
Source100: apiserver.service | ||
|
@@ -394,7 +395,7 @@ install -d %{buildroot}%{_cross_datadir}/updog | |
install -p -m 0644 %{_cross_repo_root_json} %{buildroot}%{_cross_datadir}/updog | ||
|
||
install -d %{buildroot}%{_cross_templatedir} | ||
install -p -m 0644 %{S:5} %{S:6} %{buildroot}%{_cross_templatedir} | ||
install -p -m 0644 %{S:5} %{S:6} %{S:7} %{buildroot}%{_cross_templatedir} | ||
|
||
install -d %{buildroot}%{_cross_unitdir} | ||
install -p -m 0644 \ | ||
|
@@ -464,6 +465,8 @@ install -p -m 0644 %{S:300} %{buildroot}%{_cross_udevrulesdir}/80-ephemeral-stor | |
%{_cross_bindir}/host-containers | ||
%{_cross_unitdir}/[email protected] | ||
%{_cross_tmpfilesdir}/host-containers.conf | ||
%dir %{_cross_templatedir} | ||
%{_cross_templatedir}/host-ctr-toml | ||
|
||
%files -n %{_cross_os}storewolf | ||
%{_cross_bindir}/storewolf | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
sources/api/migration/migrations/v1.2.0/container-registry-config-restarts/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "container-registry-config-restarts" | ||
version = "0.1.0" | ||
authors = ["Erikson Tung <[email protected]>"] | ||
license = "Apache-2.0 OR MIT" | ||
edition = "2018" | ||
publish = false | ||
|
||
[dependencies] | ||
migration-helpers = { path = "../../../migration-helpers" } |
37 changes: 37 additions & 0 deletions
37
sources/api/migration/migrations/v1.2.0/container-registry-config-restarts/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#![deny(rust_2018_idioms)] | ||
|
||
use migration_helpers::common_migrations::{ListReplacement, ReplaceListsMigration}; | ||
use migration_helpers::{migrate, Result}; | ||
use std::process; | ||
|
||
/// We templatized the configuration file for the Docker daemon. | ||
/// We also added a new configuration file for host-containers and bootstrap-containers | ||
fn run() -> Result<()> { | ||
migrate(ReplaceListsMigration(vec![ | ||
ListReplacement { | ||
setting: "services.docker.configuration-files", | ||
old_vals: &["proxy-env"], | ||
new_vals: &["docker-daemon-config", "proxy-env"], | ||
}, | ||
ListReplacement { | ||
setting: "services.bootstrap-containers.configuration-files", | ||
old_vals: &[], | ||
new_vals: &["host-ctr-toml"], | ||
}, | ||
ListReplacement { | ||
setting: "services.host-containers.configuration-files", | ||
old_vals: &[], | ||
new_vals: &["host-ctr-toml"], | ||
}, | ||
])) | ||
} | ||
|
||
// Returning a Result from main makes it print a Debug representation of the error, but with Snafu | ||
// we have nice Display representations of the error, so we wrap "main" (run) and print any error. | ||
// https://github.com/shepmaster/snafu/issues/110 | ||
fn main() { | ||
if let Err(e) = run() { | ||
eprintln!("{}", e); | ||
process::exit(1); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
sources/api/migration/migrations/v1.2.0/container-registry-mirrors/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "container-registry-mirrors" | ||
version = "0.1.0" | ||
authors = ["Erikson Tung <[email protected]>"] | ||
license = "Apache-2.0 OR MIT" | ||
edition = "2018" | ||
publish = false | ||
|
||
[dependencies] | ||
migration-helpers = { path = "../../../migration-helpers" } |
25 changes: 25 additions & 0 deletions
25
sources/api/migration/migrations/v1.2.0/container-registry-mirrors/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#![deny(rust_2018_idioms)] | ||
|
||
use migration_helpers::common_migrations::AddPrefixesMigration; | ||
use migration_helpers::{migrate, Result}; | ||
use std::process; | ||
|
||
/// We added a new setting for configuring image registries, `settings.container-registry` | ||
/// We also added a new configuration template file for the Docker daemon | ||
fn run() -> Result<()> { | ||
migrate(AddPrefixesMigration(vec![ | ||
"settings.container-registry", | ||
"configuration-files.docker-daemon-config", | ||
"configuration-files.host-ctr-toml", | ||
])) | ||
} | ||
|
||
// Returning a Result from main makes it print a Debug representation of the error, but with Snafu | ||
// we have nice Display representations of the error, so we wrap "main" (run) and print any error. | ||
// https://github.com/shepmaster/snafu/issues/110 | ||
fn main() { | ||
if let Err(e) = run() { | ||
eprintln!("{}", e); | ||
process::exit(1); | ||
} | ||
} |
Oops, something went wrong.