-
Notifications
You must be signed in to change notification settings - Fork 70
Conversation
results ui does not have streaming and requires refresh to sidestep timeout
also fix dependency cycle caused by merge
added kubectl to ship and integration test images
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 think there's a bug around the doneCh
newStderr := stderr.String() | ||
newStdout := stdout.String() | ||
|
||
if newStderr != stderrString || newStdout != stdoutString { |
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.
Might want to accumulate the full stdout and stderr.
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.
At least in my testing, .String()
was returning the entirety of the buffer regardless of if it had been read before
I should probably move this to a more explicit "read from buffer" mechanism however
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 think you're right. https://golang.org/src/bytes/buffer.go?s=2482:2514#L51
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.
Exactly what I had looked at myself!
pkg/lifecycle/kubectl/kubectl.go
Outdated
err := cmd.Run() | ||
|
||
doneCh <- struct{}{} | ||
<-doneCh |
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 think you were intending for the doneCh in the goroutine to consume the message in 102, then finish its work, and send another message on the doneCh that would be consumed in this line, but there's no guarantee that this won't consume the message in 102 and the goroutine never returns.
pkg/lifecycle/kubectl/kubectl.go
Outdated
return errors.New("A path to apply is required") | ||
} | ||
|
||
cmd := k.Kubectl() |
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.
We did this for helm and terraform because the unit tests run a child process.
What I Did
Added a lifecycle step
kubectl
that takes apath
to be applied and a path to akubeconfig
to use when doing so. If a kubeconfig is supplied,kubectl apply -f PATH --kubeconfig KUBECONFIG
is run, otherwisekubectl apply -f PATH
is. Output is streamed.How I Did it
The
kubectl
command is run with the provided arguments. Template functions within the arguments are evaluated first.How to verify it
Besides "run it and try", I'm not sure. To the best of my knowledge, this is the first lifecycle step besides
message
that does not produce any file output, and I am unsure how to test it.Description for the Changelog
kubectl apply
has been added as a lifecycle step.Picture of a
BoatShip (not required but encouraged)