-
Notifications
You must be signed in to change notification settings - Fork 35
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
fix the invalid kube yaml causing panic issue #171
Conversation
Signed-off-by: Stephanie <yangcao@redhat.com>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #171 +/- ##
==========================================
+ Coverage 61.28% 61.32% +0.03%
==========================================
Files 37 37
Lines 4373 4377 +4
==========================================
+ Hits 2680 2684 +4
Misses 1531 1531
Partials 162 162
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
pkg/devfile/parser/reader.go
Outdated
@@ -121,7 +121,12 @@ func ParseKubernetesYaml(values []interface{}) (KubernetesResources, error) { | |||
return KubernetesResources{}, err | |||
} | |||
|
|||
kubernetesMap := value.(map[string]interface{}) | |||
// kubernetesMap := value.(map[string]interface{}) |
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.
comment
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.
updated
@@ -72,7 +72,9 @@ func TestReadAndParseKubernetesYaml(t *testing.T) { | |||
name string | |||
src YamlSrc | |||
fs *afero.Afero | |||
testParseYamlOnly bool |
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.
where are we setting this? We are using it but i dont see it being set a value
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.
library/pkg/devfile/parser/reader_test.go
Line 177 in 88946b6
if tt.testParseYamlOnly { |
Signed-off-by: Stephanie <yangcao@redhat.com>
0157521
to
5a0c2d5
Compare
@yangcao77 tests failing |
Signed-off-by: Stephanie <yangcao@redhat.com>
f19a787
to
d3d4fe8
Compare
@maysunfaisal fixed the test failure. can you help review again ? thanks |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maysunfaisal, yangcao77 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 |
What does this PR do?:
This PR updates the kubeyaml parser to use unmarshal to ensure the kube yaml is in the expected format. to avoid the panic when trying to convert an
interface{}
into a 'map[string]interface {}'Which issue(s) this PR fixes:
for has bug: https://issues.redhat.com/browse/RHTAPBUGS-113
PR acceptance criteria:
Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened.
Unit/Functional tests
QE Integration test
Documentation
Client Impact
Gosec scans
How to test changes / Special notes to the reviewer: