Skip to content

Commit

Permalink
bug: get specs returns one return value #374
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Jan 10, 2024
1 parent 82bf59f commit 79dac91
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions cmd/registry/apis/artifacts/getartifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ var GetArtifactCmd = &cobra.Command{
},
RunE: func(cmd *cobra.Command, args []string) (err error) {
if content {
_, err = apis.GetArtifactContents(apiName, name)
return err
return apis.GetArtifactContents(apiName, name)
}
_, err = apis.GetArtifact(apiName, name)
return
Expand Down
3 changes: 1 addition & 2 deletions cmd/registry/apis/versions/artifacts/getartifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ var GetArtifactCmd = &cobra.Command{
},
RunE: func(cmd *cobra.Command, args []string) (err error) {
if content {
_, err = versions.GetArtifactContents(apiName, apiVersion, name)
return err
return versions.GetArtifactContents(apiName, apiVersion, name)
}
_, err = versions.GetArtifact(apiName, apiVersion, name)
return
Expand Down
4 changes: 3 additions & 1 deletion cmd/registry/apis/versions/specs/crtspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package specs

import (
"encoding/base64"

Check failure on line 18 in cmd/registry/apis/versions/specs/crtspec.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed (gofumpt)

Check failure on line 18 in cmd/registry/apis/versions/specs/crtspec.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed (gofumpt)
"internal/apiclient"

"internal/client/registry/apis/versions"
Expand All @@ -38,8 +39,9 @@ var CreateSpecCmd = &cobra.Command{
if err != nil {
return err
}
contents := base64.URLEncoding.EncodeToString(fileContents)
_, err = versions.CreateSpec(apiName, apiVersion, apiSpecID,
name, fileName, description, sourceURI, string(fileContents), labels, annotations)
name, fileName, description, sourceURI, contents, labels, annotations)
return
},
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/apis/versions/specs/getspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var GetSpecCmd = &cobra.Command{
},
RunE: func(cmd *cobra.Command, args []string) (err error) {
if content {
_, err = versions.GetSpecContents(apiName, apiVersion, name)
err = versions.GetSpecContents(apiName, apiVersion, name)
return err
}
_, err = versions.GetSpec(apiName, apiVersion, name)
Expand Down
3 changes: 1 addition & 2 deletions cmd/registry/artifacts/getartifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ var GetArtifactCmd = &cobra.Command{
},
RunE: func(cmd *cobra.Command, args []string) (err error) {
if content {
_, err = artifacts.GetContents(name)
return err
return artifacts.GetContents(name)
}
_, err = artifacts.Get(name)
return
Expand Down

0 comments on commit 79dac91

Please sign in to comment.