fix linting errors
This commit is contained in:
parent
6ba3a8f0f8
commit
ae8e129ce7
@ -27,7 +27,7 @@ import (
|
||||
type ContainerClient interface {
|
||||
ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error)
|
||||
ContainerStart(ctx context.Context, containerID string, options container.StartOptions) error
|
||||
ContainerList(context.Context, types.ContainerListOptions) ([]types.Container, error)
|
||||
ContainerList(context.Context, container.ListOptions) ([]types.Container, error)
|
||||
ContainerInspect(context.Context, string) (types.ContainerJSON, error)
|
||||
ContainerRemove(context.Context, string, container.RemoveOptions) error
|
||||
Close() error
|
||||
@ -163,7 +163,7 @@ func (c *Container) Create(ctx context.Context) error {
|
||||
}
|
||||
*/
|
||||
|
||||
if startErr := c.apiClient.ContainerStart(ctx, c.Id, types.ContainerStartOptions{}); startErr != nil {
|
||||
if startErr := c.apiClient.ContainerStart(ctx, c.Id, container.StartOptions{}); startErr != nil {
|
||||
return startErr
|
||||
}
|
||||
return err
|
||||
@ -175,7 +175,7 @@ func (c *Container) Read(ctx context.Context) ([]byte, error) {
|
||||
var containerID string
|
||||
filterArgs := filters.NewArgs()
|
||||
filterArgs.Add("name", "/"+c.Name)
|
||||
containers, err := c.apiClient.ContainerList(ctx, types.ContainerListOptions{
|
||||
containers, err := c.apiClient.ContainerList(ctx, container.ListOptions{
|
||||
All: true,
|
||||
Filters: filterArgs,
|
||||
})
|
||||
@ -219,7 +219,7 @@ func (c *Container) Read(ctx context.Context) ([]byte, error) {
|
||||
}
|
||||
|
||||
func (c *Container) Delete(ctx context.Context) error {
|
||||
err := c.apiClient.ContainerRemove(ctx, c.Id, types.ContainerRemoveOptions{
|
||||
err := c.apiClient.ContainerRemove(ctx, c.Id, container.RemoveOptions{
|
||||
RemoveVolumes: true,
|
||||
Force: false,
|
||||
})
|
||||
@ -235,7 +235,7 @@ func (c *Container) Type() string { return "container" }
|
||||
func (c *Container) ResolveId(ctx context.Context) string {
|
||||
filterArgs := filters.NewArgs()
|
||||
filterArgs.Add("name", "/"+c.Name)
|
||||
containers, err := c.apiClient.ContainerList(ctx, types.ContainerListOptions{
|
||||
containers, err := c.apiClient.ContainerList(ctx, container.ListOptions{
|
||||
All: true,
|
||||
Filters: filterArgs,
|
||||
})
|
||||
|
@ -349,8 +349,6 @@ func (n *NetworkRouteProto) UnmarshalYAML(value *yaml.Node) error {
|
||||
}
|
||||
|
||||
func (n *NetworkRoute) UnmarshalJSON(data []byte) error {
|
||||
fmt.Printf("UnmarshalJSON %#v\n", string(data))
|
||||
panic(data)
|
||||
if err := json.Unmarshal(data, n); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
type MockContainerClient struct {
|
||||
InjectContainerStart func(ctx context.Context, containerID string, options container.StartOptions) error
|
||||
InjectContainerCreate func(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error)
|
||||
InjectContainerList func(context.Context, types.ContainerListOptions) ([]types.Container, error)
|
||||
InjectContainerList func(context.Context, container.ListOptions) ([]types.Container, error)
|
||||
InjectContainerInspect func(context.Context, string) (types.ContainerJSON, error)
|
||||
InjectContainerRemove func(context.Context, string, container.RemoveOptions) error
|
||||
InjectClose func() error
|
||||
@ -29,7 +29,7 @@ func (m *MockContainerClient) ContainerStart(ctx context.Context, containerID st
|
||||
return m.InjectContainerStart(ctx, containerID, options)
|
||||
}
|
||||
|
||||
func (m *MockContainerClient) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) {
|
||||
func (m *MockContainerClient) ContainerList(ctx context.Context, options container.ListOptions) ([]types.Container, error) {
|
||||
return m.InjectContainerList(ctx, options)
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ func (m *MockResource) URI() string {
|
||||
}
|
||||
|
||||
func (m *MockResource) ResolveId(ctx context.Context) string {
|
||||
return m.ResolveId(ctx)
|
||||
return m.InjectResolveId(ctx)
|
||||
}
|
||||
|
||||
func (m *MockResource) LoadDecl(yamlResourceDeclaration string) error {
|
||||
|
Loading…
Reference in New Issue
Block a user