-
Notifications
You must be signed in to change notification settings - Fork 149
*: add wait-for-kube command #46
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
Conversation
92861f3 to
69f5be4
Compare
|
/lgtm |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
69f5be4 to
c1b735e
Compare
c1b735e to
bb42be5
Compare
| HASH:=$(shell git rev-parse --verify 'HEAD^{commit}') | ||
| BUILD_DATE:=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
| GLDFLAGS=-X $(REPO)/pkg/version.versionFromGit=$(VERSION_OVERRIDE) -X $(REPO)/pkg/version.commitFromGit=$(HASH) -X $(REPO)/pkg/version.buildDate=$(BUILD_DATE) | ||
| GOFALGS= |
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 was giving a warning obviously not needed cleaned up here.
cfc552d to
5fdba04
Compare
alaypatel07
left a comment
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.
IMO we should check for env variables
|
|
||
| func (w *waitForKubeOpts) Run() error { | ||
| wait.PollInfinite(retryDuration, func() (bool, error) { | ||
| if _, err := os.Stat(saTokenPath); os.IsNotExist(err) { |
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 it sufficient enough to check that the env variables are populated with this?
Should we have an equivalent of inCluster function here and check for env variable to be safe?
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 it sufficient enough to check that the env variables are populated with this?
If the SA token has synced that means kube scheduled staticsync so yes.
Should we have an equivalent of inCluster function here and check for env variable to be safe?
Where? we are waiting.
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.
to be clear static sync is a daemonset
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.
our container will not change its ENV unless it restarts right?
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.
yes ideally it will not change, but want to be sure with something like
if !inCluster {
return fmt.Errorf("kube env not populated")
}
Where inCluster is
func inCluster() bool {
if os.Getenv("KUBERNETES_SERVICE_HOST") == "" || os.Getenv("KUBERNETES_SERVICE_PORT") == "" {
return false
}
return true
}
We can either do it after the wait loop, so the initContainer will crashlooping until the env is populated.
if the env is not populated, it is not a bug against us
5fdba04 to
35a4621
Compare
alaypatel07
left a comment
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 @hexfusion
/lgtm
35a4621 to
239ee57
Compare
|
/lgtm |
239ee57 to
2b35076
Compare
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2b35076 to
7fdcd96
Compare
|
/lgtm |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
22 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
@hexfusion: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
When the static pod starts we need to wait for kube until any containers that require a k8s client start. This ensures the container has been scheduled with kube and will contain required ENV for client creation.
Signed-off-by: Sam Batschelet sbatsche@redhat.com