Skip to content

Commit

Permalink
added a LVMLogicalVolumeWatcher controller
Browse files Browse the repository at this point in the history
Signed-off-by: viktor.kramarenko <[email protected]>
  • Loading branch information
ViktorKram committed Jan 23, 2024
1 parent 9713f94 commit 017b297
Show file tree
Hide file tree
Showing 8 changed files with 580 additions and 159 deletions.
10 changes: 10 additions & 0 deletions crds/lvmlogicalvolume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@ spec:
description: |
properties:
type:
x-kubernetes-validations:
- rule: self == oldSelf
type: string
enum: [Thick, Thin]
size:
type: string
lvmVolumeGroup:
x-kubernetes-validations:
- rule: self == oldSelf
type: string
thin:
x-kubernetes-validations:
- rule: self == oldSelf
type: object
properties:
poolName:
Expand All @@ -56,6 +62,10 @@ spec:
actualSize:
type: string
additionalPrinterColumns:
- jsonPath: .status.phase
name: Phase
type: string
description: The current resource status.
- jsonPath: .spec.lvmVolumeGroup
name: LVMVolumeGroup
type: string
Expand Down
8 changes: 5 additions & 3 deletions images/agent/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,19 @@ func NewConfig() (*Options, error) {
func getMachineId() (string, error) {
id := os.Getenv(MachineID)
if id == "" {
args := []string{"-m", "-u", "-i", "-n", "-p", "-t", "1", "cat", "/etc/machine-id"}
args := []string{"-m", "-u", "-i", "-n", "-p", "-t", "1", "cat", "./etc/machine-id"}

var stdout *bytes.Buffer
var stdout bytes.Buffer
cmd := exec.Command("/usr/bin/nsenter", args...)
cmd.Stdout = stdout
cmd.Stdout = &stdout
err := cmd.Run()
if err != nil {
return "", err
}

id = stdout.String()
fmt.Println("MACHINE ID " + id)

}

return id, nil
Expand Down
Loading

0 comments on commit 017b297

Please sign in to comment.