From d8e185267d31b97d72b70303841119594a0db73d Mon Sep 17 00:00:00 2001 From: vaikas-google Date: Tue, 9 Aug 2016 16:31:13 -0700 Subject: [PATCH 1/4] First cut of adding dynamic cluster support to status command --- _proto/hapi/release/status.proto | 1 + cmd/helm/status.go | 1 + cmd/tiller/environment/environment.go | 8 +++++ cmd/tiller/release_server.go | 11 ++++++ pkg/kube/client.go | 51 ++++++++++++++++++++++++++- pkg/proto/hapi/release/status.pb.go | 24 +++++++------ 6 files changed, 84 insertions(+), 12 deletions(-) diff --git a/_proto/hapi/release/status.proto b/_proto/hapi/release/status.proto index 999f7bea7..9fc8eb49a 100644 --- a/_proto/hapi/release/status.proto +++ b/_proto/hapi/release/status.proto @@ -38,4 +38,5 @@ message Status { Code code = 1; google.protobuf.Any details = 2; + string cluster_status = 3; } diff --git a/cmd/helm/status.go b/cmd/helm/status.go index 3b522644f..cf407bbb6 100644 --- a/cmd/helm/status.go +++ b/cmd/helm/status.go @@ -68,6 +68,7 @@ func (s *statusCmd) run() error { fmt.Fprintf(s.out, "Last Deployed: %s\n", timeconv.String(res.Info.LastDeployed)) fmt.Fprintf(s.out, "Status: %s\n", res.Info.Status.Code) + fmt.Fprintf(s.out, "Cluster Status:\n%s\n", res.Info.Status.ClusterStatus) if res.Info.Status.Details != nil { fmt.Fprintf(s.out, "Details: %s\n", res.Info.Status.Details) } diff --git a/cmd/tiller/environment/environment.go b/cmd/tiller/environment/environment.go index 2a9d85370..609a1d113 100644 --- a/cmd/tiller/environment/environment.go +++ b/cmd/tiller/environment/environment.go @@ -147,6 +147,14 @@ type KubeClient interface { // by "\n---\n"). Create(namespace string, reader io.Reader) error + // Get gets one or more resources. + // + // namespace must contain a valid existing namespace. + // + // reader must contain a YAML stream (one or more YAML documents separated + // by "\n---\n"). + Get(namespace string, reader io.Reader) (string, error) + // Delete destroys one or more resources. // // namespace must contain a valid existing namespace. diff --git a/cmd/tiller/release_server.go b/cmd/tiller/release_server.go index 061a76c4b..f924cecf7 100644 --- a/cmd/tiller/release_server.go +++ b/cmd/tiller/release_server.go @@ -159,6 +159,17 @@ func (s *releaseServer) GetReleaseStatus(c ctx.Context, req *services.GetRelease if rel.Info == nil { return nil, errors.New("release info is missing") } + + // Ok, we got the status of the release as we had jotted down, now we need to match the + // manifest we stashed away with reality from the cluster. + kubeCli := s.env.KubeClient + resp, err := kubeCli.Get(rel.Namespace, bytes.NewBufferString(rel.Manifest)) + if err != nil { + log.Printf("warning: COULDN'T FETCH %q failed: %s", rel.Name, err) + return nil, err + } + rel.Info.Status.ClusterStatus = resp + return &services.GetReleaseStatusResponse{Info: rel.Info}, nil } diff --git a/pkg/kube/client.go b/pkg/kube/client.go index da073d173..66acd3ce2 100644 --- a/pkg/kube/client.go +++ b/pkg/kube/client.go @@ -17,6 +17,7 @@ limitations under the License. package kube // import "k8s.io/helm/pkg/kube" import ( + "bytes" "fmt" "io" "log" @@ -50,7 +51,7 @@ func New(config clientcmd.ClientConfig) *Client { } } -// ResourceActorFunc performs an action on a signle resource. +// ResourceActorFunc performs an action on a single resource. type ResourceActorFunc func(*resource.Info) error // Create creates kubernetes resources from an io.reader @@ -63,6 +64,54 @@ func (c *Client) Create(namespace string, reader io.Reader) error { return perform(c, namespace, reader, createResource) } +// Get gets kubernetes resources as pretty printed string +// +// Namespace will set the namespace +func (c *Client) Get(namespace string, reader io.Reader) (string, error) { + // Since we don't know what order the objects come in, let's group them by the types, so + // that when we print them, they come looking good (headers apply to subgroups, etc.) + objs := make(map[string][]runtime.Object) + err := perform(c, namespace, reader, func(info *resource.Info) error { + log.Printf("Doing get for: '%s'", info.Name) + obj, err := resource.NewHelper(info.Client, info.Mapping).Get(info.Namespace, info.Name, info.Export) + if err != nil { + return err + } + // We need to fetch the + or, err := api.GetReference(obj) + if err != nil { + log.Printf("FAILED GetReference for: %#v\n%v", obj, err) + return err + } + + // Use APIVersion/Kind as grouping mechanism + objType := or.APIVersion + "/" + or.Kind + objs[objType] = append(objs[objType], obj) + return nil + }) + + // Ok, now we have all the objects grouped by types (say, by v1/Pod, v1/Service, etc.), so + // spin through them and print them. Printer is cool since it prints the header only when + // an object type changes, so we can just rely on that. Problem is it doesn't seem to keep + // track of tab widths + buf := new(bytes.Buffer) + p := kubectl.NewHumanReadablePrinter(false, false, false, false, false, false, []string{}) + for t, ot := range objs { + for _, o := range ot { + err = p.PrintObj(o, buf) + if err != nil { + log.Printf("failed to print object type '%s', object: '%s' :\n %v", t, o, err) + return "", err + } + } + _, err := buf.WriteString("\n") + if err != nil { + return "", err + } + } + return buf.String(), err +} + // Update reads in the current configuration and a modified configuration from io.reader // and creates resources that don't already exists, updates resources that have been modified // and deletes resources from the current configuration that are not present in the diff --git a/pkg/proto/hapi/release/status.pb.go b/pkg/proto/hapi/release/status.pb.go index 1c7f161ef..66a4345f5 100644 --- a/pkg/proto/hapi/release/status.pb.go +++ b/pkg/proto/hapi/release/status.pb.go @@ -51,8 +51,9 @@ func (Status_Code) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, [] // Status defines the status of a release. type Status struct { - Code Status_Code `protobuf:"varint,1,opt,name=code,enum=hapi.release.Status_Code" json:"code,omitempty"` - Details *google_protobuf1.Any `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"` + Code Status_Code `protobuf:"varint,1,opt,name=code,enum=hapi.release.Status_Code" json:"code,omitempty"` + Details *google_protobuf1.Any `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"` + ClusterStatus string `protobuf:"bytes,3,opt,name=cluster_status,json=clusterStatus" json:"cluster_status,omitempty"` } func (m *Status) Reset() { *m = Status{} } @@ -73,20 +74,21 @@ func init() { } var fileDescriptor3 = []byte{ - // 226 bytes of a gzipped FileDescriptorProto + // 251 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0x48, 0x2c, 0xc8, 0xd4, 0x2f, 0x4a, 0xcd, 0x49, 0x4d, 0x2c, 0x4e, 0xd5, 0x2f, 0x2e, 0x49, 0x2c, 0x29, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x01, 0x49, 0xe9, 0x41, 0xa5, 0xa4, 0x24, 0xd3, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0x72, 0x49, 0xa5, 0x69, 0xfa, 0x89, 0x79, 0x95, 0x10, 0x85, - 0x4a, 0x9b, 0x19, 0xb9, 0xd8, 0x82, 0xc1, 0x3a, 0x85, 0x74, 0xb9, 0x58, 0x92, 0xf3, 0x53, 0x52, + 0x4a, 0xb7, 0x18, 0xb9, 0xd8, 0x82, 0xc1, 0x3a, 0x85, 0x74, 0xb9, 0x58, 0x92, 0xf3, 0x53, 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, 0xf8, 0x8c, 0x24, 0xf5, 0x90, 0x8d, 0xd0, 0x83, 0xa8, 0xd1, 0x73, 0x06, 0x2a, 0x08, 0x02, 0x2b, 0x13, 0xd2, 0xe3, 0x62, 0x4f, 0x49, 0x2d, 0x49, 0xcc, 0xcc, 0x29, 0x96, 0x60, 0x02, 0xea, 0xe0, 0x36, 0x12, 0xd1, 0x83, 0x58, 0xa3, 0x07, 0xb3, 0x46, 0xcf, 0x31, - 0xaf, 0x32, 0x08, 0xa6, 0x48, 0xc9, 0x8b, 0x8b, 0x05, 0xa4, 0x5b, 0x88, 0x9b, 0x8b, 0x3d, 0xd4, - 0xcf, 0xdb, 0xcf, 0x3f, 0xdc, 0x4f, 0x80, 0x41, 0x88, 0x87, 0x8b, 0xc3, 0xc5, 0x35, 0xc0, 0xc7, - 0x3f, 0xd2, 0xd5, 0x45, 0x80, 0x11, 0x24, 0xe5, 0xe2, 0xea, 0xe3, 0x1a, 0x02, 0xe4, 0x30, 0x09, - 0xf1, 0x71, 0x71, 0x05, 0x87, 0x06, 0xb8, 0x06, 0x05, 0xbb, 0xba, 0x00, 0xf9, 0xcc, 0x42, 0x5c, - 0x5c, 0x6c, 0x6e, 0x8e, 0x9e, 0x3e, 0x40, 0x36, 0x8b, 0x13, 0x67, 0x14, 0x3b, 0xd4, 0x61, 0x49, - 0x6c, 0x60, 0xdb, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x99, 0x9a, 0x3b, 0x0d, 0x01, - 0x00, 0x00, + 0xaf, 0x32, 0x08, 0xa6, 0x48, 0x48, 0x95, 0x8b, 0x2f, 0x39, 0xa7, 0xb4, 0xb8, 0x24, 0xb5, 0x28, + 0x1e, 0xe2, 0x54, 0x09, 0x66, 0xa0, 0x36, 0xce, 0x20, 0x5e, 0xa8, 0x28, 0xc4, 0x06, 0x25, 0x2f, + 0x2e, 0x16, 0x90, 0x25, 0x42, 0xdc, 0x5c, 0xec, 0xa1, 0x7e, 0xde, 0x7e, 0xfe, 0xe1, 0x7e, 0x02, + 0x0c, 0x42, 0x3c, 0x5c, 0x1c, 0x2e, 0xae, 0x01, 0x3e, 0xfe, 0x91, 0xae, 0x2e, 0x02, 0x8c, 0x20, + 0x29, 0x17, 0x57, 0x1f, 0xd7, 0x10, 0x20, 0x87, 0x49, 0x88, 0x8f, 0x8b, 0x2b, 0x38, 0x34, 0xc0, + 0x35, 0x28, 0xd8, 0xd5, 0x05, 0xc8, 0x67, 0x16, 0xe2, 0xe2, 0x62, 0x73, 0x73, 0xf4, 0xf4, 0x01, + 0xb2, 0x59, 0x9c, 0x38, 0xa3, 0xd8, 0xa1, 0xee, 0x4f, 0x62, 0x03, 0x3b, 0xca, 0x18, 0x10, 0x00, + 0x00, 0xff, 0xff, 0xa0, 0xaf, 0xd3, 0x6a, 0x34, 0x01, 0x00, 0x00, } From d2841f92f3773d35b2ce3fee08f65513a0b6b663 Mon Sep 17 00:00:00 2001 From: vaikas-google Date: Tue, 9 Aug 2016 21:54:26 -0700 Subject: [PATCH 2/4] formatting changes, add comments, make tests pass --- _proto/hapi/release/status.proto | 3 ++- cmd/helm/status.go | 2 +- cmd/tiller/environment/environment.go | 9 +++++++- cmd/tiller/environment/environment_test.go | 3 +++ cmd/tiller/release_server.go | 4 ++-- pkg/kube/client.go | 9 ++++++-- pkg/proto/hapi/release/status.pb.go | 27 +++++++++++----------- 7 files changed, 37 insertions(+), 20 deletions(-) diff --git a/_proto/hapi/release/status.proto b/_proto/hapi/release/status.proto index 9fc8eb49a..ac179f668 100644 --- a/_proto/hapi/release/status.proto +++ b/_proto/hapi/release/status.proto @@ -38,5 +38,6 @@ message Status { Code code = 1; google.protobuf.Any details = 2; - string cluster_status = 3; + // Cluster resources as kubectl would print them. + string resources = 3; } diff --git a/cmd/helm/status.go b/cmd/helm/status.go index cf407bbb6..436445642 100644 --- a/cmd/helm/status.go +++ b/cmd/helm/status.go @@ -68,7 +68,7 @@ func (s *statusCmd) run() error { fmt.Fprintf(s.out, "Last Deployed: %s\n", timeconv.String(res.Info.LastDeployed)) fmt.Fprintf(s.out, "Status: %s\n", res.Info.Status.Code) - fmt.Fprintf(s.out, "Cluster Status:\n%s\n", res.Info.Status.ClusterStatus) + fmt.Fprintf(s.out, "Resources:\n%s\n", res.Info.Status.Resources) if res.Info.Status.Details != nil { fmt.Fprintf(s.out, "Details: %s\n", res.Info.Status.Details) } diff --git a/cmd/tiller/environment/environment.go b/cmd/tiller/environment/environment.go index 609a1d113..3c07e187d 100644 --- a/cmd/tiller/environment/environment.go +++ b/cmd/tiller/environment/environment.go @@ -147,7 +147,8 @@ type KubeClient interface { // by "\n---\n"). Create(namespace string, reader io.Reader) error - // Get gets one or more resources. + // Get gets one or more resources. Returned string hsa the format like kubectl + // provides with the column headers separating the resource types. // // namespace must contain a valid existing namespace. // @@ -192,6 +193,12 @@ func (p *PrintingKubeClient) Create(ns string, r io.Reader) error { return err } +// Get prints the values of what would be created with a real KubeClient. +func (p *PrintingKubeClient) Get(ns string, r io.Reader) (string, error) { + _, err := io.Copy(p.Out, r) + return "", err +} + // Delete implements KubeClient delete. // // It only prints out the content to be deleted. diff --git a/cmd/tiller/environment/environment_test.go b/cmd/tiller/environment/environment_test.go index ff82e2cc1..3d9060c11 100644 --- a/cmd/tiller/environment/environment_test.go +++ b/cmd/tiller/environment/environment_test.go @@ -80,6 +80,9 @@ type mockKubeClient struct { func (k *mockKubeClient) Create(ns string, r io.Reader) error { return nil } +func (k *mockKubeClient) Get(ns string, r io.Reader) (string, error) { + return nil +} func (k *mockKubeClient) Delete(ns string, r io.Reader) error { return nil } diff --git a/cmd/tiller/release_server.go b/cmd/tiller/release_server.go index f924cecf7..78888e8f2 100644 --- a/cmd/tiller/release_server.go +++ b/cmd/tiller/release_server.go @@ -165,10 +165,10 @@ func (s *releaseServer) GetReleaseStatus(c ctx.Context, req *services.GetRelease kubeCli := s.env.KubeClient resp, err := kubeCli.Get(rel.Namespace, bytes.NewBufferString(rel.Manifest)) if err != nil { - log.Printf("warning: COULDN'T FETCH %q failed: %s", rel.Name, err) + log.Printf("warning: Get for %s failed: %v", rel.Name, err) return nil, err } - rel.Info.Status.ClusterStatus = resp + rel.Info.Status.Resources = resp return &services.GetReleaseStatusResponse{Info: rel.Info}, nil } diff --git a/pkg/kube/client.go b/pkg/kube/client.go index 66acd3ce2..cb7e4590b 100644 --- a/pkg/kube/client.go +++ b/pkg/kube/client.go @@ -77,14 +77,15 @@ func (c *Client) Get(namespace string, reader io.Reader) (string, error) { if err != nil { return err } - // We need to fetch the + // We need to grab the ObjectReference so we can correctly group the objects. or, err := api.GetReference(obj) if err != nil { log.Printf("FAILED GetReference for: %#v\n%v", obj, err) return err } - // Use APIVersion/Kind as grouping mechanism + // Use APIVersion/Kind as grouping mechanism. I'm not sure if you can have multiple + // versions per cluster, but this certainly won't hurt anything, so let's be safe. objType := or.APIVersion + "/" + or.Kind objs[objType] = append(objs[objType], obj) return nil @@ -97,6 +98,10 @@ func (c *Client) Get(namespace string, reader io.Reader) (string, error) { buf := new(bytes.Buffer) p := kubectl.NewHumanReadablePrinter(false, false, false, false, false, false, []string{}) for t, ot := range objs { + _, err = buf.WriteString("==> " + t + "\n") + if err != nil { + return "", err + } for _, o := range ot { err = p.PrintObj(o, buf) if err != nil { diff --git a/pkg/proto/hapi/release/status.pb.go b/pkg/proto/hapi/release/status.pb.go index 66a4345f5..33f418aac 100644 --- a/pkg/proto/hapi/release/status.pb.go +++ b/pkg/proto/hapi/release/status.pb.go @@ -51,9 +51,10 @@ func (Status_Code) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, [] // Status defines the status of a release. type Status struct { - Code Status_Code `protobuf:"varint,1,opt,name=code,enum=hapi.release.Status_Code" json:"code,omitempty"` - Details *google_protobuf1.Any `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"` - ClusterStatus string `protobuf:"bytes,3,opt,name=cluster_status,json=clusterStatus" json:"cluster_status,omitempty"` + Code Status_Code `protobuf:"varint,1,opt,name=code,enum=hapi.release.Status_Code" json:"code,omitempty"` + Details *google_protobuf1.Any `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"` + // Cluster resources as kubectl would print them. + Resources string `protobuf:"bytes,3,opt,name=resources" json:"resources,omitempty"` } func (m *Status) Reset() { *m = Status{} } @@ -74,21 +75,21 @@ func init() { } var fileDescriptor3 = []byte{ - // 251 bytes of a gzipped FileDescriptorProto + // 247 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0x48, 0x2c, 0xc8, 0xd4, 0x2f, 0x4a, 0xcd, 0x49, 0x4d, 0x2c, 0x4e, 0xd5, 0x2f, 0x2e, 0x49, 0x2c, 0x29, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x01, 0x49, 0xe9, 0x41, 0xa5, 0xa4, 0x24, 0xd3, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0x72, 0x49, 0xa5, 0x69, 0xfa, 0x89, 0x79, 0x95, 0x10, 0x85, - 0x4a, 0xb7, 0x18, 0xb9, 0xd8, 0x82, 0xc1, 0x3a, 0x85, 0x74, 0xb9, 0x58, 0x92, 0xf3, 0x53, 0x52, + 0x4a, 0x17, 0x19, 0xb9, 0xd8, 0x82, 0xc1, 0x3a, 0x85, 0x74, 0xb9, 0x58, 0x92, 0xf3, 0x53, 0x52, 0x25, 0x18, 0x15, 0x18, 0x35, 0xf8, 0x8c, 0x24, 0xf5, 0x90, 0x8d, 0xd0, 0x83, 0xa8, 0xd1, 0x73, 0x06, 0x2a, 0x08, 0x02, 0x2b, 0x13, 0xd2, 0xe3, 0x62, 0x4f, 0x49, 0x2d, 0x49, 0xcc, 0xcc, 0x29, 0x96, 0x60, 0x02, 0xea, 0xe0, 0x36, 0x12, 0xd1, 0x83, 0x58, 0xa3, 0x07, 0xb3, 0x46, 0xcf, 0x31, - 0xaf, 0x32, 0x08, 0xa6, 0x48, 0x48, 0x95, 0x8b, 0x2f, 0x39, 0xa7, 0xb4, 0xb8, 0x24, 0xb5, 0x28, - 0x1e, 0xe2, 0x54, 0x09, 0x66, 0xa0, 0x36, 0xce, 0x20, 0x5e, 0xa8, 0x28, 0xc4, 0x06, 0x25, 0x2f, - 0x2e, 0x16, 0x90, 0x25, 0x42, 0xdc, 0x5c, 0xec, 0xa1, 0x7e, 0xde, 0x7e, 0xfe, 0xe1, 0x7e, 0x02, - 0x0c, 0x42, 0x3c, 0x5c, 0x1c, 0x2e, 0xae, 0x01, 0x3e, 0xfe, 0x91, 0xae, 0x2e, 0x02, 0x8c, 0x20, - 0x29, 0x17, 0x57, 0x1f, 0xd7, 0x10, 0x20, 0x87, 0x49, 0x88, 0x8f, 0x8b, 0x2b, 0x38, 0x34, 0xc0, - 0x35, 0x28, 0xd8, 0xd5, 0x05, 0xc8, 0x67, 0x16, 0xe2, 0xe2, 0x62, 0x73, 0x73, 0xf4, 0xf4, 0x01, - 0xb2, 0x59, 0x9c, 0x38, 0xa3, 0xd8, 0xa1, 0xee, 0x4f, 0x62, 0x03, 0x3b, 0xca, 0x18, 0x10, 0x00, - 0x00, 0xff, 0xff, 0xa0, 0xaf, 0xd3, 0x6a, 0x34, 0x01, 0x00, 0x00, + 0xaf, 0x32, 0x08, 0xa6, 0x48, 0x48, 0x86, 0x8b, 0xb3, 0x28, 0xb5, 0x38, 0xbf, 0xb4, 0x28, 0x39, + 0xb5, 0x58, 0x82, 0x19, 0xa8, 0x83, 0x33, 0x08, 0x21, 0xa0, 0xe4, 0xc5, 0xc5, 0x02, 0x32, 0x5b, + 0x88, 0x9b, 0x8b, 0x3d, 0xd4, 0xcf, 0xdb, 0xcf, 0x3f, 0xdc, 0x4f, 0x80, 0x41, 0x88, 0x87, 0x8b, + 0xc3, 0xc5, 0x35, 0xc0, 0xc7, 0x3f, 0xd2, 0xd5, 0x45, 0x80, 0x11, 0x24, 0xe5, 0xe2, 0xea, 0xe3, + 0x1a, 0x02, 0xe4, 0x30, 0x09, 0xf1, 0x71, 0x71, 0x05, 0x87, 0x06, 0xb8, 0x06, 0x05, 0xbb, 0xba, + 0x00, 0xf9, 0xcc, 0x42, 0x5c, 0x5c, 0x6c, 0x6e, 0x8e, 0x9e, 0x3e, 0x40, 0x36, 0x8b, 0x13, 0x67, + 0x14, 0x3b, 0xd4, 0xd9, 0x49, 0x6c, 0x60, 0xb7, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd1, + 0xc3, 0xbf, 0x50, 0x2b, 0x01, 0x00, 0x00, } From bdbe457c3c869c7d92208b1ca636c92fc27d01f7 Mon Sep 17 00:00:00 2001 From: vaikas-google Date: Wed, 10 Aug 2016 10:36:38 -0700 Subject: [PATCH 3/4] forgot to change the return to string --- cmd/tiller/environment/environment_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/tiller/environment/environment_test.go b/cmd/tiller/environment/environment_test.go index 3d9060c11..82d20592e 100644 --- a/cmd/tiller/environment/environment_test.go +++ b/cmd/tiller/environment/environment_test.go @@ -81,7 +81,7 @@ func (k *mockKubeClient) Create(ns string, r io.Reader) error { return nil } func (k *mockKubeClient) Get(ns string, r io.Reader) (string, error) { - return nil + return "", nil } func (k *mockKubeClient) Delete(ns string, r io.Reader) error { return nil From 05374bbebf1a49cdedec7ca9ca5e0ce45ea261d2 Mon Sep 17 00:00:00 2001 From: vaikas-google Date: Wed, 10 Aug 2016 10:44:56 -0700 Subject: [PATCH 4/4] untabify status.proto file --- _proto/hapi/release/status.proto | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/_proto/hapi/release/status.proto b/_proto/hapi/release/status.proto index ac179f668..6f17913db 100644 --- a/_proto/hapi/release/status.proto +++ b/_proto/hapi/release/status.proto @@ -22,22 +22,22 @@ option go_package = "release"; // Status defines the status of a release. message Status { - enum Code { - // Status_UNKNOWN indicates that a release is in an uncertain state. - UNKNOWN = 0; - // Status_DEPLOYED indicates that the release has been pushed to Kubernetes. - DEPLOYED = 1; - // Status_DELETED indicates that a release has been deleted from Kubermetes. - DELETED = 2; - // Status_SUPERSEDED indicates that this release object is outdated and a newer one exists. - SUPERSEDED = 3; - // Status_FAILED indicates that the release was not successfully deployed. - FAILED = 4; - } + enum Code { + // Status_UNKNOWN indicates that a release is in an uncertain state. + UNKNOWN = 0; + // Status_DEPLOYED indicates that the release has been pushed to Kubernetes. + DEPLOYED = 1; + // Status_DELETED indicates that a release has been deleted from Kubermetes. + DELETED = 2; + // Status_SUPERSEDED indicates that this release object is outdated and a newer one exists. + SUPERSEDED = 3; + // Status_FAILED indicates that the release was not successfully deployed. + FAILED = 4; + } - Code code = 1; + Code code = 1; - google.protobuf.Any details = 2; + google.protobuf.Any details = 2; // Cluster resources as kubectl would print them. string resources = 3; }