Skip to content

Commit

Permalink
used a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
h4ck3rk3y committed Feb 26, 2024
1 parent 4e13074 commit bdcbecb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const (
HttpApplicationProtocol = "http"

GitHubAuthStorageDirPath = "/kurtosis-data/github-auth/"

EmptyApplicationURL = ""
)

// This maps a Docker container's status to a binary "is the container considered running?" determiner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const (
timeBetweenWaitForApiContainerAvailabilityRetries = 1 * time.Second

apicDebugServerPort = 50103 // in ClI this is 50101 and in engine is 50102
emptyUrl = ""
)

// TODO: MIGRATE THIS FOLDER TO USE STRUCTURE OF USER_SERVICE_FUNCTIONS MODULE
Expand Down Expand Up @@ -130,7 +129,7 @@ func (backend *DockerKurtosisBackend) CreateAPIContainer(
return nil, stacktrace.Propagate(err, "An error occurred creating a new wait with default values")
}

privateGrpcPortSpec, err := port_spec.NewPortSpec(grpcPortNum, apiContainerTransportProtocol, consts.HttpApplicationProtocol, defaultWait, emptyUrl)
privateGrpcPortSpec, err := port_spec.NewPortSpec(grpcPortNum, apiContainerTransportProtocol, consts.HttpApplicationProtocol, defaultWait, consts.EmptyApplicationURL)
if err != nil {
return nil, stacktrace.Propagate(
err,
Expand Down Expand Up @@ -164,7 +163,7 @@ func (backend *DockerKurtosisBackend) CreateAPIContainer(
}

if shouldStartInDebugMode {
debugServerPortSpec, err := port_spec.NewPortSpec(uint16(apicDebugServerPort), apiContainerTransportProtocol, consts.HttpApplicationProtocol, defaultWait, emptyUrl)
debugServerPortSpec, err := port_spec.NewPortSpec(uint16(apicDebugServerPort), apiContainerTransportProtocol, consts.HttpApplicationProtocol, defaultWait, consts.EmptyApplicationURL)
if err != nil {
return nil, stacktrace.Propagate(
err,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const (
maxWaitForEngineAvailabilityRetries = 10
timeBetweenWaitForEngineAvailabilityRetries = 1 * time.Second
logsStorageDirPath = "/var/log/kurtosis/"
emptyUrl = ""
)

func CreateEngine(
Expand Down Expand Up @@ -65,7 +64,7 @@ func CreateEngine(
return nil, stacktrace.Propagate(err, "An error occurred creating a wait with default values")
}

privateGrpcPortSpec, err := port_spec.NewPortSpec(grpcPortNum, consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait, emptyUrl)
privateGrpcPortSpec, err := port_spec.NewPortSpec(grpcPortNum, consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait, consts.EmptyApplicationURL)
if err != nil {
return nil, stacktrace.Propagate(
err,
Expand Down Expand Up @@ -138,7 +137,7 @@ func CreateEngine(
}
logrus.Infof("Reverse proxy started.")

enclaveManagerUIPortSpec, err := port_spec.NewPortSpec(uint16(enclaveManagerUIPort), consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait, emptyUrl)
enclaveManagerUIPortSpec, err := port_spec.NewPortSpec(uint16(enclaveManagerUIPort), consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait, consts.EmptyApplicationURL)
if err != nil {
return nil, stacktrace.Propagate(
err,
Expand All @@ -148,7 +147,7 @@ func CreateEngine(
)
}

enclaveManagerApiPortSpec, err := port_spec.NewPortSpec(uint16(enclaveManagerAPIPort), consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait, emptyUrl)
enclaveManagerApiPortSpec, err := port_spec.NewPortSpec(uint16(enclaveManagerAPIPort), consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait, consts.EmptyApplicationURL)
if err != nil {
return nil, stacktrace.Propagate(
err,
Expand All @@ -158,7 +157,7 @@ func CreateEngine(
)
}

restAPIPortSpec, err := port_spec.NewPortSpec(engine.RESTAPIPortAddr, consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait, emptyUrl)
restAPIPortSpec, err := port_spec.NewPortSpec(engine.RESTAPIPortAddr, consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait, consts.EmptyApplicationURL)
if err != nil {
return nil, stacktrace.Propagate(
err,
Expand Down Expand Up @@ -213,7 +212,7 @@ func CreateEngine(

// Configure the debug port only if it's required
if shouldStartInDebugMode {
debugServerPortSpec, err := port_spec.NewPortSpec(uint16(engineDebugServerPort), consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait, emptyUrl)
debugServerPortSpec, err := port_spec.NewPortSpec(uint16(engineDebugServerPort), consts.EngineTransportProtocol, consts.HttpApplicationProtocol, defaultWait, consts.EmptyApplicationURL)
if err != nil {
return nil, stacktrace.Propagate(
err,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const (
printfCmdName = "printf"
mkdirCmdName = "mkdir"
shCmdFlag = "-c"
emptyUrl = ""
)

type traefikContainerConfigProvider struct {
Expand Down Expand Up @@ -72,7 +71,7 @@ func (traefik *traefikContainerConfigProvider) GetContainerArgs(
}

// Publish HTTP and Dashboard entrypoint ports
privateHttpPortSpec, err := port_spec.NewPortSpec(httpPort, port_spec.TransportProtocol_TCP, consts.HttpApplicationProtocol, defaultWait, emptyUrl)
privateHttpPortSpec, err := port_spec.NewPortSpec(httpPort, port_spec.TransportProtocol_TCP, consts.HttpApplicationProtocol, defaultWait, consts.EmptyApplicationURL)
if err != nil {
return nil, stacktrace.Propagate(
err,
Expand All @@ -85,7 +84,7 @@ func (traefik *traefikContainerConfigProvider) GetContainerArgs(
if err != nil {
return nil, stacktrace.Propagate(err, "An error occurred transforming the private http port spec to a Docker port")
}
privateDashboardPortSpec, err := port_spec.NewPortSpec(dashboardPort, port_spec.TransportProtocol_TCP, consts.HttpApplicationProtocol, defaultWait, emptyUrl)
privateDashboardPortSpec, err := port_spec.NewPortSpec(dashboardPort, port_spec.TransportProtocol_TCP, consts.HttpApplicationProtocol, defaultWait, consts.EmptyApplicationURL)
if err != nil {
return nil, stacktrace.Propagate(
err,
Expand Down

0 comments on commit bdcbecb

Please sign in to comment.