diff --git a/examples/auth.json b/examples/auth.json new file mode 100644 index 0000000..a2e9214 --- /dev/null +++ b/examples/auth.json @@ -0,0 +1,20 @@ +{ + "quay.io": { + "username": "xxx", + "password": "xxxxxxxxx", + "insecure": true + }, + "registry.cn-beijing.aliyuncs.com": { + "username": "xxx", + "password": "xxxxxxxxx" + }, + "docker.io": { + "username": "xxx", + "password": "xxxxxxxxxx" + }, + "quay.io/coreos": { + "username": "abc", + "password": "xxxxxxxxx", + "insecure": true + } +} diff --git a/examples/auth.yaml b/examples/auth.yaml new file mode 100644 index 0000000..c56ee21 --- /dev/null +++ b/examples/auth.yaml @@ -0,0 +1,14 @@ +quay.io: + username: xxx + password: xxxxxxxxx + insecure: true +registry.cn-beijing.aliyuncs.com: + username: xxx + password: xxxxxxxxx +docker.io: + username: xxx + password: xxxxxxxxxx +quay.io/coreos: + username: abc + password: xxxxxxxxx + insecure: true diff --git a/examples/config.json b/examples/config.json new file mode 100644 index 0000000..b03c5db --- /dev/null +++ b/examples/config.json @@ -0,0 +1,29 @@ +{ + "auth": { + "quay.io": { + "username": "xxx", + "password": "xxxxxxxxx", + "insecure": true + }, + "registry.cn-beijing.aliyuncs.com": { + "username": "xxx", + "password": "xxxxxxxxx" + }, + "docker.io": { + "username": "xxx", + "password": "xxxxxxxxxx" + }, + "quay.io/coreos": { + "username": "abc", + "password": "xxxxxxxxx", + "insecure": true + } + }, + "images": { + "quay.io/coreos/kube-rbac-proxy": "quay.io/ruohe/kube-rbac-proxy", + + "quay.io/coreos/kube-rbac-proxy:v1.0": "quay.io/ruohe/kube-rbac-proxy", + + "quay.io/coreos/kube-rbac-proxy:v1.0,v2.0": "quay.io/ruohe/kube-rbac-proxy" + } +} diff --git a/examples/config.yaml b/examples/config.yaml new file mode 100644 index 0000000..7652715 --- /dev/null +++ b/examples/config.yaml @@ -0,0 +1,19 @@ +auth: + quay.io: + username: xxx + password: xxxxxxxxx + insecure: true + registry.cn-beijing.aliyuncs.com: + username: xxx + password: xxxxxxxxx + docker.io: + username: xxx + password: xxxxxxxxxx + quay.io/coreos: + username: abc + password: xxxxxxxxx + insecure: true +images: + quay.io/coreos/kube-rbac-proxy: quay.io/ruohe/kube-rbac-proxy + quay.io/coreos/kube-rbac-proxy:v1.0: quay.io/ruohe/kube-rbac-proxy + quay.io/coreos/kube-rbac-proxy:v1.0,v2.0: quay.io/ruohe/kube-rbac-proxy \ No newline at end of file diff --git a/examples/images.json b/examples/images.json new file mode 100644 index 0000000..95655f4 --- /dev/null +++ b/examples/images.json @@ -0,0 +1,6 @@ +{ + "quay.io/coreos/kube-rbac-proxy": "quay.io/ruohe/kube-rbac-proxy", + "quay.io/coreos/kube-rbac-proxy:v1.0": "quay.io/ruohe/kube-rbac-proxy", + "quay.io/coreos/kube-rbac-proxy:v1.0,v2.0": "quay.io/ruohe/kube-rbac-proxy", + "quay.io/coreos/kube-rbac-proxy:v1.1": ["quay.io/ruohe/kube-rbac-proxy1", "quay.io/ruohe/kube-rbac-proxy2"] +} diff --git a/examples/images.yaml b/examples/images.yaml new file mode 100644 index 0000000..dac5a66 --- /dev/null +++ b/examples/images.yaml @@ -0,0 +1,7 @@ +quay.io/coreos/kube-rbac-proxy: quay.io/ruohe/kube-rbac-proxy +quay.io/coreos/kube-rbac-proxy:v1.0: quay.io/ruohe/kube-rbac-proxy +quay.io/coreos/kube-rbac-proxy:v1.0,v2.0: quay.io/ruohe/kube-rbac-proxy +quay.io/coreos/kube-rbac-proxy@sha256:14b267eb38aa85fd12d0e168fffa2d8a6187ac53a14a0212b0d4fce8d729598c: quay.io/ruohe/kube-rbac-proxy +quay.io/coreos/kube-rbac-proxy:v1.1: + - quay.io/ruohe/kube-rbac-proxy1 + - quay.io/ruohe/kube-rbac-proxy2 \ No newline at end of file diff --git a/pkg/client/logger.go b/pkg/client/logger.go index cb4b4e0..b0e4259 100644 --- a/pkg/client/logger.go +++ b/pkg/client/logger.go @@ -14,10 +14,14 @@ const ( func NewFileLogger(path string) *logrus.Logger { logger := logrus.New() + // disable color + if len(path) != 0 { + _ = os.Setenv("NO_COLOR", "true") + } + logger.Formatter = &logrus.TextFormatter{ FullTimestamp: true, TimestampFormat: logTimestampFormat, - ForceColors: true, } if file, err := os.OpenFile(path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0666); err == nil {