-
Notifications
You must be signed in to change notification settings - Fork 167
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
get rest api to work with 4.0 api structure, also took out oapi refer… #88
Conversation
Please note that this fix applies to |
I have created a v3 branch but already merged your other PR. And it was filed against |
@akostadinov thanks...I think it should be ok, since we need to maintain both v3 and v4 per your discussion. #87 should still apply to |
…ences since it has become obsolete
@akostadinov ok, I've resolved the conflicts |
lib/rest_openshift.rb
Outdated
return perform(**base_opts, method: "DELETE") | ||
end | ||
|
||
def self.list_projects(base_opts, opts) | ||
populate("/projects", base_opts, opts) | ||
def self.list_projects(base_opts, opts, type="project") |
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.
I think that type
here should not be a parameter but hardcoded when calling populate
method. Why would we ever want to specify a different type when calling list_projects
?
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.
yeah, we can put it here or at the populate
method as you suggested
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.
Ok, please remove this parameter type
from here as well other individual calls. populate
looks good.
See my other comment. I would leave it to you about merging k8s and openshift calls in same place.
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.
@akostadinov ok, I fixed that now.
return Http.request(**base_opts, method: "GET") | ||
end | ||
|
||
def self.post_role_oapi(base_opts, opts) |
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.
@pruan-rht any replacement for this method?
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.
@stuartchuan, for 4.0, oapi has been removed, that's why I took out this method
def self.populate(path, base_opts, opts) | ||
populate_common("/oapi/<oapi_version>", path, base_opts, opts) | ||
def self.populate(path, base_opts, opts, type) | ||
populate_common("/apis/#{type}.openshift.io/<api_version>", path, base_opts, opts) |
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.
Using api_version
here is not correct. In fact all these something.openshift.io
APIs may use different API version. But since it is less broken than before, we can merge as is to get something working. We need more investigation to figure out what might be an approach that makes sense.
/lgtm
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.
What do you mean by may use different API version
? Shouldn't they all be using the same api version?
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.
well initial assumpion was that there will be one global API version like 1, 2, 3. Now they have multiple something.k8s.io
and somehting.openshift.io
APIs and each of them can have a different independent API level. Having a single parameter for this will not work.
On the other hand it can be overridden for each call so maybe will work. As long as it works now, I'm fine.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akostadinov, pruan-rht The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…ences since it has become obsolete. According to the upstream documentation there are still differences between
k8s
andopenshift
in term of base URL. Introducetype
to use to build the url to fetch from.