1 Star 0 Fork 0

zhen00fa/kubernetes-entrypoint

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
kubernetes-entrypoint.go 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
Sean Eagan 提交于 2018-03-09 19:58 . Add pod dependencies
package main
import (
"os"
entry "github.com/stackanetes/kubernetes-entrypoint/entrypoint"
_ "github.com/stackanetes/kubernetes-entrypoint/dependencies/config"
_ "github.com/stackanetes/kubernetes-entrypoint/dependencies/container"
_ "github.com/stackanetes/kubernetes-entrypoint/dependencies/daemonset"
_ "github.com/stackanetes/kubernetes-entrypoint/dependencies/job"
_ "github.com/stackanetes/kubernetes-entrypoint/dependencies/pod"
_ "github.com/stackanetes/kubernetes-entrypoint/dependencies/service"
_ "github.com/stackanetes/kubernetes-entrypoint/dependencies/socket"
"github.com/stackanetes/kubernetes-entrypoint/logger"
command "github.com/stackanetes/kubernetes-entrypoint/util/command"
"github.com/stackanetes/kubernetes-entrypoint/util/env"
)
func main() {
var comm []string
var entrypoint *entry.Entrypoint
var err error
if entrypoint, err = entry.New(nil); err != nil {
logger.Error.Printf("Creating entrypoint failed: %v", err)
os.Exit(1)
}
entrypoint.Resolve()
if comm = env.SplitCommand(); len(comm) == 0 {
// TODO(DTadrzak): we should consider other options to handle whether pod
// is an init-container
logger.Warning.Printf("COMMAND env is empty")
os.Exit(0)
}
if err = command.Execute(comm); err != nil {
logger.Error.Printf("Cannot execute command: %v", err)
os.Exit(1)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhen00fa/kubernetes-entrypoint.git
[email protected]:zhen00fa/kubernetes-entrypoint.git
zhen00fa
kubernetes-entrypoint
kubernetes-entrypoint
master

搜索帮助