-
Notifications
You must be signed in to change notification settings - Fork 44
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
Drop unused labels from installer machineSets #182
Drop unused labels from installer machineSets #182
Conversation
6119232
to
f79bd3f
Compare
examples/machine-set.yaml
Outdated
spec: | ||
metadata: | ||
labels: | ||
node-role.kubernetes.io/master: "infra" |
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.
Is node-role.kubernetes.io/master: "infra"
a valid role label? I am familiar only with node-role.kubernetes.io/master: ""
and node-role.kubernetes.io/worker: ""
forms.
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 value is string type and i have seen forms like node-role.kubernetes.io/master: "true"
as well, I think it depends on implementation that what is treated as valid.
Alternative could be to use two labels: node-role.kubernetes.io/master: ""
and node-role.kubernetes.io/infra: ""
. But since data type allows arbitrary strings, thought of using it instead of increasing label count.
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 should be node-role.kubernetes.io/master
and node-role.kubernetes.io/infra
.
@@ -6,8 +6,6 @@ metadata: | |||
namespace: test | |||
labels: | |||
machine.openshift.io/cluster-api-cluster: tb-asg-35 | |||
machine.openshift.io/cluster-api-machine-role: infra | |||
machine.openshift.io/cluster-api-machine-type: master | |||
spec: |
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.
Machine HC controller is still using the labels to filter out master nodes [1]. Do we have any replacement for it?
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.
will update mao as well. 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.
/test e2e-aws-operator |
189a7ae
to
b16436b
Compare
pkg/actuators/machine/utils.go
Outdated
@@ -189,7 +189,7 @@ func providerConfigFromMachine(client client.Client, machine *machinev1.Machine, | |||
|
|||
// isMaster returns true if the machine is part of a cluster's control plane | |||
func isMaster(machine *machinev1.Machine) bool { | |||
if machineType, exists := machine.ObjectMeta.Labels[providerconfigv1.MachineTypeLabel]; exists && machineType == "master" { | |||
if _, exists := machine.Spec.ObjectMeta.Labels["node-role.kubernetes.io/master"]; exists { |
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.
can we fetch from node 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.
@enxebre done!
b16436b
to
67ac39b
Compare
/test e2e |
/test e2e-aws |
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ingvagabund 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 |
/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.
I know this has merged but I had some comments having looked at the description for:
ObjectMeta: metav1.ObjectMeta{ | ||
Labels: map[string]string{ | ||
"node-role.kubernetes.io/master": "", | ||
"node-role.kubernetes.io/infra": "", |
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.
Looking through the PR I got the impression we were removing infra
.
return true | ||
func (a *Actuator) isMaster(machine *machinev1.Machine) (bool, error) { | ||
if machine.Status.NodeRef == nil { | ||
glog.Errorf("NodeRef not found in machine %s", machine.Name) |
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 this can be transient should we log at warning
level?
return false, fmt.Errorf("failed to get node from machine %s", machine.Name) | ||
} | ||
|
||
if _, exists := node.Labels["node-role.kubernetes.io/master"]; exists { |
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 rest of this can collapse to:
_, exists := node.Labels["node-role.kubernetes.io/master"]
return exists
Signed-off-by: Naadir Jeewa <[email protected]>
https://jira.coreos.com/browse/CLOUD-407