-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/types/installconfig: Add an (*InstallConfig).Tags() helper
AWS resources created by the cluster (e.g. the machine-API operator creating workers) are currently missing the tectonicClusterID tag [1], which makes cleanup difficult. This helper makes it easy for those external tools to set the appropriate tags without needing local logic to generate them. [1]: #458 (comment)
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package types | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestTags(t *testing.T) { | ||
config := &InstallConfig{ | ||
ClusterID: "123", | ||
Platform: Platform{ | ||
AWS: &AWSPlatform{ | ||
UserTags: map[string]string{ | ||
"abc": "def", | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
expected := map[string]string{ | ||
"abc": "def", | ||
"tectonicClusterID": "123", | ||
} | ||
|
||
assert.Equal(t, expected, config.Tags()) | ||
} |