mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 02:38:17 +08:00
enable privileged
This commit is contained in:
parent
8331327922
commit
1a6cb25530
@ -1454,7 +1454,7 @@ func (t *ServiceLabelDaoImpl) GetTenantServiceTypeLabel(serviceID string) (*mode
|
||||
// GetPrivilegedLabel -
|
||||
func (t *ServiceLabelDaoImpl) GetPrivilegedLabel(serviceID string) (*model.TenantServiceLable, error) {
|
||||
var label model.TenantServiceLable
|
||||
if err := t.DB.Where("service_id=? and label_key = ?", serviceID, model.LabelKeyServicePrivileged).Find(&label).Error; err != nil {
|
||||
if err := t.DB.Where("service_id=? and label_value=?", serviceID, model.LabelKeyServicePrivileged).Find(&label).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &label, nil
|
||||
|
@ -138,6 +138,7 @@ func getMainContainer(as *v1.AppService, version *dbmodel.VersionInfo, dv *volum
|
||||
return nil, fmt.Errorf("get privileged label: %v", err)
|
||||
}
|
||||
if label != nil {
|
||||
logrus.Infof("service id: %s; enable privileged.", as.ServiceID)
|
||||
c.SecurityContext = &corev1.SecurityContext{Privileged: util.Bool(true)}
|
||||
}
|
||||
|
||||
@ -653,6 +654,9 @@ func createNodeSelector(as *v1.AppService, dbmanager db.Manager) map[string]stri
|
||||
selector[client.LabelOS] = l.LabelValue
|
||||
continue
|
||||
}
|
||||
if l.LabelValue == model.LabelKeyServicePrivileged {
|
||||
continue
|
||||
}
|
||||
if strings.Contains(l.LabelValue, "=") {
|
||||
kv := strings.SplitN(l.LabelValue, "=", 1)
|
||||
selector[kv[0]] = kv[1]
|
||||
|
Loading…
Reference in New Issue
Block a user