-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add types for cross project quota #9029
Conversation
@derekwaynecarr ptal |
// this resource. | ||
Selector map[string]string | ||
|
||
// Spec defines the desired quota |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quota
I need to check fuzzer tests. It seems unlikely that they all just fell out correctly. |
|
||
// orderedMap is a very simple ordering a map tracking insertion order. It allows fast and stable serializations | ||
// for our encoding. You could probably do something fancier with pointers to interfaces, but I didn't. | ||
type orderedMap struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smarterclayton not the most efficient structure, but I think its good enough to start.
Reminder. It would be nice to have this ready when I got back :) |
} | ||
|
||
// ResourceQuotasStatusByNamespace provides type correct methods | ||
type ResourceQuotasStatusByNamespace struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this not a type alias?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this not a type alias?
Not all OrderedMaps
can be dealt with as ResourceQuotaStatusByNamespaces
. I don't want to encourage casting.
Any issues in concept? List versus slice is internal enough change later. |
// ByNamespace slices the usage by namespace. This division allows for quick resolution of | ||
// deletion reconcilation inside of a single namespace without requiring a recalculation | ||
// across all namespaces. This can be used to pull the deltas for a given namespace. | ||
ByNamespace ResourceQuotasStatusByNamespace `json:"byNamespace"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NamespaceStatuses
, consistent with ContainerStatuses
. by
is awkward. Rename internally as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or Namespaces
. I think I like Namespaces
.
Are you using the new label selector? |
Yes. Wasn't expecting it in unversioned though. |
Guess so. API is fine if you change to |
8d7cd32
to
ab8ac03
Compare
Name changed. [test] |
062f903
to
01a93f7
Compare
[merge] |
aee06d9
to
4a57da1
Compare
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/4994/) (Image: devenv-rhel7_4391) |
Evaluated for origin merge up to 51a1e57 |
Evaluated for origin test up to 51a1e57 |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/4988/) |
@@ -0,0 +1,3 @@ | |||
// Package v1 is the v1 version of the API. | |||
// +genconversion=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mfojtik mind fixing this in your clientset generation PR? You're putting that comment in types.go
rather than package doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@soltysh clientset generator works differently, it needs to be in types to get the name of the type...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/me was blind, I blame Monday ;)
Adds the types for cross project quota in a new API group.
@openshift/api-review