Skip to content

Commit 8b6b270

Browse files
committed
vcs-test: clean up dead code
Now that I've turned down the VM-based vcs-test server we don't need some code. Also disable autocert on the GKE version, which I think in retrospect I never needed. For golang/go#53889. Change-Id: I005bc61228c04a37765895decd485b10167b994e Reviewed-on: https://go-review.googlesource.com/c/build/+/423342 Run-TryBot: Heschi Kreinick <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 97ac8cd commit 8b6b270

File tree

5 files changed

+8
-45
lines changed

5 files changed

+8
-45
lines changed

go.mod

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ require (
1515
github.com/NYTimes/gziphandler v1.1.1
1616
github.com/aws/aws-sdk-go v1.30.15
1717
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625
18-
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f
1918
github.com/creack/pty v1.1.15
2019
github.com/davecgh/go-spew v1.1.1
2120
github.com/dghubble/oauth1 v0.7.0
@@ -52,7 +51,6 @@ require (
5251
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
5352
golang.org/x/sys v0.0.0-20220209214540-3681064d5158
5453
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467
55-
golang.org/x/text v0.3.7
5654
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
5755
google.golang.org/api v0.70.0
5856
google.golang.org/appengine v1.6.7
@@ -108,6 +106,7 @@ require (
108106
github.com/shurcooL/graphql v0.0.0-20220520033453-bdb1221e171e // indirect
109107
github.com/sirupsen/logrus v1.8.1 // indirect
110108
go.uber.org/atomic v1.6.0 // indirect
109+
golang.org/x/text v0.3.7 // indirect
111110
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
112111
gonum.org/v1/plot v0.10.0 // indirect
113112
gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect

go.sum

-6
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QH
178178
github.com/cenkalti/backoff/v4 v4.0.2/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg=
179179
github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=
180180
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
181-
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
182181
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
183182
github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
184183
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@@ -206,7 +205,6 @@ github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMX
206205
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
207206
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
208207
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
209-
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c=
210208
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
211209
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
212210
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
@@ -434,7 +432,6 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
434432
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
435433
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
436434
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
437-
github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e h1:CYRpN206UTHUinz3VJoLaBdy1gEGeJNsqT0mvswDcMw=
438435
github.com/googleapis/gax-go v0.0.0-20161107002406-da06d194a00e/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
439436
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
440437
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
@@ -494,7 +491,6 @@ github.com/influxdata/influxdb-client-go/v2 v2.8.0/go.mod h1:x7Jo5UHHl+w8wu8UnGi
494491
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
495492
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU=
496493
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo=
497-
github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0=
498494
github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo=
499495
github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk=
500496
github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=
@@ -521,7 +517,6 @@ github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5W
521517
github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak=
522518
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
523519
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
524-
github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A=
525520
github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78=
526521
github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA=
527522
github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg=
@@ -999,7 +994,6 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd
999994
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
1000995
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
1001996
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
1002-
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
1003997
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk=
1004998
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
1005999
golang.org/x/oauth2 v0.0.0-20170207211851-4464e7848382/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=

internal/https/https.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func ListenAndServeOpts(ctx context.Context, handler http.Handler, opts *Options
7070
if opts.AutocertBucket == "" {
7171
return fmt.Errorf("must specify autocert-bucket with listen-https-autocert")
7272
}
73-
server, err := AutocertServer(ctx, opts.AutocertBucket, opts.AutocertAddr, handler)
73+
server, err := autocertServer(ctx, opts.AutocertBucket, opts.AutocertAddr, handler)
7474
if err != nil {
7575
return err
7676
}
@@ -79,7 +79,7 @@ func ListenAndServeOpts(ctx context.Context, handler http.Handler, opts *Options
7979
}
8080

8181
if opts.SelfSignedAddr != "" {
82-
server, err := SelfSignedServer(opts.SelfSignedAddr, handler)
82+
server, err := selfSignedServer(opts.SelfSignedAddr, handler)
8383
if err != nil {
8484
return err
8585
}
@@ -90,10 +90,10 @@ func ListenAndServeOpts(ctx context.Context, handler http.Handler, opts *Options
9090
return <-errc
9191
}
9292

93-
// AutocertServer returns an http.Server that is configured to serve
93+
// autocertServer returns an http.Server that is configured to serve
9494
// HTTPS on addr using a Let's Encrypt certificate cached in the GCS
9595
// bucket specified by bucket.
96-
func AutocertServer(ctx context.Context, bucket, addr string, handler http.Handler) (*http.Server, error) {
96+
func autocertServer(ctx context.Context, bucket, addr string, handler http.Handler) (*http.Server, error) {
9797
sc, err := storage.NewClient(ctx)
9898
if err != nil {
9999
return nil, fmt.Errorf("storage.NewClient: %v", err)
@@ -118,9 +118,9 @@ func AutocertServer(ctx context.Context, bucket, addr string, handler http.Handl
118118
return server, nil
119119
}
120120

121-
// SelfSignedServer returns an http.Server that is configured to serve
121+
// selfSignedServer returns an http.Server that is configured to serve
122122
// self-signed HTTPS on addr.
123-
func SelfSignedServer(addr string, handler http.Handler) (*http.Server, error) {
123+
func selfSignedServer(addr string, handler http.Handler) (*http.Server, error) {
124124
priv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
125125
if err != nil {
126126
return nil, err

vcs-test/deployment.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ spec:
3030
- name: vcs-test
3131
image: gcr.io/symbolic-datum-552/vcs-test:latest
3232
imagePullPolicy: Always
33-
command: ["/usr/bin/tini", "--", "/vcweb", "-d=/home/vcweb", "-listen-https-autocert=:443", "-autocert-bucket=vcs-test-autocert", "-listen-https-selfsigned=:444"]
33+
command: ["/usr/bin/tini", "--", "/vcweb", "-d=/home/vcweb", "-listen-https-selfsigned=:444"]
3434
volumeMounts:
3535
- mountPath: /home/vcweb
3636
name: vcs-test-cache
@@ -91,7 +91,6 @@ metadata:
9191
annotations:
9292
kubernetes.io/ingress.global-static-ip-name: vcs-test-global
9393
networking.gke.io/managed-certificates: vcs-test-cert
94-
ingress.gcp.kubernetes.io/pre-shared-cert: vcs-test-manual
9594
kubernetes.io/ingress.class: "gce"
9695
spec:
9796
rules:

vcs-test/vcweb/main.go

-29
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import (
2121
"text/tabwriter"
2222
"time"
2323

24-
"github.com/coreos/go-systemd/activation"
25-
"github.com/coreos/go-systemd/daemon"
2624
"golang.org/x/build/internal/https"
2725
)
2826

@@ -70,33 +68,6 @@ func main() {
7068
http.Handle("/auth/", newAuthHandler(http.Dir(filepath.Join(*dir, "auth"))))
7169

7270
handler := logger(http.HandlerFunc(loadAndHandle))
73-
74-
// If running under systemd, listen on 80 and 443 and serve TLS.
75-
if listeners, _ := activation.ListenersWithNames(); len(listeners) == 2 {
76-
httpListener := listeners["vcweb-http.socket"][0]
77-
httpsListener := listeners["vcweb-https.socket"][0]
78-
79-
dt, err := daemon.SdWatchdogEnabled(true)
80-
if err != nil {
81-
log.Fatal(err)
82-
}
83-
84-
daemon.SdNotify(false, "READY=1")
85-
go func() {
86-
for range time.NewTicker(dt / 2).C {
87-
daemon.SdNotify(false, "WATCHDOG=1")
88-
}
89-
}()
90-
91-
go func() {
92-
log.Fatal(http.Serve(httpListener, handler))
93-
}()
94-
s, err := https.AutocertServer(ctx, "vcs-test-autocert", "", handler)
95-
if err != nil {
96-
log.Fatal(err)
97-
}
98-
log.Fatal(s.ServeTLS(httpsListener, "", ""))
99-
}
10071
log.Fatal(https.ListenAndServe(ctx, handler))
10172
}
10273

0 commit comments

Comments
 (0)