Skip to content

Commit 6385a35

Browse files
committed
Made the container result return the registry and nil if its empty
1 parent d24ecce commit 6385a35

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

api/container.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ import (
66
)
77

88
func toContainerResult(container ContainerResult) (ContainerResult, error) {
9-
var registryName string
10-
if container.PrivateRegistry == nil {
11-
registryName = "public"
12-
} else {
13-
registryName = container.PrivateRegistry.Name
14-
}
15-
169
// Environment Variables
1710
var envVars []EnvironmentVariableResult
1811
if container.EnvironmentVariables != nil {
@@ -89,11 +82,12 @@ func toContainerResult(container ContainerResult) (ContainerResult, error) {
8982
Triggers: triggers,
9083
}
9184
}
85+
registry := container.PrivateRegistry
9286

9387
return ContainerResult{
9488
Name: container.Name,
9589
Image: container.Image,
96-
PrivateRegistry: &ContainerResultPrivateRegistry{Name: registryName},
90+
PrivateRegistry: registry,
9791
Resources: container.Resources,
9892
EnvironmentVariables: envVars,
9993
Ports: container.Ports,

api/volume.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package api
22

33
import (
44
"context"
5-
"fmt"
65
)
76

87
func (client *Client) ListVolumes(namespace string) ([]VolumeResult, error) {
@@ -44,9 +43,6 @@ func (client *Client) ListVolumeByName(namespace string, volumeName string) (*Vo
4443
break
4544
}
4645

47-
if &volume == nil {
48-
return nil, fmt.Errorf("volume %q not found in namespace %q", volumeName, namespace)
49-
}
5046
return volume, nil
5147
}
5248

0 commit comments

Comments
 (0)