Skip to content

Commit

Permalink
Fix node info not filling
Browse files Browse the repository at this point in the history
  • Loading branch information
wzshiming committed May 13, 2024
1 parent 3b622ae commit 8f7fefc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
25 changes: 13 additions & 12 deletions kustomize/stage/node/fast/node-initialize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,18 @@ spec:
memory: 1Ti
pods: 1M
{{ end }}
{{ with .status.nodeInfo }}
{{ $nodeInfo := .status.nodeInfo }}
{{ $kwokVersion := printf "kwok-%s" Version }}
nodeInfo:
architecture: {{ with .architecture }} {{ . }} {{ else }} "amd64" {{ end }}
bootID: {{ with .bootID }} {{ . }} {{ else }} "" {{ end }}
containerRuntimeVersion: {{ with .containerRuntimeVersion }} {{ . }} {{ else }} "kwok-{{ Version }}" {{ end }}
kernelVersion: {{ with .kernelVersion }} {{ . }} {{ else }} "kwok-{{ Version }}" {{ end }}
kubeProxyVersion: {{ with .kubeProxyVersion }} {{ . }} {{ else }} "kwok-{{ Version }}" {{ end }}
kubeletVersion: {{ with .kubeletVersion }} {{ . }} {{ else }} "kwok-{{ Version }}" {{ end }}
machineID: {{ with .machineID }} {{ . }} {{ else }} "" {{ end }}
operatingSystem: {{ with .operatingSystem }} {{ . }} {{ else }} "linux" {{ end }}
osImage: {{ with .osImage }} {{ . }} {{ else }} "" {{ end }}
systemUUID: {{ with .systemUUID }} {{ . }} {{ else }} "" {{ end }}
{{ end }}
architecture: {{ or $nodeInfo.architecture "amd64" }}
bootID: {{ or $nodeInfo.bootID `""` }}
containerRuntimeVersion: {{ or $nodeInfo.containerRuntimeVersion $kwokVersion }}
kernelVersion: {{ or $nodeInfo.kernelVersion $kwokVersion }}
kubeProxyVersion: {{ or $nodeInfo.kubeProxyVersion $kwokVersion }}
kubeletVersion: {{ or $nodeInfo.kubeletVersion $kwokVersion }}
machineID: {{ or $nodeInfo.machineID `""` }}
operatingSystem: {{ or $nodeInfo.operatingSystem "linux" }}
osImage: {{ or $nodeInfo.osImage `""` }}
systemUUID: {{ or $nodeInfo.systemUUID `""` }}
phase: Running
11 changes: 11 additions & 0 deletions kustomize/stage/node/fast/testdata/node-pending.output.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ stages:
daemonEndpoints:
kubeletEndpoint:
Port: <NodePort>
nodeInfo:
architecture: amd64
bootID: ""
containerRuntimeVersion: kwok-<Version>
kernelVersion: kwok-<Version>
kubeProxyVersion: kwok-<Version>
kubeletVersion: kwok-<Version>
machineID: ""
operatingSystem: linux
osImage: ""
systemUUID: ""
phase: Running
kind: patch
subresource: status
Expand Down

0 comments on commit 8f7fefc

Please sign in to comment.