GoogleCloudPlatform / k8s-config-connector

GCP Config Connector, a Kubernetes add-on for managing GCP resources
https://cloud.google.com/config-connector/docs/overview
Apache License 2.0
877 stars 214 forks source link

NetworkServicesMesh cannot be referenced #602

Open erikjoh opened 2 years ago

erikjoh commented 2 years ago

Checklist

Bug Description

The new NetworkServicesMesh (Alpha/Preview) resource cannot be referenced by other resources via non-external resource refs. Based on the error, this is because the GCP resources in the networkservices API don't have a selfLink field. See the API schema here

Additional Diagnostic Information

Kubernetes Cluster Version

Client Version: v1.23.3 Server Version: v1.22.4-gke.1501

Config Connector Version

1.72.1

Config Connector Mode

cluster

Log Output

Events:
  Type     Reason        Age               From                                 Message
  ----     ------        ----              ----                                 -------
  Warning  UpdateFailed  3s (x4 over 14s)  networkservicesgrpcroute-controller  Update call failed: error fetching live state: error converting to lite state: error resolving reference field meshes: error resolving target field value for referenced resource fabric-rnd/mesh with GroupVersionKind networkservices.cnrm.cloud.google.com/v1beta1, Kind=NetworkServicesMesh: couldn't resolve the value for target field selfLink from the referenced resource fabric-rnd/mesh

Steps to Reproduce

Steps to reproduce the issue

First, replace <project name> with a valid project name.

kubectl apply -f snippet.yaml
kubectl get networkservicesgrpcroutes -w # watch until UpdateFailed
kubectl describe networkservicesgrpcroutes route

YAML snippets

# snippet.yaml
apiVersion: networkservices.cnrm.cloud.google.com/v1beta1
kind: NetworkServicesMesh
metadata:
  name: mesh
spec:
  location: global
  projectRef:
    external: projects/<project name>
---
apiVersion: networkservices.cnrm.cloud.google.com/v1beta1
kind: NetworkServicesGRPCRoute
metadata:
  name: route
spec:
  location: global
  projectRef:
    external: projects/<project name>
  meshes:
    - name: mesh  # This should work
  hostnames:
    - hostname
  rules: []
xiaobaitusi commented 2 years ago

Hi @erikjoh, thanks for reporting the issue.

We will engage the AppNet Service team to look into the fix.