-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f93790e
commit 3844f99
Showing
12 changed files
with
94 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
kubernetes/src/main/java/io/kubernetes/client/gson/V1MetadataExclusionStrategy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
Copyright 2024 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
package io.kubernetes.client.gson; | ||
|
||
import com.google.gson.ExclusionStrategy; | ||
import com.google.gson.FieldAttributes; | ||
import io.kubernetes.client.openapi.models.V1ObjectMeta; | ||
|
||
public class V1MetadataExclusionStrategy implements com.google.gson.ExclusionStrategy { | ||
public boolean shouldSkipField(FieldAttributes f) { | ||
// Don't serialize the 'managedFields' field. | ||
return (f.getDeclaringClass().equals(V1ObjectMeta.class) && f.getName().equalsIgnoreCase("managedFields")); | ||
} | ||
|
||
public boolean shouldSkipClass(Class<?> clazz) { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1ListMeta.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1ListMeta.java | ||
index 60381b312..7fb47e230 100644 | ||
index f161284a2..d3d563bbb 100644 | ||
--- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1ListMeta.java | ||
+++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1ListMeta.java | ||
@@ -266,7 +266,9 @@ public class V1ListMeta { | ||
@@ -258,7 +258,8 @@ public class V1ListMeta { | ||
@Override | ||
public V1ListMeta read(JsonReader in) throws IOException { | ||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); | ||
- validateJsonObject(jsonObj); | ||
+ | ||
JsonElement jsonElement = elementAdapter.read(in); | ||
- validateJsonElement(jsonElement); | ||
+ // Disable validation so delete API can tolerate non-status return object (graceful deletion) | ||
+ // validateJsonObject(jsonObj); | ||
return thisAdapter.fromJsonTree(jsonObj); | ||
return thisAdapter.fromJsonTree(jsonElement); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
diff --git a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1Status.java b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1Status.java | ||
index b2b6db803..8a8a9765d 100644 | ||
index b529e3455..c2268419a 100644 | ||
--- a/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1Status.java | ||
+++ b/kubernetes/src/main/java/io/kubernetes/client/openapi/models/V1Status.java | ||
@@ -394,7 +394,8 @@ public class V1Status { | ||
@@ -378,7 +378,8 @@ public class V1Status { | ||
@Override | ||
public V1Status read(JsonReader in) throws IOException { | ||
JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); | ||
- validateJsonObject(jsonObj); | ||
JsonElement jsonElement = elementAdapter.read(in); | ||
- validateJsonElement(jsonElement); | ||
+ // Disable validation so delete API can tolerate non-status return object (graceful deletion) | ||
+ // validateJsonObject(jsonObj); | ||
return thisAdapter.fromJsonTree(jsonObj); | ||
return thisAdapter.fromJsonTree(jsonElement); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters