Skip to content

Commit 2efef1c

Browse files
fix(vm): create network interfaces with deckhouse user
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
1 parent b45d926 commit 2efef1c

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

images/virtualization-artifact/pkg/common/network/spec.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ func CreateNetworkSpec(vm *v1alpha2.VirtualMachine, vmmacs []*v1alpha2.VirtualMa
4545
return specs
4646
}
4747

48+
const deckhouseUID = 64535
49+
4850
func createMainInterfaceSpec(net v1alpha2.NetworksSpec) InterfaceSpec {
4951
return InterfaceSpec{
5052
ID: ptr.Deref(net.ID, 0),
5153
Type: net.Type,
5254
Name: net.Name,
5355
InterfaceName: NameDefaultInterface,
5456
MAC: "",
57+
UID: deckhouseUID,
58+
GID: deckhouseUID,
5559
}
5660
}
5761

@@ -62,6 +66,8 @@ func createAdditionalInterfaceSpec(net v1alpha2.NetworksSpec, mac string) Interf
6266
Name: net.Name,
6367
InterfaceName: generateInterfaceName(mac, net.Type),
6468
MAC: mac,
69+
UID: deckhouseUID,
70+
GID: deckhouseUID,
6571
}
6672
}
6773

images/virtualization-artifact/pkg/common/network/types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ type InterfaceSpec struct {
5252
Name string `json:"name"`
5353
InterfaceName string `json:"ifName"`
5454
MAC string `json:"-"`
55+
UID int `json:"uid"`
56+
GID int `json:"gid"`
5557
}
5658

5759
type InterfaceStatus struct {

0 commit comments

Comments
 (0)