-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
@@ -23,6 +23,8 @@ | |||
@Size(min = 5, max = 30) | |||
private String name; | |||
|
|||
private int maxContainers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'member def modifier' have incorrect indentation level 4, expected level should be 2.
public class DockerHost implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private long id; | ||
private final long id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'member def modifier' have incorrect indentation level 4, expected level should be 2.
|
||
@NonNull | ||
private String name; | ||
|
||
@NonNull | ||
private String dockerDaemonUrl; | ||
|
||
private Instant created = Instant.now(); | ||
private final Instant created = Instant.now(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'member def modifier' have incorrect indentation level 4, expected level should be 2.
private Instant created = Instant.now(); | ||
private final Instant created = Instant.now(); | ||
|
||
public DockerHost() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'ctor def modifier' have incorrect indentation level 4, expected level should be 2.
private final Instant created = Instant.now(); | ||
|
||
public DockerHost() { | ||
id = new Random().nextLong(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'ctor def' child have incorrect indentation level 8, expected level should be 4.
|
||
public DockerHost() { | ||
id = new Random().nextLong(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'ctor def rcurly' have incorrect indentation level 4, expected level should be 2.
import com.github.dockerjava.api.command.StatsCmd; | ||
import com.github.dockerjava.api.model.Container; | ||
import com.github.dockerjava.api.model.Info; | ||
|
||
import java.util.Collection; | ||
|
||
public interface ContainerFetcher { | ||
Collection<Container> list(); | ||
Info getInfo(); | ||
Collection<Container> list(DockerClient dockerClient); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def modifier' have incorrect indentation level 4, expected level should be 2.
Info getInfo(); | ||
Collection<Container> list(DockerClient dockerClient); | ||
|
||
Info getInfo(DockerClient dockerClient); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def modifier' have incorrect indentation level 4, expected level should be 2.
|
||
Info getInfo(DockerClient dockerClient); | ||
|
||
DockerClient getDockerClient(final String dockerHost, final String apiVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def modifier' have incorrect indentation level 4, expected level should be 2.
DockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder() | ||
.withDockerHost("tcp:https://0.0.0.0:2376") | ||
.withApiVersion("1.24") | ||
dockerClient = getDockerClient("tcp:https://0.0.0.0:2375", "1.24"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.
.withDockerHost("tcp:https://0.0.0.0:2376") | ||
.withApiVersion("1.24") | ||
dockerClient = getDockerClient("tcp:https://0.0.0.0:2375", "1.24"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def rcurly' have incorrect indentation level 4, expected level should be 2.
dockerClient = getDockerClient("tcp:https://0.0.0.0:2375", "1.24"); | ||
} | ||
|
||
public DockerClient getDockerClient(final String dockerHost, final String apiVersion) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def modifier' have incorrect indentation level 4, expected level should be 2.
dockerClient = getDockerClient("tcp:https://0.0.0.0:2375", "1.24"); | ||
} | ||
|
||
public DockerClient getDockerClient(final String dockerHost, final String apiVersion) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: Missing a Javadoc comment.
} | ||
|
||
public DockerClient getDockerClient(final String dockerHost, final String apiVersion) { | ||
DefaultDockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'member def type' have incorrect indentation level 8, expected level should be 4.
} | ||
|
||
public DockerClient getDockerClient(final String dockerHost, final String apiVersion) { | ||
DefaultDockerClientConfig config = DefaultDockerClientConfig.createDefaultConfigBuilder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.
.build(); | ||
dockerClient = DockerClientBuilder.getInstance(config).build(); | ||
return DockerClientBuilder.getInstance(config).build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.
@@ -71,6 +71,14 @@ public String addHost(@Valid DockerHost dockerHost, @RequestParam long clusterId | |||
return "redirect:/clusters/all"; | |||
} | |||
|
|||
@RequestMapping(value = "clusters/node", method = RequestMethod.DELETE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def modifier' have incorrect indentation level 4, expected level should be 2.
@@ -71,6 +71,14 @@ public String addHost(@Valid DockerHost dockerHost, @RequestParam long clusterId | |||
return "redirect:/clusters/all"; | |||
} | |||
|
|||
@RequestMapping(value = "clusters/node", method = RequestMethod.DELETE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: Missing a Javadoc comment.
@@ -71,6 +71,14 @@ public String addHost(@Valid DockerHost dockerHost, @RequestParam long clusterId | |||
return "redirect:/clusters/all"; | |||
} | |||
|
|||
@RequestMapping(value = "clusters/node", method = RequestMethod.DELETE) | |||
public String deleteHost(@RequestParam Long clusterId, @RequestParam Long hostId) { | |||
Cluster cluster = clusterRepository.getById(clusterId).get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'member def type' have incorrect indentation level 8, expected level should be 4.
@@ -71,6 +71,14 @@ public String addHost(@Valid DockerHost dockerHost, @RequestParam long clusterId | |||
return "redirect:/clusters/all"; | |||
} | |||
|
|||
@RequestMapping(value = "clusters/node", method = RequestMethod.DELETE) | |||
public String deleteHost(@RequestParam Long clusterId, @RequestParam Long hostId) { | |||
Cluster cluster = clusterRepository.getById(clusterId).get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.
@RequestMapping(value = "clusters/node", method = RequestMethod.DELETE) | ||
public String deleteHost(@RequestParam Long clusterId, @RequestParam Long hostId) { | ||
Cluster cluster = clusterRepository.getById(clusterId).get(); | ||
cluster.getHosts().removeIf(h -> h.getId() == hostId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.
public String deleteHost(@RequestParam Long clusterId, @RequestParam Long hostId) { | ||
Cluster cluster = clusterRepository.getById(clusterId).get(); | ||
cluster.getHosts().removeIf(h -> h.getId() == hostId); | ||
clusterRepository.save(cluster); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.
Cluster cluster = clusterRepository.getById(clusterId).get(); | ||
cluster.getHosts().removeIf(h -> h.getId() == hostId); | ||
clusterRepository.save(cluster); | ||
return "redirect:/clusters/all"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.
cluster.getHosts().removeIf(h -> h.getId() == hostId); | ||
clusterRepository.save(cluster); | ||
return "redirect:/clusters/all"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def rcurly' have incorrect indentation level 4, expected level should be 2.
import org.springframework.web.bind.annotation.RequestParam; | ||
|
||
import javax.ws.rs.NotFoundException; | ||
import java.util.Collection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: Wrong lexicographical order for 'java.util.Collection' import. Should be before 'javax.ws.rs.NotFoundException'.
|
||
import javax.ws.rs.NotFoundException; | ||
import java.util.Collection; | ||
import java.util.Optional; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: Wrong lexicographical order for 'java.util.Optional' import. Should be before 'javax.ws.rs.NotFoundException'.
@AllArgsConstructor(onConstructor = @__(@Autowired)) | ||
public class NodeController { | ||
|
||
ContainerFetcher containerFetcher; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'member def type' have incorrect indentation level 4, expected level should be 2.
|
||
ContainerFetcher containerFetcher; | ||
|
||
ClusterRepository clusterRepository; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'member def type' have incorrect indentation level 4, expected level should be 2.
|
||
ClusterRepository clusterRepository; | ||
|
||
@RequestMapping("/clusters/node") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def modifier' have incorrect indentation level 4, expected level should be 2.
|
||
ClusterRepository clusterRepository; | ||
|
||
@RequestMapping("/clusters/node") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: Missing a Javadoc comment.
|
||
@RequestMapping("/clusters/node") | ||
public String node(@RequestParam long clusterId, @RequestParam long nodeId, Model model) { | ||
Optional<Cluster> byId = clusterRepository.getById(clusterId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'member def type' have incorrect indentation level 8, expected level should be 4.
|
||
@RequestMapping("/clusters/node") | ||
public String node(@RequestParam long clusterId, @RequestParam long nodeId, Model model) { | ||
Optional<Cluster> byId = clusterRepository.getById(clusterId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.
@RequestMapping("/clusters/node") | ||
public String node(@RequestParam long clusterId, @RequestParam long nodeId, Model model) { | ||
Optional<Cluster> byId = clusterRepository.getById(clusterId); | ||
if (!byId.isPresent()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'if' construct must use '{}'s.
@RequestMapping("/clusters/node") | ||
public String node(@RequestParam long clusterId, @RequestParam long nodeId, Model model) { | ||
Optional<Cluster> byId = clusterRepository.getById(clusterId); | ||
if (!byId.isPresent()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'if' have incorrect indentation level 8, expected level should be 4.
if (!byId.isPresent()) | ||
throw new NotFoundException("CHANGE ME !"); | ||
|
||
Cluster cluster = byId.get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'member def type' have incorrect indentation level 8, expected level should be 4.
if (!byId.isPresent()) | ||
throw new NotFoundException("CHANGE ME !"); | ||
|
||
Cluster cluster = byId.get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Checkstyle] WARNING: 'method def' child have incorrect indentation level 8, expected level should be 4.
No description provided.