fix: three TencentCloud plugin bugs - #165
Open
susunola wants to merge 1 commit into
Open
Conversation
1. Fix credential parsing crash (hashicorp#147): Handle non-string values in tccli OAuth credential files (e.g. float64 expiresAt, nested oauth object) by using safe type assertions instead of bare .(string) casts. 2. Fix duplicate key pair in parallel builds (hashicorp#136): Use 18 chars of UUID without dashes instead of just 8 timestamp-only chars. This includes the clock_seq portion which is unique per build even when started at the same timestamp, preventing InvalidKeyPairName.Duplicate. 3. Add CLOUD_BSSD and CLOUD_HSSD disk types (hashicorp#132): These disk types are required by newer instance families like SA5. Without them, Packer rejects valid configurations.
susunola
force-pushed
the
fix/tencentcloud-bugs
branch
from
August 11, 2026 05:00
5271dd4 to
51e6ba7
Compare
This was referenced Aug 11, 2026
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.
Summary
This PR fixes three outstanding bugs in the TencentCloud plugin.
1. Fix credential parsing crash (closes #147)
The plugin panics when
tccli auth logingenerates credential files with non-string values (e.g., float64expiresAt, nestedoauthobject). All bare.(string)type assertions inaccess_config.goare replaced with safeok-checked versions.Before:
v.(string)→ panicAfter:
v, ok := v.(string)→ gracefully skip non-string values2. Fix duplicate key pair in parallel builds (closes #136)
uuid.TimeOrderedUUID()[:8]only captures the timestamp low 32 bits. Two builds started at the same second will generate colliding key pair names →InvalidKeyPairName.Duplicate.Fix: Use 18 hex chars (time_low + time_mid + time_hi_and_version + first byte of clock_seq) instead of 8. The clock_seq portion is unique per UUID generation call, so even builds at the exact same timestamp never collide. Total name length remains within Tencent Cloud key pair name limit.
3. Add CLOUD_BSSD and CLOUD_HSSD disk types (closes #132, closes #133)
These disk types are required by newer instance families (e.g., SA5). Without them, Packer rejects valid configurations with
specified disk_type is invalid.Testing
go build ./...✓go test ./...✓ (all existing tests pass)