Skip to content

Commit

Permalink
πŸ”₯ : remove unused dockerDaemon settings
Browse files Browse the repository at this point in the history
  • Loading branch information
juwit committed Sep 17, 2021
1 parent 65779b8 commit 929914c
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 31 deletions.
16 changes: 0 additions & 16 deletions src/main/java/io/gaia_app/settings/bo/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public class Settings {
*/
private List<EnvVar> envVars = new ArrayList<>();

/**
* The docker daemon url used by Gaia to spawn its runners
*/
private String dockerDaemonUrl;

public String getExternalUrl() {
return externalUrl;
}
Expand All @@ -51,14 +46,6 @@ public List<String> env() {
.collect(Collectors.toList());
}

public String getDockerDaemonUrl() {
return dockerDaemonUrl;
}

public void setDockerDaemonUrl(String dockerDaemonUrl) {
this.dockerDaemonUrl = dockerDaemonUrl;
}

/**
* Merging two settings objets
* @param saved the settings to merge
Expand All @@ -67,9 +54,6 @@ public void merge(Settings saved) {
if (saved.externalUrl != null) {
this.externalUrl = saved.externalUrl;
}
if (saved.dockerDaemonUrl != null) {
this.dockerDaemonUrl = saved.dockerDaemonUrl;
}
if (saved.envVars != null) {
this.envVars.addAll(saved.envVars);
}
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ spring.data.mongodb.uri=${gaia.mongodb.uri}
gaia.mongodb.uri=mongodb://localhost/gaia

gaia.externalUrl=http://localhost:${server.port:8080}
gaia.dockerDaemonUrl=unix:///var/run/docker.sock

docker.registry.api.url=https://registry.hub.docker.com/v2

Expand Down
6 changes: 0 additions & 6 deletions src/test/java/io/gaia_app/settings/bo/SettingsIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ void externalUrl_shouldBeConfigurableViaProperty(){
assertEquals("http://172.17.0.1:8080", settings.getExternalUrl());
}

@Test
void dockerDaemonUrl_shouldBeConfigurableViaProperty(){
assertEquals("unix:///var/run/docker.sock", settings.getDockerDaemonUrl());
}

@Test
void envVars_shouldBeConfigurableViaProperty(){
assertEquals("test", settings.getEnvVars().get(0).name);
Expand Down Expand Up @@ -67,7 +62,6 @@ void settings_shouldBeMergedWithSavedSettings(){
settings.merge(savedSettings);

assertEquals("https://gaia.io", settings.getExternalUrl());
assertEquals("unix:///var/run/docker.sock", settings.getDockerDaemonUrl());
assertThat(settings.getEnvVars()).hasSize(3)
.containsExactlyInAnyOrder(existingEnvVar, testVar, otherTestVar);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

@SpringBootTest
@TestPropertySource(properties = {"gaia.externalUrl=http://gaia.io", "gaia.dockerDaemonUrl=unix:///var/run/docker.sock"})
@TestPropertySource(properties = {"gaia.externalUrl=http://gaia.io"})
class SettingsRepositoryIT extends SharedMongoContainerTest {

@Autowired
Expand All @@ -21,9 +21,6 @@ class SettingsRepositoryIT extends SharedMongoContainerTest {
@Autowired
private SettingsRepository settingsRepository;

@Autowired
private Settings settings;

@Test
void itShouldSaveSettings(){
// given
Expand All @@ -34,7 +31,6 @@ void itShouldSaveSettings(){
// then
var saved = mongoTemplate.findAll(Settings.class).get(0);
assertEquals("http://gaia.io", saved.getExternalUrl());
assertEquals("unix:///var/run/docker.sock", saved.getDockerDaemonUrl());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class SettingsRepositoryTest {
void setUp() {
settings = new Settings();
settings.setExternalUrl("externalUrl");
settings.setDockerDaemonUrl("dockerDaemonUrl");

settingsRepository = new SettingsRepository(mongoTemplate, settings);
}
Expand All @@ -37,7 +36,6 @@ void setUp() {
void settings_shouldBeLoadedFromDatabase(){
var savedSettings = new Settings();
savedSettings.setExternalUrl("savedExternalUrl");
savedSettings.setDockerDaemonUrl("savedDockerDaemonUrl");

when(mongoTemplate.findAll(Settings.class)).thenReturn(List.of(savedSettings));

Expand All @@ -46,7 +44,6 @@ void settings_shouldBeLoadedFromDatabase(){

//then
assertEquals("savedExternalUrl", settings.getExternalUrl());
assertEquals("savedDockerDaemonUrl", settings.getDockerDaemonUrl());

verify(mongoTemplate).findAll(Settings.class);
verifyNoMoreInteractions(mongoTemplate);
Expand Down

0 comments on commit 929914c

Please sign in to comment.