mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #93871 from habibrosyad/patch-92402-4
fix vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured staticcheck
This commit is contained in:
commit
07110b7b34
@ -15,7 +15,6 @@ test/integration/scheduler_perf
|
||||
test/integration/ttlcontroller
|
||||
vendor/k8s.io/apimachinery/pkg/api/apitesting/roundtrip
|
||||
vendor/k8s.io/apimachinery/pkg/api/meta
|
||||
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured
|
||||
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructuredscheme
|
||||
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation
|
||||
vendor/k8s.io/apimachinery/pkg/conversion
|
||||
|
@ -282,14 +282,6 @@ func getNestedString(obj map[string]interface{}, fields ...string) string {
|
||||
return val
|
||||
}
|
||||
|
||||
func getNestedInt64(obj map[string]interface{}, fields ...string) int64 {
|
||||
val, found, err := NestedInt64(obj, fields...)
|
||||
if !found || err != nil {
|
||||
return 0
|
||||
}
|
||||
return val
|
||||
}
|
||||
|
||||
func getNestedInt64Pointer(obj map[string]interface{}, fields ...string) *int64 {
|
||||
val, found, err := NestedInt64(obj, fields...)
|
||||
if !found || err != nil {
|
||||
|
@ -71,7 +71,7 @@ func TestEmptyCreationTimestampIsOmitted(t *testing.T) {
|
||||
// set an initial creationTimestamp and ensure the field exists
|
||||
u.SetCreationTimestamp(now)
|
||||
metadata := u.Object["metadata"].(map[string]interface{})
|
||||
creationTimestamp, exists := metadata["creationTimestamp"]
|
||||
_, exists := metadata["creationTimestamp"]
|
||||
if !exists {
|
||||
t.Fatalf("unexpected missing creationTimestamp")
|
||||
}
|
||||
@ -79,7 +79,7 @@ func TestEmptyCreationTimestampIsOmitted(t *testing.T) {
|
||||
// set an empty timestamp and ensure the field no longer exists
|
||||
u.SetCreationTimestamp(metav1.Time{})
|
||||
metadata = u.Object["metadata"].(map[string]interface{})
|
||||
creationTimestamp, exists = metadata["creationTimestamp"]
|
||||
creationTimestamp, exists := metadata["creationTimestamp"]
|
||||
if exists {
|
||||
t.Errorf("unexpected creation timestamp field: %q", creationTimestamp)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user