Skip to content

Commit

Permalink
repository/oci: fix oci constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheu committed Sep 17, 2024
1 parent e93544e commit 0c1ecab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 3 additions & 4 deletions pkg/repository/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion pkg/repository/oci/oci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0c1ecab

Please sign in to comment.