-
Notifications
You must be signed in to change notification settings - Fork 84
Use guestbook-operator in smoketest #82
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
Use guestbook-operator in smoketest #82
Conversation
atoato88
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.
Adds concerns in comment.
examples/guestbook-operator/Makefile
Outdated
|
|
||
| # Build the docker image | ||
| docker-build: test | ||
| sed -e "s:^replace://replace:g" go.mod > go.mod.make-docker-build |
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 a rough approach, I think...
Without this change, go run smoketest.go will fail.
Here is log.
...
...
Step 5/14 : RUN go mod download
---> Running in 3e6c6d104896
go: sigs.k8s.io/kubebuilder-declarative-pattern@v0.0.0-20200317144824-bbf1fb2a4a9a: parsing /go.mod: open /go.mod: no such file or directory
The command '/bin/sh -c go mod download' returned a non-zero code: 1
Makefile:64: recipe for target 'docker-build' failed
make: *** [docker-build] Error 1
Any Ideas? or, is this reasonable?
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.
Hey @atoato88 ! I'm trying to think of a different solution here, we may not have much of an option though. It's a tricky scenario to build correctly.
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 problem is that the build target is dependent on a library that is in the same source tree (both with their own go mod files). The separation is necessary because we don't want examples/.. to be part of the library when a user consumes this.
The dashboard-operator took the following approach:
- Replace the kubebuilder-declarative-pattern dependency in the go.mod to a relative file path (../../): src
- Use vendored dependencies (instead of go modules) in the docker build src
- Update the vendor dependencies as part of docker-build src
This approach ensures that you are always running the latest code from the main repo when running the example. This is low maintenance, great for testing/development. It would 'feel better' if it didn't require using vendored dependencies. There may be a workaround for that, but I'm not sure.
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.
Thank you for helpful comment, I'll change my PR according to 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.
I've fixed about this.
Your comment solved all concerns.
Thank you!!
| # Copy the Go Modules manifests | ||
| COPY go.mod go.mod | ||
| #COPY go.mod go.mod | ||
| COPY go.mod.make-docker-build go.mod |
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 relate to my comment at L64 in examples/guestbook-operator/Makefile
|
/retitle Use guestbook-operator in smoketest |
|
/assign @johnsonj |
a808fde to
2d0acb3
Compare
|
Thank you @atoato88 ! /lgtm |
| kustomize build config/default | kubectl apply -f - | ||
|
|
||
| # Teardown controller in the configured Kubernetes cluster in ~/.kube/config | ||
| # This command does things that can't always re-run so the exit codes are ignored |
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 for the comment here!
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: atoato88, johnsonj The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
In PR #81, dashboard-operator is removed in this repository.
It is needed that change to use guestbook-operator in
hack/smoketest.goinstead of dashboard-operator.related to: #80