Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO-ISSUE: Fix use of deprecated MetalLB CRDs in UI #827

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions ui/frontend/src/components/PersistPage/persistServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const createAddressPool = async (
const object = cloneDeep(ADDRESS_POOL_TEMPLATE);
object.metadata.generateName = `ztpfw-${type}-`;
// object.metadata.namespace = namespace;
object.spec.addresses = [`${serviceIp}-${serviceIp}`];
object.spec.addresses = [`${serviceIp}/32`];

const response = await createResource(object).promise;
console.log('Resource created: ', response);
Expand Down Expand Up @@ -65,20 +65,20 @@ const patchAddressPool = async (
{
op: 'replace',
path: '/spec/addresses',
value: [`${serviceIp}-${serviceIp}`],
value: [`${serviceIp}/32`],
},
];

try {
await patchResource(addrPoolObj, addrPoolPatches).promise;
console.log(
`Patched ${addressPoolName} AddressPool name in the ${ADDRESS_POOL_NAMESPACE} namespace`,
`Patched ${addressPoolName} IPAddressPool name in the ${ADDRESS_POOL_NAMESPACE} namespace`,
);
} catch (e) {
console.error('Can not patch resource: ', e, addrPoolObj, addrPoolPatches);
setError({
title: RESOURCE_PATCH_TITLE,
message: `Can not update ${addressPoolName} AddressPool in the ${ADDRESS_POOL_NAMESPACE} namespace.`,
message: `Can not update ${addressPoolName} IPAddressPool in the ${ADDRESS_POOL_NAMESPACE} namespace.`,
});
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions ui/frontend/src/components/PersistPage/resourceTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import {
import { ADDRESS_POOL_NAMESPACE } from './constants';

export const ADDRESS_POOL_TEMPLATE = {
apiVersion: 'metallb.io/v1alpha1',
kind: 'AddressPool',
apiVersion: 'metallb.io/v1beta1',
kind: 'IPAddressPool',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike AddressPool IPAddressPool is used only for the ip assignment part. In order to advertise the IP you should create L2Advertisement.

https://github.com/metallb/metallb/blob/main/configsamples/simple_pool_adv_l2.yaml

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the advertisements for the ingress and API are created here and here. That was updated when we switched to the new version of MetalLB. The problem is the UI wasn't updated accordingly.

metadata: {
generateName: 'ztpfw-', // To be filled
name: '',
namespace: ADDRESS_POOL_NAMESPACE,
},
spec: {
protocol: 'layer2',
autoAssign: false,
addresses: [
'', // To be filled, example: '172.18.0.100-172.18.0.255',
'', // To be filled, example: '172.18.0.100/32',
],
},
};
Expand Down