Skip to content
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
3 changes: 2 additions & 1 deletion cmd/internal/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package internal provides subcommands intended for internal KNE team use.
package internal

import (
Expand All @@ -25,6 +26,6 @@ func New() *cobra.Command {
Use: "internal",
Short: "Internal contains tools for internal KNE team use.",
}
cmd.AddCommand(release.NewRelease())
cmd.AddCommand(release.New())
return cmd
}
8 changes: 6 additions & 2 deletions cmd/release/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package release provides subcommands for releasing KNE artifacts.
package release

import (
Expand All @@ -29,7 +30,8 @@ import (
"google.golang.org/api/option"
)

func NewRelease() *cobra.Command {
// New returns the release subcommand.
func New() *cobra.Command {
cmd := &cobra.Command{
Use: "release",
}
Expand Down Expand Up @@ -132,7 +134,9 @@ func triggerBuild(ctx context.Context, trigger, tagOrSHA string, tag bool) (rErr
if err != nil {
return err
}
fmt.Printf("Build ID: %s\nLogs: %s\n", md.GetBuild().GetId(), md.GetBuild().GetLogUrl())
if md.Build != nil {
fmt.Printf("Build ID: %s\nLogs: %s\n", md.Build.GetId(), md.Build.GetLogUrl())
}
fmt.Println("Waiting for build to finish")
b, err := op.Wait(ctx)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions cmd/release/release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
"testing"
)

func TestNewRelease(t *testing.T) {
cmd := NewRelease()
func TestNew(t *testing.T) {
cmd := New()
if cmd == nil {
t.Fatalf("NewRelease() returned nil")
t.Fatalf("New() returned nil")
}
if cmd.Use != "release" {
t.Errorf("cmd.Use = %q, want %q", cmd.Use, "release")
Expand Down
Loading