-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
enhancementNew feature or requestNew feature or request
Description
👋 howdy, team (cc: @kunisen @jakommo 🙏!)
AFAICT, currently in order to determine the running ECK version, we have to regex search ECK version is (.+?)\n from under eck-diagnostics.log which emits from this code:
eck-diagnostics/internal/version.go
Lines 25 to 31 in f532395
| func logVersion(v *version.Version) { | |
| s := v.String() | |
| if v == fallbackMaxVersion { | |
| s = "unknown" | |
| } | |
| logger.Printf("ECK version is %s\n", s) | |
| } |
Will you kindly consider expanding the version.json file to include this content, likely by extending this code:
eck-diagnostics/internal/kubectl.go
Lines 453 to 482 in f532395
| // versionInfo exists to marshal both eck-diagnostics version information and K8s server version information. | |
| type versionInfo struct { | |
| DiagnosticsVersion DiagnosticsVersion | |
| ServerVersion *version.Info | |
| } | |
| // Version is inspired by "kubectl version" but includes version information about this tool in addition to K8s | |
| // server version information. | |
| func (c Kubectl) Version(out io.Writer) error { | |
| v := versionInfo{ | |
| DiagnosticsVersion: about(), | |
| } | |
| client, err := c.factory.ToDiscoveryClient() | |
| if err != nil { | |
| return err | |
| } | |
| // mirroring kubectl behaviour to fetch fresh data from server | |
| client.Invalidate() | |
| serverVersion, err := client.ServerVersion() | |
| if err != nil { | |
| return err | |
| } | |
| v.ServerVersion = serverVersion | |
| bytes, err := json.MarshalIndent(v, "", " ") | |
| if err != nil { | |
| return err | |
| } | |
| _, err = out.Write(bytes) | |
| return err | |
| } |
Example diagnostic of current state:
I was told after filing this ballpark also potentially comes through in a lower file; however, since the namespace can be dynamic requesting in a root-folder file:
$ cat ./elastic-system/configmaps.json | jq '.items[]|select(.metadata.name=="elastic-operator")|.metadata.labels."app.kubernetes.io/version"'
"2.10.0"
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
