K8s-config-connector: IAMPolicyMember GoClient resourceRef type doesn't match schema in document

Created on 2 Mar 2021  路  6Comments  路  Source: GoogleCloudPlatform/k8s-config-connector

Checklist

  • [x] I did not find a related open issue.
  • [x] I did not find a solution in the troubleshooting guide: (https://cloud.google.com/config-connector/docs/troubleshooting)
  • [ ] If this issue is time-sensitive, I have submitted a corresponding issue with GCP support.

Bug Description

I'm trying to use the Go client package for IAMPolicyMember based on https://cloud.google.com/config-connector/docs/reference/resource-docs/iam/iampolicymember#external_project_level_policy_member. But the package doesn't match the schema in the document.

In the doc:

// ...
  spec:
    member: serviceAccount:iampolicymember-dep-projectlevel@${PROJECT_ID?}.iam.gserviceaccount.com
    role: roles/storage.admin
    resourceRef:
      apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1
      kind: Project
      external: projects/${PROJECT_ID?}

In the package (https://github.com/GoogleCloudPlatform/k8s-config-connector/blob/f158208856e727336001b17397cbaa4c918d2ba4/pkg/apis/k8s/v1alpha1/condition_types.go#L29-L37):

type ResourceRef struct {
    /* The external name of the referenced resource */
    External string `json:"external,omitempty"`
    /* Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names */
    Name string `json:"name,omitempty"`
    /* Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ */
    Namespace string `json:"namespace,omitempty"`
}

Therefore, I can't specify a response properly.

Additional Diagnostic Information

Kubernetes Cluster Version

N/A

Config Connector Version

N/A

Config Connector Mode

N/A

Log Output

N/A

Steps to Reproduce

Steps to reproduce the issue

$ go get github.com/GoogleCloudPlatform/[email protected]

YAML snippets

N/A

bug

Most helpful comment

Hi @aw185176, thanks for elaborating on the impact that this issue has on you. Such details help us with prioritization.

A fix is currently being worked on, and the estimate of a "few weeks" given in the other thread still holds true. We'll update this thread when the fix is released.

All 6 comments

Hi @micnncim , thank you for reporting the issue. We'll look into fixing it. Will post updates when we have new information.

@maqiuyujoyce Hi, how is the progress? Anything I can help with?

Hi @micnncim thank you for your follow up and offering for help! We are still working on it. Will post updates when the fix is out.

Gently pinging this thread to mention that this issue is blocking us from sunsetting our homerolled KCC Go types.

Hi @aw185176, thanks for elaborating on the impact that this issue has on you. Such details help us with prioritization.

A fix is currently being worked on, and the estimate of a "few weeks" given in the other thread still holds true. We'll update this thread when the fix is released.

The issue should be fixed in Config Connector v1.50.0.

Was this page helpful?
0 / 5 - 0 ratings