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

New Data Source: wiz_kubernetes_clusters #52

Merged
merged 3 commits into from
Dec 14, 2022
Merged

New Data Source: wiz_kubernetes_clusters #52

merged 3 commits into from
Dec 14, 2022

Conversation

jschoombee
Copy link
Collaborator

@jschoombee jschoombee commented Dec 14, 2022

New Data Source: wiz_kubernetes_clusters (closes #51)

KubernetesClusters vendor.KubernetesClusters `json:"kubernetesClusters"`
}

func dataSourceKubernetesClusters() *schema.Resource {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rename to dataSourceWizKubernetesClusters

Suggested change
func dataSourceKubernetesClusters() *schema.Resource {
func dataSourceWizKubernetesClusters() *schema.Resource {

"wiz_cloud_accounts": dataSourceWizCloudAccounts(),
"wiz_cloud_config_rules": dataSourceWizCloudConfigurationRules(),
"wiz_host_config_rules": dataSourceWizHostConfigurationRules(),
"wiz_kubernetes_clusters": dataSourceKubernetesClusters(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Refactoring

Suggested change
"wiz_kubernetes_clusters": dataSourceKubernetesClusters(),
"wiz_kubernetes_clusters": dataSourceWizKubernetesClusters(),

Comment on lines 2151 to 2152
// KubernetesClusters struct
type KubernetesClusters struct {
Copy link
Collaborator

@gramsa49 gramsa49 Dec 14, 2022

Choose a reason for hiding this comment

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

This is represented in the GraphQL schema as KubernetesClusterConnection. Rename to match GraphQL schema. This will simplify correlation for future developers and avoid future name conflicts.

kubernetesCluster Query:

type Query {
  kubernetesClusters(after: String, filterBy: KubernetesClusterFilters, first: Int): KubernetesClusterConnection!
Suggested change
// KubernetesClusters struct
type KubernetesClusters struct {
// KubernetesClusterConnection struct
type KubernetesClusterConnection struct {


// ReadKubernetesClusters struct
type ReadKubernetesClusters struct {
KubernetesClusters vendor.KubernetesClusters `json:"kubernetesClusters"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Refactor the type from KubernetesClusters to KubernetesClusterConnection.

Suggested change
KubernetesClusters vendor.KubernetesClusters `json:"kubernetesClusters"`
KubernetesClusters vendor.KubernetesClusterConnection `json:"kubernetesClusters"`

@gramsa49 gramsa49 merged commit db4959c into AxtonGrams:main Dec 14, 2022
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.

wiz_kubernetes_clusters datasource
3 participants