diff --git a/pkg/common/common.go b/pkg/common/common.go index a02616c2ef..8993f48913 100644 --- a/pkg/common/common.go +++ b/pkg/common/common.go @@ -60,6 +60,9 @@ const ( // AnnotationCloudProvider is the annotation to specify the cloudprovider the testrun is testing AnnotationCloudProvider = "metadata.testmachinery.gardener.cloud/cloudprovider" + // AnnotationContainerRuntime is the annotation to specify the container runtime of the shoot nodes the testrun is testing + AnnotationContainerRuntime = "metadata.testmachinery.gardener.cloud/container-runtime" + // AnnotationOperatingSystem is the annotation to specify the operating system of the shoot nodes the testrun is testing AnnotationOperatingSystem = "metadata.testmachinery.gardener.cloud/operating-system" diff --git a/pkg/testmachinery/collector/precompute.go b/pkg/testmachinery/collector/precompute.go index cb02ce0043..bf941c3464 100644 --- a/pkg/testmachinery/collector/precompute.go +++ b/pkg/testmachinery/collector/precompute.go @@ -82,6 +82,9 @@ func PreComputeTeststepFields(phase argov1.NodePhase, meta metadata.Metadata, cl if meta.AllowPrivilegedContainers != nil && !*meta.AllowPrivilegedContainers { providerEnhanced += "(NoPrivCtrs)" } + if meta.ContainerRuntime != "" { + providerEnhanced += fmt.Sprintf("{%s}", meta.ContainerRuntime) + } preComputed.ProviderEnhanced = providerEnhanced return &preComputed diff --git a/pkg/testmachinery/metadata/metadata.go b/pkg/testmachinery/metadata/metadata.go index 96072de8d1..f248065171 100644 --- a/pkg/testmachinery/metadata/metadata.go +++ b/pkg/testmachinery/metadata/metadata.go @@ -31,6 +31,7 @@ func (m *Metadata) CreateAnnotations() map[string]string { common.AnnotationCloudProvider: m.CloudProvider, common.AnnotationOperatingSystem: m.OperatingSystem, common.AnnotationOperatingSystemVersion: m.OperatingSystemVersion, + common.AnnotationContainerRuntime: m.ContainerRuntime, common.AnnotationRegion: m.Region, common.AnnotationZone: m.Zone, common.AnnotationFlavorDescription: m.FlavorDescription, @@ -77,6 +78,7 @@ func FromTestrun(tr *tmv1beta1.Testrun) *Metadata { CloudProvider: tr.Annotations[common.AnnotationCloudProvider], OperatingSystem: tr.Annotations[common.AnnotationOperatingSystem], OperatingSystemVersion: tr.Annotations[common.AnnotationOperatingSystemVersion], + ContainerRuntime: tr.Annotations[common.AnnotationContainerRuntime], Region: tr.Annotations[common.AnnotationRegion], Zone: tr.Annotations[common.AnnotationZone], FlavorDescription: tr.Annotations[common.AnnotationFlavorDescription], diff --git a/pkg/testmachinery/metadata/types.go b/pkg/testmachinery/metadata/types.go index 374785320b..5c15db3aa5 100644 --- a/pkg/testmachinery/metadata/types.go +++ b/pkg/testmachinery/metadata/types.go @@ -28,6 +28,7 @@ type Metadata struct { // todo: schrodit - add support to better persist multiple worker pools with multiple oss, versions and zones OperatingSystem string `json:"operating_system,omitempty"` OperatingSystemVersion string `json:"operating_system_version,omitempty"` + ContainerRuntime string `json:"container_runtime,omitempty"` Zone string `json:"zone,omitempty"` AllowPrivilegedContainers *bool `json:"allow_privileged_containers,omitempty"` ShootAnnotations map[string]string `json:"shoot_annotations,omitempty"` diff --git a/pkg/testrunner/template/values.go b/pkg/testrunner/template/values.go index 5d2543e687..1537773214 100644 --- a/pkg/testrunner/template/values.go +++ b/pkg/testrunner/template/values.go @@ -177,6 +177,7 @@ func (r *shootValueRenderer) GetMetadata(shoot *common.ExtendedShoot) (*metadata AllowPrivilegedContainers: shoot.AllowPrivilegedContainers, OperatingSystem: shoot.Workers[0].Machine.Image.Name, // todo: check if there a possible multiple workerpools with different images OperatingSystemVersion: operatingsystemversion, + ContainerRuntime: string(shoot.Workers[0].CRI.Name), Annotations: shoot.AdditionalAnnotations, }, nil }