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-16002: Accept *yml.patch* and *yaml.patch* extensions #6070
MGMT-16002: Accept *yml.patch* and *yaml.patch* extensions #6070
Conversation
@paul-maidment: This pull request references MGMT-16002 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 bug 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 openshift-eng/jira-lifecycle-plugin repository. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6070 +/- ##
==========================================
+ Coverage 68.36% 69.58% +1.22%
==========================================
Files 239 240 +1
Lines 35529 37517 +1988
==========================================
+ Hits 24291 26108 +1817
- Misses 9131 9197 +66
- Partials 2107 2212 +105
|
4fc2e0e
to
82373ac
Compare
data/default_release_images.json
Outdated
@@ -92,17 +92,17 @@ | |||
"cpu_architectures": [ | |||
"x86_64" | |||
], | |||
"url": "quay.io/openshift-release-dev/ocp-release:4.13.35-x86_64", | |||
"version": "4.13.35" | |||
"url": "quay.io/openshift-release-dev/ocp-release:4.13.36-x86_64", |
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.
all changes in this file are not related to your PR - please remove it
@adriengentil please review |
@paul-maidment can you add a word about the patch extension in the doc? https://github.com/openshift/assisted-service/blob/master/docs/user-guide/install-customization.md?plain=1#L9 |
internal/manifests/manifests.go
Outdated
@@ -540,12 +540,12 @@ func (m *Manifests) validateUserSuppliedManifest(ctx context.Context, clusterID | |||
if !json.Valid(manifestContent) { | |||
return m.prepareAndLogError(ctx, http.StatusBadRequest, errors.Errorf("Manifest content of file %s for cluster ID %s has an illegal JSON format", fileName, string(clusterID))) | |||
} | |||
} else if strings.HasPrefix(extension, ".patch") && (strings.Contains(fileName, ".yaml.patch") || strings.Contains(fileName, ".yml.patch")) { | |||
} else if strings.Contains(fileName, ".yaml.patch") || strings.Contains(fileName, ".yml.patch") { | |||
if err := isValidYaml(manifestContent); err != nil { |
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.
shouldn't we validate that the file is a valid yaml patch instead? https://github.com/openshift/assisted-service/blob/master/internal/common/common.go#L482
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.
Agreed!
I have changed this.
Presently we do not accept filenames containing yml.patch or yaml.patch We should accept these files. This PR rectifies that.
82373ac
to
48f3be2
Compare
48f3be2
to
0291faf
Compare
/retest-required |
0291faf
to
7827894
Compare
7827894
to
dd40439
Compare
Presently we do not accept filenames containing *yml.patch* or *yaml.patch* We should accept these files. This PR rectifies that.
dd40439
to
9546333
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adriengentil, 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 |
/retest |
/retest |
@paul-maidment: The following tests failed, say
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. |
9ad7c61
into
openshift:master
Presently we do not accept filenames containing yml.patch or yaml.patch
We should accept these files.
This PR rectifies that.
List all the issues related to this PR
What environments does this code impact?
How was this code tested?
Performed curl requests against an assisted-test-infra based cluster that is running this service image. yml.patch and yaml.patch files were accepted as expected.
Checklist
docs
, README, etc)Reviewers Checklist