fix(k8s): Fix inet-type panic#6841
Merged
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom Jan 17, 2023
shimonp21:fix_k8s_inet_panic
Merged
fix(k8s): Fix inet-type panic#6841kodiakhq[bot] merged 2 commits intocloudquery:mainfrom shimonp21:fix_k8s_inet_panic
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
shimonp21:fix_k8s_inet_panic
Conversation
disq
approved these changes
Jan 16, 2023
candiduslynx
suggested changes
Jan 16, 2023
hermanschaaf
approved these changes
Jan 16, 2023
Contributor
|
Seems tests are failing |
Contributor
Author
|
Yeah, the failing tests was the linter complaining about the for-loop-address issue Alex found. Fixed now :) |
candiduslynx
approved these changes
Jan 17, 2023
Comment on lines
+83
to
+89
| for i := range stringArrayValue { | ||
| if stringArrayValue[i] != "" && stringArrayValue[i] != "None" { | ||
| sanitized = append(sanitized, &stringArrayValue[i]) | ||
| } else { | ||
| sanitized = append(sanitized, nil) | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Actually, it could be fixed even easier: https://go.dev/play/p/p6YgBjZXixI
Suggested change
| for i := range stringArrayValue { | |
| if stringArrayValue[i] != "" && stringArrayValue[i] != "None" { | |
| sanitized = append(sanitized, &stringArrayValue[i]) | |
| } else { | |
| sanitized = append(sanitized, nil) | |
| } | |
| } | |
| for _, v := range stringArrayValue { | |
| v := v | |
| if v == "" || v == "None" { | |
| sanitized = append(sanitized, nil) | |
| continue | |
| } | |
| sanitized = append(sanitized, &v) | |
| } |
Comment on lines
+122
to
+128
| for i := range stringArrayValue { | ||
| if stringArrayValue[i] != "" && stringArrayValue[i] != "None" { | ||
| sanitized = append(sanitized, &stringArrayValue[i]) | ||
| } else { | ||
| sanitized = append(sanitized, nil) | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Actually, it could be fixed even easier: https://go.dev/play/p/p6YgBjZXixI
Suggested change
| for i := range stringArrayValue { | |
| if stringArrayValue[i] != "" && stringArrayValue[i] != "None" { | |
| sanitized = append(sanitized, &stringArrayValue[i]) | |
| } else { | |
| sanitized = append(sanitized, nil) | |
| } | |
| } | |
| for _, v := range stringArrayValue { | |
| v := v | |
| if v == "" || v == "None" { | |
| sanitized = append(sanitized, nil) | |
| continue | |
| } | |
| sanitized = append(sanitized, &v) | |
| } |
kodiakhq bot
pushed a commit
that referenced
this pull request
Jan 17, 2023
🤖 I have created a release *beep* *boop* --- ## [3.0.1](plugins-source-k8s-v3.0.0...plugins-source-k8s-v3.0.1) (2023-01-17) ### Bug Fixes * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.24.2 ([#6695](#6695)) ([694ab9f](694ab9f)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.25.0 ([#6745](#6745)) ([9c41854](9c41854)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.25.1 ([#6805](#6805)) ([9da0ce2](9da0ce2)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.26.0 ([#6839](#6839)) ([6ccda8d](6ccda8d)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.27.0 ([#6856](#6856)) ([545799b](545799b)) * **k8s:** Fix inet-type panic ([#6841](#6841)) ([8c301f8](8c301f8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
daniel-garcia
pushed a commit
to infobloxopen/ibcq-source-k8s
that referenced
this pull request
Feb 24, 2026
🤖 I have created a release *beep* *boop* --- ## [3.0.1](cloudquery/cloudquery@plugins-source-k8s-v3.0.0...plugins-source-k8s-v3.0.1) (2023-01-17) ### Bug Fixes * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.24.2 ([#6695](cloudquery/cloudquery#6695)) ([7696e57](cloudquery/cloudquery@7696e57)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.25.0 ([#6745](cloudquery/cloudquery#6745)) ([1959692](cloudquery/cloudquery@1959692)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.25.1 ([#6805](cloudquery/cloudquery#6805)) ([47ada93](cloudquery/cloudquery@47ada93)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.26.0 ([#6839](cloudquery/cloudquery#6839)) ([ea438ca](cloudquery/cloudquery@ea438ca)) * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.27.0 ([#6856](cloudquery/cloudquery#6856)) ([15f8751](cloudquery/cloudquery@15f8751)) * **k8s:** Fix inet-type panic ([#6841](cloudquery/cloudquery#6841)) ([fe85578](cloudquery/cloudquery@fe85578)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make our resolvers ignore
Nonestrings.The other way to fix is to just leave the incoming field as a
string. This way is less breaking for users.