steampipe-plugin-sdk icon indicating copy to clipboard operation
steampipe-plugin-sdk copied to clipboard

d.Connection is nil if there are no specific connection attributes set

Open e-gineer opened this issue 3 years ago • 0 comments

I'd expect d.Connection.Name to always be available, even if no specific attributes are set.

Consider this hydrate function:

func getClusterConnection(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
	return d.Connection, nil
}

If I have an "empty" config like below then I'm finding d.Connection is nil.

connection "k8s_a" {
  plugin = "kubernetes"
}

But everything works as expected if there is any attribute in the config, like this:

connection "k8s_a" {
  plugin = "kubernetes"
  config_path = "~/.kube/config"
}

e-gineer avatar Aug 10 '21 01:08 e-gineer