diff --git a/cmd/helm/helm.go b/cmd/helm/helm.go index 3b26984ab..1d439e6b3 100644 --- a/cmd/helm/helm.go +++ b/cmd/helm/helm.go @@ -78,6 +78,7 @@ func run(c *cli.Context, f func(c *cli.Context) error) { } } +// NewClient creates a new client instance preconfigured for CLI usage. func NewClient(c *cli.Context) *client.Client { host := c.GlobalString("host") debug := c.GlobalBool("debug") diff --git a/cmd/resourcifier/main.go b/cmd/resourcifier/main.go index 7d82e983a..f9b7aacdc 100644 --- a/cmd/resourcifier/main.go +++ b/cmd/resourcifier/main.go @@ -17,9 +17,6 @@ limitations under the License. package main import ( - "github.com/kubernetes/deployment-manager/pkg/util" - "github.com/kubernetes/deployment-manager/pkg/version" - "flag" "fmt" "log" @@ -28,6 +25,8 @@ import ( "github.com/gorilla/handlers" "github.com/gorilla/mux" + "github.com/kubernetes/deployment-manager/pkg/util" + "github.com/kubernetes/deployment-manager/pkg/version" ) // Route defines a routing table entry to be registered with gorilla/mux. diff --git a/pkg/client/client.go b/pkg/client/client.go index 6aa8183ad..36e4acfe5 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -32,10 +32,10 @@ import ( "github.com/kubernetes/deployment-manager/pkg/common" ) -// The default HTTP timeout +// DefaultHTTPTimeout is the default HTTP timeout. var DefaultHTTPTimeout = time.Second * 10 -// The default HTTP Protocol +// DefaultHTTPProtocol is the default HTTP Protocol (http, https). var DefaultHTTPProtocol = "http" // Client is a DM client. diff --git a/pkg/registry/registryprovider.go b/pkg/registry/registryprovider.go index c1f356c8a..dbd871d2f 100644 --- a/pkg/registry/registryprovider.go +++ b/pkg/registry/registryprovider.go @@ -280,13 +280,13 @@ func (gcsrp gcsRegistryProvider) createGCSClient(credentialName string) (*http.C return config.Client(oauth2.NoContext), nil } -// RE for a registry type that does support versions and has collections. +// TemplateRegistryMatcher is an RE for a registry type that does support versions and has collections. var TemplateRegistryMatcher = regexp.MustCompile("github.com/(.*)/(.*)/(.*)/(.*):(.*)") -// RE for a registry type that does not support versions and does not have collections. +// PackageRegistryMatcher is an RE for a registry type that does not support versions and does not have collections. var PackageRegistryMatcher = regexp.MustCompile("github.com/(.*)/(.*)/(.*)") -// RE for GCS storage +// GCSRegistryMatcher is an RE for GCS storage var GCSRegistryMatcher = regexp.MustCompile("gs://(.*)/(.*)") // IsGithubShortType returns whether a given type is a type description in a short format to a github repository type. diff --git a/pkg/util/httputil.go b/pkg/util/httputil.go index cba3988a7..8713e3abf 100644 --- a/pkg/util/httputil.go +++ b/pkg/util/httputil.go @@ -114,6 +114,7 @@ func TestHandlerWithURL(handler http.Handler, method, urlString string) (*httpte return NewHandlerTester(handler).TestWithURL(method, urlString) } +// LogHandlerText logs a line of text for a handler. func LogHandlerText(handler string, v string) { log.Printf("%s: %s\n", handler, v) }