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-12678: Add data source for sidecar health API #456

Merged
merged 4 commits into from
Sep 27, 2023
Merged

Conversation

VictorGFM
Copy link
Contributor

@VictorGFM VictorGFM commented Sep 26, 2023

Description of the change

ENG-12678: Add data source for the /v2 sidecar health API

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

Tested through manual E2E tests and running automated tests. See test result 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   TestAccSidecarListenerDataSource
=== PAUSE TestAccSidecarListenerDataSource
=== RUN   TestIntegrationsData_GetValue_Default
--- PASS: TestIntegrationsData_GetValue_Default (0.00s)
=== RUN   TestIntegrationsData_GetValue_Splunk
--- PASS: TestIntegrationsData_GetValue_Splunk (0.00s)
=== RUN   TestAccProvider
2023/09/26 20:08:03 [DEBUG] Init dataSourceSidecarListener
2023/09/26 20:08:03 [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  TestAccIntegrationIdPSAMLDataSource
=== CONT  TestAccDuoMFAIntegrationResource
=== CONT  TestAccRepositoryResource
=== CONT  TestAccRepositoryAccessGatewayResource
=== CONT  TestAccRepositoryUserAccountResource
=== CONT  TestSidecarListenerResource
=== CONT  TestAccRepositoryNetworkAccessPolicyResource
=== CONT  TestAccRepositoryAccessRulesResource
--- PASS: TestAccDuoMFAIntegrationResource (8.98s)
=== CONT  TestAccRepositoryDatamapResource
--- PASS: TestAccRepositoryAccessRulesResource (16.06s)
=== CONT  TestAccPolicyResource
=== CONT  TestAccRepositoryBindingResource
--- PASS: TestAccIntegrationIdPSAMLDataSource (17.80s)
=== CONT  TestAccRegoPolicyInstanceResource
--- PASS: TestAccRepositoryResource (21.91s)
--- PASS: TestAccPolicyResource (6.91s)
=== CONT  TestAccMsTeamsIntegrationResource
=== CONT  TestAccPolicyRuleResource
--- PASS: TestAccRepositoryAccessGatewayResource (23.30s)
=== CONT  TestAccRoleResource
--- PASS: TestAccRepositoryNetworkAccessPolicyResource (24.73s)
=== CONT  TestAccSidecarCredentialsResource
--- PASS: TestAccRepositoryBindingResource (10.15s)
=== CONT  TestAccSidecarResource
--- PASS: TestAccMsTeamsIntegrationResource (6.01s)
=== CONT  TestAccSumoLogicIntegrationResource
--- PASS: TestAccRegoPolicyInstanceResource (7.12s)
--- PASS: TestAccRepositoryDatamapResource (21.65s)
=== CONT  TestAccRepositoryConfAuthResource
--- PASS: TestAccSidecarCredentialsResource (5.97s)
=== CONT  TestAccLookerIntegrationResource
--- PASS: TestAccSumoLogicIntegrationResource (7.31s)
=== CONT  TestAccSplunkIntegrationResource
--- PASS: TestSidecarListenerResource (39.20s)
=== CONT  TestAccPagerDutyIntegrationResource
=== CONT  TestAccSlackAlertsIntegrationResource
--- PASS: TestAccLookerIntegrationResource (8.25s)
--- PASS: TestAccPolicyRuleResource (19.83s)
=== CONT  TestAccLogsIntegrationResourceFluentbit
--- PASS: TestAccRoleResource (18.77s)
=== CONT  TestAccLogstashIntegrationResource
--- PASS: TestAccSplunkIntegrationResource (7.96s)
=== CONT  TestAccSidecarInstanceIDsDataSource
=== CONT  TestAccLogsIntegrationResourceSumologic
--- PASS: TestAccPagerDutyIntegrationResource (7.69s)
=== CONT  TestAccLogsIntegrationResourceSplunk
--- PASS: TestAccRepositoryConfAuthResource (17.73s)
=== CONT  TestAccLogsIntegrationResourceElk
--- PASS: TestAccRepositoryUserAccountResource (49.40s)
--- PASS: TestAccSlackAlertsIntegrationResource (7.27s)
=== CONT  TestAccLogsIntegrationResourceDataDog
--- PASS: TestAccLogsIntegrationResourceFluentbit (8.01s)
=== CONT  TestAccLogsIntegrationResourceCloudWatch
=== CONT  TestAccIdPIntegrationResource
--- PASS: TestAccSidecarInstanceIDsDataSource (7.99s)
=== CONT  TestAccRepositoryConfAnalysisResource
--- PASS: TestAccLogsIntegrationResourceSumologic (9.96s)
--- PASS: TestAccLogsIntegrationResourceDataDog (8.60s)
=== CONT  TestAccServiceAccountResource
=== CONT  TestAccRoleDataSource
--- PASS: TestAccLogsIntegrationResourceSplunk (9.81s)
=== CONT  TestAccIntegrationIdPSAMLDraftResource
--- PASS: TestAccLogsIntegrationResourceElk (9.78s)
--- PASS: TestAccLogstashIntegrationResource (16.15s)
=== CONT  TestAccSidecarListenerDataSource
--- PASS: TestAccLogsIntegrationResourceCloudWatch (10.15s)
=== CONT  TestAccRepositoryDataSource
--- PASS: TestAccSidecarResource (32.47s)
=== CONT  TestAccDatalabelDataSource
--- PASS: TestAccRoleDataSource (6.83s)
=== CONT  TestAccHCVaultIntegrationResource
=== CONT  TestAccDatalabelResource
--- PASS: TestAccRepositoryConfAnalysisResource (11.08s)
=== CONT  TestAccRoleSSOGroupsResource
--- PASS: TestAccIntegrationIdPSAMLDraftResource (12.93s)
=== CONT  TestAccLogsIntegrationResourceElkEmptyEsCredentials
--- PASS: TestAccHCVaultIntegrationResource (8.35s)
--- PASS: TestAccDatalabelResource (9.72s)
=== CONT  TestAccDatadogIntegrationResource
=== CONT  TestAccSAMLCertificateDataSource
--- PASS: TestAccRepositoryDataSource (16.73s)
--- PASS: TestAccSidecarListenerDataSource (21.48s)
=== CONT  TestAccLoggingIntegrationDataSource
--- PASS: TestAccLogsIntegrationResourceElkEmptyEsCredentials (9.37s)
=== CONT  TestAccIntegrationIdPSAMLResource
--- PASS: TestAccSAMLCertificateDataSource (5.61s)
=== CONT  TestAccSidecarCftTemplateDataSource
--- PASS: TestAccDatalabelDataSource (22.83s)
=== CONT  TestAccSAMLConfigurationDataSource
--- PASS: TestAccServiceAccountResource (27.92s)
=== CONT  TestAccELKIntegrationResource
--- PASS: TestAccDatadogIntegrationResource (8.73s)
=== CONT  TestAccPermissionDataSource
--- PASS: TestAccRoleSSOGroupsResource (16.09s)
=== CONT  TestAccSidecarBoundPortsDataSource
--- PASS: TestAccPermissionDataSource (4.93s)
=== CONT  TestAccSidecarIDDataSource
--- PASS: TestAccLoggingIntegrationDataSource (11.46s)
=== CONT  TestAccSidecarHealthDataSource
--- PASS: TestAccELKIntegrationResource (7.96s)
--- PASS: TestAccSAMLConfigurationDataSource (10.34s)
--- PASS: TestAccSidecarCftTemplateDataSource (13.26s)
--- PASS: TestAccIdPIntegrationResource (44.79s)
--- PASS: TestAccSidecarIDDataSource (6.94s)
--- PASS: TestAccSidecarHealthDataSource (6.55s)
--- PASS: TestAccSidecarBoundPortsDataSource (14.32s)
--- PASS: TestAccIntegrationIdPSAMLResource (20.20s)
PASS
ok  	github.com/cyralinc/terraform-provider-cyral/cyral	103.715s

@VictorGFM VictorGFM marked this pull request as ready for review September 26, 2023 23:16
@wcmjunior wcmjunior removed the request for review from Yowgf September 26, 2023 23:41
@VictorGFM VictorGFM requested a review from Yowgf September 27, 2023 15:34
Copy link
Contributor

@Yowgf Yowgf left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Just a minor doc comment

cyral/data_source_cyral_sidecar_health.go Outdated Show resolved Hide resolved
@sonarqubecloud
Copy link

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 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@VictorGFM VictorGFM merged commit 0b9a271 into main Sep 27, 2023
3 checks passed
@VictorGFM VictorGFM deleted the feature/ENG-12678 branch September 27, 2023 16:21
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.

2 participants