Correct grammar, capitalization and punctuation for remaining strings.

reviewable/pr2601/r5
Justin Scott 8 years ago
parent 5524b8177c
commit 5dbc1236ec

@ -33,8 +33,8 @@ import (
) )
const initDesc = ` const initDesc = `
This command installs Tiller (the helm server side component) onto your This command installs Tiller (the Helm server side component) onto your
Kubernetes Cluster and sets up local configuration in $HELM_HOME (default ~/.helm/) Kubernetes Cluster and sets up local configuration in $HELM_HOME (default ~/.helm/).
As with the rest of the Helm commands, 'helm init' discovers Kubernetes clusters As with the rest of the Helm commands, 'helm init' discovers Kubernetes clusters
by reading $KUBECONFIG (default '~/.kube/config') and using the default context. by reading $KUBECONFIG (default '~/.kube/config') and using the default context.

@ -71,7 +71,7 @@ func Upgrade(client kubernetes.Interface, opts *Options) error {
return err return err
} }
// createDeployment creates the Tiller deployment resource. // createDeployment creates the Tiller Deployment resource.
func createDeployment(client extensionsclient.DeploymentsGetter, opts *Options) error { func createDeployment(client extensionsclient.DeploymentsGetter, opts *Options) error {
obj := deployment(opts) obj := deployment(opts)
_, err := client.Deployments(obj.Namespace).Create(obj) _, err := client.Deployments(obj.Namespace).Create(obj)

@ -94,8 +94,8 @@ func (f Files) Glob(pattern string) Files {
} }
// AsConfig turns a Files group and flattens it to a YAML map suitable for // AsConfig turns a Files group and flattens it to a YAML map suitable for
// including in the `data` section of a Kubernetes ConfigMap definition. // including in the 'data' section of a Kubernetes ConfigMap definition.
// Duplicate keys will be overwritten, so be aware that your filenames // Duplicate keys will be overwritten, so be aware that your file names
// (regardless of path) should be unique. // (regardless of path) should be unique.
// //
// This is designed to be called from a template, and will return empty string // This is designed to be called from a template, and will return empty string
@ -103,7 +103,7 @@ func (f Files) Glob(pattern string) Files {
// object is nil. // object is nil.
// //
// The output will not be indented, so you will want to pipe this to the // The output will not be indented, so you will want to pipe this to the
// `indent` template function. // 'indent' template function.
// //
// data: // data:
// {{ .Files.Glob("config/**").AsConfig() | indent 4 }} // {{ .Files.Glob("config/**").AsConfig() | indent 4 }}
@ -122,9 +122,9 @@ func (f Files) AsConfig() string {
return ToYaml(m) return ToYaml(m)
} }
// AsSecrets returns the value of a Files object as base64 suitable for // AsSecrets returns the base64-encoded value of a Files object suitable for
// including in the `data` section of a Kubernetes Secret definition. // including in the 'data' section of a Kubernetes Secret definition.
// Duplicate keys will be overwritten, so be aware that your filenames // Duplicate keys will be overwritten, so be aware that your file names
// (regardless of path) should be unique. // (regardless of path) should be unique.
// //
// This is designed to be called from a template, and will return empty string // This is designed to be called from a template, and will return empty string
@ -132,7 +132,7 @@ func (f Files) AsConfig() string {
// object is nil. // object is nil.
// //
// The output will not be indented, so you will want to pipe this to the // The output will not be indented, so you will want to pipe this to the
// `indent` template function. // 'indent' template function.
// //
// data: // data:
// {{ .Files.Glob("secrets/*").AsSecrets() }} // {{ .Files.Glob("secrets/*").AsSecrets() }}

@ -29,7 +29,7 @@ import (
rls "k8s.io/helm/pkg/proto/hapi/services" rls "k8s.io/helm/pkg/proto/hapi/services"
) )
// Client manages client side of the helm-tiller protocol // Client manages client side of the Helm-Tiller protocol.
type Client struct { type Client struct {
opts options opts options
} }
@ -40,7 +40,7 @@ func NewClient(opts ...Option) *Client {
return c.Option(opts...) return c.Option(opts...)
} }
// Option configures the Helm client with the provided options // Option configures the Helm client with the provided options.
func (h *Client) Option(opts ...Option) *Client { func (h *Client) Option(opts ...Option) *Client {
for _, opt := range opts { for _, opt := range opts {
opt(&h.opts) opt(&h.opts)
@ -64,7 +64,7 @@ func (h *Client) ListReleases(opts ...ReleaseListOption) (*rls.ListReleasesRespo
return h.list(ctx, req) return h.list(ctx, req)
} }
// InstallRelease loads a chart from chstr, installs it and returns the release response. // InstallRelease loads a chart from chstr, installs it, and returns the release response.
func (h *Client) InstallRelease(chstr, ns string, opts ...InstallOption) (*rls.InstallReleaseResponse, error) { func (h *Client) InstallRelease(chstr, ns string, opts ...InstallOption) (*rls.InstallReleaseResponse, error) {
// load the chart to install // load the chart to install
chart, err := chartutil.Load(chstr) chart, err := chartutil.Load(chstr)
@ -135,7 +135,7 @@ func (h *Client) DeleteRelease(rlsName string, opts ...DeleteOption) (*rls.Unins
return h.delete(ctx, req) return h.delete(ctx, req)
} }
// UpdateRelease loads a chart from chstr and updates a release to a new/different chart // UpdateRelease loads a chart from chstr and updates a release to a new/different chart.
func (h *Client) UpdateRelease(rlsName string, chstr string, opts ...UpdateOption) (*rls.UpdateReleaseResponse, error) { func (h *Client) UpdateRelease(rlsName string, chstr string, opts ...UpdateOption) (*rls.UpdateReleaseResponse, error) {
// load the chart to update // load the chart to update
chart, err := chartutil.Load(chstr) chart, err := chartutil.Load(chstr)
@ -146,7 +146,7 @@ func (h *Client) UpdateRelease(rlsName string, chstr string, opts ...UpdateOptio
return h.UpdateReleaseFromChart(rlsName, chart, opts...) return h.UpdateReleaseFromChart(rlsName, chart, opts...)
} }
// UpdateReleaseFromChart updates a release to a new/different chart // UpdateReleaseFromChart updates a release to a new/different chart.
func (h *Client) UpdateReleaseFromChart(rlsName string, chart *chart.Chart, opts ...UpdateOption) (*rls.UpdateReleaseResponse, error) { func (h *Client) UpdateReleaseFromChart(rlsName string, chart *chart.Chart, opts ...UpdateOption) (*rls.UpdateReleaseResponse, error) {
// apply the update options // apply the update options
@ -181,7 +181,7 @@ func (h *Client) UpdateReleaseFromChart(rlsName string, chart *chart.Chart, opts
return h.update(ctx, req) return h.update(ctx, req)
} }
// GetVersion returns the server version // GetVersion returns the server version.
func (h *Client) GetVersion(opts ...VersionOption) (*rls.GetVersionResponse, error) { func (h *Client) GetVersion(opts ...VersionOption) (*rls.GetVersionResponse, error) {
for _, opt := range opts { for _, opt := range opts {
opt(&h.opts) opt(&h.opts)
@ -197,7 +197,7 @@ func (h *Client) GetVersion(opts ...VersionOption) (*rls.GetVersionResponse, err
return h.version(ctx, req) return h.version(ctx, req)
} }
// RollbackRelease rolls back a release to the previous version // RollbackRelease rolls back a release to the previous version.
func (h *Client) RollbackRelease(rlsName string, opts ...RollbackOption) (*rls.RollbackReleaseResponse, error) { func (h *Client) RollbackRelease(rlsName string, opts ...RollbackOption) (*rls.RollbackReleaseResponse, error) {
for _, opt := range opts { for _, opt := range opts {
opt(&h.opts) opt(&h.opts)
@ -270,7 +270,7 @@ func (h *Client) ReleaseHistory(rlsName string, opts ...HistoryOption) (*rls.Get
return h.history(ctx, req) return h.history(ctx, req)
} }
// RunReleaseTest executes a pre-defined test on a release // RunReleaseTest executes a pre-defined test on a release.
func (h *Client) RunReleaseTest(rlsName string, opts ...ReleaseTestOption) (<-chan *rls.TestReleaseResponse, <-chan error) { func (h *Client) RunReleaseTest(rlsName string, opts ...ReleaseTestOption) (<-chan *rls.TestReleaseResponse, <-chan error) {
for _, opt := range opts { for _, opt := range opts {
opt(&h.opts) opt(&h.opts)
@ -283,7 +283,7 @@ func (h *Client) RunReleaseTest(rlsName string, opts ...ReleaseTestOption) (<-ch
return h.test(ctx, req) return h.test(ctx, req)
} }
// connect returns a grpc connection to tiller or error. The grpc dial options // connect returns a gRPC connection to Tiller or error. The gRPC dial options
// are constructed here. // are constructed here.
func (h *Client) connect(ctx context.Context) (conn *grpc.ClientConn, err error) { func (h *Client) connect(ctx context.Context) (conn *grpc.ClientConn, err error) {
opts := []grpc.DialOption{ opts := []grpc.DialOption{

@ -31,13 +31,13 @@ import (
tpb "k8s.io/helm/pkg/proto/hapi/services" tpb "k8s.io/helm/pkg/proto/hapi/services"
) )
// path to example charts relative to pkg/helm. // Path to example charts relative to pkg/helm.
const chartsDir = "../../docs/examples/" const chartsDir = "../../docs/examples/"
// sentinel error to indicate to the Helm client to not send the request to tiller. // Sentinel error to indicate to the Helm client to not send the request to Tiller.
var errSkip = errors.New("test: skip") var errSkip = errors.New("test: skip")
// Verify ReleaseListOption's are applied to a ListReleasesRequest correctly. // Verify each ReleaseListOption is applied to a ListReleasesRequest correctly.
func TestListReleases_VerifyOptions(t *testing.T) { func TestListReleases_VerifyOptions(t *testing.T) {
// Options testdata // Options testdata
var limit = 2 var limit = 2
@ -92,7 +92,7 @@ func TestListReleases_VerifyOptions(t *testing.T) {
} }
} }
// Verify InstallOption's are applied to an InstallReleaseRequest correctly. // Verify each InstallOption is applied to an InstallReleaseRequest correctly.
func TestInstallRelease_VerifyOptions(t *testing.T) { func TestInstallRelease_VerifyOptions(t *testing.T) {
// Options testdata // Options testdata
var disableHooks = true var disableHooks = true
@ -141,7 +141,7 @@ func TestInstallRelease_VerifyOptions(t *testing.T) {
} }
} }
// Verify DeleteOptions's are applied to an UninstallReleaseRequest correctly. // Verify each DeleteOptions is applied to an UninstallReleaseRequest correctly.
func TestDeleteRelease_VerifyOptions(t *testing.T) { func TestDeleteRelease_VerifyOptions(t *testing.T) {
// Options testdata // Options testdata
var releaseName = "test" var releaseName = "test"
@ -178,7 +178,7 @@ func TestDeleteRelease_VerifyOptions(t *testing.T) {
} }
} }
// Verify UpdateOption's are applied to an UpdateReleaseRequest correctly. // Verify each UpdateOption is applied to an UpdateReleaseRequest correctly.
func TestUpdateRelease_VerifyOptions(t *testing.T) { func TestUpdateRelease_VerifyOptions(t *testing.T) {
// Options testdata // Options testdata
var chartName = "alpine" var chartName = "alpine"
@ -221,7 +221,7 @@ func TestUpdateRelease_VerifyOptions(t *testing.T) {
} }
} }
// Verify RollbackOption's are applied to a RollbackReleaseRequest correctly. // Verify each RollbackOption is applied to a RollbackReleaseRequest correctly.
func TestRollbackRelease_VerifyOptions(t *testing.T) { func TestRollbackRelease_VerifyOptions(t *testing.T) {
// Options testdata // Options testdata
var disableHooks = true var disableHooks = true
@ -261,7 +261,7 @@ func TestRollbackRelease_VerifyOptions(t *testing.T) {
} }
} }
// Verify StatusOption's are applied to a GetReleaseStatusRequest correctly. // Verify each StatusOption is applied to a GetReleaseStatusRequest correctly.
func TestReleaseStatus_VerifyOptions(t *testing.T) { func TestReleaseStatus_VerifyOptions(t *testing.T) {
// Options testdata // Options testdata
var releaseName = "test" var releaseName = "test"
@ -290,7 +290,7 @@ func TestReleaseStatus_VerifyOptions(t *testing.T) {
} }
} }
// Verify ContentOption's are applied to a GetReleaseContentRequest correctly. // Verify each ContentOption is applied to a GetReleaseContentRequest correctly.
func TestReleaseContent_VerifyOptions(t *testing.T) { func TestReleaseContent_VerifyOptions(t *testing.T) {
// Options testdata // Options testdata
var releaseName = "test" var releaseName = "test"

@ -63,7 +63,7 @@ type Client struct {
Log func(string, ...interface{}) Log func(string, ...interface{})
} }
// New create a new Client // New creates a new Client.
func New(config clientcmd.ClientConfig) *Client { func New(config clientcmd.ClientConfig) *Client {
return &Client{ return &Client{
Factory: cmdutil.NewFactory(config), Factory: cmdutil.NewFactory(config),
@ -147,12 +147,12 @@ func (c *Client) Build(namespace string, reader io.Reader) (Result, error) {
return result, scrubValidationError(err) return result, scrubValidationError(err)
} }
// Get gets Kubernetes resources as pretty printed string. // Get gets Kubernetes resources as pretty-printed string.
// //
// Namespace will set the namespace // Namespace will set the namespace.
func (c *Client) Get(namespace string, reader io.Reader) (string, error) { 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 // 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.) // that when we print them, they come out looking good (headers apply to subgroups, etc.).
objs := make(map[string][]runtime.Object) objs := make(map[string][]runtime.Object)
infos, err := c.BuildUnstructured(namespace, reader) infos, err := c.BuildUnstructured(namespace, reader)
if err != nil { if err != nil {
@ -181,7 +181,7 @@ func (c *Client) Get(namespace string, reader io.Reader) (string, error) {
// Ok, now we have all the objects grouped by types (say, by v1/Pod, v1/Service, etc.), so // 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 // 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 // an object type changes, so we can just rely on that. Problem is it doesn't seem to keep
// track of tab widths // track of tab widths.
buf := new(bytes.Buffer) buf := new(bytes.Buffer)
p, _ := c.Printer(nil, printers.PrintOptions{}) p, _ := c.Printer(nil, printers.PrintOptions{})
for t, ot := range objs { for t, ot := range objs {
@ -577,7 +577,7 @@ func (c *Client) waitForJob(e watch.Event, name string) (bool, error) {
return false, nil return false, nil
} }
// scrubValidationError removes kubectl info from the message // scrubValidationError removes kubectl info from the message.
func scrubValidationError(err error) error { func scrubValidationError(err error) error {
if err == nil { if err == nil {
return nil return nil
@ -591,7 +591,7 @@ func scrubValidationError(err error) error {
} }
// WaitAndGetCompletedPodPhase waits up to a timeout until a pod enters a completed phase // WaitAndGetCompletedPodPhase waits up to a timeout until a pod enters a completed phase
// and returns said phase (PodSucceeded or PodFailed qualify) // and returns said phase (PodSucceeded or PodFailed qualify).
func (c *Client) WaitAndGetCompletedPodPhase(namespace string, reader io.Reader, timeout time.Duration) (api.PodPhase, error) { func (c *Client) WaitAndGetCompletedPodPhase(namespace string, reader io.Reader, timeout time.Duration) (api.PodPhase, error) {
infos, err := c.Build(namespace, reader) infos, err := c.Build(namespace, reader)
if err != nil { if err != nil {

@ -69,7 +69,7 @@ type Queryor interface {
Query(labels map[string]string) ([]*rspb.Release, error) Query(labels map[string]string) ([]*rspb.Release, error)
} }
// Driver is the interface composed of Creator, Updator, Deletor, Queryor // Driver is the interface composed of Creator, Updator, Deletor, and Queryor
// interfaces. It defines the behavior for storing, updating, deleted, // interfaces. It defines the behavior for storing, updating, deleted,
// and retrieving Tiller releases from some underlying storage mechanism, // and retrieving Tiller releases from some underlying storage mechanism,
// e.g. memory, configmaps. // e.g. memory, configmaps.

@ -133,9 +133,9 @@ type KubeClient interface {
WatchUntilReady(namespace string, reader io.Reader, timeout int64, shouldWait bool) error WatchUntilReady(namespace string, reader io.Reader, timeout int64, shouldWait bool) error
// Update updates one or more resources or creates the resource // Update updates one or more resources or creates the resource
// if it doesn't exist // if it doesn't exist.
// //
// namespace must contain a valid existing namespace // namespace must contain a valid existing namespace.
// //
// reader must contain a YAML stream (one or more YAML documents separated // reader must contain a YAML stream (one or more YAML documents separated
// by "\n---\n"). // by "\n---\n").
@ -145,7 +145,7 @@ type KubeClient interface {
BuildUnstructured(namespace string, reader io.Reader) (kube.Result, error) BuildUnstructured(namespace string, reader io.Reader) (kube.Result, error)
// WaitAndGetCompletedPodPhase waits up to a timeout until a pod enters a completed phase // WaitAndGetCompletedPodPhase waits up to a timeout until a pod enters a completed phase
// and returns said phase (PodSucceeded or PodFailed qualify) // and returns said phase (PodSucceeded or PodFailed qualify).
WaitAndGetCompletedPodPhase(namespace string, reader io.Reader, timeout time.Duration) (api.PodPhase, error) WaitAndGetCompletedPodPhase(namespace string, reader io.Reader, timeout time.Duration) (api.PodPhase, error)
} }
@ -197,7 +197,7 @@ func (p *PrintingKubeClient) BuildUnstructured(ns string, reader io.Reader) (kub
return []*resource.Info{}, nil return []*resource.Info{}, nil
} }
// WaitAndGetCompletedPodPhase implements KubeClient WaitAndGetCompletedPodPhase // WaitAndGetCompletedPodPhase implements KubeClient WaitAndGetCompletedPodPhase.
func (p *PrintingKubeClient) WaitAndGetCompletedPodPhase(namespace string, reader io.Reader, timeout time.Duration) (api.PodPhase, error) { func (p *PrintingKubeClient) WaitAndGetCompletedPodPhase(namespace string, reader io.Reader, timeout time.Duration) (api.PodPhase, error) {
_, err := io.Copy(p.Out, reader) _, err := io.Copy(p.Out, reader)
return api.PodUnknown, err return api.PodUnknown, err

Loading…
Cancel
Save