Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 0db8aa1

Browse files
committed
Re-order flag print output and use apimachinery error aggregate
Signed-off-by: JoshVanL <[email protected]>
1 parent 92f809e commit 0db8aa1

File tree

3 files changed

+5
-31
lines changed

3 files changed

+5
-31
lines changed

cmd/app/options/app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package options
33

44
import (
55
"github.com/spf13/pflag"
6+
cliflag "k8s.io/component-base/cli/flag"
67

78
"github.com/jetstack/kube-oidc-proxy/pkg/util/flags"
8-
cliflag "k8s.io/component-base/cli/flag"
99
)
1010

1111
type KubeOIDCProxyOptions struct {

cmd/app/options/options.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@ import (
66
"fmt"
77

88
"github.com/spf13/cobra"
9+
k8sErrors "k8s.io/apimachinery/pkg/util/errors"
910
"k8s.io/apiserver/pkg/util/term"
1011
cliflag "k8s.io/component-base/cli/flag"
11-
12-
"github.com/jetstack/kube-oidc-proxy/pkg/util"
1312
)
1413

1514
const (
1615
AppName = "kube-oidc-proxy"
1716
)
1817

1918
type Options struct {
19+
App *KubeOIDCProxyOptions
2020
OIDCAuthentication *OIDCAuthenticationOptions
2121
SecureServing *SecureServingOptions
2222
Client *ClientOptions
23-
App *KubeOIDCProxyOptions
2423
Misc *MiscOptions
2524

2625
nfs *cliflag.NamedFlagSets
@@ -31,10 +30,10 @@ func New() *Options {
3130

3231
// Add flags to command sets
3332
return &Options{
33+
App: NewKubeOIDCProxyOptions(nfs),
3434
OIDCAuthentication: NewOIDCAuthenticationOptions(nfs),
3535
SecureServing: NewSecureServingOptions(nfs),
3636
Client: NewClientOptions(nfs),
37-
App: NewKubeOIDCProxyOptions(nfs),
3837
Misc: NewMiscOptions(nfs),
3938

4039
nfs: nfs,
@@ -82,7 +81,7 @@ func (o *Options) Validate(cmd *cobra.Command) error {
8281
}
8382

8483
if len(errs) > 0 {
85-
return util.JoinErrors(errs)
84+
return k8sErrors.NewAggregate(errs)
8685
}
8786

8887
return nil

pkg/util/errors.go

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)