Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #104 from upalatucci/stp-enabled-form
Browse files Browse the repository at this point in the history
OCPBUGS-36238: STP enabled by default
  • Loading branch information
openshift-merge-bot[bot] authored Jul 3, 2024
2 parents e8e378e + 0826821 commit b2ea8c8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/utils/components/PolicyForm/PolicyForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ const PolicyForm: FC<PolicyFormProps> = ({ policy, setPolicy, createForm = false
type: InterfaceType.LINUX_BRIDGE,
name: `interface-${draftPolicy.spec.desiredState.interfaces.length}`,
state: 'up',
});
bridge: {
options: {
stp: {
enabled: false,
},
},
},
} as NodeNetworkConfigurationInterface);
});
};

Expand Down
4 changes: 2 additions & 2 deletions src/utils/components/PolicyForm/PolicyInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const PolicyInterface: FC<PolicyInterfaceProps> = ({

if (newType === InterfaceType.LINUX_BRIDGE) {
delete draftInterface['link-aggregation'];
draftInterface.bridge = { port: [], options: {} };
draftInterface.bridge = { port: [], options: { stp: { enabled: false } } };
}

if (newType === InterfaceType.BOND) {
Expand Down Expand Up @@ -363,7 +363,7 @@ const PolicyInterface: FC<PolicyInterfaceProps> = ({
</Text>
}
id={`policy-interface-stp-${id}`}
isChecked={policyInterface?.bridge?.options?.stp?.enabled}
isChecked={policyInterface?.bridge?.options?.stp?.enabled !== false}
onChange={(_, newValue) => onSTPChange(newValue)}
isDisabled={isInterfaceCreated}
/>
Expand Down
7 changes: 7 additions & 0 deletions src/views/policies/new/NewPolicy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ const initialPolicy: V1NodeNetworkConfigurationPolicy = {
name: 'br0',
type: InterfaceType.LINUX_BRIDGE,
state: NETWORK_STATES.Up,
bridge: {
options: {
stp: {
enabled: false,
},
},
},
} as NodeNetworkConfigurationInterface,
],
},
Expand Down

0 comments on commit b2ea8c8

Please sign in to comment.