forked from docker/cli
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Go back to kamoulox master Signed-off-by: Simon Ferquel <simon.ferquel@docker.com> * Stack LS Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
- Loading branch information
1 parent
1b1847d
commit 20a80f3
Showing
671 changed files
with
129,862 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package stack | ||
|
||
import ( | ||
"fmt" | ||
"io" | ||
"text/tabwriter" | ||
) | ||
|
||
type kformatter struct { | ||
writer *tabwriter.Writer | ||
} | ||
|
||
func newKformatter(out io.Writer, headers ...interface{}) kformatter { | ||
kformatter := kformatter{ | ||
writer: tabwriter.NewWriter(out, 0, 8, 1, '\t', 0), | ||
} | ||
kformatter.Write(headers...) | ||
return kformatter | ||
} | ||
|
||
func (f kformatter) Write(data ...interface{}) { | ||
for i, val := range data { | ||
fmt.Fprint(f.writer, val) | ||
if i != len(data)-1 { | ||
fmt.Fprint(f.writer, "\t") | ||
} | ||
} | ||
fmt.Fprintln(f.writer) | ||
} | ||
|
||
func (f kformatter) Flush() { | ||
f.writer.Flush() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package orchestrator | ||
|
||
import "os" | ||
|
||
func GetOrchestrator() string { | ||
return os.Getenv("DOCKER_ORCHESTRATOR") | ||
} | ||
|
||
func IsKubernetesEnabled() bool { | ||
orchestrator := GetOrchestrator() | ||
switch orchestrator { | ||
case "kubernetes", "kube", "k8s": | ||
return true | ||
} | ||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.