-
Notifications
You must be signed in to change notification settings - Fork 706
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
Deprecate the ENV MY_POD_NAME and use default namespace #348
Conversation
553b69e
to
43e99c9
Compare
cmd/tf_operator/app/server.go
Outdated
@@ -103,7 +98,7 @@ func Run(opt *options.ServerOption) error { | |||
|
|||
rl := &resourcelock.EndpointsLock{ | |||
EndpointsMeta: metav1.ObjectMeta{ | |||
Namespace: namespace, | |||
Namespace: metav1.NamespaceDefault, |
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.
Is NamespaceDefault the default namespace? Why do you use the default Namespace and not the pod's namespace?
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.
This is resourcelock
‘s namespace.
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.
Shouldn't we be using the namespace that the controller is deployed in for the resource lock? What if we want to deploy different instances of the controller in different namespaces? Wouldn't the end up trying to share the same resource lock causing problems?
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.
Why do we need this resource lock? to make sure that there is only one instance to create the controller in the namespace at any time?
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.
@jlewi I'm not sure about this, will take a look at it, and file a issue to follow up.
@gaocegege It is used for HA.
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.
I'd be ok with getting rid of MY_POD_NAME in this PR but leaving MY_POD_NAMESPACE until we can resolve the issue.
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.
Looks like there were some test failures.
/test tf-k8s-presubmit |
@jlewi Is the test machine out of disk? |
It was the other day but I cleaned it up so it shouldn't be anymore; let me check. |
Test project ran out of IP addressess
|
/test tf-k8s-presubmit |
@jlewi Ping. |
@jlewi PTAL, thanks! |
43e99c9
to
71a12d4
Compare
Not sure what is this error |
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.
The error is caused by goimports: the name of the package should be the same name in the source. There is a related issue: joefitzgerald/go-plus#52 (comment)
pkg/util/util.go
Outdated
@@ -10,6 +10,11 @@ import ( | |||
log "github.com/golang/glog" |
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.
Changing this line to "github.com/golang/glog"
could solve the errors in Travis CI
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.
Thanks so much, addressed your comments.
71a12d4
to
9f993a8
Compare
Hi, this PR fixes #341:
MY_POD_NAMESPACE
andMY_POD_NAME
NamespaceDefault
by default@jlewi PTAL, thanks!
This change is