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

Add table azure_kubernetes_service_version Closes #606 #623

Merged
merged 6 commits into from
Jul 6, 2023
Merged

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Jun 23, 2023

Integration test logs

Logs
N/A

Example query results

Results
> select
  name,
  id,
  type,
  orchestrator_type,
  orchestrator_version
from
  azure_kubernetes_service_version
where
  region = 'eastus2';
+---------+--------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------+---------------->
| name    | id                                                                                                                       | type                                               | orchestrator_ty>
+---------+--------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------+---------------->
| default | /subscriptions/g33456tr-f95f-4771-bbb5-529d4c345633/providers/Microsoft.ContainerService/locations/eastus2/orchestrators | Microsoft.ContainerService/locations/orchestrators | Kubernetes     >
| default | /subscriptions/g33456tr-f95f-4771-bbb5-529d4c345633/providers/Microsoft.ContainerService/locations/eastus2/orchestrators | Microsoft.ContainerService/locations/orchestrators | Kubernetes     >
| default | /subscriptions/g33456tr-f95f-4771-bbb5-529d4c345633/providers/Microsoft.ContainerService/locations/eastus2/orchestrators | Microsoft.ContainerService/locations/orchestrators | Kubernetes     >
| default | /subscriptions/g33456tr-f95f-4771-bbb5-529d4c345633/providers/Microsoft.ContainerService/locations/eastus2/orchestrators | Microsoft.ContainerService/locations/orchestrators | Kubernetes     >
| default | /subscriptions/g33456tr-f95f-4771-bbb5-529d4c345633/providers/Microsoft.ContainerService/locations/eastus2/orchestrators | Microsoft.ContainerService/locations/orchestrators | Kubernetes     >
| default | /subscriptions/g33456tr-f95f-4771-bbb5-529d4c345633/providers/Microsoft.ContainerService/locations/eastus2/orchestrators | Microsoft.ContainerService/locations/orchestrators | Kubernetes     >
| default | /subscriptions/g33456tr-f95f-4771-bbb5-529d4c345633/providers/Microsoft.ContainerService/locations/eastus2/orchestrators | Microsoft.ContainerService/locations/orchestrators | Kubernetes     >
+---------+--------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------+---------------->

@ParthaI ParthaI requested a review from misraved June 23, 2023 10:55
@ParthaI ParthaI self-assigned this Jun 23, 2023
@ParthaI ParthaI linked an issue Jun 23, 2023 that may be closed by this pull request
Copy link
Contributor

@misraved misraved left a comment

Choose a reason for hiding this comment

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

@ParthaI please take a look at the review comments. Thanks!!

},
{
Name: "id",
Description: "Id of the orchestrator version profile list result.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Description: "Id of the orchestrator version profile list result.",
Description: "ID of the orchestrator version profile list result.",


Azure AKS (Azure Kubernetes Service) orchestrator is a managed container orchestration service provided by Microsoft Azure. It simplifies the deployment, management, and scaling of containerized applications using Kubernetes. AKS allows you to deploy and manage containerized applications without the need to manage the underlying infrastructure. It provides automated Kubernetes upgrades, built-in monitoring and diagnostics, and seamless integration with other Azure services. AKS enables developers and DevOps teams to focus on application development and deployment, while Azure takes care of the underlying Kubernetes infrastructure.

**Note:** You must need to pass the `location` in where clause to query this table.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
**Note:** You must need to pass the `location` in where clause to query this table.
**Note:** You need to pass the `location` in the where clause to query this table.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ParthaI what was the reasoning behind the naming convention of the table?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@misraved misraved left a comment

Choose a reason for hiding this comment

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

@ParthaI please take a look at the review comment. Thanks!!

Please make sure that the input parameters are checked correctly for empty values before making the API call.

Also could you please format the example queries using https://www.freeformatter.com/sql-formatter.html#before-output (2 spaces per indent level)?

Comment on lines +128 to +129
location := d.EqualsQualString("location")
resourceType := d.EqualsQualString("resource_type")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we not check if location and resourceType parameters are empty or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@misraved, Thank you for catching that.

  • Looking at the list config, the location is required in the WHERE clause for querying this table.
KeyColumns: plugin.KeyColumnSlice{
				{
					Name:    "location",
					Require: plugin.Required,
				},
				{
					Name:    "resource_type",
					Require: plugin.Optional,
				},
			},
  • If we do not provide the location in the WHERE clause, Steampipe will throw an error stating that the location is required for querying this table.
  • On the other hand, the resource_type is optional in the WHERE clause, meaning we can choose to include it or not.
  • If we include the resource_type in the WHERE clause, the API will filter the response based on the specified value. Otherwise, it will return all resource types.

I don't believe we need to perform any empty checks in this case. Thanks again!

@misraved misraved merged commit c1efd34 into main Jul 6, 2023
@misraved misraved deleted the issue-606 branch July 6, 2023 08:07
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.

Add table azure_kubernetes_service_version
2 participants