import statement metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" is throwing k8s.io/apimachinery/pkg/util/clock: module k8s.io/apimachinery@latest found (v0.25.4), but does not contain package k8s.io/apimachinery/pkg/util/clock error #602
-
Hi All, I created terratest go language script for validating kubernetees pods and services
I am using below import statement for utlizing/invoking ListPods and ListServices functions
When i run below command then go.mod file is getting generated successfully without any error
But when i run ANY of below command then i am getting error as k8s.io/apimachinery/pkg/util/clock: module k8s.io/apimachinery@latest found (v0.25.4), but does not contain package k8s.io/apimachinery/pkg/util/clock
Below is my go version
Link and screenshot mentioned here https://github.com/gruntwork-io/terratest/blob/6fb86056797e3e62ebdd9011ba26605e0976a6f8/modules/k8s/pod_test.go#L20 is throwing error import statement metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" is throwing k8s.io/apimachinery/pkg/util/clock: module k8s.io/apimachinery@latest found (v0.25.4), but does not contain package k8s.io/apimachinery/pkg/util/clock error Please help me at earliset as it is blocked for my Hackfest project accomplishment This was working earlier around couple of months back but NOT working now :( |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
hi,
|
Beta Was this translation helpful? Give feedback.
hi,
usually, I fix this by locking dependencies versions, apimachinery in this case(maybe k8s api and client-go too):
go.sum
go.mod
set the same versions as in terratest https://github.com/gruntwork-io/terratest/blob/master/go.mod#L47go mod tidy -compat=1.17