mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +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
|
test/integration/ttlcontroller
|
||||||
vendor/k8s.io/apimachinery/pkg/api/apitesting/roundtrip
|
vendor/k8s.io/apimachinery/pkg/api/apitesting/roundtrip
|
||||||
vendor/k8s.io/apimachinery/pkg/api/meta
|
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/unstructured/unstructuredscheme
|
||||||
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation
|
vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation
|
||||||
vendor/k8s.io/apimachinery/pkg/conversion
|
vendor/k8s.io/apimachinery/pkg/conversion
|
||||||
|
@ -282,14 +282,6 @@ func getNestedString(obj map[string]interface{}, fields ...string) string {
|
|||||||
return val
|
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 {
|
func getNestedInt64Pointer(obj map[string]interface{}, fields ...string) *int64 {
|
||||||
val, found, err := NestedInt64(obj, fields...)
|
val, found, err := NestedInt64(obj, fields...)
|
||||||
if !found || err != nil {
|
if !found || err != nil {
|
||||||
|
@ -71,7 +71,7 @@ func TestEmptyCreationTimestampIsOmitted(t *testing.T) {
|
|||||||
// set an initial creationTimestamp and ensure the field exists
|
// set an initial creationTimestamp and ensure the field exists
|
||||||
u.SetCreationTimestamp(now)
|
u.SetCreationTimestamp(now)
|
||||||
metadata := u.Object["metadata"].(map[string]interface{})
|
metadata := u.Object["metadata"].(map[string]interface{})
|
||||||
creationTimestamp, exists := metadata["creationTimestamp"]
|
_, exists := metadata["creationTimestamp"]
|
||||||
if !exists {
|
if !exists {
|
||||||
t.Fatalf("unexpected missing creationTimestamp")
|
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
|
// set an empty timestamp and ensure the field no longer exists
|
||||||
u.SetCreationTimestamp(metav1.Time{})
|
u.SetCreationTimestamp(metav1.Time{})
|
||||||
metadata = u.Object["metadata"].(map[string]interface{})
|
metadata = u.Object["metadata"].(map[string]interface{})
|
||||||
creationTimestamp, exists = metadata["creationTimestamp"]
|
creationTimestamp, exists := metadata["creationTimestamp"]
|
||||||
if exists {
|
if exists {
|
||||||
t.Errorf("unexpected creation timestamp field: %q", creationTimestamp)
|
t.Errorf("unexpected creation timestamp field: %q", creationTimestamp)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user