Skip to content

Commit

Permalink
Fix for Bug 1813369 - Wrong key for selecting nodes in MachineConfigPool
Browse files Browse the repository at this point in the history
  • Loading branch information
dtaylor113 committed Apr 6, 2020
1 parent 566f052 commit 54f6875
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
7 changes: 1 addition & 6 deletions frontend/public/components/machine-config-pool.tsx
Expand Up @@ -155,17 +155,12 @@ const MachineConfigPoolCounts: React.SFC<MachineConfigPoolCountsProps> = ({ obj

const MachineConfigPoolSummary: React.SFC<MachineConfigPoolSummaryProps> = ({ obj }) => {
const machineConfigSelector = _.get(obj, 'spec.machineConfigSelector');
const machineSelector = _.get(obj, 'spec.machineSelector');
return (
<ResourceSummary resource={obj}>
<ResourceSummary resource={obj} showNodeSelector>
<dt>Machine Config Selector</dt>
<dd>
<Selector kind={machineConfigReference} selector={machineConfigSelector} />
</dd>
<dt>Machine Selector</dt>
<dd>
<Selector kind={nodeReference} selector={machineSelector} />
</dd>
</ResourceSummary>
);
};
Expand Down
4 changes: 3 additions & 1 deletion frontend/public/components/utils/details-page.tsx
Expand Up @@ -37,7 +37,9 @@ const getTolerationsPath = (obj: K8sResourceKind): string => {

const getNodeSelectorPath = (obj: K8sResourceKind): string => {
// FIXME: Is this correct for all types (jobs, cron jobs)? It would be better for the embedding page to pass in the path.
return obj.kind === 'Pod' ? 'spec.nodeSelector' : 'spec.template.spec.nodeSelector';
return obj.kind === 'Pod' || obj.kind === 'MachineConfigPool'
? 'spec.nodeSelector'
: 'spec.template.spec.nodeSelector';
};

export const ResourceSummary: React.SFC<ResourceSummaryProps> = ({
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/models/yaml-templates.ts
Expand Up @@ -1007,7 +1007,7 @@ spec:
machineConfigSelector:
matchLabels:
machineconfiguration.openshift.io/role: master
machineSelector:
nodeSelector:
matchLabels:
node-role.kubernetes.io/master: ""
`,
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/module/k8s/index.ts
Expand Up @@ -685,7 +685,7 @@ export type MachineConfigPoolStatus = {

export type MachineConfigPoolSpec = {
machineConfigSelector?: Selector;
machineSelector?: Selector;
nodeSelector?: Selector;
paused: boolean;
maxUnavailable: number | string;
};
Expand Down

0 comments on commit 54f6875

Please sign in to comment.