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

OCPBUGS-36238: STP enabled by default #104

Merged
merged 1 commit into from
Jul 3, 2024
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
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
Loading