Skip to content

bug: project logs command flags have no effect #702

@Sypher845

Description

@Sypher845

In the project logs command, the flags --page, --page-size, --query, --sort are defined and and also are accepted as input from the user.

	flags := cmd.Flags()
	flags.Int64VarP(&opts.Page, "page", "", 1, "Page number")
	flags.Int64VarP(&opts.PageSize, "page-size", "", 10, "Size of per page")
	flags.StringVarP(&opts.Q, "query", "q", "", "Query string to query resources")
	flags.StringVarP(&opts.Sort, "sort", "", "", "Sort the resource list in ascending or descending order")

The struct var opts api.ListFlags in which they are stored is not passed to api.LosProject() ,
resp, err = api.LogsProject(projectName)
only the projectName is passed

Also in the project_handler.go, it only handles logic of accepting only projectName

func LogsProject(projectName string) (*project.GetLogExtsOK, error) {
	ctx, client, err := utils.ContextWithClient()
	if err != nil {
		return nil, err
	}

	response, err := client.Project.GetLogExts(ctx, &project.GetLogExtsParams{
		ProjectName: projectName,
		Context:     ctx,
	})
	if err != nil {
		return nil, err
	}

	return response, nil
}

I am working on this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: LowA problem that causes minor errors—such as formatting or display problemsbugSomething isn't workinggoPull requests that update go code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions