Skip to content

Commit 9284c63

Browse files
liveaverageclaude
andcommitted
Address deprecation feedback from PR review
- Replace DiskSize with DiskSizeBytes in instance.go - Replace Memory with MemoryBytes in instancetype.go - Remove emojis from logger statements in instance.go - Change logger.Info to logger.Debug for "building instance type" log Generated with Claude Code Co-Authored-By: Claude <[email protected]>
1 parent dc51bb1 commit 9284c63

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

v1/providers/nebius/instance.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (c *NebiusClient) CreateInstance(ctx context.Context, attrs v1.CreateInstan
117117

118118
// Add labels/tags to metadata (always create labels for resource tracking)
119119
createReq.Metadata.Labels = make(map[string]string)
120-
c.logger.Info(ctx, "🏷️ Setting instance tags during CreateInstance",
120+
c.logger.Info(ctx, "Setting instance tags during CreateInstance",
121121
v1.LogField("providedTagsCount", len(attrs.Tags)),
122122
v1.LogField("providedTags", fmt.Sprintf("%+v", attrs.Tags)),
123123
v1.LogField("refID", attrs.RefID))
@@ -337,7 +337,7 @@ func (c *NebiusClient) convertNebiusInstanceToV1(ctx context.Context, instance *
337337
InstanceType: instanceTypeID, // Full instance type ID (e.g., "gpu-h100-sxm.8gpu-128vcpu-1600gb")
338338
InstanceTypeID: v1.InstanceTypeID(instanceTypeID), // Same as InstanceType - required for dev-plane lookup
339339
ImageID: imageFamily,
340-
DiskSize: units.Base2Bytes(diskSize), // diskSize is already in bytes from getBootDiskSize
340+
DiskSizeBytes: v1.NewBytes(v1.BytesValue(diskSize), v1.Byte), // diskSize is already in bytes from getBootDiskSize
341341
Tags: tags,
342342
Status: v1.Status{LifecycleStatus: lifecycleStatus},
343343
// SSH connectivity details
@@ -717,7 +717,7 @@ func (c *NebiusClient) ListInstances(ctx context.Context, args v1.ListInstancesA
717717
continue
718718
}
719719

720-
c.logger.Info(ctx, "🔍 Processing instance from Nebius API",
720+
c.logger.Info(ctx, "Processing instance from Nebius API",
721721
v1.LogField("instanceID", nebiusInstance.Metadata.Id),
722722
v1.LogField("instanceName", nebiusInstance.Metadata.Name),
723723
v1.LogField("rawLabelsCount", len(nebiusInstance.Metadata.Labels)),
@@ -732,7 +732,7 @@ func (c *NebiusClient) ListInstances(ctx context.Context, args v1.ListInstancesA
732732
continue
733733
}
734734

735-
c.logger.Info(ctx, "🏷️ Instance after conversion",
735+
c.logger.Info(ctx, "Instance after conversion",
736736
v1.LogField("instanceID", instance.CloudID),
737737
v1.LogField("convertedTagsCount", len(instance.Tags)),
738738
v1.LogField("convertedTags", fmt.Sprintf("%+v", instance.Tags)))

v1/providers/nebius/instancetype.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func (c *NebiusClient) getInstanceTypesForLocation(ctx context.Context, platform
165165
// ID and Type are the same - no region/provider prefix
166166
instanceTypeID := fmt.Sprintf("%s.%s", platform.Metadata.Name, preset.Name)
167167

168-
c.logger.Info(ctx, "building instance type",
168+
c.logger.Debug(ctx, "building instance type",
169169
v1.LogField("instanceTypeID", instanceTypeID),
170170
v1.LogField("platformName", platform.Metadata.Name),
171171
v1.LogField("presetName", preset.Name),
@@ -178,8 +178,8 @@ func (c *NebiusClient) getInstanceTypesForLocation(ctx context.Context, platform
178178
Location: location.Name,
179179
Type: instanceTypeID, // Same as ID - both use dot-separated format
180180
VCPU: preset.Resources.VcpuCount,
181-
Memory: units.Base2Bytes(int64(preset.Resources.MemoryGibibytes) * 1024 * 1024 * 1024), // Convert GiB to bytes
182-
NetworkPerformance: "standard", // Default network performance
181+
MemoryBytes: v1.NewBytes(v1.BytesValue(preset.Resources.MemoryGibibytes), v1.Gibibyte), // Memory in GiB
182+
NetworkPerformance: "standard", // Default network performance
183183
IsAvailable: isAvailable,
184184
Stoppable: true, // All Nebius instances support stop/start operations
185185
ElasticRootVolume: true, // Nebius supports dynamic disk allocation

0 commit comments

Comments
 (0)