-
Notifications
You must be signed in to change notification settings - Fork 578
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
Supplemental update for v1alpha2 #896
Supplemental update for v1alpha2 #896
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 |
00340df
to
2596d19
Compare
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 fine to me, one q about the rbac though
- apiGroups: | ||
- "" | ||
- cluster.sigs.k8s.io |
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 the v1a1 api group for clusters?
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 CAPI v1a2 group
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.
- no, it's not
- i solved my rbac issue thanks to this 😂
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.
oops sorry didn't see your response, i was responding to myself, not you!
edb1cb2
to
5bdf1d1
Compare
/test pull-cluster-api-provider-aws-bazel-integration |
5bdf1d1
to
ac34e79
Compare
/test pull-cluster-api-provider-aws-bazel-integration |
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
6a88e5a
to
59ab908
Compare
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
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 commit looks fine. the code is removed as it should be in CABPK
Signed-off-by: Vince Prignano <[email protected]>
a5bf3c8
to
d0e1047
Compare
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
/test pull-cluster-api-provider-aws-bazel-integration |
CoreClient: coreClient, | ||
Client: cs.ClusterV1alpha2(), | ||
ClusterClient: cs.ClusterV1alpha2(), |
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.
Not needed currently, but as we continue to refine for v1alpha2, since we have access to the manager client, we should probably remove the typed clients.
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.
Totally agree, once the Cluster actuator is also out, we might be able to get rid of them easily
items: | ||
description: AWSMachineProviderCondition is a condition in a AWSMachineProviderStatus | ||
description: NodeAddress contains information for the node's address. |
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.
s/NodeAddress/MachineAddresses or InstanceAddresses since we said that these do not need to align with the reported NodeAddresses from the Cloud Provider integration.
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.
Do we need to fork/copy the NodeAddress struct?
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'm thinking it wouldn't hurt to create our own with inspiration from the NodeAddress struct, since we could very well end up with different requirements down the line.
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'll open a PR to CAPI to fork the type, so other providers can use it as well. I can follow-up in a new PR to fixup the CRD/dependency or fix it here, which do you prefer?
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.
followup is good
@@ -25,6 +25,12 @@ import ( | |||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |||
) | |||
|
|||
const ( | |||
AnnotationClusterInfrastructureReady = "aws.cluster.sigs.k8s.io/infrastructure-ready" |
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.
Should this be: aws.infrastructure.cluster.sigs.k8s.io
instead?
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 :)
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.
(For v1alpha2)
} | ||
|
||
// create creates a machine and is invoked by the machine controller. | ||
func (r *ReconcileAWSMachine) create(scope *actuators.MachineScope) 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.
Since this is eventually calling CreateOrGetMachine
should this be named createOrGet
instead?
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 so, I copied the old actuator code. But this create
call only happens if the exist
call doesn't succeed
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 probably need to clean this up quite a bit down the line, no need to do additional queries against the AWS api if we've already verified the existence.
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.
Completely agree
|
||
scope.SetInstanceID(i.ID) | ||
scope.SetInstanceState(i.State) | ||
scope.SetAnnotation("cluster-api-provider-aws", "true") |
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.
Shouldn't this annotation be namespaced?
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 can definitely namespace it, I copied it from the old codebase
case infrav1.InstanceStateRunning: | ||
scope.Info("Machine instance is running", "instance-id", *scope.GetInstanceID()) | ||
case infrav1.InstanceStatePending: | ||
scope.Info("Machine instance is pending", "instance-id", *scope.GetInstanceID()) |
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 said that the Machine should enter an error state if the underlying instance is no longer available, should that be taken into account 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'll follow-up with more logic changes in later PRs, how does that sound? There is a bunch of things to take care of, e.g. Ready/Addresses/etc
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
Signed-off-by: Vince Prignano <[email protected]>
} | ||
|
||
// AWSMachineStatus defines the observed state of AWSMachine | ||
type AWSMachineStatus struct { | ||
// InstanceID is the instance ID of the machine created in AWS | ||
// Ready is true when the provider resource is ready. | ||
Ready *bool `json:"ready,omitempty"` |
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.
Remind me why this is optional?
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 went for *bool
on Status.InfrastructureReady
, didn't we want to keep all of them consistent? I honestly don't remember anymore why we decided to go that route, I'll need to dig some CAPI PR
/lgtm |
Signed-off-by: Vince Prignano [email protected]
What this PR does / why we need it:
This PR is a supplemental update for #892 and adds the following:
manager/main.go
to include the new controller and API types.AWSMachineTemplate
type to be used with MachineSets.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 #
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: