Merge pull request #13592 from hakman/fix_metadata_obj_type

Fix unexpected type for object metadata when using gossip DNS
This commit is contained in:
Kubernetes Prow Robot 2022-05-03 04:47:55 -07:00 committed by GitHub
commit ec7545f30a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ func KubeObjectToApplyYAML(data runtime.Object) (string, error) {
// Remove metadata.creationTimestamp (can't be applied, shouldn't be specified)
metadataObj, found := jsonObj["metadata"]
if found {
if metadata, ok := metadataObj.(map[interface{}]interface{}); ok {
if metadata, ok := metadataObj.(map[string]interface{}); ok {
delete(metadata, "creationTimestamp")
} else {
klog.Warningf("unexpected type for object metadata: %T", metadataObj)