Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions k8s/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

// GetPodSpec extracts the PodSpec from a Kubernetes object
func GetPodSpec(obj interface{}) (*corev1.PodSpec, error) {
func GetPodSpec(obj any) (*corev1.PodSpec, error) {
switch resource := obj.(type) {
case *corev1.Pod:
return &resource.Spec, nil
Expand Down Expand Up @@ -38,7 +38,7 @@ func GetContainerImages(containers []corev1.Container) []string {
return images
}

func GetContainersFromObject(obj interface{}) ([]corev1.Container, error) {
func GetContainersFromObject(obj any) ([]corev1.Container, error) {
podSpec, err := GetPodSpec(obj)
if err != nil {
return nil, err
Expand Down
6 changes: 3 additions & 3 deletions k8s/k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
func TestGetPodSpec(t *testing.T) {
tests := []struct {
name string
obj interface{}
obj any
wantErr bool
}{
{"Pod", &corev1.Pod{}, false},
Expand Down Expand Up @@ -75,7 +75,7 @@ func TestGetPodSpecSupported(t *testing.T) {

tests := []struct {
name string
obj interface{}
obj any
}{
{"Deployment", &appsv1.Deployment{
Spec: appsv1.DeploymentSpec{
Expand Down Expand Up @@ -176,7 +176,7 @@ func TestGetContainerImages(t *testing.T) {
func TestGetContainersFromObject(t *testing.T) {
tests := []struct {
name string
obj interface{}
obj any
want []corev1.Container
wantErr bool
}{
Expand Down
Loading