Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add registry mirror support in Jib build plugins #3011

Merged
merged 44 commits into from
Jan 28, 2021
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b1286b6
wip
chanseokoh Jan 8, 2021
33c4292
Merge remote-tracking branch 'origin/master' into docker-mirror-pull
chanseokoh Jan 8, 2021
211387c
wip
chanseokoh Jan 8, 2021
a454011
Remove unnecessary file lock
chanseokoh Jan 8, 2021
211aa63
Merge remote-tracking branch 'origin/master' into file-sync-cleanup
chanseokoh Jan 12, 2021
db873bb
Merge remote-tracking branch 'origin/master' into file-sync-cleanup
chanseokoh Jan 12, 2021
3412f54
wip
chanseokoh Jan 12, 2021
a2a202a
Add tests
chanseokoh Jan 12, 2021
1a482f8
Add registry mirror configs
chanseokoh Jan 12, 2021
196d077
wip
chanseokoh Jan 12, 2021
382d0f8
Clean up
chanseokoh Jan 13, 2021
1dcd766
Merge remote-tracking branch 'origin/master' into refactor-global-jib…
chanseokoh Jan 13, 2021
f6ce23b
Merge branch 'refactor-global-jib-config' into add-mirror-configs
chanseokoh Jan 13, 2021
d28eb8a
wip
chanseokoh Jan 13, 2021
84ed59e
wip
chanseokoh Jan 14, 2021
15f6ea5
fix
chanseokoh Jan 14, 2021
24ce1b7
wip
chanseokoh Jan 14, 2021
1b7e9f1
refactor
chanseokoh Jan 14, 2021
264adbd
fix
chanseokoh Jan 14, 2021
146cd76
Add Javadocs
chanseokoh Jan 15, 2021
0d3fb90
Merge remote-tracking branch 'origin/master' into add-mirror-configs
chanseokoh Jan 15, 2021
9345bfa
Use ListMultimap
chanseokoh Jan 15, 2021
b59ca3a
more Multimap
chanseokoh Jan 15, 2021
babbc4a
Fix test
chanseokoh Jan 20, 2021
df45f26
Merge branch 'docker-mirror-pull' into docker-mirror-final
chanseokoh Jan 20, 2021
8a4ce6d
wire mirror config
chanseokoh Jan 20, 2021
04d6d67
Rename to addRegistryMirrors()
chanseokoh Jan 21, 2021
2c0bff0
Merge remote-tracking branch 'origin/master' into add-mirror-configs
chanseokoh Jan 21, 2021
e365444
Refactor
chanseokoh Jan 21, 2021
8b3cc74
Merge branch 'add-mirror-configs' into docker-mirror-final
chanseokoh Jan 21, 2021
d6b5bee
wip
chanseokoh Jan 21, 2021
8a1d4e1
Fix progress dispatcher
chanseokoh Jan 21, 2021
35ebd19
fix
chanseokoh Jan 21, 2021
7f1b1ae
fix
chanseokoh Jan 21, 2021
36aa636
Merge branch 'fix-progress' into docker-mirror-final
chanseokoh Jan 21, 2021
3246ddb
fix progress
chanseokoh Jan 21, 2021
3fedfa0
working
chanseokoh Jan 21, 2021
b6981e0
Merge remote-tracking branch 'origin/master' into docker-mirror-final
chanseokoh Jan 21, 2021
1d2b74d
Add tests
chanseokoh Jan 22, 2021
67d6e00
Merge branch 'master' into docker-mirror-final
chanseokoh Jan 28, 2021
4cc7575
Update Javadoc
chanseokoh Jan 28, 2021
1f77d64
Add failover test
chanseokoh Jan 28, 2021
afe5855
Format code
chanseokoh Jan 28, 2021
c68d320
Move log message
chanseokoh Jan 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests
chanseokoh committed Jan 12, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit a2a202ab3b92df562888105e107a20d4d3aaf12a
Original file line number Diff line number Diff line change
@@ -45,28 +45,60 @@ public void setUp() {
}

@Test
public void testIsDisableUpdateCheck_systemProperty() throws IOException {
public void testReadConfig_default() throws IOException {
GlobalConfig globalConfig = GlobalConfig.readConfig(configDir);
assertThat(globalConfig.isDisableUpdateCheck()).isFalse();
}

@Test
public void testReadConfig_newConfigCreated() throws IOException {
GlobalConfig.readConfig(configDir);
String configJson =
new String(Files.readAllBytes(configDir.resolve("config.json")), StandardCharsets.UTF_8);
assertThat(configJson).isEqualTo("{\"disableUpdateCheck\":false}");
}

@Test
public void testReadConfig_emptyJson() throws IOException {
Files.write(configDir.resolve("config.json"), "{}".getBytes(StandardCharsets.UTF_8));
GlobalConfig globalConfig = GlobalConfig.readConfig(configDir);
assertThat(globalConfig.isDisableUpdateCheck()).isFalse();
}

@Test
public void testReadConfig() throws IOException {
Files.write(
configDir.resolve("config.json"),
"{\"disableUpdateCheck\":false}".getBytes(StandardCharsets.UTF_8));
"{\"disableUpdateCheck\":true}".getBytes(StandardCharsets.UTF_8));

GlobalConfig globalConfig = GlobalConfig.readConfig(configDir);
System.setProperty(PropertyNames.DISABLE_UPDATE_CHECKS, "true");
assertThat(globalConfig.isDisableUpdateCheck()).isTrue();
}

@Test
public void testIsDisableUpdateCheck_disabled() throws IOException {
public void testReadConfig_systemProperties() throws IOException {
Files.write(
configDir.resolve("config.json"),
"{\"disableUpdateCheck\":true}".getBytes(StandardCharsets.UTF_8));
"{\"disableUpdateCheck\":false}".getBytes(StandardCharsets.UTF_8));

GlobalConfig globalConfig = GlobalConfig.readConfig(configDir);
System.setProperty(PropertyNames.DISABLE_UPDATE_CHECKS, "true");
assertThat(globalConfig.isDisableUpdateCheck()).isTrue();
}

@Test
public void testPerformUpdateCheck_badConfig() throws IOException {
public void testReadConfig_emptyFile() throws IOException {
temporaryFolder.newFile("config.json");
IOException exception =
assertThrows(IOException.class, () -> GlobalConfig.readConfig(configDir));
assertThat(exception)
.hasMessageThat()
.startsWith("Failed to read global Jib config; you may need to fix or delete");
assertThat(exception).hasMessageThat().endsWith(File.separator + "config.json");
}

@Test
public void testReadConfig_corrupted() throws IOException {
Files.write(
configDir.resolve("config.json"), "corrupt config".getBytes(StandardCharsets.UTF_8));
IOException exception =