Skip to content

Instantly share code, notes, and snippets.

@j-griffith
Last active January 15, 2019 21:47
Show Gist options
  • Select an option

  • Save j-griffith/65499fbfb1c35bc8e05c2cce70ac330c to your computer and use it in GitHub Desktop.

Select an option

Save j-griffith/65499fbfb1c35bc8e05c2cce70ac330c to your computer and use it in GitHub Desktop.
// GitPopulator provides a struct for populating PVCs with data form a Git repo
type GitPopulator struct {
Repo string `json:"repo"`
Branch string `json:"branch,omitempty"`
Tag string `json:"tag,omitempty"`
}
// HTTPPopulator provides a struct for populating PVCs with data from a simple HTTP source
type HTTPPopulator struct {
URL string `json:"url"`
}
// S3Populator provides a struct for populating PVCs with data from an S3 source
type S3Populator struct {
URL string `json:"url"`
}
// PopulatorSpec defines the desired state of Populator
type PopulatorSpec struct {
PVC string `json:"pvc"`
PopulatorType string `json:"populator_type"`
DestinationDirectory string `json:"destination_directory"`
Git *GitPopulator `json:"git,omitempty"`
HTTP *HTTPPopulator `json:"http,omitempty"`
S3 *S3Populator `json:"s3,omitempty"`
}
````````````````````````````````````
apiVersion: populators.k8s.io/v1alpha1
kind: Populator
metadata:
labels:
controller-tools.k8s.io: "1.0"
name: git-populator
spec:
PopulatorType: "git"
DestinationDirectory: "/data"
Git:
Repo: "https://github.com/j-griffith/foo"
Branch: "master"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment