Skip to content

Commit

Permalink
chore: add context suppport to cmd/clusterctl/internal
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedosin committed Aug 18, 2023
1 parent ef8828d commit fb5883c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion cmd/clusterctl/internal/test/fake_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ limitations under the License.

package test

import "fmt"
import (
"fmt"
)

type FakeProcessor struct {
errGetVariables error
Expand Down
5 changes: 3 additions & 2 deletions cmd/clusterctl/internal/test/fake_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package test

import (
"context"
"errors"

apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
Expand Down Expand Up @@ -96,7 +97,7 @@ func (f *FakeProxy) CheckClusterAvailable() error {
}

// ListResources returns all the resources known by the FakeProxy.
func (f *FakeProxy) ListResources(labels map[string]string, namespaces ...string) ([]unstructured.Unstructured, error) {
func (f *FakeProxy) ListResources(_ context.Context, labels map[string]string, namespaces ...string) ([]unstructured.Unstructured, error) {
var ret []unstructured.Unstructured //nolint:prealloc
for _, o := range f.objs {
u := unstructured.Unstructured{}
Expand Down Expand Up @@ -142,7 +143,7 @@ func (f *FakeProxy) GetContexts(_ string) ([]string, error) {
return nil, nil
}

func (f *FakeProxy) GetResourceNames(_, _ string, _ []client.ListOption, _ string) ([]string, error) {
func (f *FakeProxy) GetResourceNames(_ context.Context, _, _ string, _ []client.ListOption, _ string) ([]string, error) {
return nil, nil
}

Expand Down
4 changes: 3 additions & 1 deletion cmd/clusterctl/internal/test/fake_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package test

import (
"context"

"github.com/pkg/errors"
"sigs.k8s.io/yaml"

Expand Down Expand Up @@ -55,7 +57,7 @@ type imageMeta struct {
Tag string `json:"tag,omitempty"`
}

func (f *FakeReader) Init(_ string) error {
func (f *FakeReader) Init(_ context.Context, _ string) error {
f.initialized = true
return nil
}
Expand Down

0 comments on commit fb5883c

Please sign in to comment.