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

ENG-12679: Add data source for sidecar instance API #457

Merged
merged 7 commits into from
Oct 2, 2023

Conversation

VictorGFM
Copy link
Contributor

@VictorGFM VictorGFM commented Sep 28, 2023

Description of the change

ENG-12679: Add data source for the /v2 sidecar instance API

This PR contains the following changes:

  1. Add cyral_sidecar_instance data source.
  2. Deprecates cyral_sidecar_instance_ids data source (since it will be replaced by cyral_sidecar_instance).

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • Jira issue referenced in commit message and/or PR title

Testing

Manual E2E tests and running automated tests with make command. See results below:

go test github.com/cyralinc/terraform-provider-cyral/... -v -race -timeout 20m
?   	github.com/cyralinc/terraform-provider-cyral	[no test files]
=== RUN   TestNewClient_WhenTLSSkipVerifyIsEnabled_ThenInsecureSkipVerifyIsTrue
2023/09/19 20:12:47 [DEBUG] Init NewClient
2023/09/19 20:12:47 [DEBUG] TokenSource: &{0xc00013cf00 {0 0} <nil> 0}
2023/09/19 20:12:47 [DEBUG] End NewClient
--- PASS: TestNewClient_WhenTLSSkipVerifyIsEnabled_ThenInsecureSkipVerifyIsTrue (0.00s)
=== RUN   TestNewClient_WhenTLSSkipVerifyIsDisabled_ThenInsecureSkipVerifyIsFalse
2023/09/19 20:12:47 [DEBUG] Init NewClient
2023/09/19 20:12:47 [DEBUG] TokenSource: &{0xc00013cf48 {0 0} <nil> 0}
2023/09/19 20:12:47 [DEBUG] End NewClient
--- PASS: TestNewClient_WhenTLSSkipVerifyIsDisabled_ThenInsecureSkipVerifyIsFalse (0.00s)
=== RUN   TestNewClient_WhenClientIDIsEmpty_ThenThrowError
2023/09/19 20:12:47 [DEBUG] Init NewClient
--- PASS: TestNewClient_WhenClientIDIsEmpty_ThenThrowError (0.00s)
=== RUN   TestNewClient_WhenClientSecretIsEmpty_ThenThrowError
2023/09/19 20:12:47 [DEBUG] Init NewClient
--- PASS: TestNewClient_WhenClientSecretIsEmpty_ThenThrowError (0.00s)
=== RUN   TestNewClient_WhenControlPlaneIsEmpty_ThenThrowError
2023/09/19 20:12:47 [DEBUG] Init NewClient
--- PASS: TestNewClient_WhenControlPlaneIsEmpty_ThenThrowError (0.00s)
PASS
ok  	github.com/cyralinc/terraform-provider-cyral/client	(cached)
=== RUN   TestAccDatalabelDataSource
=== PAUSE TestAccDatalabelDataSource
=== RUN   TestAccIntegrationIdPSAMLDataSource
=== PAUSE TestAccIntegrationIdPSAMLDataSource
=== RUN   TestAccLoggingIntegrationDataSource
=== PAUSE TestAccLoggingIntegrationDataSource
=== RUN   TestAccPermissionDataSource
=== PAUSE TestAccPermissionDataSource
=== RUN   TestAccRepositoryDataSource
=== PAUSE TestAccRepositoryDataSource
=== RUN   TestAccRoleDataSource
=== PAUSE TestAccRoleDataSource
=== RUN   TestAccSAMLCertificateDataSource
=== PAUSE TestAccSAMLCertificateDataSource
=== RUN   TestAccSAMLConfigurationDataSource
=== PAUSE TestAccSAMLConfigurationDataSource
=== RUN   TestAccSidecarBoundPortsDataSource
=== PAUSE TestAccSidecarBoundPortsDataSource
=== RUN   TestAccSidecarCftTemplateDataSource
=== PAUSE TestAccSidecarCftTemplateDataSource
=== RUN   TestAccSidecarHealthDataSource
=== PAUSE TestAccSidecarHealthDataSource
=== RUN   TestAccSidecarIDDataSource
=== PAUSE TestAccSidecarIDDataSource
=== RUN   TestAccSidecarInstanceIDsDataSource
=== PAUSE TestAccSidecarInstanceIDsDataSource
=== RUN   TestAccSidecarInstanceDataSource
=== PAUSE TestAccSidecarInstanceDataSource
=== RUN   TestAccSidecarListenerDataSource
=== PAUSE TestAccSidecarListenerDataSource
=== RUN   TestAccSystemInfoDataSource
=== PAUSE TestAccSystemInfoDataSource
=== RUN   TestIntegrationsData_GetValue_Default
--- PASS: TestIntegrationsData_GetValue_Default (0.00s)
=== RUN   TestIntegrationsData_GetValue_Splunk
--- PASS: TestIntegrationsData_GetValue_Splunk (0.00s)
=== RUN   TestAccProvider
2023/09/27 21:14:01 [DEBUG] Init dataSourceSidecarListener
2023/09/27 21:14:01 [DEBUG] End dataSourceSidecarListener
--- PASS: TestAccProvider (0.01s)
=== RUN   TestAccDatalabelResource
=== PAUSE TestAccDatalabelResource
=== RUN   TestAccDatadogIntegrationResource
=== PAUSE TestAccDatadogIntegrationResource
=== RUN   TestAccELKIntegrationResource
=== PAUSE TestAccELKIntegrationResource
=== RUN   TestAccHCVaultIntegrationResource
=== PAUSE TestAccHCVaultIntegrationResource
=== RUN   TestAccIntegrationIdPSAMLDraftResource
=== PAUSE TestAccIntegrationIdPSAMLDraftResource
=== RUN   TestAccIntegrationIdPSAMLResource
=== PAUSE TestAccIntegrationIdPSAMLResource
=== RUN   TestAccIdPIntegrationResource
=== PAUSE TestAccIdPIntegrationResource
=== RUN   TestAccLogsIntegrationResourceCloudWatch
=== PAUSE TestAccLogsIntegrationResourceCloudWatch
=== RUN   TestAccLogsIntegrationResourceDataDog
=== PAUSE TestAccLogsIntegrationResourceDataDog
=== RUN   TestAccLogsIntegrationResourceElk
=== PAUSE TestAccLogsIntegrationResourceElk
=== RUN   TestAccLogsIntegrationResourceElkEmptyEsCredentials
=== PAUSE TestAccLogsIntegrationResourceElkEmptyEsCredentials
=== RUN   TestAccLogsIntegrationResourceSplunk
=== PAUSE TestAccLogsIntegrationResourceSplunk
=== RUN   TestAccLogsIntegrationResourceSumologic
=== PAUSE TestAccLogsIntegrationResourceSumologic
=== RUN   TestAccLogsIntegrationResourceFluentbit
=== PAUSE TestAccLogsIntegrationResourceFluentbit
=== RUN   TestAccLogstashIntegrationResource
=== PAUSE TestAccLogstashIntegrationResource
=== RUN   TestAccLookerIntegrationResource
=== PAUSE TestAccLookerIntegrationResource
=== RUN   TestAccDuoMFAIntegrationResource
=== PAUSE TestAccDuoMFAIntegrationResource
=== RUN   TestAccPagerDutyIntegrationResource
=== PAUSE TestAccPagerDutyIntegrationResource
=== RUN   TestAccSlackAlertsIntegrationResource
=== PAUSE TestAccSlackAlertsIntegrationResource
=== RUN   TestAccSplunkIntegrationResource
=== PAUSE TestAccSplunkIntegrationResource
=== RUN   TestAccSumoLogicIntegrationResource
=== PAUSE TestAccSumoLogicIntegrationResource
=== RUN   TestAccMsTeamsIntegrationResource
=== PAUSE TestAccMsTeamsIntegrationResource
=== RUN   TestAccPolicyRuleResource
=== PAUSE TestAccPolicyRuleResource
=== RUN   TestPolicyRuleResourceUpgradeV0
--- PASS: TestPolicyRuleResourceUpgradeV0 (0.00s)
=== RUN   TestAccPolicyResource
=== PAUSE TestAccPolicyResource
=== RUN   TestAccRegoPolicyInstanceResource
=== PAUSE TestAccRegoPolicyInstanceResource
=== RUN   TestAccRepositoryAccessGatewayResource
=== PAUSE TestAccRepositoryAccessGatewayResource
=== RUN   TestAccRepositoryAccessRulesResource
=== PAUSE TestAccRepositoryAccessRulesResource
=== RUN   TestAccRepositoryBindingResource
=== PAUSE TestAccRepositoryBindingResource
=== RUN   TestAccRepositoryConfAnalysisResource
=== PAUSE TestAccRepositoryConfAnalysisResource
=== RUN   TestRepositoryConfAnalysisResourceUpgradeV0
--- PASS: TestRepositoryConfAnalysisResourceUpgradeV0 (0.00s)
=== RUN   TestAccRepositoryConfAuthResource
=== PAUSE TestAccRepositoryConfAuthResource
=== RUN   TestRepositoryConfAuthResourceUpgradeV0
--- PASS: TestRepositoryConfAuthResourceUpgradeV0 (0.00s)
=== RUN   TestAccRepositoryDatamapResource
=== PAUSE TestAccRepositoryDatamapResource
=== RUN   TestAccRepositoryNetworkAccessPolicyResource
=== PAUSE TestAccRepositoryNetworkAccessPolicyResource
=== RUN   TestAccRepositoryResource
=== PAUSE TestAccRepositoryResource
=== RUN   TestAccRepositoryUserAccountResource
=== PAUSE TestAccRepositoryUserAccountResource
=== RUN   TestAccRoleSSOGroupsResource
=== PAUSE TestAccRoleSSOGroupsResource
=== RUN   TestRoleSSOGroupsResourceUpgradeV0
--- PASS: TestRoleSSOGroupsResourceUpgradeV0 (0.00s)
=== RUN   TestAccRoleResource
=== PAUSE TestAccRoleResource
=== RUN   TestAccServiceAccountResource
=== PAUSE TestAccServiceAccountResource
=== RUN   TestAccSidecarCredentialsResource
=== PAUSE TestAccSidecarCredentialsResource
=== RUN   TestSidecarListenerResource
=== PAUSE TestSidecarListenerResource
=== RUN   TestAccSidecarResource
=== PAUSE TestAccSidecarResource
=== RUN   TestElementsMatch
--- PASS: TestElementsMatch (0.00s)
=== CONT  TestAccLoggingIntegrationDataSource
=== CONT  TestAccSidecarResource
=== CONT  TestAccRepositoryAccessGatewayResource
=== CONT  TestAccRegoPolicyInstanceResource
=== CONT  TestAccSidecarCredentialsResource
=== CONT  TestAccLogsIntegrationResourceSplunk
=== CONT  TestAccSlackAlertsIntegrationResource
=== CONT  TestAccRoleResource
--- PASS: TestAccSidecarCredentialsResource (7.11s)
=== CONT  TestAccRepositoryDatamapResource
=== CONT  TestAccRepositoryConfAuthResource
--- PASS: TestAccSlackAlertsIntegrationResource (7.43s)
--- PASS: TestAccRegoPolicyInstanceResource (8.52s)
=== CONT  TestAccSidecarHealthDataSource
--- PASS: TestAccLogsIntegrationResourceSplunk (8.53s)
=== CONT  TestAccSidecarCftTemplateDataSource
=== CONT  TestAccRepositoryConfAnalysisResource
--- PASS: TestAccLoggingIntegrationDataSource (11.09s)
--- PASS: TestAccSidecarHealthDataSource (5.42s)
=== CONT  TestAccSidecarIDDataSource
--- PASS: TestAccRoleResource (18.33s)
=== CONT  TestAccRepositoryResource
--- PASS: TestAccRepositoryConfAnalysisResource (8.43s)
=== CONT  TestAccSAMLConfigurationDataSource
--- PASS: TestAccSidecarCftTemplateDataSource (11.38s)
=== CONT  TestAccRepositoryAccessRulesResource
--- PASS: TestAccRepositoryAccessGatewayResource (20.54s)
=== CONT  TestAccPermissionDataSource
--- PASS: TestAccSidecarIDDataSource (6.62s)
=== CONT  TestAccServiceAccountResource
--- PASS: TestAccRepositoryConfAuthResource (15.16s)
=== CONT  TestAccDatalabelResource
--- PASS: TestAccPermissionDataSource (4.23s)
=== CONT  TestAccSystemInfoDataSource
--- PASS: TestAccSidecarResource (27.15s)
=== CONT  TestAccIdPIntegrationResource
--- PASS: TestAccSAMLConfigurationDataSource (8.40s)
=== CONT  TestAccDatadogIntegrationResource
=== CONT  TestAccSidecarListenerDataSource
--- PASS: TestAccRepositoryDatamapResource (21.31s)
=== CONT  TestAccELKIntegrationResource
--- PASS: TestAccSystemInfoDataSource (4.01s)
--- PASS: TestAccDatalabelResource (7.55s)
=== CONT  TestAccSplunkIntegrationResource
--- PASS: TestAccRepositoryAccessRulesResource (14.42s)
=== CONT  TestAccPagerDutyIntegrationResource
--- PASS: TestAccDatadogIntegrationResource (7.67s)
=== CONT  TestAccDuoMFAIntegrationResource
=== CONT  TestAccLookerIntegrationResource
--- PASS: TestAccELKIntegrationResource (7.15s)
--- PASS: TestAccSplunkIntegrationResource (7.37s)
=== CONT  TestAccLogsIntegrationResourceSumologic
=== CONT  TestAccRoleSSOGroupsResource
--- PASS: TestAccRepositoryResource (21.48s)
--- PASS: TestAccPagerDutyIntegrationResource (8.27s)
=== CONT  TestSidecarListenerResource
=== CONT  TestAccRepositoryNetworkAccessPolicyResource
--- PASS: TestAccLookerIntegrationResource (8.06s)
=== CONT  TestAccRoleDataSource
--- PASS: TestAccDuoMFAIntegrationResource (8.50s)
--- PASS: TestAccServiceAccountResource (24.15s)
=== CONT  TestAccSAMLCertificateDataSource
=== CONT  TestAccRepositoryBindingResource
--- PASS: TestAccLogsIntegrationResourceSumologic (8.45s)
--- PASS: TestAccSidecarListenerDataSource (19.44s)
=== CONT  TestAccSidecarInstanceIDsDataSource
--- PASS: TestAccSAMLCertificateDataSource (4.71s)
=== CONT  TestAccLogstashIntegrationResource
--- PASS: TestAccRoleDataSource (8.19s)
=== CONT  TestAccLogsIntegrationResourceElk
--- PASS: TestAccRoleSSOGroupsResource (14.49s)
=== CONT  TestAccSidecarInstanceDataSource
--- PASS: TestAccSidecarInstanceIDsDataSource (9.29s)
=== CONT  TestAccPolicyResource
--- PASS: TestAccRepositoryBindingResource (11.78s)
=== CONT  TestAccRepositoryDataSource
--- PASS: TestAccLogsIntegrationResourceElk (8.09s)
=== CONT  TestAccLogsIntegrationResourceDataDog
=== CONT  TestAccPolicyRuleResource
--- PASS: TestAccSidecarInstanceDataSource (7.43s)
=== CONT  TestAccLogsIntegrationResourceCloudWatch
--- PASS: TestAccLogstashIntegrationResource (14.69s)
=== CONT  TestAccIntegrationIdPSAMLDataSource
--- PASS: TestAccPolicyResource (8.49s)
--- PASS: TestAccLogsIntegrationResourceDataDog (8.34s)
=== CONT  TestAccIntegrationIdPSAMLResource
--- PASS: TestAccRepositoryNetworkAccessPolicyResource (25.07s)
=== CONT  TestAccSumoLogicIntegrationResource
=== CONT  TestAccDatalabelDataSource
--- PASS: TestAccIdPIntegrationResource (45.19s)
--- PASS: TestAccLogsIntegrationResourceCloudWatch (8.77s)
=== CONT  TestAccIntegrationIdPSAMLDraftResource
--- PASS: TestAccRepositoryDataSource (16.00s)
=== CONT  TestAccMsTeamsIntegrationResource
=== CONT  TestAccLogsIntegrationResourceFluentbit
--- PASS: TestAccSumoLogicIntegrationResource (7.92s)
--- PASS: TestAccMsTeamsIntegrationResource (7.30s)
=== CONT  TestAccHCVaultIntegrationResource
--- PASS: TestAccPolicyRuleResource (21.16s)
=== CONT  TestAccLogsIntegrationResourceElkEmptyEsCredentials
--- PASS: TestSidecarListenerResource (40.87s)
=== CONT  TestAccRepositoryUserAccountResource
=== CONT  TestAccSidecarBoundPortsDataSource
--- PASS: TestAccLogsIntegrationResourceFluentbit (8.42s)
--- PASS: TestAccIntegrationIdPSAMLDraftResource (12.64s)
--- PASS: TestAccIntegrationIdPSAMLDataSource (21.09s)
--- PASS: TestAccHCVaultIntegrationResource (8.82s)
--- PASS: TestAccIntegrationIdPSAMLResource (22.30s)
--- PASS: TestAccLogsIntegrationResourceElkEmptyEsCredentials (8.32s)
--- PASS: TestAccDatalabelDataSource (21.31s)
--- PASS: TestAccSidecarBoundPortsDataSource (13.33s)
--- PASS: TestAccRepositoryUserAccountResource (47.65s)
PASS
ok  	github.com/cyralinc/terraform-provider-cyral/cyral	131.866s

@VictorGFM VictorGFM marked this pull request as ready for review October 2, 2023 21:13
@sonarcloud
Copy link

sonarcloud bot commented Oct 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@wcmjunior wcmjunior merged commit fbaf876 into main Oct 2, 2023
3 checks passed
@wcmjunior wcmjunior deleted the feature/ENG-12679 branch October 2, 2023 21:39
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.

None yet

2 participants