diff --git a/pkg/repository/oci/oci.go b/pkg/repository/oci/oci.go index 2bdde3a..7dedacc 100644 --- a/pkg/repository/oci/oci.go +++ b/pkg/repository/oci/oci.go @@ -30,12 +30,11 @@ func NewOCI(data map[string]string) *OCI { CompartmentID: data["compartmentID"], Profile: data["profile"], ConfigPath: data["configPath"], - client: &artifacts.ArtifactsClient{}, } } func (r *OCI) Ensure(ctx context.Context, name string) error { - err := r.auth(ctx) + err := r.auth() if err != nil { return err } @@ -49,7 +48,7 @@ func (r *OCI) Ensure(ctx context.Context, name string) error { return nil } -func (r *OCI) auth(ctx context.Context) error { +func (r *OCI) auth() error { if r.client != nil { return nil } @@ -59,7 +58,7 @@ func (r *OCI) auth(ctx context.Context) error { if err != nil { return err } - return err + return nil } func (r *OCI) create(ctx context.Context, name string) error { diff --git a/pkg/repository/oci/oci_test.go b/pkg/repository/oci/oci_test.go index 6ac6548..713f915 100644 --- a/pkg/repository/oci/oci_test.go +++ b/pkg/repository/oci/oci_test.go @@ -59,7 +59,8 @@ func TestOCI_Ensure(t *testing.T) { assert.NoError(t, err) assert.True(t, exists) err = oci.create(ctx, name) - assert.Error(t, err, "repository already exists") + assert.Error(t, err) + assert.ErrorContains(t, err, "repository already exists") } func TestParserRegistryRepository(t *testing.T) {