-
Notifications
You must be signed in to change notification settings - Fork 0
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 Organization type #11
Conversation
db40c14
to
7661a74
Compare
The Organization type is provided by a custom API server. This requires the Organization resource to be in a different group than the CRDs. We introduce the group `organization.appuio.io`
7661a74
to
96cb276
Compare
81e127b
to
cf5704f
Compare
d2250f8
to
2ffadfc
Compare
ab78343
to
4e8becc
Compare
4e8becc
to
ef8ae8c
Compare
eb23345
to
b55ca40
Compare
b55ca40
to
fff02ee
Compare
7648f21
to
da95fdf
Compare
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.
LGTM overall, I looked at the following files carefully and didn't spot any errors:
apis/organization/v1/organization_types.go
apiserver/organization/organization.go
apiserver/organization/organization_list.go
apiserver/organization/table.go
Re codeclimate: Would it make sense to tune the maintainability checks to accept the methods which currently generate warnings (cf. https://docs.codeclimate.com/docs/advanced-configuration#section-default-checks)?
Re codeclimate: You can manually make exceptions for individual cases if you're logged in (I did it for 2 of 3). They are persistent. |
It has nothing to do with Go's error handling. It's just a complex interface defined by Kubernetes that we need to implement and there is nothing we can do about it. |
13e0fb7
to
88ad247
Compare
I'm pretty sure we could apply refactoring methods like "extract method" or introduce other helpers for it, but let's not make a fuss now ;) |
Oh wait I completely misread the issue from codeclimate 🤦 I thought it complained about the number of return values.. So yes I guess we could "fix" that. But I'm not sure that would improve readability. |
* Improve naming of helper function * Add go generate to makefile * Make README more copy pastable
a582d17
to
72d740a
Compare
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.
LGTM, while I'm not super versed here I did not find any obvious code errors
🚀
Co-authored-by: Chris <github.account@chrigel.net>
The Organization type is provided by a custom API server. This requires the Organization resource to be in a different group than the CRDs. We introduce the group
organization.appuio.io
Summary
This PR got quite large, however a lot of the code is auto-generated or tests.
I used the apiserver-runtime to reduce the amount of boilerplate, but the core business logic is independent from the library
Organization
type inapis/organization
.apiserver/organization
contains the actual API server implementationorganization.go
andorganization_list.go
contain theorganizationStorage
object that implements therest.Storage
interface of Kubernetes and is the core of the api server.namespaces.go
is only a thin layer of abstraction to access namespaces. I introduce it to more easily mock the interaction with Kubernetes in tests (See the auto-generatemock/
package)table.go
handles the server side printing for kubectlI will handle deployment and adding the api server to the local-environment as a separate PR.
The CodeClimate issues are interfaces of Kubernetes
Checklist
bug
,enhancement
,documentation
,change
,breaking
,dependency
as they show up in the changelog.