this is my very first question here :)
I am trying to write something in Go which for the moment is just getting ResourceQuotas. While testing I noticed that when importing k8s.io/api/core/v1 like this:
coreV1 "k8s.io/api/core/v1"
And having a variable like this, with the type coming from coreV1:
rq := &coreV1.ResourceQuota{
TypeMeta: v1.TypeMeta{},
ObjectMeta: v1.ObjectMeta{},
Spec: coreV1.ResourceQuotaSpec{
Hard: map[coreV1.ResourceName]resources.Quantity{},
Scopes: []coreV1.ResourceQuotaScope{},
ScopeSelector: &coreV1.ScopeSelector{},
},
Status: coreV1.ResourceQuotaStatus{},
}
I am not able to e.g. set a ResourceQuota's requests.cpu or limits.cpu, only this is possible:
CPULimts := rq.Spec.Hard.Cpu()
fmt.Println(CPULimts)
Am I using it wrong or missing something? ResourceQuotas like this: https://kubernetes.io/docs/concepts/policy/resource-quotas/#viewing-and-setting-quotas are working just perfectly fine in many of the clusters I manage.
Do I maybe need to use some other package?
Thank you in advance!