Skip to content

Commit

Permalink
get latest
Browse files Browse the repository at this point in the history
  • Loading branch information
skonto committed Feb 15, 2023
1 parent 9eadbea commit cc42e6b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
14 changes: 10 additions & 4 deletions cmd/default-domain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"flag"
"fmt"
"net"
"net/http"
"os"
"strings"
"time"
Expand All @@ -39,7 +40,7 @@ import (
netv1alpha1 "knative.dev/networking/pkg/apis/networking/v1alpha1"
netclient "knative.dev/networking/pkg/client/clientset/versioned"
netcfg "knative.dev/networking/pkg/config"
"knative.dev/pkg/injection"
netprobe "knative.dev/networking/pkg/http/probe"
"knative.dev/pkg/logging"
"knative.dev/pkg/signals"
"knative.dev/pkg/system"
Expand Down Expand Up @@ -187,8 +188,13 @@ func main() {
return
}

// Setup default health probes
injection.ServeHealthProbes(ctx)
// Start an HTTP Server
h := netprobe.NewHandler(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
}))
//nolinlt:gosec https://github.com/knative/serving/issues/13439
server := http.Server{Addr: ":8080", Handler: h, ReadHeaderTimeout: time.Minute}
go server.ListenAndServe()

// Determine the address of the gateway service.
address, err := findGatewayAddress(ctx, kubeClient, client)
Expand Down Expand Up @@ -220,5 +226,5 @@ func main() {
}

logger.Info("Updated default domain to: ", domain)
<-ctx.Done()
server.Shutdown(context.Background())
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
)

replace knative.dev/pkg => github.com/skonto/pkg v0.0.0-20230209121325-a145416fffb7
replace knative.dev/pkg => github.com/skonto/pkg v0.0.0-20230215113428-d296136e0174
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -893,8 +893,8 @@ github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sivchari/tenv v1.4.7/go.mod h1:5nF+bITvkebQVanjU6IuMbvIot/7ReNsUV7I5NbprB0=
github.com/skonto/pkg v0.0.0-20230209121325-a145416fffb7 h1:4VlNb1dnSkcgqyzcUPAWvWXvBCVbpmqrp1PoGzJg0MU=
github.com/skonto/pkg v0.0.0-20230209121325-a145416fffb7/go.mod h1:VO/fcEsq43seuONRQxZyftWHjpMabYzRHDtpSEQ/eoQ=
github.com/skonto/pkg v0.0.0-20230215113428-d296136e0174 h1:Txp0ufRLr7/VbV2KIx9NaTau6foHEppbJb9va07Of8g=
github.com/skonto/pkg v0.0.0-20230215113428-d296136e0174/go.mod h1:VO/fcEsq43seuONRQxZyftWHjpMabYzRHDtpSEQ/eoQ=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
Expand Down
4 changes: 3 additions & 1 deletion vendor/knative.dev/pkg/injection/sharedmain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,9 @@ func MainWithConfig(ctx context.Context, component string, cfg *rest.Config, cto

// Setup default health checks to catch issues with cache sync etc.
if !healthProbesDisabled(ctx) {
injection.ServeHealthProbes(ctx)
eg.Go(func() error {
return injection.ServeHealthProbes(ctx, injection.HealthCheckDefaultPort)
})
}

// This will block until either a signal arrives or one of the grouped functions
Expand Down
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ knative.dev/networking/pkg/http/stats
knative.dev/networking/pkg/ingress
knative.dev/networking/pkg/k8s
knative.dev/networking/pkg/prober
# knative.dev/pkg v0.0.0-20230207013346-decc1cc0acad => github.com/skonto/pkg v0.0.0-20230209121325-a145416fffb7
# knative.dev/pkg v0.0.0-20230207013346-decc1cc0acad => github.com/skonto/pkg v0.0.0-20230215113428-d296136e0174
## explicit; go 1.18
knative.dev/pkg/apiextensions/storageversion
knative.dev/pkg/apiextensions/storageversion/cmd/migrate
Expand Down Expand Up @@ -1415,4 +1415,4 @@ sigs.k8s.io/structured-merge-diff/v4/value
# sigs.k8s.io/yaml v1.3.0
## explicit; go 1.12
sigs.k8s.io/yaml
# knative.dev/pkg => github.com/skonto/pkg v0.0.0-20230209121325-a145416fffb7
# knative.dev/pkg => github.com/skonto/pkg v0.0.0-20230215113428-d296136e0174

0 comments on commit cc42e6b

Please sign in to comment.