Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
凌波微步_大先生
dashboard
提交
cb0c0e7f
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,发现更多精彩内容 >>
提交
cb0c0e7f
编写于
12月 23, 2015
作者:
B
bryk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add run as privileged option to the deploy form
上级
98fb69a6
变更
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
浏览文件 @
cb0c0e7f
...
...
@@ -57,6 +57,9 @@ type AppDeploymentSpec struct {
// Labels that will be defined on Pods/RCs/Services
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.
...
...
@@ -99,6 +102,9 @@ func DeployApp(spec *AppDeploymentSpec, client client.Interface) error {
containerSpec
:=
api
.
Container
{
Name
:
spec
.
Name
,
Image
:
spec
.
ContainerImage
,
SecurityContext
:
&
api
.
SecurityContext
{
Privileged
:
&
spec
.
RunAsPrivileged
,
},
}
if
spec
.
ContainerCommand
!=
nil
{
...
...
src/app/externs/backendapi.js
浏览文件 @
cb0c0e7f
...
...
@@ -52,7 +52,8 @@ backendApi.Label;
* portMappings: !Array<!backendApi.PortMapping>,
* labels: !Array<!backendApi.Label>,
* replicas: number,
* namespace: string
* namespace: string,
* runAsPrivileged: boolean,
* }}
*/
backendApi
.
AppDeploymentSpec
;
...
...
src/app/frontend/deploy/deployfromsettings.html
浏览文件 @
cb0c0e7f
...
...
@@ -129,11 +129,20 @@ limitations under the License.
</md-input-container>
</div>
<kd-user-help>
By default, your containers run the selected image's default entrypoint command. You can
use the
command options to override the default.
By default, your containers run the selected image's default entrypoint command. You can
use the
command options to override the default.
<a
href=
""
>
Learn more
</a>
</kd-user-help>
</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>
<md-button
class=
"md-primary kd-deploy-moreoptions-button"
type=
"button"
...
...
src/app/frontend/deploy/deployfromsettings_controller.js
浏览文件 @
cb0c0e7f
...
...
@@ -94,6 +94,12 @@ export default class DeployFromSettingsController {
*/
this
.
name
;
/**
* Whether to run the container as privileged user.
* @export {boolean}
*/
this
.
runAsPrivileged
=
false
;
/**
* Currently chosen namespace.
* @export {string}
...
...
@@ -136,6 +142,7 @@ export default class DeployFromSettingsController {
replicas
:
this
.
replicas
,
namespace
:
this
.
namespace
,
labels
:
this
.
toBackendApiLabels_
(
this
.
labels
),
runAsPrivileged
:
this
.
runAsPrivileged
,
};
let
defer
=
this
.
q_
.
defer
();
...
...
src/test/backend/deploy_test.go
浏览文件 @
cb0c0e7f
...
...
@@ -24,8 +24,9 @@ import (
func
TestDeployApp
(
t
*
testing
.
T
)
{
namespace
:=
"foo-namespace"
spec
:=
&
AppDeploymentSpec
{
Namespace
:
namespace
,
Name
:
"foo-name"
,
Namespace
:
namespace
,
Name
:
"foo-name"
,
RunAsPrivileged
:
true
,
}
expectedRc
:=
&
api
.
ReplicationController
{
ObjectMeta
:
api
.
ObjectMeta
{
...
...
@@ -43,6 +44,9 @@ func TestDeployApp(t *testing.T) {
Spec
:
api
.
PodSpec
{
Containers
:
[]
api
.
Container
{{
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录