Skip to content

Commit

Permalink
Manage machine role
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Haeusler committed Jun 29, 2020
1 parent e6b447d commit d882847
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ local params = inv.parameters.openshift4_nodes;

local machine = function(name, spec)
local machineSpec = if std.objectHas(spec, 'spec') then spec.spec else {};
local type = if std.objectHas(spec, 'type') then spec.type else 'worker';
com.namespaced('openshift-machine-api', kube._Object('machine.openshift.io/v1beta1', 'MachineSet', name) {
metadata+: {
labels+: {
Expand All @@ -27,8 +28,8 @@ local machine = function(name, spec)
creationTimestamp: null,
labels: {
'machine.openshift.io/cluster-api-cluster': params.infrastructureID,
'machine.openshift.io/cluster-api-machine-role': 'worker',
'machine.openshift.io/cluster-api-machine-type': 'worker',
'machine.openshift.io/cluster-api-machine-role': type,
'machine.openshift.io/cluster-api-machine-type': type,
'machine.openshift.io/cluster-api-machineset': name,
},
},
Expand Down

0 comments on commit d882847

Please sign in to comment.