-
Notifications
You must be signed in to change notification settings - Fork 34
Conversation
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.
Overall looks good to me, just a question on the source for the images.
Also, would be nice to get the license headers in here now for all new code (and use #11 to follow up on previous files).
metricsAddr string | ||
enableLeaderElection bool | ||
) | ||
|
||
func main() { | ||
flag.StringVar(&image, "image", "docker.io/projectcontour/contour:latest", "The image used for the managed Contour.") | ||
flag.StringVar(&contourImage, "contour-image", "docker.io/projectcontour/contour:main", |
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.
So does this define the default for the operator? Meaning, if I create a new "contour" CRD, then this is what is used if not specified?
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.
@stevesloka that is correct.
flag.StringVar(&image, "image", "docker.io/projectcontour/contour:latest", "The image used for the managed Contour.") | ||
flag.StringVar(&contourImage, "contour-image", "docker.io/projectcontour/contour:main", | ||
"The container image used for the managed Contour.") | ||
flag.StringVar(&envoyImage, "envoy-image", "docker.io/envoyproxy/envoy:v1.15.1", |
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.
Same here as previous question with Contour image.
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.
Same answer as #44 (comment).
func checkContainerHasImage(t *testing.T, container *corev1.Container, image string) { | ||
t.Helper() | ||
|
||
if container.Image == image { |
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 checks against the image defined in the flag right? So the version of the image defined in the flag changes, would this then cause an immediate upgrade?
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.
As mentioned above, the contour/envoy container images are set from the operator CLI. If the operator was restarted with new values for these flags, the images would be differ causing the Envoy DamonSet
and the Contour Deployment
to trigger a rolling update.
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.
Maybe it's a docs issue then but that behavior needs to be super clear to users. I would have expected that upgrades to the instances would be done via the CRD that manages that instance.
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.
+1 to @stevesloka's comment, I think ideally you'd manage the versions of Contour and Envoy on the CRD so they could be controlled declaratively and independently of one another if multiple Contours are being managed. Let's file an issue to track.
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.
Commit |
controller/contour/daemonset.go
Outdated
owningContourLabel: contour.Name, | ||
} | ||
|
||
pointerTo := func(ios intstr.IntOrString) *intstr.IntOrString { return &ios } |
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.
You might as well do this:
pointerTo := func(i int) *intstr.IntOrString {
val := intstr.IntOrString{IntVal: int32(i)}
return &val
}
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.
With your suggested changes:
$ make test
/Users/daneyonhansen/code/go/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go fmt ./...
go vet ./...
# github.com/projectcontour/contour-operator/controller/contour
controller/contour/controller.go:35:41: cannot convert i (type intstr.IntOrString) to type int32
# github.com/projectcontour/contour-operator/controller/contour
vet: controller/contour/controller.go:35:42: cannot convert i (variable of type intstr.IntOrString) to int32
make: *** [vet] Error 2
I did move the func up in scope to remove duplication with deployment.go
.
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.
Well clearly you'd want to update the call sites too 😂
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 looks OK to me. I marked a few nits, and it needs to be rebased. I'll hold off any final merge until @stevesloka completes his review as well.
Signed-off-by: Daneyon Hansen <[email protected]>
flag.StringVar(&image, "image", "docker.io/projectcontour/contour:main", "The image used for the managed Contour.") | ||
flag.StringVar(&contourImage, "contour-image", "docker.io/projectcontour/contour:main", | ||
"The container image used for the managed Contour.") | ||
flag.StringVar(&envoyImage, "envoy-image", "docker.io/envoyproxy/envoy:v1.15.1", |
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.
FYI, we've updated Contour's main branch to use Envoy 1.16.0.
func checkContainerHasImage(t *testing.T, container *corev1.Container, image string) { | ||
t.Helper() | ||
|
||
if container.Image == image { |
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.
+1 to @stevesloka's comment, I think ideally you'd manage the versions of Contour and Envoy on the CRD so they could be controlled declaratively and independently of one another if multiple Contours are being managed. Let's file an issue to track.
Adds support for managing Envoy through a
DaemonSet
resource.Fixes #40
/assign @jpeach @stevesloka @skriss
/cc @Miciah