-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement fix for sles linux integ-test #278
base: main
Are you sure you want to change the base?
Conversation
dims []types.Dimension | ||
failed []dimension.Instruction | ||
) | ||
log.Println(fmt.Sprintf("OS VERSION IS %s", m.env.OS)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just
log.Println(fmt.Sprintf("OS VERSION IS %s", m.env.OS)) | |
log.Printf("OS VERSION IS %s\n", m.env.OS) |
failed []dimension.Instruction | ||
) | ||
log.Println(fmt.Sprintf("OS VERSION IS %s", m.env.OS)) | ||
if strings.Contains(m.env.OS, "sles") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - I'd prefer to use HasPrefix
} else { | ||
dims, failed = m.DimensionFactory.GetDimensions([]dimension.Instruction{ | ||
{ | ||
Key: "interface", | ||
Value: dimension.ExpectedDimensionValue{aws.String("docker0")}, | ||
}, | ||
{ | ||
Key: "InstanceId", | ||
Value: dimension.UnknownDimensionValue(), | ||
}, | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frankly we could consolidate this since the only thing that differs is the name of the expected dimension.
var dimName string
if strings.HasPrefix(m.env.OS, "sles") {
dimName = "eth0"
} else {
dimName = "docker0"
}
dims, failed = m.DimensionFactory.GetDimensions([]dimension.Instruction{
{
Key: "interface",
Value: dimension.ExpectedDimensionValue{&dimName},
},
{
Key: "InstanceId",
Value: dimension.UnknownDimensionValue(),
},
})
I was curious how the other tests are working with the docker0 interface since that isnt something available typically by default. And just noticed we have a docker component baked into our AMIs - which is missing from the SLES ones. So we should update those and not need these OS level overrides in code. |
Description of the issue
EC2 Linux SLES integ-tests were failing due to the test checking for the
docker0
interface dimension for the net plugin on all EC2 instances.SLES versions of Linux do not publish net metrics to
docker0
. They only publish to theeth0
interface dimension.Description of changes
This change passes the OS using terraform, allowing us to check for the
eth0
dimension when it's an SLES version of LinuxLicense
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
Successfully tested by running the workflow