Skip to content

Commit 5b20433

Browse files
author
Antoine Pelisse
committed
Add node and endpoints set golden-data
1 parent 9b4736e commit 5b20433

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

internal/cli/main_test.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,25 @@ func TestFieldSet(t *testing.T) {
197197
typeName: "io.k8s.api.core.v1.Pod",
198198
},
199199
expectedOutputPath: testdata("podset.json"),
200+
}, {
201+
options: Options{
202+
schemaPath: testdata("k8s-schema.yaml"),
203+
fieldset: testdata("node.yaml"),
204+
typeName: "io.k8s.api.core.v1.Node",
205+
},
206+
expectedOutputPath: testdata("nodeset.json"),
207+
}, {
208+
options: Options{
209+
schemaPath: testdata("k8s-schema.yaml"),
210+
fieldset: testdata("endpoints.yaml"),
211+
typeName: "io.k8s.api.core.v1.Endpoints",
212+
},
213+
expectedOutputPath: testdata("endpointsset.json"),
200214
}}
201215

202216
for _, tt := range cases {
203217
tt := tt
204-
t.Run(tt.options.fieldset, func(t *testing.T) {
218+
t.Run(tt.options.typeName, func(t *testing.T) {
205219
op, err := tt.options.Resolve()
206220
if err != nil {
207221
t.Fatal(err)

internal/testdata/endpointsset.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"f:apiVersion":{},"f:kind":{},"f:metadata":{"f:creationTimestamp":{},"f:labels":{"f:app":{},".":{}},"f:name":{},"f:namespace":{},"f:resourceVersion":{},"f:selfLink":{},"f:uid":{},".":{}},"f:subsets":{}}

internal/testdata/nodeset.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"f:apiVersion":{},"f:kind":{},"f:metadata":{"f:annotations":{"f:container.googleapis.com/instance_id":{},"f:node.alpha.kubernetes.io/ttl":{},"f:volumes.kubernetes.io/controller-managed-attach-detach":{},".":{}},"f:creationTimestamp":{},"f:labels":{"f:beta.kubernetes.io/arch":{},"f:beta.kubernetes.io/fluentd-ds-ready":{},"f:beta.kubernetes.io/instance-type":{},"f:beta.kubernetes.io/os":{},"f:cloud.google.com/gke-nodepool":{},"f:cloud.google.com/gke-os-distribution":{},"f:failure-domain.beta.kubernetes.io/region":{},"f:failure-domain.beta.kubernetes.io/zone":{},"f:kubernetes.io/hostname":{},".":{}},"f:name":{},"f:resourceVersion":{},"f:selfLink":{},"f:uid":{},".":{}},"f:spec":{"f:podCIDR":{},"f:providerID":{},".":{}},"f:status":{"f:addresses":{"k:{\"type\":\"ExternalIP\"}":{"f:address":{},"f:type":{},".":{}},"k:{\"type\":\"Hostname\"}":{"f:address":{},"f:type":{},".":{}},"k:{\"type\":\"InternalIP\"}":{"f:address":{},"f:type":{},".":{}},".":{}},"f:allocatable":{"f:cpu":{},"f:ephemeral-storage":{},"f:hugepages-2Mi":{},"f:memory":{},"f:pods":{},".":{}},"f:capacity":{"f:cpu":{},"f:ephemeral-storage":{},"f:hugepages-2Mi":{},"f:memory":{},"f:pods":{},".":{}},"f:conditions":{"k:{\"type\":\"CorruptDockerOverlay2\"}":{"f:lastHeartbeatTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{},".":{}},"k:{\"type\":\"DiskPressure\"}":{"f:lastHeartbeatTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{},".":{}},"k:{\"type\":\"FrequentContainerdRestart\"}":{"f:lastHeartbeatTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{},".":{}},"k:{\"type\":\"FrequentDockerRestart\"}":{"f:lastHeartbeatTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{},".":{}},"k:{\"type\":\"FrequentKubeletRestart\"}":{"f:lastHeartbeatTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{},".":{}},"k:{\"type\":\"FrequentUnregisterNetDevice\"}":{"f:lastHeartbeatTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{},".":{}},"k:{\"type\":\"KernelDeadlock\"}":{"f:lastHeartbeatTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{},".":{}},"k:{\"type\":\"MemoryPressure\"}":{"f:lastHeartbeatTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{},".":{}},"k:{\"type\":\"NetworkUnavailable\"}":{"f:lastHeartbeatTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{},".":{}},"k:{\"type\":\"OutOfDisk\"}":{"f:lastHeartbeatTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{},".":{}},"k:{\"type\":\"PIDPressure\"}":{"f:lastHeartbeatTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{},".":{}},"k:{\"type\":\"ReadonlyFilesystem\"}":{"f:lastHeartbeatTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{},".":{}},"k:{\"type\":\"Ready\"}":{"f:lastHeartbeatTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{},".":{}},".":{}},"f:daemonEndpoints":{"f:kubeletEndpoint":{"f:Port":{},".":{}},".":{}},"f:images":{},"f:nodeInfo":{"f:architecture":{},"f:bootID":{},"f:containerRuntimeVersion":{},"f:kernelVersion":{},"f:kubeProxyVersion":{},"f:kubeletVersion":{},"f:machineID":{},"f:operatingSystem":{},"f:osImage":{},"f:systemUUID":{},".":{}},"f:volumesAttached":{},"f:volumesInUse":{},".":{}}}

0 commit comments

Comments
 (0)