Skip to content

Commit 8d9266a

Browse files
authored
docs: record the symbol moves and behaviour changes from the v2 beta (#1882)
* docs: record the symbol moves and behaviour changes from the v2 beta v2-import-map.md is the artifact people migrate from, and it covered import paths only. It was also marked FROZEN without qualification, which reads as 'this is the whole migration'. It is not: #1877 moved eight functions between modules, and #1878 and #1879 changed two behaviours. Add a relocation table, a note on what deliberately stayed in teststructure and why the churn is small, a qualifier swap recipe with the two cases where a blind find and replace goes wrong, and a section on the ExternalIP preference and the RestConfig serialization error. Rescope the FROZEN note to import paths. Every symbol in the table was checked against the merged code. * chore: trim prose * chore: trim prose
1 parent 60904a4 commit 8d9266a

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

docs/v2-import-map.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Terratest v2 Import Map
22

3-
Status: FROZEN. The one open decision (renames) is resolved: the three hyphenated packages are renamed to idiomatic Go names at the `/v2` boundary.
3+
Status: FROZEN for import paths. The one open decision (renames) is resolved: the three hyphenated packages are renamed to idiomatic Go names at the `/v2` boundary.
4+
5+
Some symbols also moved between modules during the beta. See [Symbols relocated during the v2 beta](#symbols-relocated-during-the-v2-beta).
46

57
Built from the actual v1 layout at tag `v1.0.1-test` (27 `modules/` packages, 2 `cmd/` binaries, 1 `internal/lib` tree).
68

@@ -66,6 +68,31 @@ So e.g. `modules/logger/parser` -> `modules/core/v2/logger/parser`, `modules/aws
6668
|---|---|
6769
| `internal/lib/formatting` | `internal/formatting` |
6870

71+
## Symbols relocated during the v2 beta
72+
73+
Moved to the module owning the type, so `teststructure` no longer requires `aws`, `k8s`, `packer` and `ssh` (#1877).
74+
Signatures and on-disk filenames are unchanged, and every call site is a compile error.
75+
76+
| beta.1 | beta.2 onwards |
77+
|---|---|
78+
| `teststructure.{Save,Load}Ec2KeyPair` | `aws.{Save,Load}Ec2KeyPair` |
79+
| `teststructure.{Save,Load}KubectlOptions` | `k8s.{Save,Load}KubectlOptions` |
80+
| `teststructure.{Save,Load}PackerOptions` | `packer.{Save,Load}PackerOptions` |
81+
| `teststructure.{Save,Load}SSHKeyPair` | `ssh.{Save,Load}SSHKeyPair` |
82+
83+
Nothing else moved. Watch for files that alias Terratest's `aws` because plain `aws` is the AWS SDK.
84+
85+
## Behaviour changes during the v2 beta
86+
87+
**Node addresses prefer `ExternalIP`** (#1878). `k8s.FindNodeHostnameContextE` and `GetServiceEndpoint` (NodePort)
88+
now return the Node's `ExternalIP` when present, falling back to the internal hostname as before. On EKS that is the
89+
public IP, so no EC2 call and no `ec2:DescribeInstances` permission is needed. Signatures are unchanged; the new
90+
`FindNodeHostnameWithOptionsContext[E]` consults `NodePublicIPLookup` for clusters with no `ExternalIP`.
91+
92+
**`KubectlOptions` carrying a `RestConfig` no longer serializes** (#1879). `MarshalJSON` returns
93+
`k8s.ErrRestConfigNotSerializable` instead of dropping the config. This already failed, with an opaque
94+
`json: unsupported type: transport.WrapperFunc`. Use `NewKubectlOptions` or `NewKubectlOptionsWithInClusterAuth`.
95+
6996
## Accounting
7097

7198
27 `modules/` packages = 6 collapsed into core + 15 standalone submodules + 6 removed. Plus 2 removed `cmd/` binaries and 1 internal flatten. Submodule count: 16.

0 commit comments

Comments
 (0)