From 8a99c149ce174527f1f23d31a025cc1e38642ff3 Mon Sep 17 00:00:00 2001 From: Pratik Patel Date: Fri, 31 Oct 2025 17:29:27 -0700 Subject: [PATCH 1/2] fix(BREV-2064): reduce noise from some logs --- v1/providers/shadeform/instance.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/v1/providers/shadeform/instance.go b/v1/providers/shadeform/instance.go index 1867ffde..87a83817 100644 --- a/v1/providers/shadeform/instance.go +++ b/v1/providers/shadeform/instance.go @@ -258,7 +258,6 @@ func (c *ShadeformClient) getLifecycleStatus(status string) v1.LifecycleStatus { // convertInstanceInfoResponseToV1Instance - converts Instance Info to v1 instance func (c *ShadeformClient) convertInstanceInfoResponseToV1Instance(ctx context.Context, instanceInfo openapi.InstanceInfoResponse) (*v1.Instance, error) { - c.logger.Debug(ctx, "converting instance info response to v1 instance", v1.LogField("instanceInfo", instanceInfo)) instanceType := c.getInstanceType(string(instanceInfo.Cloud), instanceInfo.ShadeInstanceType) lifeCycleStatus := c.getLifecycleStatus(string(instanceInfo.Status)) @@ -271,18 +270,15 @@ func (c *ShadeformClient) convertInstanceInfoResponseToV1Instance(ctx context.Co if !found { return nil, errors.WrapAndTrace(errors.New("could not find refID tag")) } - c.logger.Debug(ctx, "refID found, deleting from tags", v1.LogField("refID", refID)) delete(tags, refIDTagName) cloudCredRefID, found := tags[cloudCredRefIDTagName] if !found { return nil, errors.WrapAndTrace(errors.New("could not find cloudCredRefID tag")) } - c.logger.Debug(ctx, "cloudCredRefID found, deleting from tags", v1.LogField("cloudCredRefID", cloudCredRefID)) delete(tags, cloudCredRefIDTagName) diskSize := units.Base2Bytes(instanceInfo.Configuration.StorageInGb) * units.GiB - c.logger.Debug(ctx, "calculated diskSize", v1.LogField("diskSize", diskSize), v1.LogField("storageInGb", instanceInfo.Configuration.StorageInGb)) instance := &v1.Instance{ Name: c.getProvidedInstanceName(instanceInfo.Name), @@ -315,7 +311,6 @@ func (c *ShadeformClient) convertInstanceInfoResponseToV1Instance(ctx context.Co // convertInstanceInfoResponseToV1Instance - converts /instances response to v1 instance; the api struct is slightly // different from instance info response and expected to diverge so keeping it as a separate function for now func (c *ShadeformClient) convertShadeformInstanceToV1Instance(ctx context.Context, shadeformInstance openapi.Instance) (*v1.Instance, error) { - c.logger.Debug(ctx, "converting shadeform instance to v1 instance", v1.LogField("shadeformInstance", shadeformInstance)) instanceType := c.getInstanceType(string(shadeformInstance.Cloud), shadeformInstance.ShadeInstanceType) lifeCycleStatus := c.getLifecycleStatus(string(shadeformInstance.Status)) @@ -328,18 +323,15 @@ func (c *ShadeformClient) convertShadeformInstanceToV1Instance(ctx context.Conte if !found { return nil, errors.WrapAndTrace(errors.New("could not find refID tag")) } - c.logger.Debug(ctx, "refID found, deleting from tags", v1.LogField("refID", refID)) delete(tags, refIDTagName) cloudCredRefID, found := tags[cloudCredRefIDTagName] if !found { return nil, errors.WrapAndTrace(errors.New("could not find cloudCredRefID tag")) } - c.logger.Debug(ctx, "cloudCredRefID found, deleting from tags", v1.LogField("cloudCredRefID", cloudCredRefID)) delete(tags, cloudCredRefIDTagName) diskSize := units.Base2Bytes(shadeformInstance.Configuration.StorageInGb) * units.GiB - c.logger.Debug(ctx, "calculated diskSize", v1.LogField("diskSize", diskSize), v1.LogField("storageInGb", shadeformInstance.Configuration.StorageInGb)) instance := &v1.Instance{ Name: shadeformInstance.Name, From c7cf06f23d4fa2ed7efcaabb52012107a1ccbade Mon Sep 17 00:00:00 2001 From: Pratik Patel Date: Wed, 5 Nov 2025 17:49:47 -0800 Subject: [PATCH 2/2] feat(BREV-2064): lint --- v1/providers/shadeform/instance.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/v1/providers/shadeform/instance.go b/v1/providers/shadeform/instance.go index 87a83817..aa7c4d33 100644 --- a/v1/providers/shadeform/instance.go +++ b/v1/providers/shadeform/instance.go @@ -180,7 +180,7 @@ func (c *ShadeformClient) GetInstance(ctx context.Context, instanceID v1.CloudPr return nil, errors.WrapAndTrace(fmt.Errorf("no instance returned from get request")) } - instance, err := c.convertInstanceInfoResponseToV1Instance(ctx, *resp) + instance, err := c.convertInstanceInfoResponseToV1Instance(*resp) if err != nil { return nil, errors.WrapAndTrace(err) } @@ -215,7 +215,7 @@ func (c *ShadeformClient) ListInstances(ctx context.Context, _ v1.ListInstancesA var instances []v1.Instance for _, instance := range resp.Instances { - singleInstance, err := c.convertShadeformInstanceToV1Instance(ctx, instance) + singleInstance, err := c.convertShadeformInstanceToV1Instance(instance) if err != nil { return nil, errors.WrapAndTrace(err) } @@ -257,7 +257,7 @@ func (c *ShadeformClient) getLifecycleStatus(status string) v1.LifecycleStatus { } // convertInstanceInfoResponseToV1Instance - converts Instance Info to v1 instance -func (c *ShadeformClient) convertInstanceInfoResponseToV1Instance(ctx context.Context, instanceInfo openapi.InstanceInfoResponse) (*v1.Instance, error) { +func (c *ShadeformClient) convertInstanceInfoResponseToV1Instance(instanceInfo openapi.InstanceInfoResponse) (*v1.Instance, error) { instanceType := c.getInstanceType(string(instanceInfo.Cloud), instanceInfo.ShadeInstanceType) lifeCycleStatus := c.getLifecycleStatus(string(instanceInfo.Status)) @@ -310,7 +310,7 @@ func (c *ShadeformClient) convertInstanceInfoResponseToV1Instance(ctx context.Co // convertInstanceInfoResponseToV1Instance - converts /instances response to v1 instance; the api struct is slightly // different from instance info response and expected to diverge so keeping it as a separate function for now -func (c *ShadeformClient) convertShadeformInstanceToV1Instance(ctx context.Context, shadeformInstance openapi.Instance) (*v1.Instance, error) { +func (c *ShadeformClient) convertShadeformInstanceToV1Instance(shadeformInstance openapi.Instance) (*v1.Instance, error) { instanceType := c.getInstanceType(string(shadeformInstance.Cloud), shadeformInstance.ShadeInstanceType) lifeCycleStatus := c.getLifecycleStatus(string(shadeformInstance.Status))