Skip to content

Commit

Permalink
Merge pull request #7221 from blackpiglet/schedule_cli_fix
Browse files Browse the repository at this point in the history
Fix shedule get and describe CLI nil pointer issue
  • Loading branch information
blackpiglet authored Dec 18, 2023
2 parents 71b947a + 6222891 commit ee879fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pkg/cmd/cli/schedule/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ func NewDescribeCommand(f client.Factory, use string) *cobra.Command {
crClient, err := f.KubebuilderClient()
cmd.CheckError(err)

var schedules *v1.ScheduleList
schedules := new(v1.ScheduleList)
if len(args) > 0 {
schedules = new(v1.ScheduleList)
for _, name := range args {
schedule := new(v1.Schedule)
err := crClient.Get(context.TODO(), ctrlclient.ObjectKey{Namespace: f.Namespace(), Name: name}, schedule)
Expand Down
3 changes: 1 addition & 2 deletions pkg/cmd/cli/schedule/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ func NewGetCommand(f client.Factory, use string) *cobra.Command {
crClient, err := f.KubebuilderClient()
cmd.CheckError(err)

var schedules *api.ScheduleList
schedules := new(api.ScheduleList)
if len(args) > 0 {
schedules = new(api.ScheduleList)
for _, name := range args {
schedule := new(api.Schedule)
err := crClient.Get(context.TODO(), ctrlclient.ObjectKey{Name: name, Namespace: f.Namespace()}, schedule)
Expand Down

0 comments on commit ee879fd

Please sign in to comment.