Skip to content
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 panic for floating point variables #653

Merged
merged 1 commit into from
Apr 12, 2021

Conversation

patilpankaj212
Copy link
Contributor

@patilpankaj212 patilpankaj212 commented Apr 12, 2021

fixes #652

@patilpankaj212 patilpankaj212 linked an issue Apr 12, 2021 that may be closed by this pull request
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Apr 12, 2021

Codecov Report

Merging #653 (6617b2a) into master (5db6cb2) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #653      +/-   ##
==========================================
+ Coverage   77.91%   77.94%   +0.02%     
==========================================
  Files         105      105              
  Lines        2604     2607       +3     
==========================================
+ Hits         2029     2032       +3     
  Misses        427      427              
  Partials      148      148              
Impacted Files Coverage Δ
.../iac-providers/terraform/commons/cty-converters.go 87.17% <100.00%> (+1.06%) ⬆️

@@ -58,7 +64,7 @@ func ctyToSlice(ctyVal cty.Value) (interface{}, error) {
var val []interface{}
var allErrs error

if strings.Contains(ctyVal.Type().FriendlyName(), "list") {
if ctyVal.Type().IsListType() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, does IsListType() give a more reliable and consistent output?

@kanchwala-yusuf
Copy link
Contributor

@patilpankaj212 , was wondering if we could add a sample terraform config in our unit tests for testing this particular case?

@kanchwala-yusuf kanchwala-yusuf merged commit 114222a into tenable:master Apr 12, 2021
@patilpankaj212 patilpankaj212 deleted the fix-floatVar-panic branch May 5, 2022 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic while resolving floating point variable
2 participants