Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
5000252e
Commit
5000252e
authored
Aug 18, 2015
by
Robert Bailey
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12669 from deads2k/tolerate-missing-template-flag
tolerate output without template file
parents
a2caee0d
969d526c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
printing.go
pkg/kubectl/cmd/util/printing.go
+4
-1
No files found.
pkg/kubectl/cmd/util/printing.go
View file @
5000252e
...
@@ -82,7 +82,10 @@ func OutputVersion(cmd *cobra.Command, defaultVersion string) string {
...
@@ -82,7 +82,10 @@ func OutputVersion(cmd *cobra.Command, defaultVersion string) string {
// Requires that printer flags have been added to cmd (see AddPrinterFlags).
// Requires that printer flags have been added to cmd (see AddPrinterFlags).
func
PrinterForCommand
(
cmd
*
cobra
.
Command
)
(
kubectl
.
ResourcePrinter
,
bool
,
error
)
{
func
PrinterForCommand
(
cmd
*
cobra
.
Command
)
(
kubectl
.
ResourcePrinter
,
bool
,
error
)
{
outputFormat
:=
GetFlagString
(
cmd
,
"output"
)
outputFormat
:=
GetFlagString
(
cmd
,
"output"
)
templateFile
:=
GetFlagString
(
cmd
,
"template"
)
// templates are logically optional for specifying a format.
// TODO once https://github.com/kubernetes/kubernetes/issues/12668 is fixed, this should fall back to GetFlagString
templateFile
,
_
:=
cmd
.
Flags
()
.
GetString
(
"template"
)
if
len
(
outputFormat
)
==
0
&&
len
(
templateFile
)
!=
0
{
if
len
(
outputFormat
)
==
0
&&
len
(
templateFile
)
!=
0
{
outputFormat
=
"template"
outputFormat
=
"template"
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment