MCPcopy
hub / github.com/kubernetes/client-go / ServerVersion

Method ServerVersion

discovery/discovery_client.go:407–418  ·  view source on GitHub ↗

ServerVersion retrieves and parses the server's version (git version).

()

Source from the content-addressed store, hash-verified

405
406// ServerVersion retrieves and parses the server's version (git version).
407func (d *DiscoveryClient) ServerVersion() (*version.Info, error) {
408 body, err := d.restClient.Get().AbsPath("/version").Do().Raw()
409 if err != nil {
410 return nil, err
411 }
412 var info version.Info
413 err = json.Unmarshal(body, &info)
414 if err != nil {
415 return nil, fmt.Errorf("unable to parse the server version: %v", err)
416 }
417 return &info, nil
418}
419
420// OpenAPISchema fetches the open api schema using a rest client and parses the proto.
421func (d *DiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) {

Callers

nothing calls this directly

Calls 5

RawMethod · 0.80
AbsPathMethod · 0.80
DoMethod · 0.65
GetMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected