Repository navigation
Description
Summary
Core accepts an EdgeRoute whose provider declares PrefixReachability only at a version core does not implement. Route acceptance checks that the provider lists the capability by name and ignores its version, so a provider that declares only PrefixReachability at v9 gets its routes accepted and advertised with v1 behavior.
The check is
galactic/internal/edge/route/check.go
Lines 237 to 254 in b00948a
| // checkProvider reads the route's provider: approved and implementing | |
| // PrefixReachability. | |
| func checkProvider(ctx context.Context, reader client.Reader, rt *galacticv1alpha1.EdgeRoute) (*Refusal, error) { | |
| var prov galacticv1alpha1.EdgeProvider | |
| switch err := reader.Get(ctx, client.ObjectKey{Name: rt.Spec.ProviderRef.Name}, &prov); { | |
| case apierrors.IsNotFound(err): | |
| return refuse(string(admission.UnknownProvider), "EdgeProvider %s does not exist", rt.Spec.ProviderRef.Name), nil | |
| case err != nil: | |
| return nil, err | |
| case !prov.Status.Approved || !prov.DeletionTimestamp.IsZero(): | |
| return refuse(string(admission.ProviderNotApproved), "EdgeProvider %s is not approved", prov.Name), nil | |
| case !slices.ContainsFunc(prov.Spec.Capabilities, func(c galacticv1alpha1.EdgeCapability) bool { | |
| return c.Name == PrefixReachability | |
| }): | |
| return refuse(string(admission.UnsupportedCapability), "EdgeProvider %s does not implement %s", | |
| prov.Name, PrefixReachability), nil | |
| } | |
| return nil, nil |
EdgeProvider lists: | - A core release implements the capability versions listed under [Decisions](#decisions). Admission refuses any other capability version with `UnsupportedCapability`, even one the `EdgeProvider` lists. |
Reproduce
- Register and approve an
EdgeProviderwhose onlyPrefixReachabilityentry is atv9. - Grant it an
EdgeServicewithPrefixReachabilityand a prefix. - From a ready attachment of that provider, claim an
EdgeRoutefor a prefix inside the grant. - The route is accepted.
Acceptance criteria
- A route is refused with
UnsupportedCapabilitywhen its provider declaresPrefixReachabilityat no version core implements - A route whose provider declares
PrefixReachabilityat a version core implements is accepted as before
Activity
fix(edge): Refuse routes at an unsupported PrefixReachability version