Skip to content

Commit

Permalink
fix: auth (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahanmmi committed Jul 4, 2024
1 parent fa2ecf2 commit 51aef7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugin/processor/compute_instance/compute_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (m *ComputeInstanceProcessor) ResultsSummary() *golang.ResultSummary {

func (m *ComputeInstanceProcessor) UpdateSummary(itemId string) {
i, ok := m.items.Get(itemId)
if ok && i.Wastage.Rightsizing.Recommended != nil {
if ok && i.Wastage != nil && i.Wastage.Rightsizing.Recommended != nil {
totalSaving := 0.0
totalCurrentCost := 0.0
for _, v := range i.Wastage.VolumesRightsizing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ func (job *OptimizeComputeInstancesJob) Run(ctx context.Context) error {
}
}

grpcCtx := metadata.NewOutgoingContext(ctx, metadata.Pairs("workspace-name", "kaytu"))
grpcCtx, cancel := context.WithTimeout(grpcCtx, shared.GrpcOptimizeRequestTimeout)
defer cancel()

metrics := make(map[string]*golang2.Metric)
for k, v := range item.Metrics {
metrics[k] = &golang2.Metric{
Expand All @@ -104,7 +100,10 @@ func (job *OptimizeComputeInstancesJob) Run(ctx context.Context) error {
}
}

response, err := job.processor.client.GCPComputeOptimization(ctx, &golang2.GCPComputeOptimizationRequest{
grpcCtx := metadata.NewOutgoingContext(ctx, metadata.Pairs("workspace-name", "kaytu"))
grpcCtx, cancel := context.WithTimeout(grpcCtx, shared.GrpcOptimizeRequestTimeout)
defer cancel()
response, err := job.processor.client.GCPComputeOptimization(grpcCtx, &golang2.GCPComputeOptimizationRequest{
RequestId: wrapperspb.String(requestId),
CliVersion: wrapperspb.String(version.VERSION),
Identification: job.processor.provider.Identify(),
Expand Down

0 comments on commit 51aef7e

Please sign in to comment.