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

fix(iam_ssh_key): do not read public key in resource #2695

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Codelax
Copy link
Member

@Codelax Codelax commented Aug 7, 2024

This caused the value to differ from requested input and this can lead to issue in terraform if the value is used in other resources.
Also as it cannot be updated, it seems right to assume the local key is the correct key

This caused the value to differ from requested input and this can lead to issue in terraform if the value is used in other resources.
Also as it cannot be updated, it seems right to assume the local key is the correct key
@Codelax Codelax added bug iam IAM issues, bugs and feature requests labels Aug 7, 2024
@Codelax Codelax self-assigned this Aug 7, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 69.56522% with 7 lines in your changes missing coverage. Please review.

Project coverage is 71.02%. Comparing base (fe86049) to head (2816600).
Report is 139 commits behind head on master.

Files Patch % Lines
internal/services/iam/ssh_key_data_source.go 70.58% 4 Missing and 1 partial ⚠️
internal/services/iam/ssh_key.go 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2695      +/-   ##
==========================================
- Coverage   71.43%   71.02%   -0.42%     
==========================================
  Files         277      334      +57     
  Lines       35875    33511    -2364     
==========================================
- Hits        25628    23800    -1828     
+ Misses       8028     7402     -626     
- Partials     2219     2309      +90     

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

@@ -55,6 +55,14 @@ func ResourceSSKKey() *schema.Resource {
areEqual := bytes.Equal(marshalledOldValue, marshalledNewValue)
return areEqual
},
StateFunc: func(v interface{}) string {
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a bit of documentation explaining that the last part of the public key will be trimmed.

@remyleone remyleone marked this pull request as draft August 7, 2024 14:04
@remyleone
Copy link
Member

Could you do additional testing to ensure that the formatting happening in the terraform state is consistant with the key stored on the IAM backend?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug iam IAM issues, bugs and feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants