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

feat(provider): add octavia loadbalancer log subscription #637

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rom123Soleil
Copy link

Description

Create ovh provider for public cloud octavia loadbalancer log subscription

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (improve existing resource(s) or datasource(s))
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Not tested yet

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or issues
  • I have added acceptance tests that prove my fix is effective or that my feature works
  • New and existing acceptance tests pass locally with my changes
  • I ran succesfully go mod vendor if I added or modify go.mod file

params := (&CloudProjectRegionLoadbalancerLogSubscriptionResourceCreateOpts{}).fromResource(d)
res := &CloudProjectRegionLoadbalancerLogSubscriptionResponse{}

log.Printf("[DEBUG] Will create Log subscrition : %+v for loadbalancer %s on region %s from project %s", params, loadbalancerID, regionName, serviceName)
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
log.Printf("[DEBUG] Will create Log subscrition : %+v for loadbalancer %s on region %s from project %s", params, loadbalancerID, regionName, serviceName)
log.Printf("[DEBUG] Will create Log subscription: %+v for loadbalancer %s on region %s from project %s", params, loadbalancerID, regionName, serviceName)

log.Printf("[DEBUG] Waiting for Log subscription operation %s to be READY", res.OperationID)
op, err := waitForDbaasLogsOperation(ctx, config.OVHClient, res.LDPServiceName, res.OperationID)
if err != nil {
return diag.Errorf("timeout while waiting log subscrition operation %s to be READY: %q", res.OperationID, err)
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
return diag.Errorf("timeout while waiting log subscrition operation %s to be READY: %q", res.OperationID, err)
return diag.Errorf("timeout while waiting log subscription operation %s to be READY: %q", res.OperationID, err)

if err != nil {
return diag.Errorf("timeout while waiting log subscrition operation %s to be READY: %q", res.OperationID, err)
}
log.Printf("[DEBUG] Log subscrition operation %s is READY", res.OperationID)
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
log.Printf("[DEBUG] Log subscrition operation %s is READY", res.OperationID)
log.Printf("[DEBUG] Log subscription operation %s is READY", res.OperationID)
$:~/go/src/github.com/ovh/terraform-provider-ovh GIT[master]$ git grep -c subscrition
ovh/data_cloud_project_database_log_subscription.go:3
ovh/data_cloud_project_database_log_subscriptions.go:1
ovh/resource_cloud_project_database_log_subscription.go:6
ovh/resource_cloud_project_region_loadbalancer_log_subscription.go:6
website/docs/d/cloud_project_database_log_subscriptions.html.markdown:1
website/docs/r/cloud_project_database_log_subscription.html.markdown:1

I guess we have a few to fix

)
res := &CloudProjectRegionLoadbalancerLogSubscriptionResponse{}

log.Printf("[DEBUG] Will read log subscrition %s from loadbalancer %s on region %s from project %s", id, loadbalancerID, regionName, serviceName)
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
log.Printf("[DEBUG] Will read log subscrition %s from loadbalancer %s on region %s from project %s", id, loadbalancerID, regionName, serviceName)
log.Printf("[DEBUG] Will read log subscription %s from loadbalancer %s on region %s from project %s", id, loadbalancerID, regionName, serviceName)


res := &CloudProjectRegionLoadbalancerLogSubscriptionResponse{}

log.Printf("[DEBUG] Will delete Log subscrition for loadbalancer %s on region %s from project %s", loadbalancerID, regionName, serviceName)
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
log.Printf("[DEBUG] Will delete Log subscrition for loadbalancer %s on region %s from project %s", loadbalancerID, regionName, serviceName)
log.Printf("[DEBUG] Will delete Log subscription for loadbalancer %s on region %s from project %s", loadbalancerID, regionName, serviceName)

@@ -0,0 +1 @@
package ovh
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you have to fill these

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