-
Notifications
You must be signed in to change notification settings - Fork 113
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
Refine the other operator related names #631
Refine the other operator related names #631
Conversation
@zhangtbj: The label(s) In response to this:
Instructions 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. |
/kind cleanup |
@zhangtbj you currently have a release-note set but with no text was your intent to have a release note, or to not have one? Or is determining that part of the work in progress? |
Hi @gabemontero my mistake. It doesn't require the release notes. Just the internal fix for the renaming. I remove the Thanks! |
test/integration/utils/operator.go
Outdated
// but it disables the prometheus metrics and leader election. This intended | ||
// to for testing. | ||
func (t *TestBuild) StartBuildOperator() (chan struct{}, error) { | ||
func (t *TestBuild) StartBuildController() (chan struct{}, 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.
I think I did a similar comment somewhere else, this function actually starts a manager, which is an interface in the controller-runtime pkg. I think StartManager
is a better name, rather than a search/replace approach.
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!, two cents:
- I think the logic should be: start a controller and controller starts a manager, so manager should be included in the controller, and the goal of this file is used to start a controller for test, not start a manager as a internal usage.
- I am not sure if we want to add more config beside of manager in future to enrich the test.
So I prefer to keep StartBuildController.
But I am fine for both names.
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.
Technically speaking this function does the following:
- Add all controllers to the manager, so we add four
- Starts all registered Controllers and blocks until the Stop channel is closed
For me StartBuildController
is missleading, can we call this StartControllers
?
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 for renaming, either Manager or Controllers
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.
Agree and fixed. Thanks all
@zhangtbj @qu1queee Quick question: Since we removed any "operator" references from the End to End test anyway in #632, we could also consider removing any changes done here in the |
@HeavyWombat thats a question for @zhangtbj |
.github/workflows/ci.yml
Outdated
@@ -119,7 +119,7 @@ jobs: | |||
make install-controller-kind | |||
kubectl -n shipwright-build rollout status deployment shipwright-build-controller --timeout=1m || true | |||
- name: Test | |||
run: TEST_E2E_OPERATOR=managed_outside TEST_NAMESPACE=shipwright-build TEST_IMAGE_REPO=registry.registry.svc.cluster.local:32222/shipwright-io/build-e2e make test-e2e | |||
run: TEST_E2E_CONTROLLER=managed_outside TEST_NAMESPACE=shipwright-build TEST_IMAGE_REPO=registry.registry.svc.cluster.local:32222/shipwright-io/build-e2e make test-e2e |
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 tackled that in #632. Like commented somewhere else too, I would opt for leaving the end to end tests untouched in this PR here.
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 Matthias, agree. But it is hard to extract the change in multiple files. Let us merge the #632 PR first, then I will resolve the conflict here.
Makefile
Outdated
# E2E test controller behavior, can be start_local or managed_outside | ||
TEST_E2E_CONTROLLER ?= start_local |
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.
E2E related
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 Matthias, I think this PR can be wait until your PR is merged: #632
Then I can rebase and refactor the e2e related change later.
Makefile
Outdated
TEST_WATCH_NAMESPACE=${TEST_NAMESPACE} \ | ||
TEST_E2E_OPERATOR=${TEST_E2E_OPERATOR} \ | ||
TEST_E2E_CONTROLLER=${TEST_E2E_CONTROLLER} \ |
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.
E2E related
docs/development/testing.md
Outdated
@@ -119,7 +119,7 @@ The following table contains a set of environment variables that control the beh | |||
| `TEST_NAMESPACE` | `default` | Target namespace to execute tests upon, default is `default`. | | |||
| `TEST_E2E_FLAGS` | `-failFast -flakeAttempts=2 -p -randomizeAllSpecs -slowSpecThreshold=300 -timeout=20m -trace -v` | Ginkgo flags. See all Ginkgo flags here: [The Ginkgo CLI](https://onsi.github.io/ginkgo/#the-ginkgo-cli). Especially of interest are `--focus` and `--skip` to run selective tests. | | |||
| `TEST_E2E_CREATE_GLOBALOBJECTS` | `true` | Boolean, if `false`, the custom resource definitions and (cluster) build strategies are not created and deleted by the e2e test code | | |||
| `TEST_E2E_OPERATOR` | `start_local` | String with allowed values `start_local` (will start the local operator and print its logs add the end of the test run) and `managed_outside` (will assume that the operator is running through whatever means) | | |||
| `TEST_E2E_CONTROLLER` | `start_local` | String with allowed values `start_local` (will start the local Shipwright build controller and print its logs add the end of the test run) and `managed_outside` (will assume that the Shipwright build controller is running through whatever means) | |
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.
E2E related
test/e2e/e2e_suite_test.go
Outdated
@@ -17,7 +17,7 @@ import ( | |||
) | |||
|
|||
var ( | |||
operatorCmd *exec.Cmd | |||
controllerCmd *exec.Cmd |
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.
E2E related
test/e2e/e2e_test.go
Outdated
@@ -10,13 +10,13 @@ import ( | |||
. "github.com/onsi/ginkgo" | |||
. "github.com/onsi/gomega" | |||
|
|||
operator "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" | |||
controller "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" |
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.
E2E related
test/integration/utils/operator.go
Outdated
// but it disables the prometheus metrics and leader election. This intended | ||
// to for testing. | ||
func (t *TestBuild) StartBuildOperator() (chan struct{}, error) { | ||
func (t *TestBuild) StartBuildController() (chan struct{}, 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.
+1 for renaming, either Manager or Controllers
// so that we can nuke the instance later inside the AfterEach Ginkgo | ||
// block | ||
tb.StopBuildOperator, err = tb.StartBuildOperator() | ||
tb.StopBuildController, err = tb.StartBuildController() | ||
if err != nil { | ||
fmt.Println("fail to start the Build powerful operator", 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.
fmt.Println("fail to start the Build powerful operator", err) | |
fmt.Println("fail to start the powerful Build controllers", 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.
Thanks Matthias!
Fixed
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.
Given that this PR is updating documentation, I request that a release note be added, such as:
Renamed "build operator" to "build controller" in code and documentation.
version/version.go
Outdated
// Version describes the version of build | ||
var Version = "0.0.1" | ||
// Version describes the version of Shipwright build controller | ||
var Version = "devel" |
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 don't think we are overwriting this value in make build
or make release
. If not, we should do so via go flags.
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.
Agree.
I changed it as a go flags in our main.go, now it can be set in the different release deployment, like:
➜ build git:(operator_refine) ✗ go run cmd/manager/main.go --version v0.3.0
{"level":"info","ts":1614919747.8687959,"logger":"build","msg":"Shipwright Build Controller Version: v0.3.0"}
{"level":"info","ts":1614919747.868852,"logger":"build","msg":"Go Version: go1.14.13"}
{"level":"info","ts":1614919747.868873,"logger":"build","msg":"Go OS/Arch: darwin/amd64"}
At the same time, I also remove the operator-sdk
version in the printVersion func.
Thanks!
Hi @HeavyWombat and @qu1queee , After the PR is merged: #632 I rebased this PR and remove the E2E related code change. Please review again. Thanks! |
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.
/lgtm
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qu1queee 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 |
/retest |
1 similar comment
/retest |
Seems the |
/retest |
Changes
After the PR
Rename Shipwright components away from "operator"
: #610There are still some codes and comments which uses
operator
which may make end user or new developer confusion.If we decide to swtich
build operator
toShipwright build controller
, we should review all codes and switch them all.operator-sdk
related words as before0.0.1
to0.3.0
/kind cleanup
Submitter Checklist
See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes