Skip to content

Commit

Permalink
test: Instance profiles on EC2NodeClass to allow for cleanup (#5000)
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam authored Nov 1, 2023
1 parent db13430 commit dcb2843
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions test/pkg/environment/aws/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ func GetTimeStreamAPI(session *session.Session) timestreamwriteiface.TimestreamW
func (env *Environment) DefaultEC2NodeClass() *v1beta1.EC2NodeClass {
nodeClass := test.EC2NodeClass()
nodeClass.Spec.AMIFamily = &v1beta1.AMIFamilyAL2
nodeClass.Spec.Tags = map[string]string{
"testing/cluster": env.ClusterName,
}
nodeClass.Spec.SecurityGroupSelectorTerms = []v1beta1.SecurityGroupSelectorTerm{
{
Tags: map[string]string{"karpenter.sh/discovery": env.ClusterName},
Expand Down
4 changes: 2 additions & 2 deletions test/suites/beta/integration/tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (
var _ = Describe("Tags", func() {
Context("Static Tags", func() {
It("should tag all associated resources", func() {
nodeClass.Spec.Tags = map[string]string{"TestTag": "TestVal"}
nodeClass.Spec.Tags["TestTag"] = "TestVal"
pod := coretest.Pod()

env.ExpectCreated(pod, nodeClass, nodePool)
Expand Down Expand Up @@ -72,7 +72,7 @@ var _ = Describe("Tags", func() {

It("shouldn't overwrite custom Name tags", func() {
nodeClass = test.EC2NodeClass(*nodeClass, v1beta1.EC2NodeClass{Spec: v1beta1.EC2NodeClassSpec{
Tags: map[string]string{"Name": "custom-name"},
Tags: map[string]string{"Name": "custom-name", "testing/cluster": env.ClusterName},
}})
nodePool = coretest.NodePool(*nodePool, corev1beta1.NodePool{
Spec: corev1beta1.NodePoolSpec{
Expand Down

0 comments on commit dcb2843

Please sign in to comment.