kastenhq / kubestr

Apache License 2.0
349 stars 47 forks source link

Updating CreatePodArgs to consume PVC args as a map instead of string #285

Closed shlokc9 closed 2 months ago

shlokc9 commented 2 months ago

This PR updates the signature of PVC specific arguments in the following CreatePodArgs;

type CreatePodArgs struct {
    Name           string // Only one of Name or
    GenerateName   string // GenerateName should be specified.
    PVCName        string
    Namespace      string
    RunAsUser      int64
    ContainerImage string
    Command        []string
    ContainerArgs  []string
    MountPath      string // Only one of MountPath or
    DevicePath     string // DevicePath should be specified.
}

from multiple string type variables to a single map[string]VolumePath type variables;

type VolumePath struct {
    MountPath  string // Only one of MountPath or
    DevicePath string // DevicePath should be specified.
}

type CreatePodArgs struct {
    Name           string // Only one of Name or
    GenerateName   string // GenerateName should be specified.
    PVCMap         map[string]VolumePath
    Namespace      string
    RunAsUser      int64
    ContainerImage string
    Command        []string
    ContainerArgs  []string
}

to allow input of multiple PVCs while creating an inspector pod

Tested these code changes by running all the fake tests in the csi package