Skip to content

Commit 7bb027b

Browse files
committed
Cleanup apiserver
1 parent fb8c1e4 commit 7bb027b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

apiserver.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515

1616
const defaultEtcdPathPrefix = "/registry/stash.appscode.com"
1717

18-
type AdmissionServerOptions struct {
18+
type APIServerOptions struct {
1919
RecommendedOptions *genericoptions.RecommendedOptions
2020

2121
AdmissionHooks []apiserver.AdmissionHook
@@ -24,8 +24,8 @@ type AdmissionServerOptions struct {
2424
StdErr io.Writer
2525
}
2626

27-
func NewAdmissionServerOptions(out, errOut io.Writer, admissionHooks ...apiserver.AdmissionHook) *AdmissionServerOptions {
28-
o := &AdmissionServerOptions{
27+
func NewAPIServerOptions(out, errOut io.Writer, admissionHooks ...apiserver.AdmissionHook) *APIServerOptions {
28+
o := &APIServerOptions{
2929
// TODO we will nil out the etcd storage options. This requires a later level of k8s.io/apiserver
3030
RecommendedOptions: genericoptions.NewRecommendedOptions(defaultEtcdPathPrefix, apiserver.Codecs.LegacyCodec(admissionv1beta1.SchemeGroupVersion)),
3131

@@ -41,7 +41,7 @@ func NewAdmissionServerOptions(out, errOut io.Writer, admissionHooks ...apiserve
4141

4242
// NewCommandStartMaster provides a CLI handler for 'start master' command
4343
func NewCommandStartAPIServer(out, errOut io.Writer, stopCh <-chan struct{}) *cobra.Command {
44-
o := NewAdmissionServerOptions(out, errOut)
44+
o := NewAPIServerOptions(out, errOut)
4545

4646
cmd := &cobra.Command{
4747
Use: "apiserver",
@@ -71,15 +71,15 @@ func NewCommandStartAPIServer(out, errOut io.Writer, stopCh <-chan struct{}) *co
7171
return cmd
7272
}
7373

74-
func (o AdmissionServerOptions) Validate(args []string) error {
74+
func (o APIServerOptions) Validate(args []string) error {
7575
return nil
7676
}
7777

78-
func (o *AdmissionServerOptions) Complete() error {
78+
func (o *APIServerOptions) Complete() error {
7979
return nil
8080
}
8181

82-
func (o AdmissionServerOptions) Config() (*apiserver.Config, error) {
82+
func (o APIServerOptions) Config() (*apiserver.Config, error) {
8383
// TODO have a "real" external address
8484
if err := o.RecommendedOptions.SecureServing.MaybeDefaultWithSelfSignedCerts("localhost", nil, []net.IP{net.ParseIP("127.0.0.1")}); err != nil {
8585
return nil, fmt.Errorf("error creating self-signed certificates: %v", err)
@@ -99,7 +99,7 @@ func (o AdmissionServerOptions) Config() (*apiserver.Config, error) {
9999
return config, nil
100100
}
101101

102-
func (o AdmissionServerOptions) RunServer(stopCh <-chan struct{}) error {
102+
func (o APIServerOptions) RunServer(stopCh <-chan struct{}) error {
103103
config, err := o.Config()
104104
if err != nil {
105105
return err

0 commit comments

Comments
 (0)