Merged
Conversation
gopose status commandgopose status コマンドを実装しました
Owner
|
@all-contributors please add @akinoriakatsuka for code |
Contributor
|
I've put up a pull request to add @akinoriakatsuka! 🎉 |
Contributor
Author
|
@harakeishi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
gopose statusコマンドを実装し、Docker Composeプロジェクトのポートマッピング状態を確認できるようにしました。compose.override.ymlによるオーバーライド状況も表示され、どのポートが変更されているかを一目で把握できます。--detailed は雛形にはありましたが、未実装です。
変更内容
cmd/status.goにgopose statusコマンドの実装を追加-fフラグでの手動指定にも対応)compose.override.yml/docker-compose.override.ymlの読み込み機能-o json)の出力対応cmd/status_test.goに包括的なテストスイートを追加(8テストケース群)collectPortInfos関数のユニットテスト(8ケース)outputTable関数の出力検証テストoutputJSON関数の出力検証テストloadOverrideConfig関数のテスト(存在有無、複数ファイル形式対応)PortInfoのJSONシリアライズテスト期待すること
動作確認
go test ./... -count=1全パッケージPASSgo vet ./...警告なしgo build成功gopose status --helpヘルプ表示gopose statusテーブル出力gopose status -o jsonJSON出力gopose status -f custom.ymlファイル指定overridden (元ポート番号)形式でSTATUSカラムに表示されること