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

Profile controller not using camel case for resourcequotaspec and GcpServiceAccount #4389

Closed
jlewi opened this issue Oct 24, 2019 · 4 comments

Comments

@jlewi
Copy link
Contributor

jlewi commented Oct 24, 2019

/kind bug

Here is the profile created by default on gcp

kubectl -n kubeflow get profiles -o yaml
apiVersion: v1
items:
- apiVersion: kubeflow.org/v1beta1
  kind: Profile
  metadata:
    annotations:
      kubectl.kubernetes.io/last-applied-configuration: |
        {"apiVersion":"kubeflow.org/v1beta1","kind":"Profile","metadata":{"annotations":{},"name":"kubeflow-jlewi"},"spec":{"owner":{"kind":"User","name":"jlewi@google.com"}}}
    creationTimestamp: "2019-10-24T03:55:37Z"
    finalizers:
    - profile-finalizer
    generation: 2
    name: kubeflow-jlewi
    resourceVersion: "5648"
    selfLink: /apis/kubeflow.org/v1beta1/profiles/kubeflow-jlewi
    uid: 232bf931-f612-11e9-8cd6-42010a8e012b
  spec:
    owner:
      kind: User
      name: jlewi@google.com
    plugins:
    - kind: WorkloadIdentity
      spec:
        GcpServiceAccount: kftest-1023-204737-user@jlewi-dev.iam.gserviceaccount.com
    resourcequotaspec: {}

The names of the plugins field spec.GcpServiceAccount and resourcequotaspec do not follow standard Kubernetes camel case.

The convention is

gcpServiceAccount
resourceQuotaSpec

This code

GcpServiceAccount string `json:"gcpserviceaccount,omitempty"`

Leads me to expect it would be gcpserviceaccount

It looks like resourcequotaspec is set incorrectly here

ResourceQuotaSpec v1.ResourceQuotaSpec `json:"resourcequotaspec,omitempty"`

P0 because this is an API change and we want the API to not have to change after v1beta1.

@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label kind/bug to this issue, with a confidence of 0.97. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@lluunn
Copy link
Contributor

lluunn commented Oct 24, 2019

I don't understand with json:"gcpserviceaccount,omitempty" why it's showing GcpServiceAccount?

@jlewi
Copy link
Contributor Author

jlewi commented Oct 24, 2019

@kunmingg just submitted a fix
#4396

We need to cherry pick it onto the branch.

@jlewi
Copy link
Contributor Author

jlewi commented Oct 31, 2019

Verified this is fixed using

kubeflow/manifests - v0.7.0-rc.2-16-gd6dad08
kubeflow/kubeflow - v0.4.0-rc.1-802-gd66f8b97

kubectl -n kubeflow get profiles -o yaml
apiVersion: v1
items:
- apiVersion: kubeflow.org/v1beta1
  kind: Profile
  metadata:
    annotations:
      kubectl.kubernetes.io/last-applied-configuration: |
        {"apiVersion":"kubeflow.org/v1beta1","kind":"Profile","metadata":{"annotations":{},"name":"kubeflow-jlewi"},"spec":{"owner":{"kind":"User","name":"jlewi@google.com"}}}
    creationTimestamp: "2019-10-31T00:13:47Z"
    finalizers:
    - profile-finalizer
    generation: 2
    name: kubeflow-jlewi
    resourceVersion: "5343"
    selfLink: /apis/kubeflow.org/v1beta1/profiles/kubeflow-jlewi
    uid: 4f1bfd8e-fb73-11e9-a86e-42010a8e001c
  spec:
    owner:
      kind: User
      name: jlewi@google.com
    plugins:
    - kind: WorkloadIdentity
      spec:
        gcpServiceAccount: kftest-1030-170357-user@jlewi-dev.iam.gserviceaccount.com
    resourceQuotaSpec: {}
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

@jlewi jlewi closed this as completed Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants