Remove deprecated libraries, update other libs, add ci v1.23 (#8118)
This commit is contained in:
parent
c917ffacd2
commit
38c73233f3
19 changed files with 97 additions and 311 deletions
|
|
@ -24,7 +24,6 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/ncabatoff/process-exporter/proc"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"k8s.io/ingress-nginx/internal/nginx"
|
||||
)
|
||||
|
|
@ -43,27 +42,27 @@ func (n *NGINXController) Check(_ *http.Request) error {
|
|||
// check the nginx master process is running
|
||||
fs, err := proc.NewFS("/proc", false)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "reading /proc directory")
|
||||
return fmt.Errorf("reading /proc directory: %w", err)
|
||||
}
|
||||
|
||||
f, err := os.ReadFile(nginx.PID)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "reading %v", nginx.PID)
|
||||
return fmt.Errorf("reading %v: %w", nginx.PID, err)
|
||||
}
|
||||
|
||||
pid, err := strconv.Atoi(strings.TrimRight(string(f), "\r\n"))
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "reading NGINX PID from file %v", nginx.PID)
|
||||
return fmt.Errorf("reading NGINX PID from file %v: %w", nginx.PID, err)
|
||||
}
|
||||
|
||||
_, err = fs.Proc(pid)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "checking for NGINX process with PID %v", pid)
|
||||
return fmt.Errorf("checking for NGINX process with PID %v: %w", pid, err)
|
||||
}
|
||||
|
||||
statusCode, _, err := nginx.NewGetStatusRequest("/is-dynamic-lb-initialized")
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "checking if the dynamic load balancer started")
|
||||
return fmt.Errorf("checking if the dynamic load balancer started: %w", err)
|
||||
}
|
||||
|
||||
if statusCode != 200 {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import (
|
|||
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
apiv1 "k8s.io/api/core/v1"
|
||||
networking "k8s.io/api/networking/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
|
@ -180,7 +179,7 @@ func (s *k8sStore) getPemCertificate(secretName string) (*ingress.SSLCert, error
|
|||
if secretName == s.defaultSSLCertificate {
|
||||
path, err := ssl.StoreSSLCertOnDisk(nsSecName, sslCert)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "storing default SSL Certificate")
|
||||
return nil, fmt.Errorf("storing default SSL Certificate: %w", err)
|
||||
}
|
||||
|
||||
sslCert.PemFileName = path
|
||||
|
|
|
|||
|
|
@ -36,8 +36,6 @@ import (
|
|||
text_template "text/template"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
networkingv1 "k8s.io/api/networking/v1"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/klog/v2"
|
||||
|
|
@ -81,7 +79,7 @@ type Template struct {
|
|||
func NewTemplate(file string) (*Template, error) {
|
||||
data, err := os.ReadFile(file)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "unexpected error reading template %v", file)
|
||||
return nil, fmt.Errorf("unexpected error reading template %s: %w", file, err)
|
||||
}
|
||||
|
||||
tmpl, err := text_template.New("nginx.tmpl").Funcs(funcMap).Parse(string(data))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue