Log Errors Missing in Internal
Adds a few missing errors and fix formatting for others. Fixes #3013
This commit is contained in:
parent
edc6e93c19
commit
10de8cac56
5 changed files with 8 additions and 5 deletions
|
@ -19,6 +19,7 @@ package file
|
||||||
import (
|
import (
|
||||||
"crypto/sha1"
|
"crypto/sha1"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"github.com/golang/glog"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -27,6 +28,7 @@ func SHA1(filename string) string {
|
||||||
hasher := sha1.New()
|
hasher := sha1.New()
|
||||||
s, err := ioutil.ReadFile(filename)
|
s, err := ioutil.ReadFile(filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
glog.Errorf("Error reading file %v", err)
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -773,7 +773,7 @@ func (n *NGINXController) getServiceClusterEndpoint(svcKey string, backend *exte
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if port == -1 {
|
if port == -1 {
|
||||||
return endpoint, fmt.Errorf("Service %q does not have a port named %q", svc.Name, backend.ServicePort)
|
return endpoint, fmt.Errorf("service %q does not have a port named %q", svc.Name, backend.ServicePort)
|
||||||
}
|
}
|
||||||
endpoint.Port = fmt.Sprintf("%d", port)
|
endpoint.Port = fmt.Sprintf("%d", port)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -395,7 +395,7 @@ func (n NGINXController) DefaultEndpoint() ingress.Endpoint {
|
||||||
// running the command "nginx -t" using a temporal file.
|
// running the command "nginx -t" using a temporal file.
|
||||||
func (n NGINXController) testTemplate(cfg []byte) error {
|
func (n NGINXController) testTemplate(cfg []byte) error {
|
||||||
if len(cfg) == 0 {
|
if len(cfg) == 0 {
|
||||||
return fmt.Errorf("Invalid NGINX configuration (empty)")
|
return fmt.Errorf("invalid NGINX configuration (empty)")
|
||||||
}
|
}
|
||||||
tmpfile, err := ioutil.TempFile("", "nginx-cfg")
|
tmpfile, err := ioutil.TempFile("", "nginx-cfg")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -848,7 +848,7 @@ func post(url string, data interface{}) error {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if resp.StatusCode != http.StatusCreated {
|
if resp.StatusCode != http.StatusCreated {
|
||||||
return fmt.Errorf("Unexpected error code: %d", resp.StatusCode)
|
return fmt.Errorf("unexpected error code: %d", resp.StatusCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -134,7 +134,7 @@ func (s k8sStore) getPemCertificate(secretName string) (*ingress.SSLCert, error)
|
||||||
return nil, ErrSecretForAuth
|
return nil, ErrSecretForAuth
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, fmt.Errorf("Secret %q contains no keypair or CA certificate", secretName)
|
return nil, fmt.Errorf("secret %q contains no keypair or CA certificate", secretName)
|
||||||
}
|
}
|
||||||
|
|
||||||
sslCert.Name = secret.Name
|
sslCert.Name = secret.Name
|
||||||
|
@ -209,7 +209,7 @@ func (s *k8sStore) sendDummyEvent() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrSecretForAuth error to indicate a secret is used for authentication
|
// ErrSecretForAuth error to indicate a secret is used for authentication
|
||||||
var ErrSecretForAuth = fmt.Errorf("Secret is used for authentication")
|
var ErrSecretForAuth = fmt.Errorf("secret is used for authentication")
|
||||||
|
|
||||||
func isErrSecretForAuth(e error) bool {
|
func isErrSecretForAuth(e error) bool {
|
||||||
return e == ErrSecretForAuth
|
return e == ErrSecretForAuth
|
||||||
|
|
|
@ -42,6 +42,7 @@ func ParseNameNS(input string) (string, string, error) {
|
||||||
func GetNodeIPOrName(kubeClient clientset.Interface, name string, useInternalIP bool) string {
|
func GetNodeIPOrName(kubeClient clientset.Interface, name string, useInternalIP bool) string {
|
||||||
node, err := kubeClient.CoreV1().Nodes().Get(name, metav1.GetOptions{})
|
node, err := kubeClient.CoreV1().Nodes().Get(name, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
glog.Errorf("Error getting node %v: %v", name, err)
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue