Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit f514bae

Browse files
committed
fix observation of vlan attachments in response to API href changes
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
1 parent 03e098b commit f514bae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/controller/ports/assignment/managed.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package assignment
1818

1919
import (
2020
"context"
21-
"strings"
21+
"path"
2222

2323
"github.com/packethost/packngo"
2424
"github.com/pkg/errors"
@@ -127,7 +127,7 @@ func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.Ex
127127
}
128128

129129
for _, net := range port.AttachedVirtualNetworks {
130-
if strings.TrimPrefix(net.Href, "/virtual-networks/") == a.Spec.ForProvider.VirtualNetworkID {
130+
if path.Base(net.Href) == a.Spec.ForProvider.VirtualNetworkID {
131131
a.Status.SetConditions(xpv1.Available())
132132
o.ResourceExists = true
133133
}

0 commit comments

Comments
 (0)