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

Support directly designating a gitSSHKey instead of File for launcher #5258

Merged
merged 17 commits into from
Oct 7, 2024

Conversation

t-kikuc
Copy link
Member

@t-kikuc t-kikuc commented Oct 7, 2024

What this PR does / why we need it:

Add --git-ssh-key-data for launcher. This flag enables passing a sshKey without preparing a file.

Usecase:

Which issue(s) this PR fixes:

N/A

Does this PR introduce a user-facing change?: N/A

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

@t-kikuc t-kikuc enabled auto-merge (squash) October 7, 2024 05:53
@t-kikuc t-kikuc marked this pull request as draft October 7, 2024 05:56
auto-merge was automatically disabled October 7, 2024 05:56

Pull request was converted to draft

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Project coverage is 24.02%. Comparing base (2ef9ad3) to head (1c6e430).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
pkg/app/launcher/cmd/launcher/launcher.go 0.00% 20 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5258   +/-   ##
=======================================
  Coverage   24.02%   24.02%           
=======================================
  Files         439      439           
  Lines       47017    47040   +23     
=======================================
+ Hits        11295    11301    +6     
- Misses      34819    34835   +16     
- Partials      903      904    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Warashi
Warashi previously approved these changes Oct 7, 2024
Copy link
Contributor

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

👍🏻

@t-kikuc t-kikuc changed the title Support reading a gitSSHKey from an env variable for launcher Support directly designating a gitSSHKey instead of File for launcher Oct 7, 2024
@t-kikuc t-kikuc marked this pull request as ready for review October 7, 2024 06:21
@t-kikuc
Copy link
Member Author

t-kikuc commented Oct 7, 2024

@Warashi
Sorry, would you please review it again?

I changed from --git-ssh-key-env to --git-ssh-key-data since it's easier to use.

@t-kikuc t-kikuc enabled auto-merge (squash) October 7, 2024 06:24
Warashi
Warashi previously approved these changes Oct 7, 2024
Copy link
Contributor

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

Thanks

I commented on a nitpick, but you can merge this, leaving it as-is.

if err != nil {
return fmt.Errorf("failed to create a temp file for SSH key data (%w)", err)
}
if _, err = tmpKeyFile.WriteString(string(decodedKey)); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

nits.
We can use Write method as belows

