MCPcopy
hub / github.com/ContainerSSH/ContainerSSH / Validate

Method Validate

config/kubernetes.go:81–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79}
80
81func (c KubernetesConnectionConfig) Validate() error {
82 if c.Host == "" {
83 return newError("host", "no host specified")
84 }
85 if c.APIPath == "" {
86 return newError("path", "no API path specified")
87 }
88 if c.BearerTokenFile != "" {
89 if _, err := os.Stat(c.BearerTokenFile); err != nil {
90 return wrapWithMessage(err, "bearerTokenFile", "bearer token file %s not found", c.BearerTokenFile)
91 }
92 }
93 return nil
94}
95
96// KubernetesPodConfig describes the pod to launch.
97//

Callers

nothing calls this directly

Calls 2

newErrorFunction · 0.85
wrapWithMessageFunction · 0.85

Tested by

no test coverage detected