Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: Context get cmd #18

Open
wants to merge 4 commits into
base: context
Choose a base branch
from
Open

feat: Context get cmd #18

wants to merge 4 commits into from

Conversation

D0ri123
Copy link

@D0ri123 D0ri123 commented Oct 6, 2024

related issue #12

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

Signed-off-by: LeeSeolHui <lsh81550@gmail.com>
Signed-off-by: LeeSeolHui <lsh81550@gmail.com>
@D0ri123 D0ri123 marked this pull request as draft October 6, 2024 04:55
Copy link

@eugene70 eugene70 left a comment

Choose a reason for hiding this comment

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

찬영님께 코멘트한 것 처럼 app.go 의 코드를 참고하여 수정해 주시면 NewContextCommand 메소드가 너무 길어지는 것을 방지할 수 있을 것 같습니다.

@@ -96,9 +99,22 @@ argocd context cd.argoproj.io --delete`,
},
}

// Get context details
Copy link

Choose a reason for hiding this comment

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

아래와 같이 Get Command 생성부를 별도의 메소드로 분리하는 것이 좋을 것 같습니다. app.go 참고.
func NewContextGetCommand(clientOpts *argocdclient.ClientOptions) *cobra.Command {
...
}

command.AddCommand(listCommand)
command.AddCommand(useCommand)
command.AddCommand(deleteCommand)
command.AddCommand(getDetailsCommand)
Copy link

Choose a reason for hiding this comment

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

app.go 에서처럼 AddCommand의 인자로 Get Command 생성 함수를 호출하는 방식이 좋겠습니다.
command.AddCommand(NewContextGetCommand(clientOpts))

Signed-off-by: LeeSeolHui <lsh81550@gmail.com>
Signed-off-by: LeeSeolHui <lsh81550@gmail.com>
@D0ri123 D0ri123 marked this pull request as ready for review October 20, 2024 06:42
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants