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

When source_type = "all" (default or explicitly set), if I only have helm or manifest config args, query fails with invalid configuration #166

Closed
cbruno10 opened this issue Sep 19, 2023 · 1 comment · Fixed by #167
Assignees
Labels
bug Something isn't working

Comments

@cbruno10
Copy link
Contributor

Describe the bug
When source_type = "all" (default or explicitly set) in my kubernetes.spc, if I run a query, I receive an error since Kube is looking for a cluster to connect to:

connection "kubernetes" {
  plugin = "kubernetes"
  
  manifest_file_paths =  ["/Users/cbruno/kube/deployments.yaml"]
  # Defaults to "all"
  #source_type = "all"
}
> select * from kubernetes.kubernetes_deployment

Error: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable (SQLSTATE HV000)

+------+-----------+-----+----------+----------------+----------+----------+----------+-------------------+------------------------+--------+---------------------------+---------------------+-----------------+---
| name | namespace | uid | replicas | selector_query | selector | template | strategy | min_ready_seconds | revision_history_limit | paused | progress_deadline_seconds | observed_generation | status_replicas | up
+------+-----------+-----+----------+----------------+----------+----------+----------+-------------------+------------------------+--------+---------------------------+---------------------+-----------------+---
+------+-----------+-----+----------+----------------+----------+----------+----------+-------------------+------------------------+--------+---------------------------+---------------------+-----------------+---

Time: 29ms.

If I then change source_type = "manifest", then the query works:

> select * from kubernetes.kubernetes_deployment
+-----------------------+-----------+--------+----------+---------------------------+-------------------------------------------------+-----------------------------------------------------------------------------
| name                  | namespace | uid    | replicas | selector_query            | selector                                        | template
+-----------------------+-----------+--------+----------+---------------------------+-------------------------------------------------+-----------------------------------------------------------------------------
| redis-cart            |           | <null> | <null>   | app=redis-cart            | {"matchLabels":{"app":"redis-cart"}}            | {"metadata":{"creationTimestamp":null,"labels":{"app":"redis-cart"}},"spec":
...

Time: 126ms. Rows fetched: 12. Hydrate calls: 12.

Steampipe version (steampipe -v)
v0.20.9

Plugin version (steampipe plugin list)
v0.22.1

To reproduce
See above

Expected behavior
If source_type = "all", even if I don't have a Kube cluster configured, the helm and manifest information should still be loaded

Additional context
Add any other context about the problem here.

@cbruno10 cbruno10 added the bug Something isn't working label Sep 19, 2023
@cbruno10
Copy link
Contributor Author

Maybe source_type should be changed source_types and it would accept an array of values, e.g., source_types = ["helm", "manifest", "deployed". With this pattern, a user could load any combination of sources.

@cbruno10 cbruno10 linked a pull request Sep 19, 2023 that will close this issue
@graza-io graza-io self-assigned this Sep 29, 2023
cbruno10 added a commit that referenced this issue Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants