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

[FIX] Azure query for Key Vault runs to infinite loop. Closes #35 #82

Merged
merged 2 commits into from
Apr 19, 2021

Conversation

Subhajit97
Copy link
Contributor

Integration test logs

Logs
No env file present for the current environment:  staging 
 Falling back to .env config
No env file present for the current environment:  staging
customEnv TURBOT_TEST_EXPECTED_TIMEOUT 300

SETUP: tests/azure_key_vault []

PRETEST: tests/azure_key_vault

TEST: tests/azure_key_vault
Running terraform
data.azurerm_client_config.current: Refreshing state...
data.null_data_source.resource: Refreshing state...
azurerm_resource_group.named_test_resource: Creating...
azurerm_resource_group.named_test_resource: Creation complete after 5s [id=/subscriptions/********-****-****-****-************/resourceGroups/turbottest35668]
azurerm_key_vault.named_test_resource: Creating...
azurerm_key_vault.named_test_resource: Still creating... [10s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [20s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [30s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [40s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [50s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [1m0s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [1m10s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [1m20s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [1m30s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [1m40s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [1m50s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [2m0s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [2m10s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [2m20s elapsed]
azurerm_key_vault.named_test_resource: Still creating... [2m30s elapsed]
azurerm_key_vault.named_test_resource: Creation complete after 2m30s [id=/subscriptions/********-****-****-****-************/resourceGroups/turbottest35668/providers/Microsoft.KeyVault/vaults/turbottest35668]
azurerm_key_vault_access_policy.named_test_resource: Creating...
azurerm_key_vault_access_policy.named_test_resource: Still creating... [10s elapsed]
azurerm_key_vault_access_policy.named_test_resource: Creation complete after 13s [id=/subscriptions/********-****-****-****-************/resourceGroups/turbottest35668/providers/Microsoft.KeyVault/vaults/turbottest35668/objectId/e416149c-435f-47ac-994e-7b87a45652af]

Warning: Deprecated Resource

The null_data_source was historically used to construct intermediate values to
re-use elsewhere in configuration, the same can now be achieved using locals


Apply complete! Resources: 3 added, 0 changed, 0 destroyed.

Outputs:

object_id = e416149c-435f-47ac-994e-7b87a45652af
resource_aka = azure:///subscriptions/********-****-****-****-************/resourceGroups/turbottest35668/providers/Microsoft.KeyVault/vaults/turbottest35668
resource_aka_lower = azure:///subscriptions/********-****-****-****-************/resourcegroups/turbottest35668/providers/microsoft.keyvault/vaults/turbottest35668
resource_id = /subscriptions/********-****-****-****-************/resourceGroups/turbottest35668/providers/Microsoft.KeyVault/vaults/turbottest35668
resource_name = turbottest35668
subscription_id = ********-****-****-****-************
tenant_id = cdffd708-7da0-4cea-abeb-0a4c334d7f64

Running SQL query: test-get-query.sql
[
  {
    "enabled_for_deployment": false,
    "enabled_for_disk_encryption": false,
    "enabled_for_template_deployment": false,
    "id": "/subscriptions/********-****-****-****-************/resourceGroups/turbottest35668/providers/Microsoft.KeyVault/vaults/turbottest35668",
    "name": "turbottest35668",
    "region": "westus",
    "resource_group": "turbottest35668",
    "sku_name": "standard",
    "tenant_id": "cdffd708-7da0-4cea-abeb-0a4c334d7f64",
    "type": "Microsoft.KeyVault/vaults",
    "vault_uri": "https://turbottest35668.vault.azure.net/"
  }
]
✔ PASSED

Running SQL query: test-hydrate-query.sql
[
  {
    "access_policies": [
      {
        "objectId": "e416149c-435f-47ac-994e-7b87a45652af",
        "permissions": {
          "certificates": [],
          "keys": [
            "get"
          ],
          "secrets": [
            "get"
          ],
          "storage": []
        },
        "tenantId": "cdffd708-7da0-4cea-abeb-0a4c334d7f64"
      }
    ],
    "akas": [
      "azure:///subscriptions/********-****-****-****-************/resourceGroups/turbottest35668/providers/Microsoft.KeyVault/vaults/turbottest35668",
      "azure:///subscriptions/********-****-****-****-************/resourcegroups/turbottest35668/providers/microsoft.keyvault/vaults/turbottest35668"
    ],
    "name": "turbottest35668",
    "tags": {
      "name": "turbottest35668"
    },
    "title": "turbottest35668"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "id": "/subscriptions/********-****-****-****-************/resourceGroups/turbottest35668/providers/Microsoft.KeyVault/vaults/turbottest35668",
    "name": "turbottest35668"
  }
]
✔ PASSED

Running SQL query: test-not-found-query.sql
null
✔ PASSED

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "azure:///subscriptions/********-****-****-****-************/resourceGroups/turbottest35668/providers/Microsoft.KeyVault/vaults/turbottest35668",
      "azure:///subscriptions/********-****-****-****-************/resourcegroups/turbottest35668/providers/microsoft.keyvault/vaults/turbottest35668"
    ],
    "name": "turbottest35668",
    "tags": {
      "name": "turbottest35668"
    },
    "title": "turbottest35668"
  }
]
✔ PASSED

POSTTEST: tests/azure_key_vault

TEARDOWN: tests/azure_key_vault

SUMMARY:

1/1 passed.

Example query results

Results
N/A

@Subhajit97 Subhajit97 linked an issue Apr 8, 2021 that may be closed by this pull request
@Subhajit97 Subhajit97 requested a review from LalitLab April 8, 2021 11:34
@Subhajit97 Subhajit97 self-assigned this Apr 8, 2021
d.StreamListItem(ctx, vault)
}
result.NextWithContext(context.Background())
pagesLeft = result.NotDone()
Copy link
Contributor

Choose a reason for hiding this comment

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

@Subhajit97 can you also raise an issue for the same on Azure SDK mentioning when it happens

@LalitLab LalitLab requested a review from cbruno10 April 16, 2021 07:31
@cbruno10 cbruno10 merged commit a94413a into main Apr 19, 2021
@cbruno10 cbruno10 deleted the issue-35 branch April 19, 2021 11:19
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.

The Azure query for Key Vault runs to infinite loop.
3 participants