Change the name of the placeholder-name CLI to placeholder-name-server

Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
Ryan Richard 2020-07-27 13:32:14 -07:00 committed by Matt Moyer
parent 0acb8c8d3c
commit 9e44bc28d9
8 changed files with 17 additions and 17 deletions

View File

@ -32,15 +32,15 @@ COPY pkg ./pkg
COPY tools ./tools
COPY hack ./hack
# Build the executable binary
RUN GOOS=linux GOARCH=amd64 go build -ldflags "$(hack/get-ldflags.sh)" -o out ./...
RUN GOOS=linux GOARCH=amd64 go build -ldflags "$(hack/get-ldflags.sh)" -o out ./cmd/placeholder-name-server/...
FROM alpine:latest
# Install CA certs and some tools for debugging
RUN apk --update --no-cache add ca-certificates bash curl
WORKDIR /root/
# Copy the binary from the build-env stage
COPY --from=build-env /work/out/placeholder-name placeholder-name
COPY --from=build-env /work/out/placeholder-name-server placeholder-name-server
# Document the port
EXPOSE 443
# Set the command
CMD ["./placeholder-name"]
CMD ["./placeholder-name-server"]

View File

@ -14,7 +14,7 @@ import (
"k8s.io/component-base/logs"
"k8s.io/klog/v2"
"github.com/suzerain-io/placeholder-name/cmd/placeholder-name/app"
"github.com/suzerain-io/placeholder-name/internal/server"
)
func main() {
@ -25,7 +25,7 @@ func main() {
ctx := genericapiserver.SetupSignalContext()
if err := app.New(ctx, os.Args[1:], os.Stdout, os.Stderr).Run(); err != nil {
if err := server.New(ctx, os.Args[1:], os.Stdout, os.Stderr).Run(); err != nil {
klog.Fatal(err)
}
}

View File

@ -60,7 +60,7 @@ spec:
#@ end
imagePullPolicy: IfNotPresent
command:
- ./placeholder-name
- ./placeholder-name-server
args:
- --config=/etc/config/placeholder-name.yaml
- --downward-api-path=/etc/podinfo

View File

@ -3,8 +3,8 @@ Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Package app is the command line entry point for placeholder-name.
package app
// Package server is the command line entry point for placeholder-name-server.
package server
import (
"context"
@ -39,7 +39,7 @@ import (
"github.com/suzerain-io/placeholder-name/pkg/config"
)
// App is an object that represents the placeholder-name application.
// App is an object that represents the placeholder-name-server application.
type App struct {
cmd *cobra.Command
@ -68,8 +68,8 @@ func New(ctx context.Context, args []string, stdout, stderr io.Writer) *App {
a.recommendedOptions.Etcd = nil // turn off etcd storage because we don't need it yet
cmd := &cobra.Command{
Use: `placeholder-name`,
Long: `placeholder-name provides a generic API for mapping an external
Use: `placeholder-name-server`,
Long: `placeholder-name-server provides a generic API for mapping an external
credential from somewhere to an internal credential to be used for
authenticating to the Kubernetes API.`,
RunE: func(cmd *cobra.Command, args []string) error {

View File

@ -3,7 +3,7 @@ Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
package app
package server
import (
"bytes"
@ -17,19 +17,19 @@ import (
)
const knownGoodUsage = `
placeholder-name provides a generic API for mapping an external
placeholder-name-server provides a generic API for mapping an external
credential from somewhere to an internal credential to be used for
authenticating to the Kubernetes API.
Usage:
placeholder-name [flags]
placeholder-name-server [flags]
Flags:
--cluster-signing-cert-file string path to cluster signing certificate
--cluster-signing-key-file string path to cluster signing private key
-c, --config string path to configuration file (default "placeholder-name.yaml")
--downward-api-path string path to Downward API volume mount (default "/etc/podinfo")
-h, --help help for placeholder-name
-h, --help help for placeholder-name-server
--log-flush-frequency duration Maximum number of seconds between log flushes (default 5s)
`
@ -52,7 +52,7 @@ func TestCommand(t *testing.T) {
{
name: "OneArgFails",
args: []string{"tuna"},
wantErr: `unknown command "tuna" for "placeholder-name"`,
wantErr: `unknown command "tuna" for "placeholder-name-server"`,
},
{
name: "ShortConfigFlagSucceeds",
@ -68,7 +68,7 @@ func TestCommand(t *testing.T) {
"--config", "some/path/to/config.yaml",
"tuna",
},
wantErr: `unknown command "tuna" for "placeholder-name"`,
wantErr: `unknown command "tuna" for "placeholder-name-server"`,
},
}
for _, test := range tests {