Closed akashsinghal closed 4 years ago
Another suggestion for volume.go
design.
I would suggesting defining a struct like:
pkg/volume/source.go
----
package volume
// Represents the source of a volume to mount.
// Only one of its members may be specified.
type Source struct {
// Secret represents a secret that should populate this volume.
Secret []map[string]string `yaml:"secret"`
// add more sources here ...
}
This way, later on: we can add more sources as we want. And it is easy to extend.
K8s supports a lot of different types of sources: Check out their source code (one of them is SecretVolumeSource).
And then you can refer to the source like this:
type Volume struct {
Name string `yaml:"name"`
// Source represents the location and type of the mounted volume.
Source Source `yaml:",inline"`
}
What do you think?
Purpose of the PR
Fixes #550 https://github.com/Azure/acr/issues/348