Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
凌波微步_大先生
dashboard
提交
189d7efe
D
dashboard
项目概览
凌波微步_大先生
/
dashboard
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dashboard
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
189d7efe
编写于
12月 28, 2015
作者:
P
Piotr Bryk
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #199 from bryk/run-privileged
Add run as privileged option to the deploy form
上级
a68e63f7
a58e2b6f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
32 addition
and
5 deletion
+32
-5
src/app/backend/deploy.go
src/app/backend/deploy.go
+6
-0
src/app/externs/backendapi.js
src/app/externs/backendapi.js
+2
-1
src/app/frontend/deploy/deployfromsettings.html
src/app/frontend/deploy/deployfromsettings.html
+11
-2
src/app/frontend/deploy/deployfromsettings_controller.js
src/app/frontend/deploy/deployfromsettings_controller.js
+7
-0
src/test/backend/deploy_test.go
src/test/backend/deploy_test.go
+6
-2
未找到文件。
src/app/backend/deploy.go
浏览文件 @
189d7efe
...
@@ -57,6 +57,9 @@ type AppDeploymentSpec struct {
...
@@ -57,6 +57,9 @@ type AppDeploymentSpec struct {
// Labels that will be defined on Pods/RCs/Services
// Labels that will be defined on Pods/RCs/Services
Labels
[]
Label
`json:"labels"`
Labels
[]
Label
`json:"labels"`
// Whether to run the container as privileged user (essentially equivalent to root on the host).
RunAsPrivileged
bool
`json:"runAsPrivileged"`
}
}
// Port mapping for an application deployment.
// Port mapping for an application deployment.
...
@@ -99,6 +102,9 @@ func DeployApp(spec *AppDeploymentSpec, client client.Interface) error {
...
@@ -99,6 +102,9 @@ func DeployApp(spec *AppDeploymentSpec, client client.Interface) error {
containerSpec
:=
api
.
Container
{
containerSpec
:=
api
.
Container
{
Name
:
spec
.
Name
,
Name
:
spec
.
Name
,
Image
:
spec
.
ContainerImage
,
Image
:
spec
.
ContainerImage
,
SecurityContext
:
&
api
.
SecurityContext
{
Privileged
:
&
spec
.
RunAsPrivileged
,
},
}
}
if
spec
.
ContainerCommand
!=
nil
{
if
spec
.
ContainerCommand
!=
nil
{
...
...
src/app/externs/backendapi.js
浏览文件 @
189d7efe
...
@@ -52,7 +52,8 @@ backendApi.Label;
...
@@ -52,7 +52,8 @@ backendApi.Label;
* portMappings: !Array<!backendApi.PortMapping>,
* portMappings: !Array<!backendApi.PortMapping>,
* labels: !Array<!backendApi.Label>,
* labels: !Array<!backendApi.Label>,
* replicas: number,
* replicas: number,
* namespace: string
* namespace: string,
* runAsPrivileged: boolean,
* }}
* }}
*/
*/
backendApi
.
AppDeploymentSpec
;
backendApi
.
AppDeploymentSpec
;
...
...
src/app/frontend/deploy/deployfromsettings.html
浏览文件 @
189d7efe
...
@@ -129,11 +129,20 @@ limitations under the License.
...
@@ -129,11 +129,20 @@ limitations under the License.
</md-input-container>
</md-input-container>
</div>
</div>
<kd-user-help>
<kd-user-help>
By default, your containers run the selected image's default entrypoint command. You can
use the
By default, your containers run the selected image's default entrypoint command. You can
command options to override the default.
use the
command options to override the default.
<a
href=
""
>
Learn more
</a>
<a
href=
""
>
Learn more
</a>
</kd-user-help>
</kd-user-help>
</kd-help-section>
</kd-help-section>
<kd-help-section>
<md-switch
ng-model=
"ctrl.runAsPrivileged"
class=
"md-primary"
>
Run as privileged
</md-switch>
<kd-user-help>
Processes in privileged containers are equivalent to be running as root on the host.
</kd-user-help>
</kd-help-section>
</div>
</div>
<md-button
class=
"md-primary kd-deploy-moreoptions-button"
type=
"button"
<md-button
class=
"md-primary kd-deploy-moreoptions-button"
type=
"button"
...
...
src/app/frontend/deploy/deployfromsettings_controller.js
浏览文件 @
189d7efe
...
@@ -94,6 +94,12 @@ export default class DeployFromSettingsController {
...
@@ -94,6 +94,12 @@ export default class DeployFromSettingsController {
*/
*/
this
.
name
;
this
.
name
;
/**
* Whether to run the container as privileged user.
* @export {boolean}
*/
this
.
runAsPrivileged
=
false
;
/**
/**
* Currently chosen namespace.
* Currently chosen namespace.
* @export {string}
* @export {string}
...
@@ -136,6 +142,7 @@ export default class DeployFromSettingsController {
...
@@ -136,6 +142,7 @@ export default class DeployFromSettingsController {
replicas
:
this
.
replicas
,
replicas
:
this
.
replicas
,
namespace
:
this
.
namespace
,
namespace
:
this
.
namespace
,
labels
:
this
.
toBackendApiLabels_
(
this
.
labels
),
labels
:
this
.
toBackendApiLabels_
(
this
.
labels
),
runAsPrivileged
:
this
.
runAsPrivileged
,
};
};
let
defer
=
this
.
q_
.
defer
();
let
defer
=
this
.
q_
.
defer
();
...
...
src/test/backend/deploy_test.go
浏览文件 @
189d7efe
...
@@ -24,8 +24,9 @@ import (
...
@@ -24,8 +24,9 @@ import (
func
TestDeployApp
(
t
*
testing
.
T
)
{
func
TestDeployApp
(
t
*
testing
.
T
)
{
namespace
:=
"foo-namespace"
namespace
:=
"foo-namespace"
spec
:=
&
AppDeploymentSpec
{
spec
:=
&
AppDeploymentSpec
{
Namespace
:
namespace
,
Namespace
:
namespace
,
Name
:
"foo-name"
,
Name
:
"foo-name"
,
RunAsPrivileged
:
true
,
}
}
expectedRc
:=
&
api
.
ReplicationController
{
expectedRc
:=
&
api
.
ReplicationController
{
ObjectMeta
:
api
.
ObjectMeta
{
ObjectMeta
:
api
.
ObjectMeta
{
...
@@ -43,6 +44,9 @@ func TestDeployApp(t *testing.T) {
...
@@ -43,6 +44,9 @@ func TestDeployApp(t *testing.T) {
Spec
:
api
.
PodSpec
{
Spec
:
api
.
PodSpec
{
Containers
:
[]
api
.
Container
{{
Containers
:
[]
api
.
Container
{{
Name
:
"foo-name"
,
Name
:
"foo-name"
,
SecurityContext
:
&
api
.
SecurityContext
{
Privileged
:
&
spec
.
RunAsPrivileged
,
},
}},
}},
},
},
},
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录