@@ -15,7 +15,7 @@ import (
15
15
16
16
const defaultEtcdPathPrefix = "/registry/stash.appscode.com"
17
17
18
- type AdmissionServerOptions struct {
18
+ type APIServerOptions struct {
19
19
RecommendedOptions * genericoptions.RecommendedOptions
20
20
21
21
AdmissionHooks []apiserver.AdmissionHook
@@ -24,8 +24,8 @@ type AdmissionServerOptions struct {
24
24
StdErr io.Writer
25
25
}
26
26
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 {
29
29
// TODO we will nil out the etcd storage options. This requires a later level of k8s.io/apiserver
30
30
RecommendedOptions : genericoptions .NewRecommendedOptions (defaultEtcdPathPrefix , apiserver .Codecs .LegacyCodec (admissionv1beta1 .SchemeGroupVersion )),
31
31
@@ -41,7 +41,7 @@ func NewAdmissionServerOptions(out, errOut io.Writer, admissionHooks ...apiserve
41
41
42
42
// NewCommandStartMaster provides a CLI handler for 'start master' command
43
43
func NewCommandStartAPIServer (out , errOut io.Writer , stopCh <- chan struct {}) * cobra.Command {
44
- o := NewAdmissionServerOptions (out , errOut )
44
+ o := NewAPIServerOptions (out , errOut )
45
45
46
46
cmd := & cobra.Command {
47
47
Use : "apiserver" ,
@@ -71,15 +71,15 @@ func NewCommandStartAPIServer(out, errOut io.Writer, stopCh <-chan struct{}) *co
71
71
return cmd
72
72
}
73
73
74
- func (o AdmissionServerOptions ) Validate (args []string ) error {
74
+ func (o APIServerOptions ) Validate (args []string ) error {
75
75
return nil
76
76
}
77
77
78
- func (o * AdmissionServerOptions ) Complete () error {
78
+ func (o * APIServerOptions ) Complete () error {
79
79
return nil
80
80
}
81
81
82
- func (o AdmissionServerOptions ) Config () (* apiserver.Config , error ) {
82
+ func (o APIServerOptions ) Config () (* apiserver.Config , error ) {
83
83
// TODO have a "real" external address
84
84
if err := o .RecommendedOptions .SecureServing .MaybeDefaultWithSelfSignedCerts ("localhost" , nil , []net.IP {net .ParseIP ("127.0.0.1" )}); err != nil {
85
85
return nil , fmt .Errorf ("error creating self-signed certificates: %v" , err )
@@ -99,7 +99,7 @@ func (o AdmissionServerOptions) Config() (*apiserver.Config, error) {
99
99
return config , nil
100
100
}
101
101
102
- func (o AdmissionServerOptions ) RunServer (stopCh <- chan struct {}) error {
102
+ func (o APIServerOptions ) RunServer (stopCh <- chan struct {}) error {
103
103
config , err := o .Config ()
104
104
if err != nil {
105
105
return err
0 commit comments