MCPcopy Create free account
hub / github.com/apache/mesos / getRegistryScheme

Function getRegistryScheme

src/docker/spec.cpp:125–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123
124
125Try<string> getRegistryScheme(const string& registry)
126{
127 Result<int> port = getRegistryPort(registry);
128 if (port.isError()) {
129 return Error("Failed to get registry port: " + port.error());
130 } else if (port.isSome()) {
131 if (port.get() == 443) {
132 return "https";
133 }
134
135 if (port.get() == 80) {
136 return "http";
137 }
138
139 // NOTE: For a local registry, it's typically a http server.
140 const string host = getRegistryHost(registry);
141 if (host == "localhost" || host == "127.0.0.1") {
142 return "http";
143 }
144 }
145
146 return "https";
147}
148
149
150string getRegistryHost(const string& registry)

Callers 3

TEST_FFunction · 0.85
_pullMethod · 0.85
foreachFunction · 0.85

Calls 7

getRegistryPortFunction · 0.85
getRegistryHostFunction · 0.85
errorMethod · 0.65
ErrorFunction · 0.50
isErrorMethod · 0.45
isSomeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected