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

Commit cbe4643

Browse files
authored
Merge pull request #87 from JoshVanL/utils-to-util
Renames package utils -> util
2 parents 7b2c360 + 74750f8 commit cbe4643

File tree

10 files changed

+19
-19
lines changed

10 files changed

+19
-19
lines changed

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import (
66
"os"
77

88
"github.com/jetstack/kube-oidc-proxy/cmd"
9-
"github.com/jetstack/kube-oidc-proxy/pkg/utils"
9+
"github.com/jetstack/kube-oidc-proxy/pkg/util"
1010
)
1111

1212
func main() {
13-
stopCh := utils.SignalHandler()
13+
stopCh := util.SignalHandler()
1414
cmd := cmd.NewRunCommand(stopCh)
1515

1616
if err := cmd.Execute(); err != nil {

pkg/e2e/e2e.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
2727

2828
"github.com/jetstack/kube-oidc-proxy/pkg/e2e/issuer"
29-
"github.com/jetstack/kube-oidc-proxy/pkg/utils"
29+
"github.com/jetstack/kube-oidc-proxy/pkg/util"
3030
)
3131

3232
type E2E struct {
@@ -141,7 +141,7 @@ func (e *E2E) newIssuerProxyPair() (*http.Transport, error) {
141141
}
142142
e.issuer = issuer
143143

144-
proxyCertPath, proxyKeyPath, _, proxyCert, err := utils.NewTLSSelfSignedCertKey(pairTmpDir, "")
144+
proxyCertPath, proxyKeyPath, _, proxyCert, err := util.NewTLSSelfSignedCertKey(pairTmpDir, "")
145145
if err != nil {
146146
return nil, fmt.Errorf("failed to create key pair: %s", err)
147147
}
@@ -167,7 +167,7 @@ func (e *E2E) newIssuerProxyPair() (*http.Transport, error) {
167167
},
168168
}
169169

170-
proxyPort, err := utils.FreePort()
170+
proxyPort, err := util.FreePort()
171171
if err != nil {
172172
return nil, err
173173
}

pkg/e2e/e2e_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"sigs.k8s.io/kind/pkg/cluster"
2020
"sigs.k8s.io/kind/pkg/cluster/config"
2121

22-
"github.com/jetstack/kube-oidc-proxy/pkg/utils"
22+
"github.com/jetstack/kube-oidc-proxy/pkg/util"
2323
)
2424

2525
const (
@@ -186,7 +186,7 @@ func waitOnCoreDNS(kubeclient *kubernetes.Clientset) error {
186186
}
187187

188188
for _, pod := range pods.Items {
189-
err := utils.WaitForPodReady(kubeclient, pod.Name, pod.Namespace)
189+
err := util.WaitForPodReady(kubeclient, pod.Name, pod.Namespace)
190190
if err != nil {
191191
return fmt.Errorf("failed to wait for dns pods to become ready: %s", err)
192192
}

pkg/e2e/issuer/issuer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"net/http"
99
"time"
1010

11-
"github.com/jetstack/kube-oidc-proxy/pkg/utils"
11+
"github.com/jetstack/kube-oidc-proxy/pkg/util"
1212
"k8s.io/klog"
1313
)
1414

@@ -27,13 +27,13 @@ func New(tlsDir string) *Issuer {
2727
}
2828

2929
func (i *Issuer) Run() error {
30-
listenPort, err := utils.FreePort()
30+
listenPort, err := util.FreePort()
3131
if err != nil {
3232
return err
3333
}
3434
i.listenPort = listenPort
3535

36-
certPath, keyPath, sk, _, err := utils.NewTLSSelfSignedCertKey(i.tlsDir, "oidc-issuer")
36+
certPath, keyPath, sk, _, err := util.NewTLSSelfSignedCertKey(i.tlsDir, "oidc-issuer")
3737
if err != nil {
3838
return fmt.Errorf("failed to create issuer key pair: %s", err)
3939
}

pkg/e2e/upgrade_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"k8s.io/client-go/tools/remotecommand"
2222
"k8s.io/client-go/transport/spdy"
2323

24-
"github.com/jetstack/kube-oidc-proxy/pkg/utils"
24+
"github.com/jetstack/kube-oidc-proxy/pkg/util"
2525
)
2626

2727
const (
@@ -119,7 +119,7 @@ func Test_Upgrade(t *testing.T) {
119119
}
120120

121121
// wait for our echo server to become ready
122-
err = utils.WaitForPodReady(e2eSuite.kubeclient,
122+
err = util.WaitForPodReady(e2eSuite.kubeclient,
123123
"echoserver", namespaceUpgradeTest)
124124
if err != nil {
125125
t.Fatal(err)
@@ -182,7 +182,7 @@ func Test_Upgrade(t *testing.T) {
182182
portOut := &bytes.Buffer{}
183183
portErr := &bytes.Buffer{}
184184

185-
freePort, err := utils.FreePort()
185+
freePort, err := util.FreePort()
186186
if err != nil {
187187
t.Fatal(err)
188188
}

pkg/probe/probe_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import (
77
"testing"
88
"time"
99

10-
"github.com/jetstack/kube-oidc-proxy/pkg/utils"
10+
"github.com/jetstack/kube-oidc-proxy/pkg/util"
1111
)
1212

1313
func Test_Check(t *testing.T) {
14-
port, err := utils.FreePort()
14+
port, err := util.FreePort()
1515
if err != nil {
1616
t.Fatalf("unexpected error: %s", err)
1717
}

pkg/utils/cert.go renamed to pkg/util/cert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright Jetstack Ltd. See LICENSE for details.
2-
package utils
2+
package util
33

44
import (
55
"crypto/rsa"

pkg/utils/pods.go renamed to pkg/util/pods.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright Jetstack Ltd. See LICENSE for details.
2-
package utils
2+
package util
33

44
import (
55
"fmt"

pkg/utils/port.go renamed to pkg/util/port.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright Jetstack Ltd. See LICENSE for details.
2-
package utils
2+
package util
33

44
import (
55
"net"

pkg/utils/signals.go renamed to pkg/util/signals.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright Jetstack Ltd. See LICENSE for details.
2-
package utils
2+
package util
33

44
import (
55
"os"

0 commit comments

Comments
 (0)