-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implemented glog wrapper for use in delegated commands #8024
Conversation
@@ -112,7 +112,7 @@ func (o CreateKeyPairOptions) CreateKeyPair() error { | |||
return err | |||
} | |||
|
|||
fmt.Fprintf(o.Output, "Generated new key pair as %s and %s\n", o.PublicKeyFile, o.PrivateKeyFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is the delegation thing I was talking about. @sosiouxme requested these as Printf
s in the case where you're actually trying to run this command. When you run this command in a delegated case, you should pass an o.Output
that actual writes to glog.V(3).Info
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, need glog io.Writer wrapper
On Tue, Mar 15, 2016 at 2:16 PM, David Eads [email protected]
wrote:
In pkg/cmd/server/admin/create_keypair.go
#8024 (comment):@@ -112,7 +112,7 @@ func (o CreateKeyPairOptions) CreateKeyPair() error {
return err
}
- fmt.Fprintf(o.Output, "Generated new key pair as %s and %s\n", o.PublicKeyFile, o.PrivateKeyFile)
Yeah, this is the delegation thing I was talking about. @sosiouxme
https://github.com/sosiouxme requested these as Printfs in the case
where you're actually trying to run this command. When you run this command
in a delegated case, you should pass an o.Output that actual writes to
glog.V(3).Info.—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/openshift/origin/pull/8024/files/011a2f607bc9309896480a82044992be53dc3f3b#r56213717
0ac16e4
to
23839b4
Compare
@deads2k PTAL |
Travis flake (?):
@smarterclayton have we seen this before? I don't think this was something I changed. |
Travis may not have returned any IP addresses in ip addr list? On Fri, Apr 8, 2016 at 12:40 PM, Steve Kuznetsov [email protected]
|
43459aa
to
0bd4cec
Compare
@smarterclayton this is ready for a look. The downside of using a wrapper here is that all of the |
Use |
|
you ought to be able to layer it by doing your own level check and then calling You could also open a pull to try to get it added upstream. |
I'll try it upstream. |
5c56f9d
to
4ecf430
Compare
[test] me |
@@ -876,7 +876,7 @@ const flushInterval = 30 * time.Second | |||
|
|||
// flushDaemon periodically flushes the log file buffers. | |||
func (l *loggingT) flushDaemon() { | |||
for _ = range time.NewTicker(flushInterval).C { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't mess with things you don't need to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazingly it looks like the Go authors don't run go fmt -s
... this was an automated change, I'll revert
did you submit a pull upstream? |
@deads2k they don't allow pulls for the project, but I attempted to reach out to the authors and ask if they'd consider the patch |
4ecf430
to
ca6a26f
Compare
@deads2k reverted change from |
I'm not seeing how this moves "Generating node credentials ..." to a verbose glog level. Pointer to that bit? In fact, I think this moving things backwards |
Signed-off-by: Steve Kuznetsov <[email protected]>
ca6a26f
to
9d0dd6d
Compare
Missed that! Added more delegation. |
@@ -86,15 +85,15 @@ func (o CreateKeyPairOptions) Validate(args []string) error { | |||
} | |||
|
|||
func (o CreateKeyPairOptions) CreateKeyPair() error { | |||
glog.V(4).Infof("Creating a key pair with: %#v", o) | |||
fmt.Fprintf(o.Output, "Creating a key pair with: %#v", o) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo this, the glog was correct.
find the spots where we're calling commands to generate the config and update those instances with your new glogl writer. |
1b7ba72
to
5963a5c
Compare
Signed-off-by: Steve Kuznetsov <[email protected]>
@@ -227,7 +228,7 @@ func (o AllInOneOptions) StartAllInOne() error { | |||
if err != nil { | |||
return err | |||
} | |||
fmt.Fprintf(o.MasterOptions.Output, "%s\n", host) | |||
fmt.Fprintf(o.Output, "%s\n", host) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can revert as technically right now o.MasterOptions.Output == o.Output
but as written previously this didn't really make sense, as this is output of allinone
.
@deads2k tightened up where we use the delegation wrapper. Feels like we could use a scrub of the code to make sure we use it wherever we are supposed to, but I don't think I have the knowledge right now to make the call on when we should and shouldn't, so I'll leave that off until later. |
check flaked on #8039
extended flaked on yum: #8571 #triplewhammy |
Evaluated for origin test up to 5963a5c |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/3156/) |
@deads2k ready for a look, have green tests |
@stevekuznetsov add output to your description. lgtm |
Sample output:
|
@deads2k are these the examples you were looking for? |
[merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/3156/) (Image: devenv-rhel7_4074) |
Evaluated for origin merge up to 5963a5c |
fixes #8023
@deads2k @smarterclayton PTAL