Skip to content
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

Rename labels from sigs.k8s.io to machine.openshift.io #213

Merged
merged 3 commits into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ $ make nodelink-controller
1. Create a machineset and locate its selector. Assuming the selector corresponds
to the following list of match labels:
```
sigs.k8s.io/cluster-api-cluster: cluster
sigs.k8s.io/cluster-api-machine-role: worker
sigs.k8s.io/cluster-api-machine-type: worker
sigs.k8s.io/cluster-api-machineset: cluster-worker-us-east-1a
machine.openshift.io/cluster-api-cluster: cluster
machine.openshift.io/cluster-api-machine-role: worker
machine.openshift.io/cluster-api-machine-type: worker
machine.openshift.io/cluster-api-machineset: cluster-worker-us-east-1a
```

1. Define a `MachineHealthCheck` manifest that will be watching all machines
Expand All @@ -74,10 +74,10 @@ $ make nodelink-controller
spec:
selector:
matchLabels:
sigs.k8s.io/cluster-api-cluster: cluster
sigs.k8s.io/cluster-api-machine-role: worker
sigs.k8s.io/cluster-api-machine-type: worker
sigs.k8s.io/cluster-api-machineset: cluster-worker-us-east-1a
machine.openshift.io/cluster-api-cluster: cluster
machine.openshift.io/cluster-api-machine-role: worker
machine.openshift.io/cluster-api-machine-type: worker
machine.openshift.io/cluster-api-machineset: cluster-worker-us-east-1a
```

1. Pick a node that is managed by one of the machineset's machines
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ func hasMatchingLabels(machineHealthCheck *healthcheckingv1alpha1.MachineHealthC

func isMaster(machine mapiv1.Machine, client client.Client) bool {
machineMasterLabels := []string{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will need to be backward compatible for not to break

"machine.openshift.io/cluster-api-machine-role",
"machine.openshift.io/cluster-api-machine-type",
"sigs.k8s.io/cluster-api-machine-role",
"sigs.k8s.io/cluster-api-machine-type",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,8 @@ func TestRemediate(t *testing.T) {

func TestIsMaster(t *testing.T) {
masterMachine := machine("master")
masterMachine.Labels["sigs.k8s.io/cluster-api-machine-role"] = "master"
masterMachine.Labels["sigs.k8s.io/cluster-api-machine-type"] = "master"
masterMachine.Labels["machine.openshift.io/cluster-api-machine-role"] = "master"
masterMachine.Labels["machine.openshift.io/cluster-api-machine-type"] = "master"
masterMachine.Status = mapiv1alpha1.MachineStatus{
NodeRef: &corev1.ObjectReference{
Namespace: "",
Expand All @@ -494,8 +494,8 @@ func TestIsMaster(t *testing.T) {
masterNode.Labels["node-role.kubernetes.io/master"] = ""

workerMachine := machine("worker")
workerMachine.Labels["sigs.k8s.io/cluster-api-machine-role"] = "worker"
workerMachine.Labels["sigs.k8s.io/cluster-api-machine-type"] = "worker"
workerMachine.Labels["machine.openshift.io/cluster-api-machine-role"] = "worker"
workerMachine.Labels["machine.openshift.io/cluster-api-machine-type"] = "worker"

workerMachine.Status = mapiv1alpha1.MachineStatus{
NodeRef: &corev1.ObjectReference{
Expand Down
4 changes: 2 additions & 2 deletions test/integration/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (

const (
// AwsCredsSecretIDKey is secret key containing AWS KeyId
AwsCredsSecretIDKey = "awsAccessKeyId"
AwsCredsSecretIDKey = "aws_access_key_id"
// AwsCredsSecretAccessKey is secret key containing AWS Secret Key
AwsCredsSecretAccessKey = "awsSecretAccessKey"
AwsCredsSecretAccessKey = "aws_secret_access_key"
)

// NewClient creates our client wrapper object for the actual AWS clients we use.
Expand Down
4 changes: 2 additions & 2 deletions test/integration/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ metadata:
namespace: openshift-machine-api
type: Opaque
data:
awsAccessKeyId: $(echo -n $(aws configure get aws_access_key_id) | base64)
awsSecretAccessKey: $(echo -n $(aws configure get aws_secret_access_key) | base64)
aws_access_key_id: $(echo -n $(aws configure get aws_access_key_id) | base64)
aws_secret_access_key: $(echo -n $(aws configure get aws_secret_access_key) | base64)
spangenberg marked this conversation as resolved.
Show resolved Hide resolved
HEREDOC
18 changes: 9 additions & 9 deletions test/integration/manifests/machineset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
labels:
sigs.k8s.io/cluster-api-cluster: {{ .ClusterID }}
sigs.k8s.io/cluster-api-machine-role: worker
sigs.k8s.io/cluster-api-machine-type: worker
machine.openshift.io/cluster-api-cluster: {{ .ClusterID }}
machine.openshift.io/cluster-api-machine-role: worker
machine.openshift.io/cluster-api-machine-type: worker
name: worker
namespace: openshift-machine-api
spec:
replicas: 2
selector:
matchLabels:
sigs.k8s.io/cluster-api-cluster: {{ .ClusterID }}
sigs.k8s.io/cluster-api-machineset: worker
machine.openshift.io/cluster-api-cluster: {{ .ClusterID }}
machine.openshift.io/cluster-api-machineset: worker
template:
metadata:
labels:
sigs.k8s.io/cluster-api-cluster: {{ .ClusterID }}
sigs.k8s.io/cluster-api-machine-role: worker
sigs.k8s.io/cluster-api-machine-type: worker
sigs.k8s.io/cluster-api-machineset: worker
machine.openshift.io/cluster-api-cluster: {{ .ClusterID }}
machine.openshift.io/cluster-api-machine-role: worker
machine.openshift.io/cluster-api-machine-type: worker
machine.openshift.io/cluster-api-machineset: worker
spec:
providerSpec:
value:
Expand Down