Skip to content

Commit 1f2247c

Browse files
committed
Rename reslib
1 parent 632c992 commit 1f2247c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

pkg/operator/endpoints/logs.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
"github.com/cortexlabs/cortex/pkg/lib/errors"
2525
"github.com/cortexlabs/cortex/pkg/lib/slices"
26-
reslib "github.com/cortexlabs/cortex/pkg/operator/api/resource"
26+
"github.com/cortexlabs/cortex/pkg/operator/api/resource"
2727
"github.com/cortexlabs/cortex/pkg/operator/workloads"
2828
)
2929

@@ -80,37 +80,37 @@ func ReadLogs(w http.ResponseWriter, r *http.Request) {
8080
}
8181

8282
if resourceType != "" {
83-
resource, err := ctx.VisibleResourceByNameAndType(resourceName, resourceType)
83+
res, err := ctx.VisibleResourceByNameAndType(resourceName, resourceType)
8484
if err != nil {
8585
RespondError(w, err)
8686
return
8787
}
88-
if resource.GetResourceType() == reslib.APIType {
89-
podLabels["apiName"] = resource.GetName()
88+
if res.GetResourceType() == resource.APIType {
89+
podLabels["apiName"] = res.GetName()
9090
} else {
91-
podLabels["workloadID"] = resource.GetWorkloadID()
91+
podLabels["workloadID"] = res.GetWorkloadID()
9292
}
9393
readLogs(w, r, podLabels, appName, verbose)
9494
return
9595
}
9696

97-
resource, err := ctx.VisibleResourceByName(resourceName)
97+
res, err := ctx.VisibleResourceByName(resourceName)
9898

9999
if err == nil {
100-
workloadID = resource.GetWorkloadID()
101-
if resource.GetResourceType() == reslib.APIType {
102-
podLabels["apiName"] = resource.GetName()
100+
workloadID = res.GetWorkloadID()
101+
if res.GetResourceType() == resource.APIType {
102+
podLabels["apiName"] = res.GetName()
103103
} else {
104-
podLabels["workloadID"] = resource.GetWorkloadID()
104+
podLabels["workloadID"] = res.GetWorkloadID()
105105
}
106106
readLogs(w, r, podLabels, appName, verbose)
107107
return
108108
}
109109

110110
// Check for duplicate resources with same workload ID
111111
var workloadIDs []string
112-
for _, resource := range ctx.VisibleResourcesByName(resourceName) {
113-
workloadIDs = append(workloadIDs, resource.GetWorkloadID())
112+
for _, res := range ctx.VisibleResourcesByName(resourceName) {
113+
workloadIDs = append(workloadIDs, res.GetWorkloadID())
114114
}
115115
workloadIDs = slices.UniqueStrings(workloadIDs)
116116
if len(workloadIDs) == 1 {

0 commit comments

Comments
 (0)