Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Gerber <[email protected]>
  • Loading branch information
DebakelOrakel and simu committed Jun 18, 2024
1 parent f207313 commit 1656ef9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 5 additions & 7 deletions component/machine-sets.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ local cpMachineSetSpecs = function(set)
},
} + {
metadata+: {
annotations+: com.getValueOrDefault(set, 'annotations', {}),
annotations+: std.get(set, 'annotations', {}),
namespace: params.machineApiNamespace,
},
spec+: {
replicas: com.getValueOrDefault(set, 'replicas', 1),
replicas: std.get(set, 'replicas', 1),
selector+: {
matchLabels+: {
'machine.openshift.io/cluster-api-cluster': params.infrastructureID,
'machine.openshift.io/cluster-api-machine-role': 'master',
'machine.openshift.io/cluster-api-machine-type': 'master',
},
},
state+: 'Inactive',
state: 'Inactive',
strategy+: {
type: 'OnDelete',
},
Expand All @@ -101,8 +101,6 @@ local cpMachineSetSpecs = function(set)
},
},
spec+: {
lifecycleHooks+: {},
metadata+: {},
[if isGCP then 'providerSpec']+: {
value+: {
machineType: set.instanceType,
Expand All @@ -119,8 +117,8 @@ local cpMachineSetSpecs = function(set)
};

local machineSet = function(name, set)
local role = if std.objectHas(set, 'role') then set.role else name;
local spec = if std.objectHas(set, 'spec') then com.makeMergeable(set.spec) else {};
local role = std.get(set, 'role', name);
local spec = com.makeMergeable(std.get(set, 'spec', {}));
if role == 'master' then cpMachineSetSpecs(set) { spec+: spec }
else machineSetSpecs(name, set, role) { spec+: spec };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ spec:
machine.openshift.io/cluster-api-machine-role: master
machine.openshift.io/cluster-api-machine-type: master
spec:
lifecycleHooks: {}
metadata: {}
providerSpec:
value:
apiVersion: gcpprovider.openshift.io/v1beta1
Expand Down

0 comments on commit 1656ef9

Please sign in to comment.