mirror of https://github.com/helm/helm
When 'helm version --debug' is run, this will print the kubernetes server version as well as the helm client and server versions. Closes #1398pull/2754/head
parent
e742aa8d34
commit
63be90dda5
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright 2017 The Kubernetes Authors All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package hapi.kube;
|
||||||
|
|
||||||
|
import "hapi/kube/version.proto";
|
||||||
|
|
||||||
|
option go_package = "kube";
|
||||||
|
|
||||||
|
message Info {
|
||||||
|
hapi.kube.Version Version = 1;
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright 2017 The Kubernetes Authors All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package hapi.kube;
|
||||||
|
|
||||||
|
option go_package = "kube";
|
||||||
|
|
||||||
|
message Version {
|
||||||
|
string major = 1;
|
||||||
|
string minor = 2;
|
||||||
|
string git_version = 3;
|
||||||
|
string git_commit = 4;
|
||||||
|
string git_tree_state = 5;
|
||||||
|
string build_date = 6;
|
||||||
|
string go_version = 7;
|
||||||
|
string compiler = 8;
|
||||||
|
string platform = 9;
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
// Code generated by protoc-gen-go.
|
||||||
|
// source: hapi/kube/info.proto
|
||||||
|
// DO NOT EDIT!
|
||||||
|
|
||||||
|
/*
|
||||||
|
Package kube is a generated protocol buffer package.
|
||||||
|
|
||||||
|
It is generated from these files:
|
||||||
|
hapi/kube/info.proto
|
||||||
|
hapi/kube/version.proto
|
||||||
|
|
||||||
|
It has these top-level messages:
|
||||||
|
Info
|
||||||
|
Version
|
||||||
|
*/
|
||||||
|
package kube
|
||||||
|
|
||||||
|
import proto "github.com/golang/protobuf/proto"
|
||||||
|
import fmt "fmt"
|
||||||
|
import math "math"
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the proto package it is being compiled against.
|
||||||
|
// A compilation error at this line likely means your copy of the
|
||||||
|
// proto package needs to be updated.
|
||||||
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||||
|
|
||||||
|
type Info struct {
|
||||||
|
Version *Version `protobuf:"bytes,1,opt,name=Version" json:"Version,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Info) Reset() { *m = Info{} }
|
||||||
|
func (m *Info) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*Info) ProtoMessage() {}
|
||||||
|
func (*Info) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||||
|
|
||||||
|
func (m *Info) GetVersion() *Version {
|
||||||
|
if m != nil {
|
||||||
|
return m.Version
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*Info)(nil), "hapi.kube.Info")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("hapi/kube/info.proto", fileDescriptor0) }
|
||||||
|
|
||||||
|
var fileDescriptor0 = []byte{
|
||||||
|
// 109 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc9, 0x48, 0x2c, 0xc8,
|
||||||
|
0xd4, 0xcf, 0x2e, 0x4d, 0x4a, 0xd5, 0xcf, 0xcc, 0x4b, 0xcb, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9,
|
||||||
|
0x17, 0xe2, 0x04, 0x89, 0xea, 0x81, 0x44, 0xa5, 0xc4, 0x11, 0x0a, 0xca, 0x52, 0x8b, 0x8a, 0x33,
|
||||||
|
0xf3, 0xf3, 0x20, 0x6a, 0x94, 0x4c, 0xb8, 0x58, 0x3c, 0xf3, 0xd2, 0xf2, 0x85, 0x74, 0xb8, 0xd8,
|
||||||
|
0xc3, 0x20, 0x12, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x42, 0x7a, 0x70, 0xdd, 0x7a, 0x50,
|
||||||
|
0x99, 0x20, 0x98, 0x12, 0x27, 0xb6, 0x28, 0x16, 0x90, 0x44, 0x12, 0x1b, 0xd8, 0x10, 0x63, 0x40,
|
||||||
|
0x00, 0x00, 0x00, 0xff, 0xff, 0x9c, 0x44, 0x5d, 0xcd, 0x80, 0x00, 0x00, 0x00,
|
||||||
|
}
|
@ -0,0 +1,119 @@
|
|||||||
|
// Code generated by protoc-gen-go.
|
||||||
|
// source: hapi/kube/version.proto
|
||||||
|
// DO NOT EDIT!
|
||||||
|
|
||||||
|
package kube
|
||||||
|
|
||||||
|
import proto "github.com/golang/protobuf/proto"
|
||||||
|
import fmt "fmt"
|
||||||
|
import math "math"
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
type Version struct {
|
||||||
|
Major string `protobuf:"bytes,1,opt,name=major" json:"major,omitempty"`
|
||||||
|
Minor string `protobuf:"bytes,2,opt,name=minor" json:"minor,omitempty"`
|
||||||
|
GitVersion string `protobuf:"bytes,3,opt,name=git_version,json=gitVersion" json:"git_version,omitempty"`
|
||||||
|
GitCommit string `protobuf:"bytes,4,opt,name=git_commit,json=gitCommit" json:"git_commit,omitempty"`
|
||||||
|
GitTreeState string `protobuf:"bytes,5,opt,name=git_tree_state,json=gitTreeState" json:"git_tree_state,omitempty"`
|
||||||
|
BuildDate string `protobuf:"bytes,6,opt,name=build_date,json=buildDate" json:"build_date,omitempty"`
|
||||||
|
GoVersion string `protobuf:"bytes,7,opt,name=go_version,json=goVersion" json:"go_version,omitempty"`
|
||||||
|
Compiler string `protobuf:"bytes,8,opt,name=compiler" json:"compiler,omitempty"`
|
||||||
|
Platform string `protobuf:"bytes,9,opt,name=platform" json:"platform,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Version) Reset() { *m = Version{} }
|
||||||
|
func (m *Version) String() string { return proto.CompactTextString(m) }
|
||||||
|
func (*Version) ProtoMessage() {}
|
||||||
|
func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
|
||||||
|
|
||||||
|
func (m *Version) GetMajor() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Major
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Version) GetMinor() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Minor
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Version) GetGitVersion() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.GitVersion
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Version) GetGitCommit() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.GitCommit
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Version) GetGitTreeState() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.GitTreeState
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Version) GetBuildDate() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.BuildDate
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Version) GetGoVersion() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.GoVersion
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Version) GetCompiler() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Compiler
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Version) GetPlatform() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.Platform
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
proto.RegisterType((*Version)(nil), "hapi.kube.Version")
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { proto.RegisterFile("hapi/kube/version.proto", fileDescriptor1) }
|
||||||
|
|
||||||
|
var fileDescriptor1 = []byte{
|
||||||
|
// 229 bytes of a gzipped FileDescriptorProto
|
||||||
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0x90, 0xcd, 0x4a, 0x03, 0x51,
|
||||||
|
0x0c, 0x85, 0x69, 0x6d, 0xa7, 0x9d, 0x28, 0x2e, 0x06, 0xc1, 0x8b, 0x20, 0x8a, 0xb8, 0x70, 0xd5,
|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, 0x92, 0x42, 0xde, 0xb9, 0x21, 0x3f, 0x65, 0x9f,
|
||||||
|
0x33, 0xfb, 0x4d, 0x9d, 0xf9, 0xb7, 0x1e, 0x8f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9c, 0x4d, 0x8a,
|
||||||
|
0x4f, 0x48, 0x01, 0x00, 0x00,
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2017 The Kubernetes Authors All rights reserved.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package tiller
|
||||||
|
|
||||||
|
import (
|
||||||
|
"golang.org/x/net/context"
|
||||||
|
"k8s.io/helm/pkg/proto/hapi/kube"
|
||||||
|
"k8s.io/helm/pkg/proto/hapi/services"
|
||||||
|
"k8s.io/helm/pkg/tiller/environment"
|
||||||
|
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
|
||||||
|
)
|
||||||
|
|
||||||
|
// InfoServer implements the server-side gRPC endpoint for the HAPI info service.
|
||||||
|
type InfoServer struct {
|
||||||
|
clientset internalclientset.Interface
|
||||||
|
env *environment.Environment
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetKubeInfo returns Kubernetes server information.
|
||||||
|
func (s *InfoServer) GetKubeInfo(context.Context, *services.GetKubeInfoRequest) (*services.GetKubeInfoResponse, error) {
|
||||||
|
v, err := s.clientset.Discovery().ServerVersion()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
i := &kube.Info{
|
||||||
|
Version: &kube.Version{
|
||||||
|
Major: v.Major,
|
||||||
|
Minor: v.Minor,
|
||||||
|
GitVersion: v.GitVersion,
|
||||||
|
GitCommit: v.GitCommit,
|
||||||
|
GitTreeState: v.GitTreeState,
|
||||||
|
BuildDate: v.BuildDate,
|
||||||
|
GoVersion: v.GoVersion,
|
||||||
|
Compiler: v.Compiler,
|
||||||
|
Platform: v.Platform,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return &services.GetKubeInfoResponse{Info: i}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewInfoServer returns a new InfoServer.
|
||||||
|
func NewInfoServer(env *environment.Environment, clientset internalclientset.Interface) *InfoServer {
|
||||||
|
return &InfoServer{
|
||||||
|
env: env,
|
||||||
|
clientset: clientset,
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue