-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 go modules, update controller-{runtime, tools} to v2 #1054
Use go modules, update controller-{runtime, tools} to v2 #1054
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri 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 |
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.
Hi @vincepri,
I need more time to review this, but I did have two initial comments. One is in the code, and the other is this -- is it necessary to tie Go modules to the changes for v2? I see a lot of code changes that appear unrelated to modules.
b9ddf69
to
08fee7e
Compare
0a21b7f
to
0583f26
Compare
Current blockers:
Non blocking issues:
|
0583f26
to
6f870ec
Compare
/test pull-cluster-api-build |
6f870ec
to
e638a83
Compare
b20e6cf
to
9f7d9c9
Compare
5b63789
to
5270eec
Compare
/hold Currently waiting for directions on how to handle the ObjectMeta embedding issue from @DirectXMan12 and others. We can decide to merge this as it is with the fork to temporarily unblock v1alpha2 progress or wait if the timeframe to fix it in controller-tools works. |
5270eec
to
eac35da
Compare
/hold cancel |
/assign @ncdc |
I have at least 1 pending review comment that will need fixing before we merge, but I'm still making my way through the diffs. Until I get that submitted: /hold |
eac35da
to
2527418
Compare
Signed-off-by: Vince Prignano <vincepri@vmware.com>
2527418
to
cd23cbd
Compare
/lgtm |
/hold cancel |
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.
Late to the party, but a few things stood out to me when taking a look.
@@ -25,7 +25,7 @@ Global Flags: | |||
--log-file-max-size uint Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800) | |||
--log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) | |||
--logtostderr log to standard error instead of files (default true) | |||
--master string The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. | |||
--master --kubeconfig (Deprecated: switch to --kubeconfig) The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster. |
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 seems like an odd diff 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.
I checked with a master build of clusterctl
and it seems that's just how the help is printed out
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.
right, this seems broken
`kubebuilder` to create an example provider. For more information on `kubebuilder` | ||
and CRDs in general we highly recommend reading the [Kubebuilder Book][kubebuilder-book]. | ||
Much of the information here was adapted directly from it. The minimal version of | ||
`kubebuilder` required is [`v1.0.5`][kubebuilder-1.0.5]. | ||
`kubebuilder` required is [`v2.0.0`][kubebuilder-2.0.0]. |
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 suspect there will be more changes needed to the book to accommodate this change, should have an issue to track that work.
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.
Opened #1075
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and | |||
limitations under the License. | |||
*/ | |||
|
|||
// Code generated by client-gen. DO NOT EDIT. | |||
// Code generated by main. DO NOT EDIT. |
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 big ugly, is this because it is run using go run
now instead of compiling and running the binary?
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
// +kubebuilder:rbac:groups=cluster.k8s.io,resources=clusters,verbs=get;list;watch;create;update;patch;delete | ||
// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machines;machines/status,verbs=get;list;watch;create;update;patch;delete | ||
// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machinedeployments;machinedeployments/status,verbs=get;list;watch;create;update;patch;delete | ||
// +kubebuilder:rbac:groups=cluster.k8s.io,resources=machinesets;machinesets/status,verbs=get;list;watch;create;update;patch;delete |
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.
Are the annotations no longer supported closer to where there are required?
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.
They don't work if defined elsewhere, that's why I moved them in 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.
they should work anywhere in the packages that controller-gen is told to read, as long at they're not in, say, the Godoc for a function or something.
@@ -43,7 +43,7 @@ func ValidateClusterAPIObjects(ctx context.Context, w io.Writer, c client.Client | |||
} | |||
|
|||
machines := &clusterv1alpha1.MachineList{} | |||
if err := c.List(ctx, client.InNamespace(namespace), machines); err != nil { | |||
if err := c.List(ctx, machines, client.InNamespace(namespace)); err != nil { |
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.
What caused the ordering to change here? Is it just related to the updated client generation?
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.
It's from a controller-runtime change to the method signature
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.
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 changed the method signature to be in line with other methods and to support easier option passing.
Signed-off-by: Vince Prignano vincepri@vmware.com
What this PR does / why we need it:
controller-runtime
tov0.2.0-beta.2
.controller-tools
tov0.2.0-beta.2
.dep
,Gopkg.lock
, andGopkg.toml
.controller-tools
utilities.hack/tools.go
file to force-vendor utilities.hack/ensure-go.sh
to check and setup Go for modules.-
from controller names (e.g.machine-controller
->machine_controller
).kubectl@1.14.1
andkind@0.3.0
.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #1025
Special notes for your reviewer:
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
Release note: