mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
relax kube api data type validation (to allow metrics-server resources) (#2744)
* relax kube api data type validation (to allow metrics-server resources) Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * removed a few now incorrect tests Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com> * correct PodMetrics kind Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
1 parent
619b66c5d5
commit
c0dddc0f40
3 files changed
+19
-17
No files matched your search
@@ -107,19 +107,6 @@ describe("KubeObject", () => {
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
type TestCase = [string, any];
|
||||
const tests: TestCase[] = [
|
||||
["metadata.uid", { kind: "", apiVersion: "", metadata: { name: "", resourceVersion: "", selfLink: ""} }],
|
||||
["metadata.name", { kind: "", apiVersion: "", metadata: { uid: "", resourceVersion: "", selfLink: "" } }],
|
||||
["metadata.resourceVersion", { kind: "", apiVersion: "", metadata: { uid: "", name: "", selfLink: "" } }],
|
||||
];
|
||||
|
||||
it.each(tests)("should reject with missing non-top level field: %s", (missingField, input) => {
|
||||
expect(KubeObject.isPartialJsonApiData(input)).toBe(false);
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
type TestCase = [string, any];
|
||||
const tests: TestCase[] = [
|
||||
@@ -192,7 +179,6 @@ describe("KubeObject", () => {
|
||||
["kind", { apiVersion: "", items: [], metadata: { resourceVersion: "", selfLink: "" } }],
|
||||
["apiVersion", { kind: "", items: [], metadata: { resourceVersion: "", selfLink: "" } }],
|
||||
["metadata", { kind: "", items: [], apiVersion: "" }],
|
||||
["metadata.resourceVersion", { kind: "", items: [], apiVersion: "", metadata: { selfLink: "" } }],
|
||||
];
|
||||
|
||||
it.each(tests)("should reject with missing: %s", (missingField, input) => {
|
||||
|
||||
Reference in new issue
Block a user