@@ -39,10 +39,16 @@ type ImageUpdateAutomationSpec struct {
3939 // value.
4040 // +kubebuilder:default={"strategy":"Setters"}
4141 Update * UpdateStrategy `json:"update,omitempty"`
42- // Commit specifies how to commit to the git repo
42+ // Commit specifies how to commit to the git repository.
4343 // +required
4444 Commit CommitSpec `json:"commit"`
4545
46+ // Push specifies how and where to push commits made by the
47+ // automation. If missing, commits are pushed (back) to
48+ // `.spec.checkout.branch`.
49+ // +optional
50+ Push * PushSpec `json:"push,omitempty"`
51+
4652 // Suspend tells the controller to not run this automation, until
4753 // it is unset (or set to false). Defaults to false.
4854 // +optional
@@ -54,7 +60,9 @@ type GitCheckoutSpec struct {
5460 // to a git repository to update files in.
5561 // +required
5662 GitRepositoryRef meta.LocalObjectReference `json:"gitRepositoryRef"`
57- // Branch gives the branch to clone from the git repository.
63+ // Branch gives the branch to clone from the git repository. If
64+ // `.spec.push` is not supplied, commits will also be pushed to
65+ // this branch.
5866 // +required
5967 Branch string `json:"branch"`
6068}
@@ -95,6 +103,15 @@ type CommitSpec struct {
95103 MessageTemplate string `json:"messageTemplate,omitempty"`
96104}
97105
106+ // PushSpec specifies how and where to push commits.
107+ type PushSpec struct {
108+ // Branch specifies that commits should be pushed to the branch
109+ // named. The branch is created using `.spec.checkout.branch` as the
110+ // starting point, if it doesn't already exist.
111+ // +required
112+ Branch string `json:"branch"`
113+ }
114+
98115// ImageUpdateAutomationStatus defines the observed state of ImageUpdateAutomation
99116type ImageUpdateAutomationStatus struct {
100117 // LastAutomationRunTime records the last time the controller ran
0 commit comments