Suggested change
if _, err = tmpKeyFile.WriteString(string(decodedKey)); err != nil {
if _, err = tmpKeyFile.Write(decodedKey); err != nil {

Copy link
Member Author

Choose a reason for hiding this comment

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

@Warashi

thank you, I fixed it here 1c6e430.

It's a legacy code and I missed.

Signed-off-by: t-kikuc <[email protected]>
Copy link
Contributor

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

LGTM :+

@t-kikuc t-kikuc merged commit f017312 into master Oct 7, 2024
15 checks passed
@t-kikuc t-kikuc deleted the git-ssh-key-env branch October 7, 2024 06:38
github-actions bot pushed a commit that referenced this pull request Oct 8, 2024
…#5258)

* Generate v0.49.x docs

Signed-off-by: t-kikuc <[email protected]>

* add --git-ssh-key-env

Signed-off-by: t-kikuc <[email protected]>

* update docs: add '--git-ssh-key-env'

Signed-off-by: t-kikuc <[email protected]>

* add '\n' at the end of ssh key

Signed-off-by: t-kikuc <[email protected]>

* Directly use data instead of env

Signed-off-by: t-kikuc <[email protected]>

* Clarify the flag description

Signed-off-by: t-kikuc <[email protected]>

* fix error message:  'and' -> 'or'

Signed-off-by: t-kikuc <[email protected]>

---------

Signed-off-by: t-kikuc <[email protected]>
Signed-off-by: pipecd-bot <[email protected]>
t-kikuc added a commit that referenced this pull request Oct 8, 2024
#5263 (#5265)

* Fix panic in ECS driftdetection when a taskdef in livestates does not exist (#5240)

* Generate v0.49.x docs

Signed-off-by: t-kikuc <[email protected]>

* fix: avoid panic when live taskdef does not exist

Signed-off-by: t-kikuc <[email protected]>

---------

Signed-off-by: t-kikuc <[email protected]>
Signed-off-by: pipecd-bot <[email protected]>

* Upgrade aws-sdk-go-v2 (#5241)

* Generate v0.49.x docs

Signed-off-by: t-kikuc <[email protected]>

* upgrade aws-sdk-go-v2

Signed-off-by: t-kikuc <[email protected]>

* upgrade aws-sdk-go-v2/**/*

Signed-off-by: t-kikuc <[email protected]>

* fix compile errors caused by the breaking change

Signed-off-by: t-kikuc <[email protected]>

* fix a test due to added RestartPolicy

Signed-off-by: t-kikuc <[email protected]>

* fix: avoid panic when live taskdef does not exist

Signed-off-by: t-kikuc <[email protected]>

* fix go.sum by `make update/go-deps`

Signed-off-by: t-kikuc <[email protected]>

---------

Signed-off-by: t-kikuc <[email protected]>
Signed-off-by: pipecd-bot <[email protected]>

* Remove an unused field 'configFilePathInGitRepo' (#5248)

* Generate v0.49.x docs

Signed-off-by: t-kikuc <[email protected]>

* remove unused field 'configFilePathInGitRepo'

Signed-off-by: t-kikuc <[email protected]>

---------

Signed-off-by: t-kikuc <[email protected]>
Signed-off-by: pipecd-bot <[email protected]>

* Support fetching a piped config from AWS SSM Parameter Store (#5249)

* Generate v0.49.x docs

Signed-off-by: t-kikuc <[email protected]>

* add --aws-ssm-parameter

Signed-off-by: t-kikuc <[email protected]>

* add config-aws-ssm-parameter to piped

Signed-off-by: t-kikuc <[email protected]>

* update docs of runtime options

Signed-off-by: t-kikuc <[email protected]>

---------

Signed-off-by: t-kikuc <[email protected]>
Signed-off-by: pipecd-bot <[email protected]>

* Remove subnet ordering in head manifest (#5254)

Signed-off-by: HoangNguyen689 <[email protected]>
Signed-off-by: pipecd-bot <[email protected]>

* Update quickstart header note (#5255)

Signed-off-by: khanhtc1202 <[email protected]>
Signed-off-by: pipecd-bot <[email protected]>

* Update feature status (#5256)

Signed-off-by: khanhtc1202 <[email protected]>
Signed-off-by: pipecd-bot <[email protected]>

* Support directly designating a gitSSHKey instead of File for launcher (#5258)

* Generate v0.49.x docs

Signed-off-by: t-kikuc <[email protected]>

* add --git-ssh-key-env

Signed-off-by: t-kikuc <[email protected]>

* update docs: add '--git-ssh-key-env'

Signed-off-by: t-kikuc <[email protected]>

* add '\n' at the end of ssh key

Signed-off-by: t-kikuc <[email protected]>

* Directly use data instead of env

Signed-off-by: t-kikuc <[email protected]>

* Clarify the flag description

Signed-off-by: t-kikuc <[email protected]>

* fix error message:  'and' -> 'or'

Signed-off-by: t-kikuc <[email protected]>

---------

Signed-off-by: t-kikuc <[email protected]>
Signed-off-by: pipecd-bot <[email protected]>

* Add workflow steps to build and publish quickstart manifests (#5260)

Signed-off-by: pipecd-bot <[email protected]>

* Update workflow not to run by matrix (#5262)

Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Signed-off-by: pipecd-bot <[email protected]>

* Update RELEASE to v0.49.1 and update v0.49.x docs (#5263)

* update RELEASE to v0.49.1

Signed-off-by: t-kikuc <[email protected]>

* update docs of v0.49.x by `make release version=v0.49.1`

Signed-off-by: t-kikuc <[email protected]>

---------

Signed-off-by: t-kikuc <[email protected]>
Signed-off-by: pipecd-bot <[email protected]>

---------

Signed-off-by: t-kikuc <[email protected]>
Signed-off-by: pipecd-bot <[email protected]>
Signed-off-by: HoangNguyen689 <[email protected]>
Signed-off-by: khanhtc1202 <[email protected]>
Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Co-authored-by: Tetsuya Kikuchi <[email protected]>
Co-authored-by: HoangNguyen689 <[email protected]>
Co-authored-by: Khanh Tran <[email protected]>
Co-authored-by: Shinnosuke Sawada-Dazai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants