Skip to content

Commit

Permalink
Set the indentation in the yaml encoding of aws subnets
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewuolle committed Nov 30, 2024
1 parent 24a4118 commit 17231b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions test/e2e/managedcluster/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package aws

import (
"bytes"
"context"

. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -65,9 +66,13 @@ func PopulateHostedTemplateVars(ctx context.Context, kc *kubeclient.KubeClient,
}
}

subnetYaml, err := yaml.Marshal(subnetMaps)
buf := bytes.Buffer{}
enc := yaml.NewEncoder(&buf)
enc.SetIndent(5)
err = enc.Encode(&subnetMaps)
Expect(err).NotTo(HaveOccurred(), "failed to get marshall subnet maps")
GinkgoT().Setenv(managedcluster.EnvVarAWSSubnets, string(subnetYaml))
subnetYaml := buf.String()
GinkgoT().Setenv(managedcluster.EnvVarAWSSubnets, subnetYaml)

securityGroupID, found, err := unstructured.NestedString(
awsCluster.Object, "status", "networkStatus", "securityGroups", "node", "id")
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/managedcluster/resources/aws-hosted-cp.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
vpcID: ${AWS_VPC_ID}
region: ${AWS_REGION}
subnets:
${AWS_SUBNETS}
${AWS_SUBNETS}
instanceType: ${AWS_INSTANCE_TYPE:=t3.medium}
securityGroupIDs:
- ${AWS_SG_ID}

0 comments on commit 17231b6

Please sign in to comment.