golangci-lint update, ci cleanup, group dependabot updates (#11071)
* bump golangci-lint to v1.56.x Signed-off-by: cpanato <ctadeu@gmail.com> * cleanup empty lines Signed-off-by: cpanato <ctadeu@gmail.com> * group dependabot updates Signed-off-by: cpanato <ctadeu@gmail.com> * run on job changes as well Signed-off-by: cpanato <ctadeu@gmail.com> * remove deprecated checks Signed-off-by: cpanato <ctadeu@gmail.com> * fix lints and format Signed-off-by: cpanato <ctadeu@gmail.com> --------- Signed-off-by: cpanato <ctadeu@gmail.com>
This commit is contained in:
parent
0e11470ef3
commit
12fbe9b163
45 changed files with 96 additions and 100 deletions
|
|
@ -47,7 +47,7 @@ func main() {
|
|||
backendsAllCmd := &cobra.Command{
|
||||
Use: "all",
|
||||
Short: "Output the all dynamic backend information as a JSON array",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
Run: func(_ *cobra.Command, _ []string) {
|
||||
backendsAll()
|
||||
},
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ func main() {
|
|||
backendsListCmd := &cobra.Command{
|
||||
Use: "list",
|
||||
Short: "Output a newline-separated list of the backend names",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
Run: func(_ *cobra.Command, _ []string) {
|
||||
backendsList()
|
||||
},
|
||||
}
|
||||
|
|
@ -66,7 +66,7 @@ func main() {
|
|||
Use: "get [backend name]",
|
||||
Short: "Output the backend information only for the backend that has this name",
|
||||
Args: cobra.ExactArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
Run: func(_ *cobra.Command, args []string) {
|
||||
backendsGet(args[0])
|
||||
},
|
||||
}
|
||||
|
|
@ -81,7 +81,7 @@ func main() {
|
|||
Use: "get [hostname]",
|
||||
Short: "Get the dynamically-loaded certificate information for the given hostname",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, args []string) error {
|
||||
certGet(args[0])
|
||||
return nil
|
||||
},
|
||||
|
|
@ -93,7 +93,7 @@ func main() {
|
|||
generalCmd := &cobra.Command{
|
||||
Use: "general",
|
||||
Short: "Output the general dynamic lua state",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
Run: func(_ *cobra.Command, _ []string) {
|
||||
general()
|
||||
},
|
||||
}
|
||||
|
|
@ -102,7 +102,7 @@ func main() {
|
|||
confCmd := &cobra.Command{
|
||||
Use: "conf",
|
||||
Short: "Dump the contents of /etc/nginx/nginx.conf",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
Run: func(_ *cobra.Command, _ []string) {
|
||||
readNginxConf()
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ func main() {
|
|||
handleFatalInitError(err)
|
||||
}
|
||||
|
||||
if len(conf.DefaultService) > 0 {
|
||||
if conf.DefaultService != "" {
|
||||
err := checkService(conf.DefaultService, kubeClient)
|
||||
if err != nil {
|
||||
klog.Fatal(err)
|
||||
|
|
@ -83,7 +83,7 @@ func main() {
|
|||
klog.InfoS("Valid default backend", "service", conf.DefaultService)
|
||||
}
|
||||
|
||||
if len(conf.PublishService) > 0 {
|
||||
if conf.PublishService != "" {
|
||||
err := checkService(conf.PublishService, kubeClient)
|
||||
if err != nil {
|
||||
klog.Fatal(err)
|
||||
|
|
@ -235,7 +235,6 @@ func createApiserverClient(apiserverHost, rootCAFile, kubeConfig string) (*kuber
|
|||
retries++
|
||||
return false, nil
|
||||
})
|
||||
|
||||
// err is returned in case of timeout in the exponential backoff (ErrWaitTimeout)
|
||||
if err != nil {
|
||||
return nil, lastErr
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ func CreateCommand(flags *genericclioptions.ConfigFlags) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "backends",
|
||||
Short: "Inspect the dynamic backend information of an ingress-nginx instance",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
backend, err := cmd.Flags().GetString("backend")
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ func CreateCommand(flags *genericclioptions.ConfigFlags) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "certs",
|
||||
Short: "Output the certificate data stored in an ingress-nginx pod",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
host, err := cmd.Flags().GetString("host")
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ func CreateCommand(flags *genericclioptions.ConfigFlags) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "conf",
|
||||
Short: "Inspect the generated nginx.conf",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
host, err := cmd.Flags().GetString("host")
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ func CreateCommand(flags *genericclioptions.ConfigFlags) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "exec",
|
||||
Short: "Execute a command inside an ingress-nginx pod",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, args []string) error {
|
||||
util.PrintError(exec(flags, *pod, *deployment, *selector, *container, args, opts))
|
||||
return nil
|
||||
},
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ func CreateCommand(flags *genericclioptions.ConfigFlags) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "general",
|
||||
Short: "Inspect the other dynamic ingress-nginx information",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
util.PrintError(general(flags, *pod, *deployment, *selector, *container))
|
||||
return nil
|
||||
},
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ func CreateCommand(flags *genericclioptions.ConfigFlags) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "info",
|
||||
Short: "Show information about the ingress-nginx service",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
service, err := cmd.Flags().GetString("service")
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ func CreateCommand(flags *genericclioptions.ConfigFlags) *cobra.Command {
|
|||
Use: "ingresses",
|
||||
Aliases: []string{"ingress", "ing"},
|
||||
Short: "Provide a short summary of all of the ingress definitions",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(cmd *cobra.Command, _ []string) error {
|
||||
host, err := cmd.Flags().GetString("host")
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -139,14 +139,14 @@ func getIngressRows(ingresses *[]networking.Ingress) []ingressRow {
|
|||
ing := &(*ingresses)[i]
|
||||
address := ""
|
||||
for _, lbIng := range ing.Status.LoadBalancer.Ingress {
|
||||
if len(lbIng.IP) > 0 {
|
||||
if lbIng.IP != "" {
|
||||
address = address + lbIng.IP + ","
|
||||
}
|
||||
if len(lbIng.Hostname) > 0 {
|
||||
if lbIng.Hostname != "" {
|
||||
address = address + lbIng.Hostname + ","
|
||||
}
|
||||
}
|
||||
if len(address) > 0 {
|
||||
if address != "" {
|
||||
address = address[:len(address)-1]
|
||||
}
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ func getIngressRows(ingresses *[]networking.Ingress) []ingressRow {
|
|||
}
|
||||
|
||||
// Handle catch-all ingress
|
||||
if len(ing.Spec.Rules) == 0 && len(defaultBackendService) > 0 {
|
||||
if len(ing.Spec.Rules) == 0 && defaultBackendService != "" {
|
||||
row := ingressRow{
|
||||
Namespace: ing.Namespace,
|
||||
IngressName: ing.Name,
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ func CreateCommand(flags *genericclioptions.ConfigFlags) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "lint",
|
||||
Short: "Inspect kubernetes resources for possible issues",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
err := opts.Validate()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -73,7 +73,7 @@ func createSubcommand(flags *genericclioptions.ConfigFlags, names []string, shor
|
|||
Use: names[0],
|
||||
Aliases: names[1:],
|
||||
Short: short,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
err := opts.Validate()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ func CreateCommand(flags *genericclioptions.ConfigFlags) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "logs",
|
||||
Short: "Get the kubernetes logs for an ingress-nginx pod",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
util.PrintError(logs(flags, *pod, *deployment, *selector, *container, o))
|
||||
return nil
|
||||
},
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ func CreateCommand(flags *genericclioptions.ConfigFlags) *cobra.Command {
|
|||
cmd := &cobra.Command{
|
||||
Use: "ssh",
|
||||
Short: "ssh into a running ingress-nginx pod",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
util.PrintError(ssh(flags, *pod, *deployment, *selector, *container))
|
||||
return nil
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue