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
MGMT-14633: Include manifest information in the log download #5777
MGMT-14633: Include manifest information in the log download #5777
Conversation
@paul-maidment: This pull request references MGMT-14633 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set. In response to this:
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. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #5777 +/- ##
==========================================
- Coverage 68.07% 68.03% -0.04%
==========================================
Files 235 235
Lines 34398 34427 +29
==========================================
+ Hits 23416 23422 +6
- Misses 8921 8945 +24
+ Partials 2061 2060 -1
|
48ca0cb
to
0416e8e
Compare
internal/cluster/cluster.go
Outdated
path := filepath.Join(manifestEntry.Folder, manifestEntry.FileName) | ||
objectName := filepath.Join(string(*c.ID), constants.ManifestFolder, path) | ||
exists, _ := objectHandler.DoesObjectExist(ctx, objectName) | ||
if exists { |
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.
Maybe a guard here instead of indenting everything else?
For example:
if !exists {
continue
}
...
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.
Good suggestion..taken!
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 you want !exists
, right?
dd6774a
to
0a57142
Compare
internal/cluster/cluster.go
Outdated
path := filepath.Join(manifestEntry.Folder, manifestEntry.FileName) | ||
objectName := filepath.Join(string(*c.ID), constants.ManifestFolder, path) | ||
exists, _ := objectHandler.DoesObjectExist(ctx, objectName) | ||
if exists { |
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 you want !exists
, right?
f568a60
to
0d8677b
Compare
internal/cluster/cluster.go
Outdated
manifest_prefix = "user-supplied" | ||
} | ||
fileName := fmt.Sprintf("%s/logs/manifest_%s_%s/%s", c.ID, manifest_prefix, manifestEntry.Folder, manifestEntry.FileName) | ||
_ = m.uploadDataAsFile(ctx, log, string(fileContent), fileName, objectHandler) |
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 should probably at least log here if this errors, right?
0d8677b
to
2591a96
Compare
/retest |
2 similar comments
/retest |
/retest |
When the user downloads the logs for the cluster, we would like to include any cluster manifets in these logs so that they may be examined.
2591a96
to
68a20ca
Compare
/retest |
@paul-maidment: This pull request references MGMT-14633 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.16.0" version, but no target version was set. In response to this:
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. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: carbonin, paul-maidment 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 |
@paul-maidment: 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. |
[ART PR BUILD NOTIFIER] This PR has been included in build ose-agent-installer-api-server-container-v4.16.0-202312150050.p0.g0b779ca.assembly.stream for distgit ose-agent-installer-api-server. |
When the user downloads the logs for the cluster, we would like to include any cluster manifets in these logs so that they may be examined.
List all the issues related to this PR
What environments does this code impact?
How was this code tested?
Manually set up a cluster with manifests and then triggered a download of the manifests, a CURL request similar to
curl -X GET $SERVICE_URI/api/assisted-install/v2/clusters/61e94f28-bbd7-4719-b555-d7d7f9d5cc60/logs?logs_type=all --output logs.tar.gz
was used.I also checked in the UI to ensure that the download looks appropriate.
Checklist
docs
, README, etc)Reviewers Checklist