-
Notifications
You must be signed in to change notification settings - Fork 113
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
Use new servicelog endpoint for listing service logs #447
Use new servicelog endpoint for listing service logs #447
Conversation
dd0fc6d
to
a6b5854
Compare
/hold We'll need to wait for a new ocm-sdk to be built after openshift-online/ocm-sdk-go#847 is merged |
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.
Looking good, thanks for refactoring the flags on the way :)
formatMessage = fmt.Sprintf(`search=cluster_id = '%s'`, cluster.ID()) | ||
} | ||
// TODO uncomment these fields after https://github.com/openshift-online/ocm-sdk-go/pull/847 is merged | ||
type LogEntryView 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.
Question: Why can't we use the slv1.LogEntry
type directly? Is it to have everything as string for a proper print format after viewBytes, err := json.Marshal(view)
?
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.
We can't marshal it because the fields aren't exported unfortunately. This is the struct:
type LogEntry struct {
bitmap_ uint32
id string
href string
clusterID string
clusterUUID string
description string
eventStreamID string
logType LogType
serviceName string
severity Severity
subscriptionID string
summary string
timestamp time.Time
username string
internalOnly bool
}
After chatting with the OCM team, this was determined to be the best path forward.
d438e91
to
c124d09
Compare
c124d09
to
ea9e445
Compare
/unhold After updating ocm-api-model and ocm-sdk-go, we can now get the missing fields from the new endpoint. openshift-online/ocm-api-model#844 |
@AlexVulaj: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AlexVulaj, typeid 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 |
Resolves https://issues.redhat.com/browse/OSD-18457. At a high level, this converts our API call from
to
I refactored the command itself to be more inline with how we declare command structs and flags now.
I also refactored to use the data models directly from the ocm sdk, which led to the following PRs.
Model:
openshift-online/ocm-api-model#844
openshift-online/ocm-api-model#845
SDK:
openshift-online/ocm-sdk-go#847
openshift-online/ocm-sdk-go#848