Skip to content

Commit

Permalink
test: add failure test with an image with a digest
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercoll committed Nov 8, 2024
1 parent 1c2f322 commit e47aa1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ resourceMetrics:
stringValue: container-id
- key: container.image.name
value:
stringValue: container-image-name
stringValue: docker.io/otel/test-image
- key: container.image.tag
value:
stringValue: latest
Expand Down
5 changes: 3 additions & 2 deletions receiver/k8sclusterreceiver/internal/testutils/objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func NewPodSpecWithContainer(containerName string) *corev1.PodSpec {
Containers: []corev1.Container{
{
Name: containerName,
Image: "container-image-name",
Image: "docker.io/otel/test-image@sha256:22eeed9e66facc651d4344ef7d9ce912fccff5bb3969e745eed3ab953f309534",
Resources: corev1.ResourceRequirements{
Limits: corev1.ResourceList{
corev1.ResourceCPU: *resource.NewQuantity(20, resource.DecimalSI),
Expand All @@ -254,7 +254,7 @@ func NewPodStatusWithContainer(containerName, containerID string) *corev1.PodSta
Name: containerName,
Ready: true,
RestartCount: 3,
Image: "container-image-name",
Image: "docker.io/otel/test-image@sha256:22eeed9e66facc651d4344ef7d9ce912fccff5bb3969e745eed3ab953f309534",
ContainerID: containerID,
State: corev1.ContainerState{
Running: &corev1.ContainerStateRunning{},
Expand Down Expand Up @@ -288,6 +288,7 @@ func NewEvictedTerminatedPodStatusWithContainer(containerName, containerID strin
},
}
}

func WithOwnerReferences(or []v1.OwnerReference, obj any) any {
switch o := obj.(type) {
case *corev1.Pod:
Expand Down

0 comments on commit e47aa1a

Please sign in to comment.