@@ -10,7 +10,6 @@ import (
10
10
11
11
kcmdutil "github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd/util"
12
12
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
13
- cmdutil "github.com/openshift/origin/pkg/cmd/util"
14
13
15
14
"github.com/openshift/origin/pkg/cmd/server/crypto"
16
15
)
@@ -25,7 +24,7 @@ type CreateServerCertOptions struct {
25
24
26
25
Hostnames util.StringList
27
26
Overwrite bool
28
- Output cmdutil. Output
27
+ Output io. Writer
29
28
}
30
29
31
30
const create_server_long = `
@@ -44,7 +43,7 @@ Example: Creating a secure router certificate.
44
43
`
45
44
46
45
func NewCommandCreateServerCert (commandName string , fullName string , out io.Writer ) * cobra.Command {
47
- options := & CreateServerCertOptions {GetSignerCertOptions : & GetSignerCertOptions {}, Output : cmdutil. Output { out } }
46
+ options := & CreateServerCertOptions {GetSignerCertOptions : & GetSignerCertOptions {}, Output : out }
48
47
49
48
cmd := & cobra.Command {
50
49
Use : commandName ,
@@ -60,7 +59,6 @@ func NewCommandCreateServerCert(commandName string, fullName string, out io.Writ
60
59
}
61
60
},
62
61
}
63
- cmd .SetOutput (out )
64
62
65
63
flags := cmd .Flags ()
66
64
BindGetSignerCertOptions (options .GetSignerCertOptions , flags , "" )
@@ -99,7 +97,7 @@ func (o CreateServerCertOptions) Validate(args []string) error {
99
97
}
100
98
101
99
func (o CreateServerCertOptions ) CreateServerCert () (* crypto.TLSCertificateConfig , error ) {
102
- glog .V (2 ).Infof ("Creating a server cert with: %#v" , o )
100
+ glog .V (4 ).Infof ("Creating a server cert with: %#v" , o )
103
101
104
102
signerCert , err := o .GetSignerCertOptions .GetSignerCert ()
105
103
if err != nil {
@@ -114,9 +112,9 @@ func (o CreateServerCertOptions) CreateServerCert() (*crypto.TLSCertificateConfi
114
112
ca , written , err = signerCert .EnsureServerCert (o .CertFile , o .KeyFile , util .NewStringSet ([]string (o .Hostnames )... ))
115
113
}
116
114
if written {
117
- fmt . Fprintf ( o . Output . Get (), "Generated new server certificate as %s, key as %s\n " , o .CertFile , o .KeyFile )
115
+ glog . V ( 3 ). Infof ( "Generated new server certificate as %s, key as %s\n " , o .CertFile , o .KeyFile )
118
116
} else {
119
- fmt . Fprintf ( o . Output . Get (), "Keeping existing server certificate at %s, key at %s\n " , o .CertFile , o .KeyFile )
117
+ glog . V ( 3 ). Infof ( "Keeping existing server certificate at %s, key at %s\n " , o .CertFile , o .KeyFile )
120
118
}
121
119
return ca , err
122
120
}
0 commit comments