Skip to content

Commit

Permalink
Add apis for git sync (#1055)
Browse files Browse the repository at this point in the history
Signed-off-by: Mehedi Hasan <[email protected]>
Signed-off-by: Tamal Saha <[email protected]>
Co-authored-by: Tamal Saha <[email protected]>
  • Loading branch information
heheh13 and tamalsaha authored Aug 18, 2023
1 parent eec599f commit 8e2aab0
Show file tree
Hide file tree
Showing 17 changed files with 1,525 additions and 2 deletions.
2 changes: 2 additions & 0 deletions apis/catalog/v1alpha1/mysql_version_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ type MySQLVersionSpec struct {
Router MySQLVersionRouter `json:"router,omitempty"`
// +optional
RouterInitContainer MySQLVersionRouterInitContainer `json:"routerInitContainer,omitempty"`
// +optional
GitSyncer GitSyncer `json:"gitSyncer,omitempty"`
}

// MySQLVersionDatabase is the MySQL Database image
Expand Down
30 changes: 29 additions & 1 deletion apis/catalog/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions apis/catalog/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ type UpdateConstraints struct {
// An empty list indicates no version is rejected.
Denylist []string `json:"denylist,omitempty"`
}

// GitSyncer is the image for the kubernetes/git-sync
// https://github.com/kubernetes/git-sync
type GitSyncer struct {
Image string `json:"image"`
}
17 changes: 17 additions & 0 deletions apis/catalog/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 70 additions & 1 deletion apis/kubedb/v1alpha2/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions apis/kubedb/v1alpha2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,27 @@ type InitSpec struct {
type ScriptSourceSpec struct {
ScriptPath string `json:"scriptPath,omitempty"`
core.VolumeSource `json:",inline,omitempty"`
Git *GitRepo `json:"git,omitempty"`
}

type GitRepo struct {
// https://github.com/kubernetes/git-sync/tree/master
Args []string `json:"args"`
// List of environment variables to set in the container.
// Cannot be updated.
// +optional
Env []core.EnvVar `json:"env,omitempty"`
// Security options the pod should run with.
// More info: https://kubernetes.io/docs/concepts/policy/security-context/
// More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
// +optional
SecurityContext *core.SecurityContext `json:"securityContext,omitempty"`
// Compute Resources required by the sidecar container.
// +optional
Resources core.ResourceRequirements `json:"resources,omitempty"`
// Authentication secret for git repository
// +optional
AuthSecret *core.LocalObjectReference `json:"authSecret,omitempty"`
}

// +kubebuilder:validation:Enum=Provisioning;DataRestoring;Ready;Critical;NotReady;Halted;Unknown
Expand Down
44 changes: 44 additions & 0 deletions apis/kubedb/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions crds/catalog.kubedb.com_mysqlversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ spec:
required:
- image
type: object
gitSyncer:
properties:
image:
type: string
required:
- image
type: object
initContainer:
properties:
image:
Expand Down
Loading

0 comments on commit 8e2aab0

Please sign in to comment.