diff --git a/cmd/dbaas_external_endpoint_create_datadog.go b/cmd/dbaas_external_endpoint_create_datadog.go index 14057281..d589abb2 100644 --- a/cmd/dbaas_external_endpoint_create_datadog.go +++ b/cmd/dbaas_external_endpoint_create_datadog.go @@ -11,7 +11,7 @@ import ( v3 "github.com/exoscale/egoscale/v3" ) -func (c *dbaasExternalEndpointCreateCmd) createDatadog(_ *cobra.Command, _ []string) error { +func (c *dbaasExternalEndpointCreateCmd) createDatadog(cmd *cobra.Command, _ []string) error { ctx := gContext client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) @@ -39,7 +39,7 @@ func (c *dbaasExternalEndpointCreateCmd) createDatadog(_ *cobra.Command, _ []str if c.DatadogTags != "" { datadogRequestPayload.Settings.DatadogTags = datadogTags } - if c.DatadogDisableConsumerStats { + if cmd.Flags().Changed("datadog-disable-consumer-stats") { datadogRequestPayload.Settings.DisableConsumerStats = v3.Bool(c.DatadogDisableConsumerStats) } if c.DatadogKafkaConsumerCheckInstances != 0 { diff --git a/cmd/dbaas_external_endpoint_create_rsyslog.go b/cmd/dbaas_external_endpoint_create_rsyslog.go index 9de5d7bb..c86f0559 100644 --- a/cmd/dbaas_external_endpoint_create_rsyslog.go +++ b/cmd/dbaas_external_endpoint_create_rsyslog.go @@ -8,7 +8,7 @@ import ( v3 "github.com/exoscale/egoscale/v3" ) -func (c *dbaasExternalEndpointCreateCmd) createRsyslog(_ *cobra.Command, _ []string) error { +func (c *dbaasExternalEndpointCreateCmd) createRsyslog(cmd *cobra.Command, _ []string) error { ctx := gContext client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) if err != nil { @@ -46,7 +46,7 @@ func (c *dbaasExternalEndpointCreateCmd) createRsyslog(_ *cobra.Command, _ []str if c.RsyslogServer != "" { rsyslogRequestPayload.Settings.Server = c.RsyslogServer } - if c.RsyslogTls { + if cmd.Flags().Changed("rsyslog-tls") { rsyslogRequestPayload.Settings.Tls = v3.Bool(c.RsyslogTls) } diff --git a/cmd/dbaas_external_endpoint_update_datadog.go b/cmd/dbaas_external_endpoint_update_datadog.go index 9193cd98..1d6b24c8 100644 --- a/cmd/dbaas_external_endpoint_update_datadog.go +++ b/cmd/dbaas_external_endpoint_update_datadog.go @@ -11,7 +11,7 @@ import ( v3 "github.com/exoscale/egoscale/v3" ) -func (c *dbaasExternalEndpointUpdateCmd) updateDatadog(_ *cobra.Command, _ []string) error { +func (c *dbaasExternalEndpointUpdateCmd) updateDatadog(cmd *cobra.Command, _ []string) error { ctx := gContext client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) @@ -39,7 +39,7 @@ func (c *dbaasExternalEndpointUpdateCmd) updateDatadog(_ *cobra.Command, _ []str if c.DatadogTags != "" { datadogRequestPayload.Settings.DatadogTags = datadogTags } - if c.DatadogDisableConsumerStats { + if cmd.Flags().Changed("datadog-disable-consumer-stats") { datadogRequestPayload.Settings.DisableConsumerStats = v3.Bool(c.DatadogDisableConsumerStats) } if c.DatadogKafkaConsumerCheckInstances != 0 { diff --git a/cmd/dbaas_external_endpoint_update_rsyslog.go b/cmd/dbaas_external_endpoint_update_rsyslog.go index ab6d0487..0594bb1e 100644 --- a/cmd/dbaas_external_endpoint_update_rsyslog.go +++ b/cmd/dbaas_external_endpoint_update_rsyslog.go @@ -8,7 +8,7 @@ import ( v3 "github.com/exoscale/egoscale/v3" ) -func (c *dbaasExternalEndpointUpdateCmd) updateRsyslog(_ *cobra.Command, _ []string) error { +func (c *dbaasExternalEndpointUpdateCmd) updateRsyslog(cmd *cobra.Command, _ []string) error { ctx := gContext client, err := switchClientZoneV3(ctx, globalstate.EgoscaleV3Client, v3.ZoneName(account.CurrentAccount.DefaultZone)) if err != nil { @@ -46,13 +46,10 @@ func (c *dbaasExternalEndpointUpdateCmd) updateRsyslog(_ *cobra.Command, _ []str if c.RsyslogServer != "" { rsyslogRequestPayload.Settings.Server = c.RsyslogServer } - if c.RsyslogTls { + if cmd.Flags().Changed("rsyslog-tls") { rsyslogRequestPayload.Settings.Tls = v3.Bool(c.RsyslogTls) } - fmt.Printf("Sending Update request for %s\n", c.ID) - fmt.Printf("Sending Update request for UUID %s\n", v3.UUID(c.ID)) - op, err := client.UpdateDBAASExternalEndpointRsyslog(ctx, v3.UUID(c.ID), rsyslogRequestPayload) if err != nil { return err