Merge pull request #37684 from thaJeztah/add_remote_api_warning
Add warning if REST API is accessible through an insecure connection
diff --git a/api/server/router/build/build_routes.go b/api/server/router/build/build_routes.go
index 62bcf3f..acacfac 100644
--- a/api/server/router/build/build_routes.go
+++ b/api/server/router/build/build_routes.go
@@ -231,8 +231,7 @@
}
// check if the builder feature has been enabled from daemon as well.
- if buildOptions.Version == types.BuilderBuildKit &&
- (br.builderVersion != types.BuilderBuildKit || !br.daemon.HasExperimental()) {
+ if buildOptions.Version == types.BuilderBuildKit && br.builderVersion != types.BuilderBuildKit {
return errdefs.InvalidParameter(errors.New("buildkit is not enabled on daemon"))
}
diff --git a/api/server/router/session/session.go b/api/server/router/session/session.go
index de6d630..79ddc13 100644
--- a/api/server/router/session/session.go
+++ b/api/server/router/session/session.go
@@ -24,6 +24,6 @@
func (r *sessionRouter) initRoutes() {
r.routes = []router.Route{
- router.Experimental(router.NewPostRoute("/session", r.startSession)),
+ router.NewPostRoute("/session", r.startSession),
}
}
diff --git a/daemon/cluster/executor/container/container_test.go b/daemon/cluster/executor/container/container_test.go
index 1bf6f6c..5f967c2 100644
--- a/daemon/cluster/executor/container/container_test.go
+++ b/daemon/cluster/executor/container/container_test.go
@@ -35,3 +35,48 @@
})
}
}
+
+func TestContainerLabels(t *testing.T) {
+ c := &containerConfig{
+ task: &swarmapi.Task{
+ ID: "real-task.id",
+ Spec: swarmapi.TaskSpec{
+ Runtime: &swarmapi.TaskSpec_Container{
+ Container: &swarmapi.ContainerSpec{
+ Labels: map[string]string{
+ "com.docker.swarm.task": "user-specified-task",
+ "com.docker.swarm.task.id": "user-specified-task.id",
+ "com.docker.swarm.task.name": "user-specified-task.name",
+ "com.docker.swarm.node.id": "user-specified-node.id",
+ "com.docker.swarm.service.id": "user-specified-service.id",
+ "com.docker.swarm.service.name": "user-specified-service.name",
+ "this-is-a-user-label": "this is a user label's value",
+ },
+ },
+ },
+ },
+ ServiceID: "real-service.id",
+ Slot: 123,
+ NodeID: "real-node.id",
+ Annotations: swarmapi.Annotations{
+ Name: "real-service.name.123.real-task.id",
+ },
+ ServiceAnnotations: swarmapi.Annotations{
+ Name: "real-service.name",
+ },
+ },
+ }
+
+ expected := map[string]string{
+ "com.docker.swarm.task": "",
+ "com.docker.swarm.task.id": "real-task.id",
+ "com.docker.swarm.task.name": "real-service.name.123.real-task.id",
+ "com.docker.swarm.node.id": "real-node.id",
+ "com.docker.swarm.service.id": "real-service.id",
+ "com.docker.swarm.service.name": "real-service.name",
+ "this-is-a-user-label": "this is a user label's value",
+ }
+
+ labels := c.labels()
+ assert.DeepEqual(t, expected, labels)
+}