From 2ce27a70fb2edf3f54ae65281e5a0171afc70645 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Wed, 9 Nov 2022 17:07:03 +0200 Subject: [PATCH] Remove deprecated alpha APIs Signed-off-by: Stefan Prodan --- PROJECT | 6 - api/v1alpha1/doc.go | 24 - api/v1alpha1/groupversion_info.go | 36 -- api/v1alpha1/imageupdateautomation_types.go | 210 -------- api/v1alpha1/zz_generated.deepcopy.go | 227 -------- api/v1alpha2/doc.go | 25 - api/v1alpha2/git.go | 90 ---- api/v1alpha2/groupversion_info.go | 33 -- api/v1alpha2/imageupdateautomation_types.go | 157 ------ api/v1alpha2/reference.go | 35 -- api/v1alpha2/zz_generated.deepcopy.go | 283 ---------- ...lkit.fluxcd.io_imageupdateautomations.yaml | 502 ------------------ .../image_v1alpha1_imageupdateautomation.yaml | 14 - 13 files changed, 1642 deletions(-) delete mode 100644 api/v1alpha1/doc.go delete mode 100644 api/v1alpha1/groupversion_info.go delete mode 100644 api/v1alpha1/imageupdateautomation_types.go delete mode 100644 api/v1alpha1/zz_generated.deepcopy.go delete mode 100644 api/v1alpha2/doc.go delete mode 100644 api/v1alpha2/git.go delete mode 100644 api/v1alpha2/groupversion_info.go delete mode 100644 api/v1alpha2/imageupdateautomation_types.go delete mode 100644 api/v1alpha2/reference.go delete mode 100644 api/v1alpha2/zz_generated.deepcopy.go delete mode 100644 config/samples/image_v1alpha1_imageupdateautomation.yaml diff --git a/PROJECT b/PROJECT index 5759f9f0..7c9d05bc 100644 --- a/PROJECT +++ b/PROJECT @@ -1,12 +1,6 @@ domain: toolkit.fluxcd.io repo: github.com/fluxcd/image-automation-controller resources: -- group: image - kind: ImageUpdateAutomation - version: v1alpha1 -- group: image - kind: ImageUpdateAutomation - version: v1alpha2 - group: image kind: ImageUpdateAutomation version: v1beta1 diff --git a/api/v1alpha1/doc.go b/api/v1alpha1/doc.go deleted file mode 100644 index 451e6e29..00000000 --- a/api/v1alpha1/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2020 The Flux authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha1 contains API types for the image v1alpha1 API -// group. The types here are concerned with automated updates to git, -// based on metadata from OCI image registries gathered by the -// image-reflector-controller. -// -// +kubebuilder:object:generate=true -// +groupName=image.toolkit.fluxcd.io -package v1alpha1 diff --git a/api/v1alpha1/groupversion_info.go b/api/v1alpha1/groupversion_info.go deleted file mode 100644 index 2d3ec6a1..00000000 --- a/api/v1alpha1/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2020 The Flux authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha1 contains API Schema definitions for the image v1alpha1 API group -// +kubebuilder:object:generate=true -// +groupName=image.toolkit.fluxcd.io -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "image.toolkit.fluxcd.io", Version: "v1alpha1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/api/v1alpha1/imageupdateautomation_types.go b/api/v1alpha1/imageupdateautomation_types.go deleted file mode 100644 index dc7b7932..00000000 --- a/api/v1alpha1/imageupdateautomation_types.go +++ /dev/null @@ -1,210 +0,0 @@ -/* -Copyright 2020 The Flux authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - apimeta "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/fluxcd/pkg/apis/meta" -) - -const ImageUpdateAutomationKind = "ImageUpdateAutomation" - -// ImageUpdateAutomationSpec defines the desired state of ImageUpdateAutomation -type ImageUpdateAutomationSpec struct { - // Checkout gives the parameters for cloning the git repository, - // ready to make changes. - // +required - Checkout GitCheckoutSpec `json:"checkout"` - - // Interval gives an lower bound for how often the automation - // run should be attempted. - // +required - Interval metav1.Duration `json:"interval"` - - // Update gives the specification for how to update the files in - // the repository. This can be left empty, to use the default - // value. - // +kubebuilder:default={"strategy":"Setters"} - Update *UpdateStrategy `json:"update,omitempty"` - - // Commit specifies how to commit to the git repository. - // +required - Commit CommitSpec `json:"commit"` - - // Push specifies how and where to push commits made by the - // automation. If missing, commits are pushed (back) to - // `.spec.checkout.branch`. - // +optional - Push *PushSpec `json:"push,omitempty"` - - // Suspend tells the controller to not run this automation, until - // it is unset (or set to false). Defaults to false. - // +optional - Suspend bool `json:"suspend,omitempty"` -} - -type GitCheckoutSpec struct { - // GitRepositoryRef refers to the resource giving access details - // to a git repository to update files in. - // +required - GitRepositoryRef meta.LocalObjectReference `json:"gitRepositoryRef"` - // Branch gives the branch to clone from the git repository. If - // `.spec.push` is not supplied, commits will also be pushed to - // this branch. - // +required - Branch string `json:"branch"` -} - -// UpdateStrategyName is the type for names that go in -// .update.strategy. NB the value in the const immediately below. -// +kubebuilder:validation:Enum=Setters -type UpdateStrategyName string - -const ( - // UpdateStrategySetters is the name of the update strategy that - // uses kyaml setters. NB the value in the enum annotation for the - // type, above. - UpdateStrategySetters UpdateStrategyName = "Setters" -) - -// UpdateStrategy is a union of the various strategies for updating -// the Git repository. Parameters for each strategy (if any) can be -// inlined here. -type UpdateStrategy struct { - // Strategy names the strategy to be used. - // +required - // +kubebuilder:default=Setters - Strategy UpdateStrategyName `json:"strategy"` - - // Path to the directory containing the manifests to be updated. - // Defaults to 'None', which translates to the root path - // of the GitRepositoryRef. - // +optional - Path string `json:"path,omitempty"` -} - -// CommitSpec specifies how to commit changes to the git repository -type CommitSpec struct { - // AuthorName gives the name to provide when making a commit - // +required - AuthorName string `json:"authorName"` - // AuthorEmail gives the email to provide when making a commit - // +required - AuthorEmail string `json:"authorEmail"` - // SigningKey provides the option to sign commits with a GPG key - // +optional - SigningKey *SigningKey `json:"signingKey,omitempty"` - // MessageTemplate provides a template for the commit message, - // into which will be interpolated the details of the change made. - // +optional - MessageTemplate string `json:"messageTemplate,omitempty"` -} - -// PushSpec specifies how and where to push commits. -type PushSpec struct { - // Branch specifies that commits should be pushed to the branch - // named. The branch is created using `.spec.checkout.branch` as the - // starting point, if it doesn't already exist. - // +required - Branch string `json:"branch"` -} - -// ImageUpdateAutomationStatus defines the observed state of ImageUpdateAutomation -type ImageUpdateAutomationStatus struct { - // LastAutomationRunTime records the last time the controller ran - // this automation through to completion (even if no updates were - // made). - // +optional - LastAutomationRunTime *metav1.Time `json:"lastAutomationRunTime,omitempty"` - // LastPushCommit records the SHA1 of the last commit made by the - // controller, for this automation object - // +optional - LastPushCommit string `json:"lastPushCommit,omitempty"` - // LastPushTime records the time of the last pushed change. - // +optional - LastPushTime *metav1.Time `json:"lastPushTime,omitempty"` - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` - meta.ReconcileRequestStatus `json:",inline"` -} - -// SigningKey references a Kubernetes secret that contains a GPG keypair -type SigningKey struct { - // SecretRef holds the name to a secret that contains a 'git.asc' key - // corresponding to the ASCII Armored file containing the GPG signing - // keypair as the value. It must be in the same namespace as the - // ImageUpdateAutomation. - // +required - SecretRef meta.LocalObjectReference `json:"secretRef,omitempty"` -} - -const ( - // GitNotAvailableReason is used for ConditionReady when the - // automation run cannot proceed because the git repository is - // missing or cannot be cloned. - GitNotAvailableReason = "GitRepositoryNotAvailable" - // NoStrategyReason is used for ConditionReady when the automation - // run cannot proceed because there is no update strategy given in - // the spec. - NoStrategyReason = "MissingUpdateStrategy" -) - -// SetImageUpdateAutomationReadiness sets the ready condition with the given status, reason and message. -func SetImageUpdateAutomationReadiness(auto *ImageUpdateAutomation, status metav1.ConditionStatus, reason, message string) { - auto.Status.ObservedGeneration = auto.ObjectMeta.Generation - newCondition := metav1.Condition{ - Type: meta.ReadyCondition, - Status: status, - Reason: reason, - Message: message, - } - apimeta.SetStatusCondition(auto.GetStatusConditions(), newCondition) -} - -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Last run",type=string,JSONPath=`.status.lastAutomationRunTime` - -// ImageUpdateAutomation is the Schema for the imageupdateautomations API -type ImageUpdateAutomation struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ImageUpdateAutomationSpec `json:"spec,omitempty"` - Status ImageUpdateAutomationStatus `json:"status,omitempty"` -} - -func (auto *ImageUpdateAutomation) GetStatusConditions() *[]metav1.Condition { - return &auto.Status.Conditions -} - -// +kubebuilder:object:root=true - -// ImageUpdateAutomationList contains a list of ImageUpdateAutomation -type ImageUpdateAutomationList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ImageUpdateAutomation `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ImageUpdateAutomation{}, &ImageUpdateAutomationList{}) -} diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 0353e53c..00000000 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,227 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2020 The Flux authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommitSpec) DeepCopyInto(out *CommitSpec) { - *out = *in - if in.SigningKey != nil { - in, out := &in.SigningKey, &out.SigningKey - *out = new(SigningKey) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommitSpec. -func (in *CommitSpec) DeepCopy() *CommitSpec { - if in == nil { - return nil - } - out := new(CommitSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GitCheckoutSpec) DeepCopyInto(out *GitCheckoutSpec) { - *out = *in - out.GitRepositoryRef = in.GitRepositoryRef -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitCheckoutSpec. -func (in *GitCheckoutSpec) DeepCopy() *GitCheckoutSpec { - if in == nil { - return nil - } - out := new(GitCheckoutSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageUpdateAutomation) DeepCopyInto(out *ImageUpdateAutomation) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUpdateAutomation. -func (in *ImageUpdateAutomation) DeepCopy() *ImageUpdateAutomation { - if in == nil { - return nil - } - out := new(ImageUpdateAutomation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ImageUpdateAutomation) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageUpdateAutomationList) DeepCopyInto(out *ImageUpdateAutomationList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ImageUpdateAutomation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUpdateAutomationList. -func (in *ImageUpdateAutomationList) DeepCopy() *ImageUpdateAutomationList { - if in == nil { - return nil - } - out := new(ImageUpdateAutomationList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ImageUpdateAutomationList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageUpdateAutomationSpec) DeepCopyInto(out *ImageUpdateAutomationSpec) { - *out = *in - out.Checkout = in.Checkout - out.Interval = in.Interval - if in.Update != nil { - in, out := &in.Update, &out.Update - *out = new(UpdateStrategy) - **out = **in - } - in.Commit.DeepCopyInto(&out.Commit) - if in.Push != nil { - in, out := &in.Push, &out.Push - *out = new(PushSpec) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUpdateAutomationSpec. -func (in *ImageUpdateAutomationSpec) DeepCopy() *ImageUpdateAutomationSpec { - if in == nil { - return nil - } - out := new(ImageUpdateAutomationSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageUpdateAutomationStatus) DeepCopyInto(out *ImageUpdateAutomationStatus) { - *out = *in - if in.LastAutomationRunTime != nil { - in, out := &in.LastAutomationRunTime, &out.LastAutomationRunTime - *out = (*in).DeepCopy() - } - if in.LastPushTime != nil { - in, out := &in.LastPushTime, &out.LastPushTime - *out = (*in).DeepCopy() - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - out.ReconcileRequestStatus = in.ReconcileRequestStatus -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUpdateAutomationStatus. -func (in *ImageUpdateAutomationStatus) DeepCopy() *ImageUpdateAutomationStatus { - if in == nil { - return nil - } - out := new(ImageUpdateAutomationStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PushSpec) DeepCopyInto(out *PushSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PushSpec. -func (in *PushSpec) DeepCopy() *PushSpec { - if in == nil { - return nil - } - out := new(PushSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SigningKey) DeepCopyInto(out *SigningKey) { - *out = *in - out.SecretRef = in.SecretRef -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SigningKey. -func (in *SigningKey) DeepCopy() *SigningKey { - if in == nil { - return nil - } - out := new(SigningKey) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UpdateStrategy) DeepCopyInto(out *UpdateStrategy) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateStrategy. -func (in *UpdateStrategy) DeepCopy() *UpdateStrategy { - if in == nil { - return nil - } - out := new(UpdateStrategy) - in.DeepCopyInto(out) - return out -} diff --git a/api/v1alpha2/doc.go b/api/v1alpha2/doc.go deleted file mode 100644 index 208f2849..00000000 --- a/api/v1alpha2/doc.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2020 The Flux authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha2 contains API types for the image v1alpha2 API -// group. The types here are concerned with automated updates to git, -// based on metadata from OCI image registries gathered by the -// image-reflector-controller. There is some rearrangement from -// v1alpha1 to make room for future enhancements. -// -// +kubebuilder:object:generate=true -// +groupName=image.toolkit.fluxcd.io -package v1alpha2 diff --git a/api/v1alpha2/git.go b/api/v1alpha2/git.go deleted file mode 100644 index ada4c70b..00000000 --- a/api/v1alpha2/git.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2020 The Flux authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha2 - -import ( - "github.com/fluxcd/pkg/apis/meta" - sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" -) - -type GitSpec struct { - // Checkout gives the parameters for cloning the git repository, - // ready to make changes. If not present, the `spec.ref` field from the - // referenced `GitRepository` or its default will be used. - // +optional - Checkout *GitCheckoutSpec `json:"checkout,omitempty"` - - // Commit specifies how to commit to the git repository. - // +required - Commit CommitSpec `json:"commit"` - - // Push specifies how and where to push commits made by the - // automation. If missing, commits are pushed (back) to - // `.spec.checkout.branch` or its default. - // +optional - Push *PushSpec `json:"push,omitempty"` -} - -type GitCheckoutSpec struct { - // Reference gives a branch, tag or commit to clone from the Git - // repository. - // +required - Reference sourcev1.GitRepositoryRef `json:"ref"` -} - -// CommitSpec specifies how to commit changes to the git repository -type CommitSpec struct { - // Author gives the email and optionally the name to use as the - // author of commits. - // +required - Author CommitUser `json:"author"` - // SigningKey provides the option to sign commits with a GPG key - // +optional - SigningKey *SigningKey `json:"signingKey,omitempty"` - // MessageTemplate provides a template for the commit message, - // into which will be interpolated the details of the change made. - // +optional - MessageTemplate string `json:"messageTemplate,omitempty"` -} - -type CommitUser struct { - // Name gives the name to provide when making a commit. - // +optional - Name string `json:"name,omitempty"` - // Email gives the email to provide when making a commit. - // +required - Email string `json:"email"` -} - -// SigningKey references a Kubernetes secret that contains a GPG keypair -type SigningKey struct { - // SecretRef holds the name to a secret that contains a 'git.asc' key - // corresponding to the ASCII Armored file containing the GPG signing - // keypair as the value. It must be in the same namespace as the - // ImageUpdateAutomation. - // +required - SecretRef meta.LocalObjectReference `json:"secretRef,omitempty"` -} - -// PushSpec specifies how and where to push commits. -type PushSpec struct { - // Branch specifies that commits should be pushed to the branch - // named. The branch is created using `.spec.checkout.branch` as the - // starting point, if it doesn't already exist. - // +required - Branch string `json:"branch"` -} diff --git a/api/v1alpha2/groupversion_info.go b/api/v1alpha2/groupversion_info.go deleted file mode 100644 index 24254608..00000000 --- a/api/v1alpha2/groupversion_info.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2020 The Flux authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha2 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "image.toolkit.fluxcd.io", Version: "v1alpha2"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/api/v1alpha2/imageupdateautomation_types.go b/api/v1alpha2/imageupdateautomation_types.go deleted file mode 100644 index cbef623b..00000000 --- a/api/v1alpha2/imageupdateautomation_types.go +++ /dev/null @@ -1,157 +0,0 @@ -/* -Copyright 2020 The Flux authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha2 - -import ( - apimeta "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/fluxcd/pkg/apis/meta" -) - -const ImageUpdateAutomationKind = "ImageUpdateAutomation" - -// ImageUpdateAutomationSpec defines the desired state of ImageUpdateAutomation -type ImageUpdateAutomationSpec struct { - // SourceRef refers to the resource giving access details - // to a git repository. - // +required - SourceRef SourceReference `json:"sourceRef"` - // GitSpec contains all the git-specific definitions. This is - // technically optional, but in practice mandatory until there are - // other kinds of source allowed. - // +optional - GitSpec *GitSpec `json:"git,omitempty"` - - // Interval gives an lower bound for how often the automation - // run should be attempted. - // +required - Interval metav1.Duration `json:"interval"` - - // Update gives the specification for how to update the files in - // the repository. This can be left empty, to use the default - // value. - // +kubebuilder:default={"strategy":"Setters"} - Update *UpdateStrategy `json:"update,omitempty"` - - // Suspend tells the controller to not run this automation, until - // it is unset (or set to false). Defaults to false. - // +optional - Suspend bool `json:"suspend,omitempty"` -} - -// UpdateStrategyName is the type for names that go in -// .update.strategy. NB the value in the const immediately below. -// +kubebuilder:validation:Enum=Setters -type UpdateStrategyName string - -const ( - // UpdateStrategySetters is the name of the update strategy that - // uses kyaml setters. NB the value in the enum annotation for the - // type, above. - UpdateStrategySetters UpdateStrategyName = "Setters" -) - -// UpdateStrategy is a union of the various strategies for updating -// the Git repository. Parameters for each strategy (if any) can be -// inlined here. -type UpdateStrategy struct { - // Strategy names the strategy to be used. - // +required - // +kubebuilder:default=Setters - Strategy UpdateStrategyName `json:"strategy"` - - // Path to the directory containing the manifests to be updated. - // Defaults to 'None', which translates to the root path - // of the GitRepositoryRef. - // +optional - Path string `json:"path,omitempty"` -} - -// ImageUpdateAutomationStatus defines the observed state of ImageUpdateAutomation -type ImageUpdateAutomationStatus struct { - // LastAutomationRunTime records the last time the controller ran - // this automation through to completion (even if no updates were - // made). - // +optional - LastAutomationRunTime *metav1.Time `json:"lastAutomationRunTime,omitempty"` - // LastPushCommit records the SHA1 of the last commit made by the - // controller, for this automation object - // +optional - LastPushCommit string `json:"lastPushCommit,omitempty"` - // LastPushTime records the time of the last pushed change. - // +optional - LastPushTime *metav1.Time `json:"lastPushTime,omitempty"` - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - // +optional - Conditions []metav1.Condition `json:"conditions,omitempty"` - meta.ReconcileRequestStatus `json:",inline"` -} - -const ( - // GitNotAvailableReason is used for ConditionReady when the - // automation run cannot proceed because the git repository is - // missing or cannot be cloned. - GitNotAvailableReason = "GitRepositoryNotAvailable" - // NoStrategyReason is used for ConditionReady when the automation - // run cannot proceed because there is no update strategy given in - // the spec. - NoStrategyReason = "MissingUpdateStrategy" -) - -// SetImageUpdateAutomationReadiness sets the ready condition with the given status, reason and message. -func SetImageUpdateAutomationReadiness(auto *ImageUpdateAutomation, status metav1.ConditionStatus, reason, message string) { - auto.Status.ObservedGeneration = auto.ObjectMeta.Generation - newCondition := metav1.Condition{ - Type: meta.ReadyCondition, - Status: status, - Reason: reason, - Message: message, - } - apimeta.SetStatusCondition(auto.GetStatusConditions(), newCondition) -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status -//+kubebuilder:printcolumn:name="Last run",type=string,JSONPath=`.status.lastAutomationRunTime` - -// ImageUpdateAutomation is the Schema for the imageupdateautomations API -type ImageUpdateAutomation struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ImageUpdateAutomationSpec `json:"spec,omitempty"` - Status ImageUpdateAutomationStatus `json:"status,omitempty"` -} - -func (auto *ImageUpdateAutomation) GetStatusConditions() *[]metav1.Condition { - return &auto.Status.Conditions -} - -//+kubebuilder:object:root=true - -// ImageUpdateAutomationList contains a list of ImageUpdateAutomation -type ImageUpdateAutomationList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ImageUpdateAutomation `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ImageUpdateAutomation{}, &ImageUpdateAutomationList{}) -} diff --git a/api/v1alpha2/reference.go b/api/v1alpha2/reference.go deleted file mode 100644 index feb16d7a..00000000 --- a/api/v1alpha2/reference.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2020 The Flux authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha2 - -// SourceReference contains enough information to let you locate the -// typed, referenced source object. -type SourceReference struct { - // API version of the referent - // +optional - APIVersion string `json:"apiVersion,omitempty"` - - // Kind of the referent - // +kubebuilder:validation:Enum=GitRepository - // +kubebuilder:default=GitRepository - // +required - Kind string `json:"kind"` - - // Name of the referent - // +required - Name string `json:"name"` -} diff --git a/api/v1alpha2/zz_generated.deepcopy.go b/api/v1alpha2/zz_generated.deepcopy.go deleted file mode 100644 index 79da91ea..00000000 --- a/api/v1alpha2/zz_generated.deepcopy.go +++ /dev/null @@ -1,283 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2020 The Flux authors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommitSpec) DeepCopyInto(out *CommitSpec) { - *out = *in - out.Author = in.Author - if in.SigningKey != nil { - in, out := &in.SigningKey, &out.SigningKey - *out = new(SigningKey) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommitSpec. -func (in *CommitSpec) DeepCopy() *CommitSpec { - if in == nil { - return nil - } - out := new(CommitSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommitUser) DeepCopyInto(out *CommitUser) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommitUser. -func (in *CommitUser) DeepCopy() *CommitUser { - if in == nil { - return nil - } - out := new(CommitUser) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GitCheckoutSpec) DeepCopyInto(out *GitCheckoutSpec) { - *out = *in - out.Reference = in.Reference -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitCheckoutSpec. -func (in *GitCheckoutSpec) DeepCopy() *GitCheckoutSpec { - if in == nil { - return nil - } - out := new(GitCheckoutSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GitSpec) DeepCopyInto(out *GitSpec) { - *out = *in - if in.Checkout != nil { - in, out := &in.Checkout, &out.Checkout - *out = new(GitCheckoutSpec) - **out = **in - } - in.Commit.DeepCopyInto(&out.Commit) - if in.Push != nil { - in, out := &in.Push, &out.Push - *out = new(PushSpec) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitSpec. -func (in *GitSpec) DeepCopy() *GitSpec { - if in == nil { - return nil - } - out := new(GitSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageUpdateAutomation) DeepCopyInto(out *ImageUpdateAutomation) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUpdateAutomation. -func (in *ImageUpdateAutomation) DeepCopy() *ImageUpdateAutomation { - if in == nil { - return nil - } - out := new(ImageUpdateAutomation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ImageUpdateAutomation) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageUpdateAutomationList) DeepCopyInto(out *ImageUpdateAutomationList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ImageUpdateAutomation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUpdateAutomationList. -func (in *ImageUpdateAutomationList) DeepCopy() *ImageUpdateAutomationList { - if in == nil { - return nil - } - out := new(ImageUpdateAutomationList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ImageUpdateAutomationList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageUpdateAutomationSpec) DeepCopyInto(out *ImageUpdateAutomationSpec) { - *out = *in - out.SourceRef = in.SourceRef - if in.GitSpec != nil { - in, out := &in.GitSpec, &out.GitSpec - *out = new(GitSpec) - (*in).DeepCopyInto(*out) - } - out.Interval = in.Interval - if in.Update != nil { - in, out := &in.Update, &out.Update - *out = new(UpdateStrategy) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUpdateAutomationSpec. -func (in *ImageUpdateAutomationSpec) DeepCopy() *ImageUpdateAutomationSpec { - if in == nil { - return nil - } - out := new(ImageUpdateAutomationSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageUpdateAutomationStatus) DeepCopyInto(out *ImageUpdateAutomationStatus) { - *out = *in - if in.LastAutomationRunTime != nil { - in, out := &in.LastAutomationRunTime, &out.LastAutomationRunTime - *out = (*in).DeepCopy() - } - if in.LastPushTime != nil { - in, out := &in.LastPushTime, &out.LastPushTime - *out = (*in).DeepCopy() - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - out.ReconcileRequestStatus = in.ReconcileRequestStatus -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageUpdateAutomationStatus. -func (in *ImageUpdateAutomationStatus) DeepCopy() *ImageUpdateAutomationStatus { - if in == nil { - return nil - } - out := new(ImageUpdateAutomationStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PushSpec) DeepCopyInto(out *PushSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PushSpec. -func (in *PushSpec) DeepCopy() *PushSpec { - if in == nil { - return nil - } - out := new(PushSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SigningKey) DeepCopyInto(out *SigningKey) { - *out = *in - out.SecretRef = in.SecretRef -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SigningKey. -func (in *SigningKey) DeepCopy() *SigningKey { - if in == nil { - return nil - } - out := new(SigningKey) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SourceReference) DeepCopyInto(out *SourceReference) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceReference. -func (in *SourceReference) DeepCopy() *SourceReference { - if in == nil { - return nil - } - out := new(SourceReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UpdateStrategy) DeepCopyInto(out *UpdateStrategy) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateStrategy. -func (in *UpdateStrategy) DeepCopy() *UpdateStrategy { - if in == nil { - return nil - } - out := new(UpdateStrategy) - in.DeepCopyInto(out) - return out -} diff --git a/config/crd/bases/image.toolkit.fluxcd.io_imageupdateautomations.yaml b/config/crd/bases/image.toolkit.fluxcd.io_imageupdateautomations.yaml index dfa82ec9..18c4c000 100644 --- a/config/crd/bases/image.toolkit.fluxcd.io_imageupdateautomations.yaml +++ b/config/crd/bases/image.toolkit.fluxcd.io_imageupdateautomations.yaml @@ -15,508 +15,6 @@ spec: singular: imageupdateautomation scope: Namespaced versions: - - additionalPrinterColumns: - - jsonPath: .status.lastAutomationRunTime - name: Last run - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - description: ImageUpdateAutomation is the Schema for the imageupdateautomations - API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: ImageUpdateAutomationSpec defines the desired state of ImageUpdateAutomation - properties: - checkout: - description: Checkout gives the parameters for cloning the git repository, - ready to make changes. - properties: - branch: - description: Branch gives the branch to clone from the git repository. - If `.spec.push` is not supplied, commits will also be pushed - to this branch. - type: string - gitRepositoryRef: - description: GitRepositoryRef refers to the resource giving access - details to a git repository to update files in. - properties: - name: - description: Name of the referent. - type: string - required: - - name - type: object - required: - - branch - - gitRepositoryRef - type: object - commit: - description: Commit specifies how to commit to the git repository. - properties: - authorEmail: - description: AuthorEmail gives the email to provide when making - a commit - type: string - authorName: - description: AuthorName gives the name to provide when making - a commit - type: string - messageTemplate: - description: MessageTemplate provides a template for the commit - message, into which will be interpolated the details of the - change made. - type: string - signingKey: - description: SigningKey provides the option to sign commits with - a GPG key - properties: - secretRef: - description: SecretRef holds the name to a secret that contains - a 'git.asc' key corresponding to the ASCII Armored file - containing the GPG signing keypair as the value. It must - be in the same namespace as the ImageUpdateAutomation. - properties: - name: - description: Name of the referent. - type: string - required: - - name - type: object - type: object - required: - - authorEmail - - authorName - type: object - interval: - description: Interval gives an lower bound for how often the automation - run should be attempted. - type: string - push: - description: Push specifies how and where to push commits made by - the automation. If missing, commits are pushed (back) to `.spec.checkout.branch`. - properties: - branch: - description: Branch specifies that commits should be pushed to - the branch named. The branch is created using `.spec.checkout.branch` - as the starting point, if it doesn't already exist. - type: string - required: - - branch - type: object - suspend: - description: Suspend tells the controller to not run this automation, - until it is unset (or set to false). Defaults to false. - type: boolean - update: - default: - strategy: Setters - description: Update gives the specification for how to update the - files in the repository. This can be left empty, to use the default - value. - properties: - path: - description: Path to the directory containing the manifests to - be updated. Defaults to 'None', which translates to the root - path of the GitRepositoryRef. - type: string - strategy: - default: Setters - description: Strategy names the strategy to be used. - enum: - - Setters - type: string - required: - - strategy - type: object - required: - - checkout - - commit - - interval - type: object - status: - description: ImageUpdateAutomationStatus defines the observed state of - ImageUpdateAutomation - properties: - conditions: - items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - lastAutomationRunTime: - description: LastAutomationRunTime records the last time the controller - ran this automation through to completion (even if no updates were - made). - format: date-time - type: string - lastHandledReconcileAt: - description: LastHandledReconcileAt holds the value of the most recent - reconcile request value, so a change of the annotation value can - be detected. - type: string - lastPushCommit: - description: LastPushCommit records the SHA1 of the last commit made - by the controller, for this automation object - type: string - lastPushTime: - description: LastPushTime records the time of the last pushed change. - format: date-time - type: string - observedGeneration: - format: int64 - type: integer - type: object - type: object - served: true - storage: false - subresources: - status: {} - - additionalPrinterColumns: - - jsonPath: .status.lastAutomationRunTime - name: Last run - type: string - name: v1alpha2 - schema: - openAPIV3Schema: - description: ImageUpdateAutomation is the Schema for the imageupdateautomations - API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: ImageUpdateAutomationSpec defines the desired state of ImageUpdateAutomation - properties: - git: - description: GitSpec contains all the git-specific definitions. This - is technically optional, but in practice mandatory until there are - other kinds of source allowed. - properties: - checkout: - description: Checkout gives the parameters for cloning the git - repository, ready to make changes. If not present, the `spec.ref` - field from the referenced `GitRepository` or its default will - be used. - properties: - ref: - description: Reference gives a branch, tag or commit to clone - from the Git repository. - properties: - branch: - description: The Git branch to checkout, defaults to master. - type: string - commit: - description: The Git commit SHA to checkout, if specified - Tag filters will be ignored. - type: string - semver: - description: The Git tag semver expression, takes precedence - over Tag. - type: string - tag: - description: The Git tag to checkout, takes precedence - over Branch. - type: string - type: object - required: - - ref - type: object - commit: - description: Commit specifies how to commit to the git repository. - properties: - author: - description: Author gives the email and optionally the name - to use as the author of commits. - properties: - email: - description: Email gives the email to provide when making - a commit. - type: string - name: - description: Name gives the name to provide when making - a commit. - type: string - required: - - email - type: object - messageTemplate: - description: MessageTemplate provides a template for the commit - message, into which will be interpolated the details of - the change made. - type: string - signingKey: - description: SigningKey provides the option to sign commits - with a GPG key - properties: - secretRef: - description: SecretRef holds the name to a secret that - contains a 'git.asc' key corresponding to the ASCII - Armored file containing the GPG signing keypair as the - value. It must be in the same namespace as the ImageUpdateAutomation. - properties: - name: - description: Name of the referent. - type: string - required: - - name - type: object - type: object - required: - - author - type: object - push: - description: Push specifies how and where to push commits made - by the automation. If missing, commits are pushed (back) to - `.spec.checkout.branch` or its default. - properties: - branch: - description: Branch specifies that commits should be pushed - to the branch named. The branch is created using `.spec.checkout.branch` - as the starting point, if it doesn't already exist. - type: string - required: - - branch - type: object - required: - - commit - type: object - interval: - description: Interval gives an lower bound for how often the automation - run should be attempted. - type: string - sourceRef: - description: SourceRef refers to the resource giving access details - to a git repository. - properties: - apiVersion: - description: API version of the referent - type: string - kind: - default: GitRepository - description: Kind of the referent - enum: - - GitRepository - type: string - name: - description: Name of the referent - type: string - required: - - kind - - name - type: object - suspend: - description: Suspend tells the controller to not run this automation, - until it is unset (or set to false). Defaults to false. - type: boolean - update: - default: - strategy: Setters - description: Update gives the specification for how to update the - files in the repository. This can be left empty, to use the default - value. - properties: - path: - description: Path to the directory containing the manifests to - be updated. Defaults to 'None', which translates to the root - path of the GitRepositoryRef. - type: string - strategy: - default: Setters - description: Strategy names the strategy to be used. - enum: - - Setters - type: string - required: - - strategy - type: object - required: - - interval - - sourceRef - type: object - status: - description: ImageUpdateAutomationStatus defines the observed state of - ImageUpdateAutomation - properties: - conditions: - items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - lastAutomationRunTime: - description: LastAutomationRunTime records the last time the controller - ran this automation through to completion (even if no updates were - made). - format: date-time - type: string - lastHandledReconcileAt: - description: LastHandledReconcileAt holds the value of the most recent - reconcile request value, so a change of the annotation value can - be detected. - type: string - lastPushCommit: - description: LastPushCommit records the SHA1 of the last commit made - by the controller, for this automation object - type: string - lastPushTime: - description: LastPushTime records the time of the last pushed change. - format: date-time - type: string - observedGeneration: - format: int64 - type: integer - type: object - type: object - served: true - storage: false - subresources: - status: {} - additionalPrinterColumns: - jsonPath: .status.lastAutomationRunTime name: Last run diff --git a/config/samples/image_v1alpha1_imageupdateautomation.yaml b/config/samples/image_v1alpha1_imageupdateautomation.yaml deleted file mode 100644 index 2fffe97c..00000000 --- a/config/samples/image_v1alpha1_imageupdateautomation.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: image.toolkit.fluxcd.io/v1alpha1 -kind: ImageUpdateAutomation -metadata: - name: imageupdateautomation-sample -spec: - checkout: - gitRepositoryRef: - name: app-repo - branch: main - interval: 5m - # update strategy is left to default to "Setters" - commit: - authorName: Fluxbot - authorEmail: fluxbot@example.com