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

SO1S-461 Nodes GET API 작성 #50

Merged
merged 4 commits into from
Oct 23, 2022
Merged

SO1S-461 Nodes GET API 작성 #50

merged 4 commits into from
Oct 23, 2022

Conversation

DPS0340
Copy link
Member

@DPS0340 DPS0340 commented Oct 22, 2022

Nodes GET API 작성

Tasks

  • Fabric8 Kubernetes Client를 활용한 NodesService.findNodes() 메소드 작성
  • NodesController 작성
    • Nodes GET API 작성
    • Node Yaml GET API 작성
  • DataTypeNotFoundException 상속 구조 수정

Discussion

  • 지금 엔티티가 너무 복잡하다보니 임의로 리턴 타입을 Fabric8에서 제공하고 있는 Node DTO를 그대로 사용해서 컨트롤러단까지 추가적인 DTO 변환 / Mapper 작성 없이 제공하고 있습니다. 이게 적합한 해결책인지 궁금합니다!
  • NodesService 유닛 테스트를 작성하려고 하였지만 Fabric8 Kubernetes Client Mock Annotation을 사용할 경우 기본으로 받아올 수 있는 Nodes가 빈 리스트로 제공되고, create 조치를 하려고 하여도 오류가 발생했기 때문에 Mock을 하지 않을 경우 유닛 테스트에 실제 쿠버네티스 환경을 제공해야 된다는 문제점이 있어 테스트 작성을 포기했습니다! 가능한 해결책이 있을까요?

Jira

  • SO1S-461

@DPS0340 DPS0340 added the API API 기능이 추가됐습니다. label Oct 22, 2022
@DPS0340 DPS0340 requested a review from shinilseop October 22, 2022 00:58
@DPS0340 DPS0340 self-assigned this Oct 22, 2022
@sonarqube-so1s

This comment has been minimized.

@sonarqube-so1s

This comment has been minimized.

Copy link
Member

@NEM-NE NEM-NE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다~

public ResponseEntity<String> findDeploymentYaml(
@Valid @PathVariable("node_name") String nodeName) {
Node node = nodesService.findNodeByName(nodeName);
String yaml = kubernetesService.getWorkloadToYaml(node);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

예전에 YAML 전달 태스크를 처리할 때 고민했던게 있는데요 "yaml만 전달해주는 거면 DTO를 감싸줘야하는가?"라는 고민이 들었습니다. 제가 내렸던 최종적인 결론은 "혹시 모를 확장성을 위해 DTO를 만들고 전달을 하자"라는 결론이었는데 이 부분에 대해서는 어떻게 생각하시나요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 저도 동의합니다! DTO 기반으로 수정할게요~

@sonarqube-so1s
Copy link

Passed

Analysis Details

20 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 20 Code Smells

Coverage and Duplications

  • Coverage 65.01% Coverage (72.90% Estimated after merge)
  • Duplications 0.00% Duplicated Code (1.40% Estimated after merge)

Project ID: So1S_backend_AYHrZkBbJVI_JANDYCcZ

View in SonarQube

@DPS0340 DPS0340 merged commit 89310a8 into main Oct 23, 2022
@DPS0340 DPS0340 deleted the SO1S-461 branch October 23, 2022 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API 기능이 추가됐습니다.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants