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:
parent
0acb8c8d3c
commit
9e44bc28d9
@ -32,15 +32,15 @@ COPY pkg ./pkg
|
|||||||
COPY tools ./tools
|
COPY tools ./tools
|
||||||
COPY hack ./hack
|
COPY hack ./hack
|
||||||
# Build the executable binary
|
# 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
|
FROM alpine:latest
|
||||||
# Install CA certs and some tools for debugging
|
# Install CA certs and some tools for debugging
|
||||||
RUN apk --update --no-cache add ca-certificates bash curl
|
RUN apk --update --no-cache add ca-certificates bash curl
|
||||||
WORKDIR /root/
|
WORKDIR /root/
|
||||||
# Copy the binary from the build-env stage
|
# 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
|
# Document the port
|
||||||
EXPOSE 443
|
EXPOSE 443
|
||||||
# Set the command
|
# Set the command
|
||||||
CMD ["./placeholder-name"]
|
CMD ["./placeholder-name-server"]
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
"k8s.io/component-base/logs"
|
"k8s.io/component-base/logs"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
|
|
||||||
"github.com/suzerain-io/placeholder-name/cmd/placeholder-name/app"
|
"github.com/suzerain-io/placeholder-name/internal/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -25,7 +25,7 @@ func main() {
|
|||||||
|
|
||||||
ctx := genericapiserver.SetupSignalContext()
|
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)
|
klog.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -60,7 +60,7 @@ spec:
|
|||||||
#@ end
|
#@ end
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
command:
|
command:
|
||||||
- ./placeholder-name
|
- ./placeholder-name-server
|
||||||
args:
|
args:
|
||||||
- --config=/etc/config/placeholder-name.yaml
|
- --config=/etc/config/placeholder-name.yaml
|
||||||
- --downward-api-path=/etc/podinfo
|
- --downward-api-path=/etc/podinfo
|
||||||
|
@ -3,8 +3,8 @@ Copyright 2020 VMware, Inc.
|
|||||||
SPDX-License-Identifier: Apache-2.0
|
SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Package app is the command line entry point for placeholder-name.
|
// Package server is the command line entry point for placeholder-name-server.
|
||||||
package app
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -39,7 +39,7 @@ import (
|
|||||||
"github.com/suzerain-io/placeholder-name/pkg/config"
|
"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 {
|
type App struct {
|
||||||
cmd *cobra.Command
|
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
|
a.recommendedOptions.Etcd = nil // turn off etcd storage because we don't need it yet
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: `placeholder-name`,
|
Use: `placeholder-name-server`,
|
||||||
Long: `placeholder-name provides a generic API for mapping an external
|
Long: `placeholder-name-server provides a generic API for mapping an external
|
||||||
credential from somewhere to an internal credential to be used for
|
credential from somewhere to an internal credential to be used for
|
||||||
authenticating to the Kubernetes API.`,
|
authenticating to the Kubernetes API.`,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
@ -3,7 +3,7 @@ Copyright 2020 VMware, Inc.
|
|||||||
SPDX-License-Identifier: Apache-2.0
|
SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package app
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@ -17,19 +17,19 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const knownGoodUsage = `
|
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
|
credential from somewhere to an internal credential to be used for
|
||||||
authenticating to the Kubernetes API.
|
authenticating to the Kubernetes API.
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
placeholder-name [flags]
|
placeholder-name-server [flags]
|
||||||
|
|
||||||
Flags:
|
Flags:
|
||||||
--cluster-signing-cert-file string path to cluster signing certificate
|
--cluster-signing-cert-file string path to cluster signing certificate
|
||||||
--cluster-signing-key-file string path to cluster signing private key
|
--cluster-signing-key-file string path to cluster signing private key
|
||||||
-c, --config string path to configuration file (default "placeholder-name.yaml")
|
-c, --config string path to configuration file (default "placeholder-name.yaml")
|
||||||
--downward-api-path string path to Downward API volume mount (default "/etc/podinfo")
|
--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)
|
--log-flush-frequency duration Maximum number of seconds between log flushes (default 5s)
|
||||||
`
|
`
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ func TestCommand(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "OneArgFails",
|
name: "OneArgFails",
|
||||||
args: []string{"tuna"},
|
args: []string{"tuna"},
|
||||||
wantErr: `unknown command "tuna" for "placeholder-name"`,
|
wantErr: `unknown command "tuna" for "placeholder-name-server"`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "ShortConfigFlagSucceeds",
|
name: "ShortConfigFlagSucceeds",
|
||||||
@ -68,7 +68,7 @@ func TestCommand(t *testing.T) {
|
|||||||
"--config", "some/path/to/config.yaml",
|
"--config", "some/path/to/config.yaml",
|
||||||
"tuna",
|
"tuna",
|
||||||
},
|
},
|
||||||
wantErr: `unknown command "tuna" for "placeholder-name"`,
|
wantErr: `unknown command "tuna" for "placeholder-name-server"`,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
Loading…
Reference in New Issue
Block a user