Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update go mod #1752

Merged
merged 4 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/kyma/alpha/enable/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func filterModuleTemplates(allTemplates v1beta2.ModuleTemplateList,
filteredModuleTemplates = append(filteredModuleTemplates, mt)
continue
}
descriptor, err := mt.Spec.GetDescriptor()
descriptor, err := mt.GetDescriptor()
if err != nil {
return nil, fmt.Errorf("invalid ModuleTemplate descriptor: %v", err)
}
Expand Down
9 changes: 5 additions & 4 deletions cmd/kyma/alpha/enable/module/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package module

import (
"context"
"strings"
"testing"

"github.com/kyma-project/cli/cmd/kyma/alpha/enable/module/mock"
"github.com/kyma-project/lifecycle-manager/api/v1beta2"
"github.com/kyma-project/lifecycle-manager/pkg/testutils"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"strings"
"testing"
)

func TestChannelValidation(t *testing.T) {
Expand All @@ -19,13 +20,13 @@ func TestChannelValidation(t *testing.T) {
ControllerName: "-",
Channel: "fast",
CustomResourcePolicy: "-",
}, unstructured.Unstructured{}, false, false, false)
}, unstructured.Unstructured{}, false, false, false, false)
template2, _ := testutils.ModuleTemplateFactory(v1beta2.Module{
Name: "not-test",
ControllerName: "-",
Channel: "alpha",
CustomResourcePolicy: "-",
}, unstructured.Unstructured{}, false, false, false)
}, unstructured.Unstructured{}, false, false, false, false)
allTemplates := v1beta2.ModuleTemplateList{
TypeMeta: metav1.TypeMeta{},
ListMeta: metav1.ListMeta{},
Expand Down
244 changes: 121 additions & 123 deletions go.mod

Large diffs are not rendered by default.

640 changes: 324 additions & 316 deletions go.sum

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions pkg/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"io"
"os"
"strings"
"time"

dockerConfig "github.com/docker/cli/cli/config"
configTypes "github.com/docker/cli/cli/config/types"
Expand Down Expand Up @@ -38,10 +37,10 @@ type dockerWrapper struct {
//go:generate mockery --name Client
type Client interface {
ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig,
platform *specs.Platform, containerName string) (container.ContainerCreateCreatedBody, error)
platform *specs.Platform, containerName string) (container.CreateResponse, error)
ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error
ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error)
ContainerStop(ctx context.Context, containerID string, timeout *time.Duration) error
ContainerStop(ctx context.Context, containerID string, options container.StopOptions) error
ImageBuild(ctx context.Context, buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error)
ImagePush(ctx context.Context, image string, options types.ImagePushOptions) (io.ReadCloser, error)
Expand Down Expand Up @@ -163,7 +162,7 @@ func (w *dockerWrapper) ContainerFollowRun(ctx context.Context, containerID stri
func (w *dockerWrapper) Stop(ctx context.Context, containerID string, log func(...interface{})) func() {
return func() {
log(fmt.Sprintf("\r- Removing container %s...\n", containerID))
err := w.Docker.ContainerStop(ctx, containerID, nil)
err := w.Docker.ContainerStop(ctx, containerID, container.StopOptions{})
if err != nil {
log(err)
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/docker/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func Test_PullImageAndStartContainer(t *testing.T) {

mockDocker.On("ContainerCreate", ctx, mock.AnythingOfType("*container.Config"),
mock.AnythingOfType("*container.HostConfig"), mock.Anything, mock.Anything, testOpts.ContainerName).Return(
container.ContainerCreateCreatedBody{ID: testContainerID}, nil).Times(1)
container.CreateResponse{ID: testContainerID}, nil).Times(1)

mockDocker.On("ContainerStart", ctx, testContainerID, mock.AnythingOfType("types.ContainerStartOptions")).Return(nil).Times(1)

Expand All @@ -154,7 +154,7 @@ func Test_PullImageAndStartContainer(t *testing.T) {

mockDocker.On("ContainerCreate", ctx, mock.AnythingOfType("*container.Config"),
mock.AnythingOfType("*container.HostConfig"), mock.Anything, mock.Anything, testOpts.ContainerName).Return(
container.ContainerCreateCreatedBody{}, testErr).Times(1)
container.CreateResponse{}, testErr).Times(1)

id, err := mockWrapper.PullImageAndStartContainer(ctx, testOpts)

Expand All @@ -169,7 +169,7 @@ func Test_PullImageAndStartContainer(t *testing.T) {

mockDocker.On("ContainerCreate", ctx, mock.AnythingOfType("*container.Config"),
mock.AnythingOfType("*container.HostConfig"), mock.Anything, mock.Anything, testOpts.ContainerName).Return(
container.ContainerCreateCreatedBody{ID: testContainerID}, nil).Times(1)
container.CreateResponse{ID: testContainerID}, nil).Times(1)

mockDocker.On("ContainerStart", ctx, testContainerID, mock.AnythingOfType("types.ContainerStartOptions")).Return(testErr).Times(1)

Expand Down
61 changes: 38 additions & 23 deletions pkg/docker/mocks/Client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.