diff --git a/api/unversioned/certificatestore_types.go b/api/unversioned/certificatestore_types.go deleted file mode 100644 index ccacd14b0..000000000 --- a/api/unversioned/certificatestore_types.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright The Ratify 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. -*/ - -// +kubebuilder:skip -package unversioned - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// CertificateStoreSpec defines the desired state of CertificateStore -type CertificateStoreSpec struct { - // Important: Run "make" to regenerate code after modifying this file - - // Name of the certificate store provider - Provider string `json:"provider,omitempty"` - - // Parameters of the certificate store - Parameters runtime.RawExtension `json:"parameters,omitempty"` -} - -type CertificateStoreStatus struct { - // Important: Run "make manifests" to regenerate code after modifying this file - // Is successful in loading certificate files - IsSuccess bool `json:"issuccess"` - // Error message if operation was unsuccessful - // +optional - Error string `json:"error,omitempty"` - // Truncated error message if the message is too long - // +optional - BriefError string `json:"brieferror,omitempty"` - // The time stamp of last successful certificates fetch operation. If operation failed, last fetched time shows the time of error - // +optional - LastFetchedTime *metav1.Time `json:"lastfetchedtime,omitempty"` - // provider specific properties of the each individual certificate - // +optional - Properties runtime.RawExtension `json:"properties,omitempty"` -} - -// CertificateStore is the Schema for the certificatestores API -type CertificateStore struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec CertificateStoreSpec `json:"spec,omitempty"` - Status CertificateStoreStatus `json:"status,omitempty"` -} - -// CertificateStoreList contains a list of CertificateStore -type CertificateStoreList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []CertificateStore `json:"items"` -} diff --git a/api/unversioned/policy_types.go b/api/unversioned/policy_types.go deleted file mode 100644 index 345d4aff9..000000000 --- a/api/unversioned/policy_types.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright The Ratify 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 unversioned - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// PolicySpec defines the desired state of Policy -type PolicySpec struct { - // Important: Run "make" to regenerate code after modifying this file - - // Type of the policy - Type string `json:"type,omitempty"` - // Parameters for this policy - Parameters runtime.RawExtension `json:"parameters,omitempty"` -} - -// PolicyStatus defines the observed state of Policy -type PolicyStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // Is successful while applying the policy. - IsSuccess bool `json:"issuccess"` - // Error message if policy is not successfully applied. - // +optional - Error string `json:"error,omitempty"` - // Truncated error message if the message is too long - // +optional - BriefError string `json:"brieferror,omitempty"` -} - -// Policy is the Schema for the policies API -type Policy struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec PolicySpec `json:"spec,omitempty"` - Status PolicyStatus `json:"status,omitempty"` -} - -// PolicyList contains a list of Policy -type PolicyList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Policy `json:"items"` -} diff --git a/api/unversioned/store_types.go b/api/unversioned/store_types.go deleted file mode 100644 index 52971dd52..000000000 --- a/api/unversioned/store_types.go +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright The Ratify 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. -*/ - -// +kubebuilder:skip -package unversioned - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// StoreSpec defines the desired state of Store -type StoreSpec struct { - // Important: Run "make" to regenerate code after modifying this file - - // Name of the store - Name string `json:"name,omitempty"` - // Plugin path, optional - Address string `json:"address,omitempty"` - // OCI Artifact source to download the plugin from, optional - Source *PluginSource `json:"source,omitempty"` - - // Parameters of the store - Parameters runtime.RawExtension `json:"parameters,omitempty"` -} - -// StoreStatus defines the observed state of Store -type StoreStatus struct { - // Important: Run "make" to regenerate code after modifying this file -} - -// Store is the Schema for the stores API -type Store struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec StoreSpec `json:"spec,omitempty"` - Status StoreStatus `json:"status,omitempty"` -} - -// StoreList contains a list of Store -type StoreList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Store `json:"items"` -} diff --git a/api/unversioned/verifier_types.go b/api/unversioned/verifier_types.go deleted file mode 100644 index e55925712..000000000 --- a/api/unversioned/verifier_types.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright The Ratify 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. -*/ - -// +kubebuilder:skip -package unversioned - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// VerifierSpec defines the desired state of Verifier -type VerifierSpec struct { - // Important: Run "make" to regenerate code after modifying this file - - // Name of the verifier - Name string `json:"name,omitempty"` - - // The type of artifact this verifier handles - ArtifactTypes string `json:"artifactTypes,omitempty"` - - // # Optional. URL/file path - Address string `json:"address,omitempty"` - - // OCI Artifact source to download the plugin from, optional - Source *PluginSource `json:"source,omitempty"` - - // Parameters for this verifier - Parameters runtime.RawExtension `json:"parameters,omitempty"` -} - -// VerifierStatus defines the observed state of Verifier -type VerifierStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file -} - -// Verifier is the Schema for the verifiers API -type Verifier struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec VerifierSpec `json:"spec,omitempty"` - Status VerifierStatus `json:"status,omitempty"` -} - -// VerifierList contains a list of Verifier -type VerifierList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Verifier `json:"items"` -} diff --git a/api/unversioned/zz_generated.deepcopy.go b/api/unversioned/zz_generated.deepcopy.go deleted file mode 100644 index 6ac10b4f5..000000000 --- a/api/unversioned/zz_generated.deepcopy.go +++ /dev/null @@ -1,351 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Ratify 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 unversioned - -import () - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertificateStore) DeepCopyInto(out *CertificateStore) { - *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 CertificateStore. -func (in *CertificateStore) DeepCopy() *CertificateStore { - if in == nil { - return nil - } - out := new(CertificateStore) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertificateStoreList) DeepCopyInto(out *CertificateStoreList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]CertificateStore, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateStoreList. -func (in *CertificateStoreList) DeepCopy() *CertificateStoreList { - if in == nil { - return nil - } - out := new(CertificateStoreList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertificateStoreSpec) DeepCopyInto(out *CertificateStoreSpec) { - *out = *in - in.Parameters.DeepCopyInto(&out.Parameters) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateStoreSpec. -func (in *CertificateStoreSpec) DeepCopy() *CertificateStoreSpec { - if in == nil { - return nil - } - out := new(CertificateStoreSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertificateStoreStatus) DeepCopyInto(out *CertificateStoreStatus) { - *out = *in - if in.LastFetchedTime != nil { - in, out := &in.LastFetchedTime, &out.LastFetchedTime - *out = (*in).DeepCopy() - } - in.Properties.DeepCopyInto(&out.Properties) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertificateStoreStatus. -func (in *CertificateStoreStatus) DeepCopy() *CertificateStoreStatus { - if in == nil { - return nil - } - out := new(CertificateStoreStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PluginSource) DeepCopyInto(out *PluginSource) { - *out = *in - in.AuthProvider.DeepCopyInto(&out.AuthProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PluginSource. -func (in *PluginSource) DeepCopy() *PluginSource { - if in == nil { - return nil - } - out := new(PluginSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Policy) DeepCopyInto(out *Policy) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy. -func (in *Policy) DeepCopy() *Policy { - if in == nil { - return nil - } - out := new(Policy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PolicyList) DeepCopyInto(out *PolicyList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Policy, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyList. -func (in *PolicyList) DeepCopy() *PolicyList { - if in == nil { - return nil - } - out := new(PolicyList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PolicySpec) DeepCopyInto(out *PolicySpec) { - *out = *in - in.Parameters.DeepCopyInto(&out.Parameters) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicySpec. -func (in *PolicySpec) DeepCopy() *PolicySpec { - if in == nil { - return nil - } - out := new(PolicySpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PolicyStatus) DeepCopyInto(out *PolicyStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyStatus. -func (in *PolicyStatus) DeepCopy() *PolicyStatus { - if in == nil { - return nil - } - out := new(PolicyStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Store) DeepCopyInto(out *Store) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Store. -func (in *Store) DeepCopy() *Store { - if in == nil { - return nil - } - out := new(Store) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StoreList) DeepCopyInto(out *StoreList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Store, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoreList. -func (in *StoreList) DeepCopy() *StoreList { - if in == nil { - return nil - } - out := new(StoreList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StoreSpec) DeepCopyInto(out *StoreSpec) { - *out = *in - if in.Source != nil { - in, out := &in.Source, &out.Source - *out = new(PluginSource) - (*in).DeepCopyInto(*out) - } - in.Parameters.DeepCopyInto(&out.Parameters) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoreSpec. -func (in *StoreSpec) DeepCopy() *StoreSpec { - if in == nil { - return nil - } - out := new(StoreSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StoreStatus) DeepCopyInto(out *StoreStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoreStatus. -func (in *StoreStatus) DeepCopy() *StoreStatus { - if in == nil { - return nil - } - out := new(StoreStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Verifier) DeepCopyInto(out *Verifier) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Verifier. -func (in *Verifier) DeepCopy() *Verifier { - if in == nil { - return nil - } - out := new(Verifier) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VerifierList) DeepCopyInto(out *VerifierList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Verifier, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VerifierList. -func (in *VerifierList) DeepCopy() *VerifierList { - if in == nil { - return nil - } - out := new(VerifierList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VerifierSpec) DeepCopyInto(out *VerifierSpec) { - *out = *in - if in.Source != nil { - in, out := &in.Source, &out.Source - *out = new(PluginSource) - (*in).DeepCopyInto(*out) - } - in.Parameters.DeepCopyInto(&out.Parameters) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VerifierSpec. -func (in *VerifierSpec) DeepCopy() *VerifierSpec { - if in == nil { - return nil - } - out := new(VerifierSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *VerifierStatus) DeepCopyInto(out *VerifierStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VerifierStatus. -func (in *VerifierStatus) DeepCopy() *VerifierStatus { - if in == nil { - return nil - } - out := new(VerifierStatus) - in.DeepCopyInto(out) - return out -} diff --git a/api/v1alpha1/certificatestore_conversion.go b/api/v1alpha1/certificatestore_conversion.go index 8fc433a24..755d0b465 100644 --- a/api/v1alpha1/certificatestore_conversion.go +++ b/api/v1alpha1/certificatestore_conversion.go @@ -17,11 +17,36 @@ limitations under the License. package v1alpha1 import ( - unversioned "github.com/deislabs/ratify/api/unversioned" - conversion "k8s.io/apimachinery/pkg/conversion" + v1beta1 "github.com/deislabs/ratify/api/v1beta1" + apiconversion "k8s.io/apimachinery/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// Convert_unversioned_CertificateStoreStatus_To_v1alpha1_CertificateStoreStatus is an autogenerated conversion function. -func Convert_unversioned_CertificateStoreStatus_To_v1alpha1_CertificateStoreStatus(in *unversioned.CertificateStoreStatus, out *CertificateStoreStatus, s conversion.Scope) error { //nolint:revive // ignore linter for autogenerated code +// ConvertFrom converts from the Hub version(v1beta1) to this version. +// nolint:revive +func (dst *CertificateStore) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.CertificateStore) + + return Convert_v1beta1_CertificateStore_To_v1alpha1_CertificateStore(src, dst, nil) +} + +// ConvertTo converts this version to the Hub version(v1beta1). +// nolint:revive +func (src *CertificateStore) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.CertificateStore) + + return Convert_v1alpha1_CertificateStore_To_v1beta1_CertificateStore(src, dst, nil) +} + +// Overwrite the generated conversion function. +func Convert_v1beta1_CertificateStoreStatus_To_v1alpha1_CertificateStoreStatus(in *v1beta1.CertificateStoreStatus, out *CertificateStoreStatus, s apiconversion.Scope) error { return nil } + + +// Overwrite the generated conversion function. +// nolint:revive +func Convert_v1alpha1_CertificateStoreStatus_To_v1beta1_CertificateStoreStatus(in *CertificateStoreStatus, out *v1beta1.CertificateStoreStatus, s apiconversion.Scope) error { + out.Error = "warning: converted from v1alpha1" + return autoConvert_v1alpha1_CertificateStoreStatus_To_v1beta1_CertificateStoreStatus(in, out, s) +} \ No newline at end of file diff --git a/api/unversioned/common.go b/api/v1alpha1/certificatestore_webhook.go similarity index 50% rename from api/unversioned/common.go rename to api/v1alpha1/certificatestore_webhook.go index 00e302470..3be294b39 100644 --- a/api/unversioned/common.go +++ b/api/v1alpha1/certificatestore_webhook.go @@ -14,18 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -package unversioned +package v1alpha1 -import runtime "k8s.io/apimachinery/pkg/runtime" +import ctrl "sigs.k8s.io/controller-runtime" -// PluginSource defines the fields needed to download a plugin from an OCI Artifact source -type PluginSource struct { - // Important: Run "make" to regenerate code after modifying this file - - // OCI Artifact source to download the plugin from - Artifact string `json:"artifact,omitempty"` - - // +kubebuilder:pruning:PreserveUnknownFields - // AuthProvider to use to authenticate to the OCI Artifact source, optional - AuthProvider runtime.RawExtension `json:"authProvider,omitempty"` +func (c *CertificateStore) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr).For(c).Complete() } diff --git a/api/v1alpha1/doc.go b/api/v1alpha1/doc.go index 5f12afe87..bcf77688e 100644 --- a/api/v1alpha1/doc.go +++ b/api/v1alpha1/doc.go @@ -14,5 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:conversion-gen=github.com/deislabs/ratify/api/unversioned +// +k8s:conversion-gen=github.com/deislabs/ratify/api/v1beta1 package v1alpha1 diff --git a/api/v1alpha1/groupversion_info.go b/api/v1alpha1/groupversion_info.go index 008b6025f..f26c4468d 100644 --- a/api/v1alpha1/groupversion_info.go +++ b/api/v1alpha1/groupversion_info.go @@ -20,7 +20,6 @@ limitations under the License. package v1alpha1 import ( - runtime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "sigs.k8s.io/controller-runtime/pkg/scheme" ) @@ -35,5 +34,5 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme - localSchemeBuilder = runtime.NewSchemeBuilder(SchemeBuilder.AddToScheme) + localSchemeBuilder = SchemeBuilder.SchemeBuilder ) diff --git a/api/v1alpha1/policy_conversion.go b/api/v1alpha1/policy_conversion.go index b67653eb4..de44f94f0 100644 --- a/api/v1alpha1/policy_conversion.go +++ b/api/v1alpha1/policy_conversion.go @@ -17,50 +17,81 @@ limitations under the License. package v1alpha1 import ( - unversioned "github.com/deislabs/ratify/api/unversioned" - "github.com/deislabs/ratify/internal/constants" - conversion "k8s.io/apimachinery/pkg/conversion" + v1beta1 "github.com/deislabs/ratify/api/v1beta1" + "github.com/sirupsen/logrus" + apiconversion "k8s.io/apimachinery/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// Convert unversioned PolicySpec to PolicySpec of v1alpha1. -// -//nolint:revive // ignore linter for autogenerated code -func Convert_unversioned_PolicySpec_To_v1alpha1_PolicySpec(in *unversioned.PolicySpec, out *PolicySpec, _ conversion.Scope) error { - out.Parameters = in.Parameters - return nil +// ConvertFrom converts from the Hub version(v1beta1) to this version. +// nolint:revive +func (dst *Policy) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.Policy) + + return Convert_v1beta1_Policy_To_v1alpha1_Policy(src, dst, nil) } -// Convert unversioned PolicyStatus to PolicyStatus of v1alpha1. -// -//nolint:revive // ignore linter for autogenerated code -func Convert_unversioned_PolicyStatus_To_v1alpha1_PolicyStatus(in *unversioned.PolicyStatus, out *PolicyStatus, _ conversion.Scope) error { - return nil +// ConvertTo converts this version to the Hub version(v1beta1). +// nolint:revive +func (src *Policy) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.Policy) + + return Convert_v1alpha1_Policy_To_v1beta1_Policy(src, dst, nil) } // Convert unversioned Policy to Policy of v1alpha1. // //nolint:revive // ignore linter for autogenerated code -func Convert_unversioned_Policy_To_v1alpha1_Policy(in *unversioned.Policy, out *Policy, s conversion.Scope) error { +func Convert_v1beta1_Policy_To_v1alpha1_Policy(in *v1beta1.Policy, out *Policy, s apiconversion.Scope) error { out.ObjectMeta = in.ObjectMeta - // metadata.name in v1alpha1 is same as spec.type in unversioned. - out.ObjectMeta.Name = in.Spec.Type - if err := Convert_unversioned_PolicySpec_To_v1alpha1_PolicySpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_PolicySpec_To_v1alpha1_PolicySpec(&in.Spec, &out.Spec, s); err != nil { return err } - return Convert_unversioned_PolicyStatus_To_v1alpha1_PolicyStatus(&in.Status, &out.Status, s) + return Convert_v1beta1_PolicyStatus_To_v1alpha1_PolicyStatus(&in.Status, &out.Status, s) } -// Convert Policy of v1alpha1 to unversioned Policy. +// Overwrite generated conversion function. // -//nolint:revive // ignore linter for autogenerated code -func Convert_v1alpha1_Policy_To_unversioned_Policy(in *Policy, out *unversioned.Policy, s conversion.Scope) error { +//nolint:revive +func Convert_v1beta1_PolicySpec_To_v1alpha1_PolicySpec(in *v1beta1.PolicySpec, out *PolicySpec, s apiconversion.Scope) error { + out.Parameters = in.Parameters + return nil +} + +// Overwrite generated conversion function. +// +//nolint:revive +func Convert_v1beta1_PolicyStatus_To_v1alpha1_PolicyStatus(in *v1beta1.PolicyStatus, out *PolicyStatus, s apiconversion.Scope) error { + return autoConvert_v1beta1_PolicyStatus_To_v1alpha1_PolicyStatus(in, out, s) +} + +// Convert Policy of v1alpha1 to v1beta1 Policy. +// +//nolint:revive +func Convert_v1alpha1_Policy_To_v1beta1_Policy(in *Policy, out *v1beta1.Policy, s apiconversion.Scope) error { out.ObjectMeta = in.ObjectMeta - // metadata.name MUST be `ratify-policy` in unversioned. - out.ObjectMeta.Name = constants.RatifyPolicy - if err := Convert_v1alpha1_PolicySpec_To_unversioned_PolicySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } // spec.type in unversioned is same as metadata.name in v1alpha1. out.Spec.Type = in.ObjectMeta.Name - return Convert_v1alpha1_PolicyStatus_To_unversioned_PolicyStatus(&in.Status, &out.Status, s) + + if err := Convert_v1alpha1_PolicySpec_To_v1beta1_PolicySpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + + return Convert_v1alpha1_PolicyStatus_To_v1beta1_PolicyStatus(&in.Status, &out.Status, s) +} + +// Overwrite generated conversion function. +// +//nolint:revive +func Convert_v1alpha1_PolicySpec_To_v1beta1_PolicySpec(in *PolicySpec, out *v1beta1.PolicySpec, s apiconversion.Scope) error { + return autoConvert_v1alpha1_PolicySpec_To_v1beta1_PolicySpec(in, out, s) +} + +// Overwrite generated conversion function. +// +//nolint:revive +func Convert_v1alpha1_PolicyStatus_To_v1beta1_PolicyStatus(in *PolicyStatus, out *v1beta1.PolicyStatus, s apiconversion.Scope) error { + out.Error = "warning: converted from v1alpha1" + logrus.Info("Policy Warning: converted from v1alpha1") + return autoConvert_v1alpha1_PolicyStatus_To_v1beta1_PolicyStatus(in, out, s) } diff --git a/api/v1alpha1/policy_conversion_test.go b/api/v1alpha1/policy_conversion_test.go index 862e16c63..54a676b35 100644 --- a/api/v1alpha1/policy_conversion_test.go +++ b/api/v1alpha1/policy_conversion_test.go @@ -17,12 +17,6 @@ limitations under the License. package v1alpha1 import ( - "reflect" - "testing" - - unversioned "github.com/deislabs/ratify/api/unversioned" - "github.com/deislabs/ratify/internal/constants" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -30,54 +24,54 @@ var params = runtime.RawExtension{} const testPolicyType = "testPolicyType" -func TestConvert_unversioned_PolicySpec_To_v1alpha1_PolicySpec(t *testing.T) { - in := &unversioned.PolicySpec{ - Parameters: params, - } - out := &PolicySpec{} - if err := Convert_unversioned_PolicySpec_To_v1alpha1_PolicySpec(in, out, nil); err != nil { - t.Fatalf("unexpected error: %v", err) - } - if !reflect.DeepEqual(out.Parameters, in.Parameters) { - t.Fatalf("expect parameters to be equal, but got different values") - } -} +// func TestConvert_unversioned_PolicySpec_To_v1alpha1_PolicySpec(t *testing.T) { +// in := &unversioned.PolicySpec{ +// Parameters: params, +// } +// out := &PolicySpec{} +// if err := Convert_unversioned_PolicySpec_To_v1alpha1_PolicySpec(in, out, nil); err != nil { +// t.Fatalf("unexpected error: %v", err) +// } +// if !reflect.DeepEqual(out.Parameters, in.Parameters) { +// t.Fatalf("expect parameters to be equal, but got different values") +// } +// } -func TestConvert_unversioned_PolicyStatus_To_v1alpha1_PolicyStatus(t *testing.T) { - if err := Convert_unversioned_PolicyStatus_To_v1alpha1_PolicyStatus(nil, nil, nil); err != nil { - t.Fatalf("unexpected error: %v", err) - } -} +// func TestConvert_unversioned_PolicyStatus_To_v1alpha1_PolicyStatus(t *testing.T) { +// if err := Convert_unversioned_PolicyStatus_To_v1alpha1_PolicyStatus(nil, nil, nil); err != nil { +// t.Fatalf("unexpected error: %v", err) +// } +// } -func TestConvert_unversioned_Policy_To_v1alpha1_Policy(t *testing.T) { - in := &unversioned.Policy{ - Spec: unversioned.PolicySpec{ - Type: testPolicyType, - }, - } - out := &Policy{} - if err := Convert_unversioned_Policy_To_v1alpha1_Policy(in, out, nil); err != nil { - t.Fatalf("unexpected error: %v", err) - } - if out.ObjectMeta.Name != in.Spec.Type { - t.Fatalf("expect metadata.name to be %s, but got %s", in.Spec.Type, out.ObjectMeta.Name) - } -} +// func TestConvert_unversioned_Policy_To_v1alpha1_Policy(t *testing.T) { +// in := &unversioned.Policy{ +// Spec: unversioned.PolicySpec{ +// Type: testPolicyType, +// }, +// } +// out := &Policy{} +// if err := Convert_unversioned_Policy_To_v1alpha1_Policy(in, out, nil); err != nil { +// t.Fatalf("unexpected error: %v", err) +// } +// if out.ObjectMeta.Name != in.Spec.Type { +// t.Fatalf("expect metadata.name to be %s, but got %s", in.Spec.Type, out.ObjectMeta.Name) +// } +// } -func TestConvert_v1alpha1_Policy_To_unversioned_Policy(t *testing.T) { - in := &Policy{ - ObjectMeta: metav1.ObjectMeta{ - Name: testPolicyType, - }, - } - out := &unversioned.Policy{} - if err := Convert_v1alpha1_Policy_To_unversioned_Policy(in, out, nil); err != nil { - t.Fatalf("unexpected error: %v", err) - } - if out.ObjectMeta.Name != constants.RatifyPolicy { - t.Fatalf("expect metadata.name to be %s, but got %s", constants.RatifyPolicy, out.ObjectMeta.Name) - } - if out.Spec.Type != in.ObjectMeta.Name { - t.Fatalf("expect spec.type to be %s, but got %s", in.ObjectMeta.Name, out.Spec.Type) - } -} +// func TestConvert_v1alpha1_Policy_To_unversioned_Policy(t *testing.T) { +// in := &Policy{ +// ObjectMeta: metav1.ObjectMeta{ +// Name: testPolicyType, +// }, +// } +// out := &unversioned.Policy{} +// if err := Convert_v1alpha1_Policy_To_unversioned_Policy(in, out, nil); err != nil { +// t.Fatalf("unexpected error: %v", err) +// } +// if out.ObjectMeta.Name != constants.RatifyPolicy { +// t.Fatalf("expect metadata.name to be %s, but got %s", constants.RatifyPolicy, out.ObjectMeta.Name) +// } +// if out.Spec.Type != in.ObjectMeta.Name { +// t.Fatalf("expect spec.type to be %s, but got %s", in.ObjectMeta.Name, out.Spec.Type) +// } +// } diff --git a/api/v1alpha1/policy_webhook.go b/api/v1alpha1/policy_webhook.go new file mode 100644 index 000000000..ea48a0fc7 --- /dev/null +++ b/api/v1alpha1/policy_webhook.go @@ -0,0 +1,25 @@ +/* +Copyright The Ratify 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 ctrl "sigs.k8s.io/controller-runtime" + +func (r *Policy) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} diff --git a/api/v1alpha1/store_conversion.go b/api/v1alpha1/store_conversion.go new file mode 100644 index 000000000..3edad239d --- /dev/null +++ b/api/v1alpha1/store_conversion.go @@ -0,0 +1,38 @@ +/* +Copyright The Ratify 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 ( + v1beta1 "github.com/deislabs/ratify/api/v1beta1" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +// ConvertFrom converts from the Hub version(v1beta1) to this version. +// nolint:revive +func (dst *Store) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.Store) + + return Convert_v1beta1_Store_To_v1alpha1_Store(src, dst, nil) +} + +// ConvertTo converts this version to the Hub version(v1beta1). +// nolint:revive +func (src *Store) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.Store) + + return Convert_v1alpha1_Store_To_v1beta1_Store(src, dst, nil) +} \ No newline at end of file diff --git a/api/v1alpha1/store_webhook.go b/api/v1alpha1/store_webhook.go new file mode 100644 index 000000000..ecc05ea95 --- /dev/null +++ b/api/v1alpha1/store_webhook.go @@ -0,0 +1,25 @@ +/* +Copyright The Ratify 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 ctrl "sigs.k8s.io/controller-runtime" + +func (r *Store) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} \ No newline at end of file diff --git a/api/v1alpha1/verifier_conversion.go b/api/v1alpha1/verifier_conversion.go new file mode 100644 index 000000000..7fccd829c --- /dev/null +++ b/api/v1alpha1/verifier_conversion.go @@ -0,0 +1,38 @@ +/* +Copyright The Ratify 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 ( + v1beta1 "github.com/deislabs/ratify/api/v1beta1" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +// ConvertFrom converts from the Hub version(v1beta1) to this version. +// nolint:revive +func (dst *Verifier) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.Verifier) + + return Convert_v1beta1_Verifier_To_v1alpha1_Verifier(src, dst, nil) +} + +// ConvertTo converts this version to the Hub version(v1beta1). +// nolint:revive +func (src *Verifier) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.Verifier) + + return Convert_v1alpha1_Verifier_To_v1beta1_Verifier(src, dst, nil) +} \ No newline at end of file diff --git a/api/v1alpha1/verifier_webhook.go b/api/v1alpha1/verifier_webhook.go new file mode 100644 index 000000000..e3018501b --- /dev/null +++ b/api/v1alpha1/verifier_webhook.go @@ -0,0 +1,25 @@ +/* +Copyright The Ratify 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 ctrl "sigs.k8s.io/controller-runtime" + +func (r *Verifier) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} \ No newline at end of file diff --git a/api/v1alpha1/zz_generated.conversion.go b/api/v1alpha1/zz_generated.conversion.go index 2e6fd0418..6b1a9f6e1 100644 --- a/api/v1alpha1/zz_generated.conversion.go +++ b/api/v1alpha1/zz_generated.conversion.go @@ -23,7 +23,7 @@ package v1alpha1 import ( unsafe "unsafe" - unversioned "github.com/deislabs/ratify/api/unversioned" + v1beta1 "github.com/deislabs/ratify/api/v1beta1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -35,218 +35,218 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*CertificateStore)(nil), (*unversioned.CertificateStore)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_CertificateStore_To_unversioned_CertificateStore(a.(*CertificateStore), b.(*unversioned.CertificateStore), scope) + if err := s.AddGeneratedConversionFunc((*CertificateStore)(nil), (*v1beta1.CertificateStore)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_CertificateStore_To_v1beta1_CertificateStore(a.(*CertificateStore), b.(*v1beta1.CertificateStore), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*unversioned.CertificateStore)(nil), (*CertificateStore)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_CertificateStore_To_v1alpha1_CertificateStore(a.(*unversioned.CertificateStore), b.(*CertificateStore), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.CertificateStore)(nil), (*CertificateStore)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_CertificateStore_To_v1alpha1_CertificateStore(a.(*v1beta1.CertificateStore), b.(*CertificateStore), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*CertificateStoreList)(nil), (*unversioned.CertificateStoreList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_CertificateStoreList_To_unversioned_CertificateStoreList(a.(*CertificateStoreList), b.(*unversioned.CertificateStoreList), scope) + if err := s.AddGeneratedConversionFunc((*CertificateStoreList)(nil), (*v1beta1.CertificateStoreList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_CertificateStoreList_To_v1beta1_CertificateStoreList(a.(*CertificateStoreList), b.(*v1beta1.CertificateStoreList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*unversioned.CertificateStoreList)(nil), (*CertificateStoreList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_CertificateStoreList_To_v1alpha1_CertificateStoreList(a.(*unversioned.CertificateStoreList), b.(*CertificateStoreList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.CertificateStoreList)(nil), (*CertificateStoreList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_CertificateStoreList_To_v1alpha1_CertificateStoreList(a.(*v1beta1.CertificateStoreList), b.(*CertificateStoreList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*CertificateStoreSpec)(nil), (*unversioned.CertificateStoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_CertificateStoreSpec_To_unversioned_CertificateStoreSpec(a.(*CertificateStoreSpec), b.(*unversioned.CertificateStoreSpec), scope) + if err := s.AddGeneratedConversionFunc((*CertificateStoreSpec)(nil), (*v1beta1.CertificateStoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_CertificateStoreSpec_To_v1beta1_CertificateStoreSpec(a.(*CertificateStoreSpec), b.(*v1beta1.CertificateStoreSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*unversioned.CertificateStoreSpec)(nil), (*CertificateStoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_CertificateStoreSpec_To_v1alpha1_CertificateStoreSpec(a.(*unversioned.CertificateStoreSpec), b.(*CertificateStoreSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.CertificateStoreSpec)(nil), (*CertificateStoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_CertificateStoreSpec_To_v1alpha1_CertificateStoreSpec(a.(*v1beta1.CertificateStoreSpec), b.(*CertificateStoreSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*CertificateStoreStatus)(nil), (*unversioned.CertificateStoreStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_CertificateStoreStatus_To_unversioned_CertificateStoreStatus(a.(*CertificateStoreStatus), b.(*unversioned.CertificateStoreStatus), scope) + if err := s.AddGeneratedConversionFunc((*PluginSource)(nil), (*v1beta1.PluginSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_PluginSource_To_v1beta1_PluginSource(a.(*PluginSource), b.(*v1beta1.PluginSource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*PluginSource)(nil), (*unversioned.PluginSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_PluginSource_To_unversioned_PluginSource(a.(*PluginSource), b.(*unversioned.PluginSource), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.PluginSource)(nil), (*PluginSource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_PluginSource_To_v1alpha1_PluginSource(a.(*v1beta1.PluginSource), b.(*PluginSource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*unversioned.PluginSource)(nil), (*PluginSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_PluginSource_To_v1alpha1_PluginSource(a.(*unversioned.PluginSource), b.(*PluginSource), scope) + if err := s.AddGeneratedConversionFunc((*PolicyList)(nil), (*v1beta1.PolicyList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_PolicyList_To_v1beta1_PolicyList(a.(*PolicyList), b.(*v1beta1.PolicyList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Policy)(nil), (*unversioned.Policy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Policy_To_unversioned_Policy(a.(*Policy), b.(*unversioned.Policy), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.PolicyList)(nil), (*PolicyList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_PolicyList_To_v1alpha1_PolicyList(a.(*v1beta1.PolicyList), b.(*PolicyList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*PolicyList)(nil), (*unversioned.PolicyList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_PolicyList_To_unversioned_PolicyList(a.(*PolicyList), b.(*unversioned.PolicyList), scope) + if err := s.AddGeneratedConversionFunc((*Store)(nil), (*v1beta1.Store)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_Store_To_v1beta1_Store(a.(*Store), b.(*v1beta1.Store), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*unversioned.PolicyList)(nil), (*PolicyList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_PolicyList_To_v1alpha1_PolicyList(a.(*unversioned.PolicyList), b.(*PolicyList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Store)(nil), (*Store)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Store_To_v1alpha1_Store(a.(*v1beta1.Store), b.(*Store), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*PolicySpec)(nil), (*unversioned.PolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_PolicySpec_To_unversioned_PolicySpec(a.(*PolicySpec), b.(*unversioned.PolicySpec), scope) + if err := s.AddGeneratedConversionFunc((*StoreList)(nil), (*v1beta1.StoreList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_StoreList_To_v1beta1_StoreList(a.(*StoreList), b.(*v1beta1.StoreList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*PolicyStatus)(nil), (*unversioned.PolicyStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_PolicyStatus_To_unversioned_PolicyStatus(a.(*PolicyStatus), b.(*unversioned.PolicyStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.StoreList)(nil), (*StoreList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_StoreList_To_v1alpha1_StoreList(a.(*v1beta1.StoreList), b.(*StoreList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Store)(nil), (*unversioned.Store)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Store_To_unversioned_Store(a.(*Store), b.(*unversioned.Store), scope) + if err := s.AddGeneratedConversionFunc((*StoreSpec)(nil), (*v1beta1.StoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_StoreSpec_To_v1beta1_StoreSpec(a.(*StoreSpec), b.(*v1beta1.StoreSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*unversioned.Store)(nil), (*Store)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_Store_To_v1alpha1_Store(a.(*unversioned.Store), b.(*Store), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.StoreSpec)(nil), (*StoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_StoreSpec_To_v1alpha1_StoreSpec(a.(*v1beta1.StoreSpec), b.(*StoreSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*StoreList)(nil), (*unversioned.StoreList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_StoreList_To_unversioned_StoreList(a.(*StoreList), b.(*unversioned.StoreList), scope) + if err := s.AddGeneratedConversionFunc((*StoreStatus)(nil), (*v1beta1.StoreStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_StoreStatus_To_v1beta1_StoreStatus(a.(*StoreStatus), b.(*v1beta1.StoreStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*unversioned.StoreList)(nil), (*StoreList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_StoreList_To_v1alpha1_StoreList(a.(*unversioned.StoreList), b.(*StoreList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.StoreStatus)(nil), (*StoreStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_StoreStatus_To_v1alpha1_StoreStatus(a.(*v1beta1.StoreStatus), b.(*StoreStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*StoreSpec)(nil), (*unversioned.StoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_StoreSpec_To_unversioned_StoreSpec(a.(*StoreSpec), b.(*unversioned.StoreSpec), scope) + if err := s.AddGeneratedConversionFunc((*Verifier)(nil), (*v1beta1.Verifier)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_Verifier_To_v1beta1_Verifier(a.(*Verifier), b.(*v1beta1.Verifier), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*unversioned.StoreSpec)(nil), (*StoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_StoreSpec_To_v1alpha1_StoreSpec(a.(*unversioned.StoreSpec), b.(*StoreSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Verifier)(nil), (*Verifier)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Verifier_To_v1alpha1_Verifier(a.(*v1beta1.Verifier), b.(*Verifier), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*StoreStatus)(nil), (*unversioned.StoreStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_StoreStatus_To_unversioned_StoreStatus(a.(*StoreStatus), b.(*unversioned.StoreStatus), scope) + if err := s.AddGeneratedConversionFunc((*VerifierList)(nil), (*v1beta1.VerifierList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VerifierList_To_v1beta1_VerifierList(a.(*VerifierList), b.(*v1beta1.VerifierList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*unversioned.StoreStatus)(nil), (*StoreStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_StoreStatus_To_v1alpha1_StoreStatus(a.(*unversioned.StoreStatus), b.(*StoreStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.VerifierList)(nil), (*VerifierList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_VerifierList_To_v1alpha1_VerifierList(a.(*v1beta1.VerifierList), b.(*VerifierList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Verifier)(nil), (*unversioned.Verifier)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Verifier_To_unversioned_Verifier(a.(*Verifier), b.(*unversioned.Verifier), scope) + if err := s.AddGeneratedConversionFunc((*VerifierSpec)(nil), (*v1beta1.VerifierSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VerifierSpec_To_v1beta1_VerifierSpec(a.(*VerifierSpec), b.(*v1beta1.VerifierSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*unversioned.Verifier)(nil), (*Verifier)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_Verifier_To_v1alpha1_Verifier(a.(*unversioned.Verifier), b.(*Verifier), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.VerifierSpec)(nil), (*VerifierSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_VerifierSpec_To_v1alpha1_VerifierSpec(a.(*v1beta1.VerifierSpec), b.(*VerifierSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VerifierList)(nil), (*unversioned.VerifierList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VerifierList_To_unversioned_VerifierList(a.(*VerifierList), b.(*unversioned.VerifierList), scope) + if err := s.AddGeneratedConversionFunc((*VerifierStatus)(nil), (*v1beta1.VerifierStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_VerifierStatus_To_v1beta1_VerifierStatus(a.(*VerifierStatus), b.(*v1beta1.VerifierStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*unversioned.VerifierList)(nil), (*VerifierList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_VerifierList_To_v1alpha1_VerifierList(a.(*unversioned.VerifierList), b.(*VerifierList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.VerifierStatus)(nil), (*VerifierStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_VerifierStatus_To_v1alpha1_VerifierStatus(a.(*v1beta1.VerifierStatus), b.(*VerifierStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VerifierSpec)(nil), (*unversioned.VerifierSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VerifierSpec_To_unversioned_VerifierSpec(a.(*VerifierSpec), b.(*unversioned.VerifierSpec), scope) + if err := s.AddConversionFunc((*CertificateStoreStatus)(nil), (*v1beta1.CertificateStoreStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_CertificateStoreStatus_To_v1beta1_CertificateStoreStatus(a.(*CertificateStoreStatus), b.(*v1beta1.CertificateStoreStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*unversioned.VerifierSpec)(nil), (*VerifierSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_VerifierSpec_To_v1alpha1_VerifierSpec(a.(*unversioned.VerifierSpec), b.(*VerifierSpec), scope) + if err := s.AddConversionFunc((*PolicySpec)(nil), (*v1beta1.PolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_PolicySpec_To_v1beta1_PolicySpec(a.(*PolicySpec), b.(*v1beta1.PolicySpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VerifierStatus)(nil), (*unversioned.VerifierStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_VerifierStatus_To_unversioned_VerifierStatus(a.(*VerifierStatus), b.(*unversioned.VerifierStatus), scope) + if err := s.AddConversionFunc((*PolicyStatus)(nil), (*v1beta1.PolicyStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_PolicyStatus_To_v1beta1_PolicyStatus(a.(*PolicyStatus), b.(*v1beta1.PolicyStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*unversioned.VerifierStatus)(nil), (*VerifierStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_VerifierStatus_To_v1alpha1_VerifierStatus(a.(*unversioned.VerifierStatus), b.(*VerifierStatus), scope) + if err := s.AddConversionFunc((*Policy)(nil), (*v1beta1.Policy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_Policy_To_v1beta1_Policy(a.(*Policy), b.(*v1beta1.Policy), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*unversioned.CertificateStoreStatus)(nil), (*CertificateStoreStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_CertificateStoreStatus_To_v1alpha1_CertificateStoreStatus(a.(*unversioned.CertificateStoreStatus), b.(*CertificateStoreStatus), scope) + if err := s.AddConversionFunc((*v1beta1.CertificateStoreStatus)(nil), (*CertificateStoreStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_CertificateStoreStatus_To_v1alpha1_CertificateStoreStatus(a.(*v1beta1.CertificateStoreStatus), b.(*CertificateStoreStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*unversioned.PolicySpec)(nil), (*PolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_PolicySpec_To_v1alpha1_PolicySpec(a.(*unversioned.PolicySpec), b.(*PolicySpec), scope) + if err := s.AddConversionFunc((*v1beta1.PolicySpec)(nil), (*PolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_PolicySpec_To_v1alpha1_PolicySpec(a.(*v1beta1.PolicySpec), b.(*PolicySpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*unversioned.PolicyStatus)(nil), (*PolicyStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_PolicyStatus_To_v1alpha1_PolicyStatus(a.(*unversioned.PolicyStatus), b.(*PolicyStatus), scope) + if err := s.AddConversionFunc((*v1beta1.PolicyStatus)(nil), (*PolicyStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_PolicyStatus_To_v1alpha1_PolicyStatus(a.(*v1beta1.PolicyStatus), b.(*PolicyStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*unversioned.Policy)(nil), (*Policy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_Policy_To_v1alpha1_Policy(a.(*unversioned.Policy), b.(*Policy), scope) + if err := s.AddConversionFunc((*v1beta1.Policy)(nil), (*Policy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Policy_To_v1alpha1_Policy(a.(*v1beta1.Policy), b.(*Policy), scope) }); err != nil { return err } return nil } -func autoConvert_v1alpha1_CertificateStore_To_unversioned_CertificateStore(in *CertificateStore, out *unversioned.CertificateStore, s conversion.Scope) error { +func autoConvert_v1alpha1_CertificateStore_To_v1beta1_CertificateStore(in *CertificateStore, out *v1beta1.CertificateStore, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_CertificateStoreSpec_To_unversioned_CertificateStoreSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha1_CertificateStoreSpec_To_v1beta1_CertificateStoreSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha1_CertificateStoreStatus_To_unversioned_CertificateStoreStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha1_CertificateStoreStatus_To_v1beta1_CertificateStoreStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha1_CertificateStore_To_unversioned_CertificateStore is an autogenerated conversion function. -func Convert_v1alpha1_CertificateStore_To_unversioned_CertificateStore(in *CertificateStore, out *unversioned.CertificateStore, s conversion.Scope) error { - return autoConvert_v1alpha1_CertificateStore_To_unversioned_CertificateStore(in, out, s) +// Convert_v1alpha1_CertificateStore_To_v1beta1_CertificateStore is an autogenerated conversion function. +func Convert_v1alpha1_CertificateStore_To_v1beta1_CertificateStore(in *CertificateStore, out *v1beta1.CertificateStore, s conversion.Scope) error { + return autoConvert_v1alpha1_CertificateStore_To_v1beta1_CertificateStore(in, out, s) } -func autoConvert_unversioned_CertificateStore_To_v1alpha1_CertificateStore(in *unversioned.CertificateStore, out *CertificateStore, s conversion.Scope) error { +func autoConvert_v1beta1_CertificateStore_To_v1alpha1_CertificateStore(in *v1beta1.CertificateStore, out *CertificateStore, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_unversioned_CertificateStoreSpec_To_v1alpha1_CertificateStoreSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_CertificateStoreSpec_To_v1alpha1_CertificateStoreSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_unversioned_CertificateStoreStatus_To_v1alpha1_CertificateStoreStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_CertificateStoreStatus_To_v1alpha1_CertificateStoreStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_unversioned_CertificateStore_To_v1alpha1_CertificateStore is an autogenerated conversion function. -func Convert_unversioned_CertificateStore_To_v1alpha1_CertificateStore(in *unversioned.CertificateStore, out *CertificateStore, s conversion.Scope) error { - return autoConvert_unversioned_CertificateStore_To_v1alpha1_CertificateStore(in, out, s) +// Convert_v1beta1_CertificateStore_To_v1alpha1_CertificateStore is an autogenerated conversion function. +func Convert_v1beta1_CertificateStore_To_v1alpha1_CertificateStore(in *v1beta1.CertificateStore, out *CertificateStore, s conversion.Scope) error { + return autoConvert_v1beta1_CertificateStore_To_v1alpha1_CertificateStore(in, out, s) } -func autoConvert_v1alpha1_CertificateStoreList_To_unversioned_CertificateStoreList(in *CertificateStoreList, out *unversioned.CertificateStoreList, s conversion.Scope) error { +func autoConvert_v1alpha1_CertificateStoreList_To_v1beta1_CertificateStoreList(in *CertificateStoreList, out *v1beta1.CertificateStoreList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]unversioned.CertificateStore, len(*in)) + *out = make([]v1beta1.CertificateStore, len(*in)) for i := range *in { - if err := Convert_v1alpha1_CertificateStore_To_unversioned_CertificateStore(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha1_CertificateStore_To_v1beta1_CertificateStore(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -256,18 +256,18 @@ func autoConvert_v1alpha1_CertificateStoreList_To_unversioned_CertificateStoreLi return nil } -// Convert_v1alpha1_CertificateStoreList_To_unversioned_CertificateStoreList is an autogenerated conversion function. -func Convert_v1alpha1_CertificateStoreList_To_unversioned_CertificateStoreList(in *CertificateStoreList, out *unversioned.CertificateStoreList, s conversion.Scope) error { - return autoConvert_v1alpha1_CertificateStoreList_To_unversioned_CertificateStoreList(in, out, s) +// Convert_v1alpha1_CertificateStoreList_To_v1beta1_CertificateStoreList is an autogenerated conversion function. +func Convert_v1alpha1_CertificateStoreList_To_v1beta1_CertificateStoreList(in *CertificateStoreList, out *v1beta1.CertificateStoreList, s conversion.Scope) error { + return autoConvert_v1alpha1_CertificateStoreList_To_v1beta1_CertificateStoreList(in, out, s) } -func autoConvert_unversioned_CertificateStoreList_To_v1alpha1_CertificateStoreList(in *unversioned.CertificateStoreList, out *CertificateStoreList, s conversion.Scope) error { +func autoConvert_v1beta1_CertificateStoreList_To_v1alpha1_CertificateStoreList(in *v1beta1.CertificateStoreList, out *CertificateStoreList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]CertificateStore, len(*in)) for i := range *in { - if err := Convert_unversioned_CertificateStore_To_v1alpha1_CertificateStore(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_CertificateStore_To_v1alpha1_CertificateStore(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -277,43 +277,38 @@ func autoConvert_unversioned_CertificateStoreList_To_v1alpha1_CertificateStoreLi return nil } -// Convert_unversioned_CertificateStoreList_To_v1alpha1_CertificateStoreList is an autogenerated conversion function. -func Convert_unversioned_CertificateStoreList_To_v1alpha1_CertificateStoreList(in *unversioned.CertificateStoreList, out *CertificateStoreList, s conversion.Scope) error { - return autoConvert_unversioned_CertificateStoreList_To_v1alpha1_CertificateStoreList(in, out, s) +// Convert_v1beta1_CertificateStoreList_To_v1alpha1_CertificateStoreList is an autogenerated conversion function. +func Convert_v1beta1_CertificateStoreList_To_v1alpha1_CertificateStoreList(in *v1beta1.CertificateStoreList, out *CertificateStoreList, s conversion.Scope) error { + return autoConvert_v1beta1_CertificateStoreList_To_v1alpha1_CertificateStoreList(in, out, s) } -func autoConvert_v1alpha1_CertificateStoreSpec_To_unversioned_CertificateStoreSpec(in *CertificateStoreSpec, out *unversioned.CertificateStoreSpec, s conversion.Scope) error { +func autoConvert_v1alpha1_CertificateStoreSpec_To_v1beta1_CertificateStoreSpec(in *CertificateStoreSpec, out *v1beta1.CertificateStoreSpec, s conversion.Scope) error { out.Provider = in.Provider out.Parameters = in.Parameters return nil } -// Convert_v1alpha1_CertificateStoreSpec_To_unversioned_CertificateStoreSpec is an autogenerated conversion function. -func Convert_v1alpha1_CertificateStoreSpec_To_unversioned_CertificateStoreSpec(in *CertificateStoreSpec, out *unversioned.CertificateStoreSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_CertificateStoreSpec_To_unversioned_CertificateStoreSpec(in, out, s) +// Convert_v1alpha1_CertificateStoreSpec_To_v1beta1_CertificateStoreSpec is an autogenerated conversion function. +func Convert_v1alpha1_CertificateStoreSpec_To_v1beta1_CertificateStoreSpec(in *CertificateStoreSpec, out *v1beta1.CertificateStoreSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_CertificateStoreSpec_To_v1beta1_CertificateStoreSpec(in, out, s) } -func autoConvert_unversioned_CertificateStoreSpec_To_v1alpha1_CertificateStoreSpec(in *unversioned.CertificateStoreSpec, out *CertificateStoreSpec, s conversion.Scope) error { +func autoConvert_v1beta1_CertificateStoreSpec_To_v1alpha1_CertificateStoreSpec(in *v1beta1.CertificateStoreSpec, out *CertificateStoreSpec, s conversion.Scope) error { out.Provider = in.Provider out.Parameters = in.Parameters return nil } -// Convert_unversioned_CertificateStoreSpec_To_v1alpha1_CertificateStoreSpec is an autogenerated conversion function. -func Convert_unversioned_CertificateStoreSpec_To_v1alpha1_CertificateStoreSpec(in *unversioned.CertificateStoreSpec, out *CertificateStoreSpec, s conversion.Scope) error { - return autoConvert_unversioned_CertificateStoreSpec_To_v1alpha1_CertificateStoreSpec(in, out, s) +// Convert_v1beta1_CertificateStoreSpec_To_v1alpha1_CertificateStoreSpec is an autogenerated conversion function. +func Convert_v1beta1_CertificateStoreSpec_To_v1alpha1_CertificateStoreSpec(in *v1beta1.CertificateStoreSpec, out *CertificateStoreSpec, s conversion.Scope) error { + return autoConvert_v1beta1_CertificateStoreSpec_To_v1alpha1_CertificateStoreSpec(in, out, s) } -func autoConvert_v1alpha1_CertificateStoreStatus_To_unversioned_CertificateStoreStatus(in *CertificateStoreStatus, out *unversioned.CertificateStoreStatus, s conversion.Scope) error { +func autoConvert_v1alpha1_CertificateStoreStatus_To_v1beta1_CertificateStoreStatus(in *CertificateStoreStatus, out *v1beta1.CertificateStoreStatus, s conversion.Scope) error { return nil } -// Convert_v1alpha1_CertificateStoreStatus_To_unversioned_CertificateStoreStatus is an autogenerated conversion function. -func Convert_v1alpha1_CertificateStoreStatus_To_unversioned_CertificateStoreStatus(in *CertificateStoreStatus, out *unversioned.CertificateStoreStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_CertificateStoreStatus_To_unversioned_CertificateStoreStatus(in, out, s) -} - -func autoConvert_unversioned_CertificateStoreStatus_To_v1alpha1_CertificateStoreStatus(in *unversioned.CertificateStoreStatus, out *CertificateStoreStatus, s conversion.Scope) error { +func autoConvert_v1beta1_CertificateStoreStatus_To_v1alpha1_CertificateStoreStatus(in *v1beta1.CertificateStoreStatus, out *CertificateStoreStatus, s conversion.Scope) error { // WARNING: in.IsSuccess requires manual conversion: does not exist in peer-type // WARNING: in.Error requires manual conversion: does not exist in peer-type // WARNING: in.BriefError requires manual conversion: does not exist in peer-type @@ -322,57 +317,57 @@ func autoConvert_unversioned_CertificateStoreStatus_To_v1alpha1_CertificateStore return nil } -func autoConvert_v1alpha1_PluginSource_To_unversioned_PluginSource(in *PluginSource, out *unversioned.PluginSource, s conversion.Scope) error { +func autoConvert_v1alpha1_PluginSource_To_v1beta1_PluginSource(in *PluginSource, out *v1beta1.PluginSource, s conversion.Scope) error { out.Artifact = in.Artifact out.AuthProvider = in.AuthProvider return nil } -// Convert_v1alpha1_PluginSource_To_unversioned_PluginSource is an autogenerated conversion function. -func Convert_v1alpha1_PluginSource_To_unversioned_PluginSource(in *PluginSource, out *unversioned.PluginSource, s conversion.Scope) error { - return autoConvert_v1alpha1_PluginSource_To_unversioned_PluginSource(in, out, s) +// Convert_v1alpha1_PluginSource_To_v1beta1_PluginSource is an autogenerated conversion function. +func Convert_v1alpha1_PluginSource_To_v1beta1_PluginSource(in *PluginSource, out *v1beta1.PluginSource, s conversion.Scope) error { + return autoConvert_v1alpha1_PluginSource_To_v1beta1_PluginSource(in, out, s) } -func autoConvert_unversioned_PluginSource_To_v1alpha1_PluginSource(in *unversioned.PluginSource, out *PluginSource, s conversion.Scope) error { +func autoConvert_v1beta1_PluginSource_To_v1alpha1_PluginSource(in *v1beta1.PluginSource, out *PluginSource, s conversion.Scope) error { out.Artifact = in.Artifact out.AuthProvider = in.AuthProvider return nil } -// Convert_unversioned_PluginSource_To_v1alpha1_PluginSource is an autogenerated conversion function. -func Convert_unversioned_PluginSource_To_v1alpha1_PluginSource(in *unversioned.PluginSource, out *PluginSource, s conversion.Scope) error { - return autoConvert_unversioned_PluginSource_To_v1alpha1_PluginSource(in, out, s) +// Convert_v1beta1_PluginSource_To_v1alpha1_PluginSource is an autogenerated conversion function. +func Convert_v1beta1_PluginSource_To_v1alpha1_PluginSource(in *v1beta1.PluginSource, out *PluginSource, s conversion.Scope) error { + return autoConvert_v1beta1_PluginSource_To_v1alpha1_PluginSource(in, out, s) } -func autoConvert_v1alpha1_Policy_To_unversioned_Policy(in *Policy, out *unversioned.Policy, s conversion.Scope) error { +func autoConvert_v1alpha1_Policy_To_v1beta1_Policy(in *Policy, out *v1beta1.Policy, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_PolicySpec_To_unversioned_PolicySpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha1_PolicySpec_To_v1beta1_PolicySpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha1_PolicyStatus_To_unversioned_PolicyStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha1_PolicyStatus_To_v1beta1_PolicyStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -func autoConvert_unversioned_Policy_To_v1alpha1_Policy(in *unversioned.Policy, out *Policy, s conversion.Scope) error { +func autoConvert_v1beta1_Policy_To_v1alpha1_Policy(in *v1beta1.Policy, out *Policy, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_unversioned_PolicySpec_To_v1alpha1_PolicySpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_PolicySpec_To_v1alpha1_PolicySpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_unversioned_PolicyStatus_To_v1alpha1_PolicyStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_PolicyStatus_To_v1alpha1_PolicyStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -func autoConvert_v1alpha1_PolicyList_To_unversioned_PolicyList(in *PolicyList, out *unversioned.PolicyList, s conversion.Scope) error { +func autoConvert_v1alpha1_PolicyList_To_v1beta1_PolicyList(in *PolicyList, out *v1beta1.PolicyList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]unversioned.Policy, len(*in)) + *out = make([]v1beta1.Policy, len(*in)) for i := range *in { - if err := Convert_v1alpha1_Policy_To_unversioned_Policy(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha1_Policy_To_v1beta1_Policy(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -382,18 +377,18 @@ func autoConvert_v1alpha1_PolicyList_To_unversioned_PolicyList(in *PolicyList, o return nil } -// Convert_v1alpha1_PolicyList_To_unversioned_PolicyList is an autogenerated conversion function. -func Convert_v1alpha1_PolicyList_To_unversioned_PolicyList(in *PolicyList, out *unversioned.PolicyList, s conversion.Scope) error { - return autoConvert_v1alpha1_PolicyList_To_unversioned_PolicyList(in, out, s) +// Convert_v1alpha1_PolicyList_To_v1beta1_PolicyList is an autogenerated conversion function. +func Convert_v1alpha1_PolicyList_To_v1beta1_PolicyList(in *PolicyList, out *v1beta1.PolicyList, s conversion.Scope) error { + return autoConvert_v1alpha1_PolicyList_To_v1beta1_PolicyList(in, out, s) } -func autoConvert_unversioned_PolicyList_To_v1alpha1_PolicyList(in *unversioned.PolicyList, out *PolicyList, s conversion.Scope) error { +func autoConvert_v1beta1_PolicyList_To_v1alpha1_PolicyList(in *v1beta1.PolicyList, out *PolicyList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]Policy, len(*in)) for i := range *in { - if err := Convert_unversioned_Policy_To_v1alpha1_Policy(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_Policy_To_v1alpha1_Policy(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -403,111 +398,101 @@ func autoConvert_unversioned_PolicyList_To_v1alpha1_PolicyList(in *unversioned.P return nil } -// Convert_unversioned_PolicyList_To_v1alpha1_PolicyList is an autogenerated conversion function. -func Convert_unversioned_PolicyList_To_v1alpha1_PolicyList(in *unversioned.PolicyList, out *PolicyList, s conversion.Scope) error { - return autoConvert_unversioned_PolicyList_To_v1alpha1_PolicyList(in, out, s) +// Convert_v1beta1_PolicyList_To_v1alpha1_PolicyList is an autogenerated conversion function. +func Convert_v1beta1_PolicyList_To_v1alpha1_PolicyList(in *v1beta1.PolicyList, out *PolicyList, s conversion.Scope) error { + return autoConvert_v1beta1_PolicyList_To_v1alpha1_PolicyList(in, out, s) } -func autoConvert_v1alpha1_PolicySpec_To_unversioned_PolicySpec(in *PolicySpec, out *unversioned.PolicySpec, s conversion.Scope) error { +func autoConvert_v1alpha1_PolicySpec_To_v1beta1_PolicySpec(in *PolicySpec, out *v1beta1.PolicySpec, s conversion.Scope) error { out.Parameters = in.Parameters return nil } -// Convert_v1alpha1_PolicySpec_To_unversioned_PolicySpec is an autogenerated conversion function. -func Convert_v1alpha1_PolicySpec_To_unversioned_PolicySpec(in *PolicySpec, out *unversioned.PolicySpec, s conversion.Scope) error { - return autoConvert_v1alpha1_PolicySpec_To_unversioned_PolicySpec(in, out, s) -} - -func autoConvert_unversioned_PolicySpec_To_v1alpha1_PolicySpec(in *unversioned.PolicySpec, out *PolicySpec, s conversion.Scope) error { +func autoConvert_v1beta1_PolicySpec_To_v1alpha1_PolicySpec(in *v1beta1.PolicySpec, out *PolicySpec, s conversion.Scope) error { // WARNING: in.Type requires manual conversion: does not exist in peer-type out.Parameters = in.Parameters return nil } -func autoConvert_v1alpha1_PolicyStatus_To_unversioned_PolicyStatus(in *PolicyStatus, out *unversioned.PolicyStatus, s conversion.Scope) error { +func autoConvert_v1alpha1_PolicyStatus_To_v1beta1_PolicyStatus(in *PolicyStatus, out *v1beta1.PolicyStatus, s conversion.Scope) error { return nil } -// Convert_v1alpha1_PolicyStatus_To_unversioned_PolicyStatus is an autogenerated conversion function. -func Convert_v1alpha1_PolicyStatus_To_unversioned_PolicyStatus(in *PolicyStatus, out *unversioned.PolicyStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_PolicyStatus_To_unversioned_PolicyStatus(in, out, s) -} - -func autoConvert_unversioned_PolicyStatus_To_v1alpha1_PolicyStatus(in *unversioned.PolicyStatus, out *PolicyStatus, s conversion.Scope) error { +func autoConvert_v1beta1_PolicyStatus_To_v1alpha1_PolicyStatus(in *v1beta1.PolicyStatus, out *PolicyStatus, s conversion.Scope) error { // WARNING: in.IsSuccess requires manual conversion: does not exist in peer-type // WARNING: in.Error requires manual conversion: does not exist in peer-type // WARNING: in.BriefError requires manual conversion: does not exist in peer-type return nil } -func autoConvert_v1alpha1_Store_To_unversioned_Store(in *Store, out *unversioned.Store, s conversion.Scope) error { +func autoConvert_v1alpha1_Store_To_v1beta1_Store(in *Store, out *v1beta1.Store, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_StoreSpec_To_unversioned_StoreSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha1_StoreSpec_To_v1beta1_StoreSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha1_StoreStatus_To_unversioned_StoreStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha1_StoreStatus_To_v1beta1_StoreStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha1_Store_To_unversioned_Store is an autogenerated conversion function. -func Convert_v1alpha1_Store_To_unversioned_Store(in *Store, out *unversioned.Store, s conversion.Scope) error { - return autoConvert_v1alpha1_Store_To_unversioned_Store(in, out, s) +// Convert_v1alpha1_Store_To_v1beta1_Store is an autogenerated conversion function. +func Convert_v1alpha1_Store_To_v1beta1_Store(in *Store, out *v1beta1.Store, s conversion.Scope) error { + return autoConvert_v1alpha1_Store_To_v1beta1_Store(in, out, s) } -func autoConvert_unversioned_Store_To_v1alpha1_Store(in *unversioned.Store, out *Store, s conversion.Scope) error { +func autoConvert_v1beta1_Store_To_v1alpha1_Store(in *v1beta1.Store, out *Store, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_unversioned_StoreSpec_To_v1alpha1_StoreSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_StoreSpec_To_v1alpha1_StoreSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_unversioned_StoreStatus_To_v1alpha1_StoreStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_StoreStatus_To_v1alpha1_StoreStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_unversioned_Store_To_v1alpha1_Store is an autogenerated conversion function. -func Convert_unversioned_Store_To_v1alpha1_Store(in *unversioned.Store, out *Store, s conversion.Scope) error { - return autoConvert_unversioned_Store_To_v1alpha1_Store(in, out, s) +// Convert_v1beta1_Store_To_v1alpha1_Store is an autogenerated conversion function. +func Convert_v1beta1_Store_To_v1alpha1_Store(in *v1beta1.Store, out *Store, s conversion.Scope) error { + return autoConvert_v1beta1_Store_To_v1alpha1_Store(in, out, s) } -func autoConvert_v1alpha1_StoreList_To_unversioned_StoreList(in *StoreList, out *unversioned.StoreList, s conversion.Scope) error { +func autoConvert_v1alpha1_StoreList_To_v1beta1_StoreList(in *StoreList, out *v1beta1.StoreList, s conversion.Scope) error { out.ListMeta = in.ListMeta - out.Items = *(*[]unversioned.Store)(unsafe.Pointer(&in.Items)) + out.Items = *(*[]v1beta1.Store)(unsafe.Pointer(&in.Items)) return nil } -// Convert_v1alpha1_StoreList_To_unversioned_StoreList is an autogenerated conversion function. -func Convert_v1alpha1_StoreList_To_unversioned_StoreList(in *StoreList, out *unversioned.StoreList, s conversion.Scope) error { - return autoConvert_v1alpha1_StoreList_To_unversioned_StoreList(in, out, s) +// Convert_v1alpha1_StoreList_To_v1beta1_StoreList is an autogenerated conversion function. +func Convert_v1alpha1_StoreList_To_v1beta1_StoreList(in *StoreList, out *v1beta1.StoreList, s conversion.Scope) error { + return autoConvert_v1alpha1_StoreList_To_v1beta1_StoreList(in, out, s) } -func autoConvert_unversioned_StoreList_To_v1alpha1_StoreList(in *unversioned.StoreList, out *StoreList, s conversion.Scope) error { +func autoConvert_v1beta1_StoreList_To_v1alpha1_StoreList(in *v1beta1.StoreList, out *StoreList, s conversion.Scope) error { out.ListMeta = in.ListMeta out.Items = *(*[]Store)(unsafe.Pointer(&in.Items)) return nil } -// Convert_unversioned_StoreList_To_v1alpha1_StoreList is an autogenerated conversion function. -func Convert_unversioned_StoreList_To_v1alpha1_StoreList(in *unversioned.StoreList, out *StoreList, s conversion.Scope) error { - return autoConvert_unversioned_StoreList_To_v1alpha1_StoreList(in, out, s) +// Convert_v1beta1_StoreList_To_v1alpha1_StoreList is an autogenerated conversion function. +func Convert_v1beta1_StoreList_To_v1alpha1_StoreList(in *v1beta1.StoreList, out *StoreList, s conversion.Scope) error { + return autoConvert_v1beta1_StoreList_To_v1alpha1_StoreList(in, out, s) } -func autoConvert_v1alpha1_StoreSpec_To_unversioned_StoreSpec(in *StoreSpec, out *unversioned.StoreSpec, s conversion.Scope) error { +func autoConvert_v1alpha1_StoreSpec_To_v1beta1_StoreSpec(in *StoreSpec, out *v1beta1.StoreSpec, s conversion.Scope) error { out.Name = in.Name out.Address = in.Address - out.Source = (*unversioned.PluginSource)(unsafe.Pointer(in.Source)) + out.Source = (*v1beta1.PluginSource)(unsafe.Pointer(in.Source)) out.Parameters = in.Parameters return nil } -// Convert_v1alpha1_StoreSpec_To_unversioned_StoreSpec is an autogenerated conversion function. -func Convert_v1alpha1_StoreSpec_To_unversioned_StoreSpec(in *StoreSpec, out *unversioned.StoreSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_StoreSpec_To_unversioned_StoreSpec(in, out, s) +// Convert_v1alpha1_StoreSpec_To_v1beta1_StoreSpec is an autogenerated conversion function. +func Convert_v1alpha1_StoreSpec_To_v1beta1_StoreSpec(in *StoreSpec, out *v1beta1.StoreSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_StoreSpec_To_v1beta1_StoreSpec(in, out, s) } -func autoConvert_unversioned_StoreSpec_To_v1alpha1_StoreSpec(in *unversioned.StoreSpec, out *StoreSpec, s conversion.Scope) error { +func autoConvert_v1beta1_StoreSpec_To_v1alpha1_StoreSpec(in *v1beta1.StoreSpec, out *StoreSpec, s conversion.Scope) error { out.Name = in.Name out.Address = in.Address out.Source = (*PluginSource)(unsafe.Pointer(in.Source)) @@ -515,98 +500,98 @@ func autoConvert_unversioned_StoreSpec_To_v1alpha1_StoreSpec(in *unversioned.Sto return nil } -// Convert_unversioned_StoreSpec_To_v1alpha1_StoreSpec is an autogenerated conversion function. -func Convert_unversioned_StoreSpec_To_v1alpha1_StoreSpec(in *unversioned.StoreSpec, out *StoreSpec, s conversion.Scope) error { - return autoConvert_unversioned_StoreSpec_To_v1alpha1_StoreSpec(in, out, s) +// Convert_v1beta1_StoreSpec_To_v1alpha1_StoreSpec is an autogenerated conversion function. +func Convert_v1beta1_StoreSpec_To_v1alpha1_StoreSpec(in *v1beta1.StoreSpec, out *StoreSpec, s conversion.Scope) error { + return autoConvert_v1beta1_StoreSpec_To_v1alpha1_StoreSpec(in, out, s) } -func autoConvert_v1alpha1_StoreStatus_To_unversioned_StoreStatus(in *StoreStatus, out *unversioned.StoreStatus, s conversion.Scope) error { +func autoConvert_v1alpha1_StoreStatus_To_v1beta1_StoreStatus(in *StoreStatus, out *v1beta1.StoreStatus, s conversion.Scope) error { return nil } -// Convert_v1alpha1_StoreStatus_To_unversioned_StoreStatus is an autogenerated conversion function. -func Convert_v1alpha1_StoreStatus_To_unversioned_StoreStatus(in *StoreStatus, out *unversioned.StoreStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_StoreStatus_To_unversioned_StoreStatus(in, out, s) +// Convert_v1alpha1_StoreStatus_To_v1beta1_StoreStatus is an autogenerated conversion function. +func Convert_v1alpha1_StoreStatus_To_v1beta1_StoreStatus(in *StoreStatus, out *v1beta1.StoreStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_StoreStatus_To_v1beta1_StoreStatus(in, out, s) } -func autoConvert_unversioned_StoreStatus_To_v1alpha1_StoreStatus(in *unversioned.StoreStatus, out *StoreStatus, s conversion.Scope) error { +func autoConvert_v1beta1_StoreStatus_To_v1alpha1_StoreStatus(in *v1beta1.StoreStatus, out *StoreStatus, s conversion.Scope) error { return nil } -// Convert_unversioned_StoreStatus_To_v1alpha1_StoreStatus is an autogenerated conversion function. -func Convert_unversioned_StoreStatus_To_v1alpha1_StoreStatus(in *unversioned.StoreStatus, out *StoreStatus, s conversion.Scope) error { - return autoConvert_unversioned_StoreStatus_To_v1alpha1_StoreStatus(in, out, s) +// Convert_v1beta1_StoreStatus_To_v1alpha1_StoreStatus is an autogenerated conversion function. +func Convert_v1beta1_StoreStatus_To_v1alpha1_StoreStatus(in *v1beta1.StoreStatus, out *StoreStatus, s conversion.Scope) error { + return autoConvert_v1beta1_StoreStatus_To_v1alpha1_StoreStatus(in, out, s) } -func autoConvert_v1alpha1_Verifier_To_unversioned_Verifier(in *Verifier, out *unversioned.Verifier, s conversion.Scope) error { +func autoConvert_v1alpha1_Verifier_To_v1beta1_Verifier(in *Verifier, out *v1beta1.Verifier, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_VerifierSpec_To_unversioned_VerifierSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha1_VerifierSpec_To_v1beta1_VerifierSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha1_VerifierStatus_To_unversioned_VerifierStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha1_VerifierStatus_To_v1beta1_VerifierStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha1_Verifier_To_unversioned_Verifier is an autogenerated conversion function. -func Convert_v1alpha1_Verifier_To_unversioned_Verifier(in *Verifier, out *unversioned.Verifier, s conversion.Scope) error { - return autoConvert_v1alpha1_Verifier_To_unversioned_Verifier(in, out, s) +// Convert_v1alpha1_Verifier_To_v1beta1_Verifier is an autogenerated conversion function. +func Convert_v1alpha1_Verifier_To_v1beta1_Verifier(in *Verifier, out *v1beta1.Verifier, s conversion.Scope) error { + return autoConvert_v1alpha1_Verifier_To_v1beta1_Verifier(in, out, s) } -func autoConvert_unversioned_Verifier_To_v1alpha1_Verifier(in *unversioned.Verifier, out *Verifier, s conversion.Scope) error { +func autoConvert_v1beta1_Verifier_To_v1alpha1_Verifier(in *v1beta1.Verifier, out *Verifier, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_unversioned_VerifierSpec_To_v1alpha1_VerifierSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_VerifierSpec_To_v1alpha1_VerifierSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_unversioned_VerifierStatus_To_v1alpha1_VerifierStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_VerifierStatus_To_v1alpha1_VerifierStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_unversioned_Verifier_To_v1alpha1_Verifier is an autogenerated conversion function. -func Convert_unversioned_Verifier_To_v1alpha1_Verifier(in *unversioned.Verifier, out *Verifier, s conversion.Scope) error { - return autoConvert_unversioned_Verifier_To_v1alpha1_Verifier(in, out, s) +// Convert_v1beta1_Verifier_To_v1alpha1_Verifier is an autogenerated conversion function. +func Convert_v1beta1_Verifier_To_v1alpha1_Verifier(in *v1beta1.Verifier, out *Verifier, s conversion.Scope) error { + return autoConvert_v1beta1_Verifier_To_v1alpha1_Verifier(in, out, s) } -func autoConvert_v1alpha1_VerifierList_To_unversioned_VerifierList(in *VerifierList, out *unversioned.VerifierList, s conversion.Scope) error { +func autoConvert_v1alpha1_VerifierList_To_v1beta1_VerifierList(in *VerifierList, out *v1beta1.VerifierList, s conversion.Scope) error { out.ListMeta = in.ListMeta - out.Items = *(*[]unversioned.Verifier)(unsafe.Pointer(&in.Items)) + out.Items = *(*[]v1beta1.Verifier)(unsafe.Pointer(&in.Items)) return nil } -// Convert_v1alpha1_VerifierList_To_unversioned_VerifierList is an autogenerated conversion function. -func Convert_v1alpha1_VerifierList_To_unversioned_VerifierList(in *VerifierList, out *unversioned.VerifierList, s conversion.Scope) error { - return autoConvert_v1alpha1_VerifierList_To_unversioned_VerifierList(in, out, s) +// Convert_v1alpha1_VerifierList_To_v1beta1_VerifierList is an autogenerated conversion function. +func Convert_v1alpha1_VerifierList_To_v1beta1_VerifierList(in *VerifierList, out *v1beta1.VerifierList, s conversion.Scope) error { + return autoConvert_v1alpha1_VerifierList_To_v1beta1_VerifierList(in, out, s) } -func autoConvert_unversioned_VerifierList_To_v1alpha1_VerifierList(in *unversioned.VerifierList, out *VerifierList, s conversion.Scope) error { +func autoConvert_v1beta1_VerifierList_To_v1alpha1_VerifierList(in *v1beta1.VerifierList, out *VerifierList, s conversion.Scope) error { out.ListMeta = in.ListMeta out.Items = *(*[]Verifier)(unsafe.Pointer(&in.Items)) return nil } -// Convert_unversioned_VerifierList_To_v1alpha1_VerifierList is an autogenerated conversion function. -func Convert_unversioned_VerifierList_To_v1alpha1_VerifierList(in *unversioned.VerifierList, out *VerifierList, s conversion.Scope) error { - return autoConvert_unversioned_VerifierList_To_v1alpha1_VerifierList(in, out, s) +// Convert_v1beta1_VerifierList_To_v1alpha1_VerifierList is an autogenerated conversion function. +func Convert_v1beta1_VerifierList_To_v1alpha1_VerifierList(in *v1beta1.VerifierList, out *VerifierList, s conversion.Scope) error { + return autoConvert_v1beta1_VerifierList_To_v1alpha1_VerifierList(in, out, s) } -func autoConvert_v1alpha1_VerifierSpec_To_unversioned_VerifierSpec(in *VerifierSpec, out *unversioned.VerifierSpec, s conversion.Scope) error { +func autoConvert_v1alpha1_VerifierSpec_To_v1beta1_VerifierSpec(in *VerifierSpec, out *v1beta1.VerifierSpec, s conversion.Scope) error { out.Name = in.Name out.ArtifactTypes = in.ArtifactTypes out.Address = in.Address - out.Source = (*unversioned.PluginSource)(unsafe.Pointer(in.Source)) + out.Source = (*v1beta1.PluginSource)(unsafe.Pointer(in.Source)) out.Parameters = in.Parameters return nil } -// Convert_v1alpha1_VerifierSpec_To_unversioned_VerifierSpec is an autogenerated conversion function. -func Convert_v1alpha1_VerifierSpec_To_unversioned_VerifierSpec(in *VerifierSpec, out *unversioned.VerifierSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_VerifierSpec_To_unversioned_VerifierSpec(in, out, s) +// Convert_v1alpha1_VerifierSpec_To_v1beta1_VerifierSpec is an autogenerated conversion function. +func Convert_v1alpha1_VerifierSpec_To_v1beta1_VerifierSpec(in *VerifierSpec, out *v1beta1.VerifierSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_VerifierSpec_To_v1beta1_VerifierSpec(in, out, s) } -func autoConvert_unversioned_VerifierSpec_To_v1alpha1_VerifierSpec(in *unversioned.VerifierSpec, out *VerifierSpec, s conversion.Scope) error { +func autoConvert_v1beta1_VerifierSpec_To_v1alpha1_VerifierSpec(in *v1beta1.VerifierSpec, out *VerifierSpec, s conversion.Scope) error { out.Name = in.Name out.ArtifactTypes = in.ArtifactTypes out.Address = in.Address @@ -615,25 +600,25 @@ func autoConvert_unversioned_VerifierSpec_To_v1alpha1_VerifierSpec(in *unversion return nil } -// Convert_unversioned_VerifierSpec_To_v1alpha1_VerifierSpec is an autogenerated conversion function. -func Convert_unversioned_VerifierSpec_To_v1alpha1_VerifierSpec(in *unversioned.VerifierSpec, out *VerifierSpec, s conversion.Scope) error { - return autoConvert_unversioned_VerifierSpec_To_v1alpha1_VerifierSpec(in, out, s) +// Convert_v1beta1_VerifierSpec_To_v1alpha1_VerifierSpec is an autogenerated conversion function. +func Convert_v1beta1_VerifierSpec_To_v1alpha1_VerifierSpec(in *v1beta1.VerifierSpec, out *VerifierSpec, s conversion.Scope) error { + return autoConvert_v1beta1_VerifierSpec_To_v1alpha1_VerifierSpec(in, out, s) } -func autoConvert_v1alpha1_VerifierStatus_To_unversioned_VerifierStatus(in *VerifierStatus, out *unversioned.VerifierStatus, s conversion.Scope) error { +func autoConvert_v1alpha1_VerifierStatus_To_v1beta1_VerifierStatus(in *VerifierStatus, out *v1beta1.VerifierStatus, s conversion.Scope) error { return nil } -// Convert_v1alpha1_VerifierStatus_To_unversioned_VerifierStatus is an autogenerated conversion function. -func Convert_v1alpha1_VerifierStatus_To_unversioned_VerifierStatus(in *VerifierStatus, out *unversioned.VerifierStatus, s conversion.Scope) error { - return autoConvert_v1alpha1_VerifierStatus_To_unversioned_VerifierStatus(in, out, s) +// Convert_v1alpha1_VerifierStatus_To_v1beta1_VerifierStatus is an autogenerated conversion function. +func Convert_v1alpha1_VerifierStatus_To_v1beta1_VerifierStatus(in *VerifierStatus, out *v1beta1.VerifierStatus, s conversion.Scope) error { + return autoConvert_v1alpha1_VerifierStatus_To_v1beta1_VerifierStatus(in, out, s) } -func autoConvert_unversioned_VerifierStatus_To_v1alpha1_VerifierStatus(in *unversioned.VerifierStatus, out *VerifierStatus, s conversion.Scope) error { +func autoConvert_v1beta1_VerifierStatus_To_v1alpha1_VerifierStatus(in *v1beta1.VerifierStatus, out *VerifierStatus, s conversion.Scope) error { return nil } -// Convert_unversioned_VerifierStatus_To_v1alpha1_VerifierStatus is an autogenerated conversion function. -func Convert_unversioned_VerifierStatus_To_v1alpha1_VerifierStatus(in *unversioned.VerifierStatus, out *VerifierStatus, s conversion.Scope) error { - return autoConvert_unversioned_VerifierStatus_To_v1alpha1_VerifierStatus(in, out, s) +// Convert_v1beta1_VerifierStatus_To_v1alpha1_VerifierStatus is an autogenerated conversion function. +func Convert_v1beta1_VerifierStatus_To_v1alpha1_VerifierStatus(in *v1beta1.VerifierStatus, out *VerifierStatus, s conversion.Scope) error { + return autoConvert_v1beta1_VerifierStatus_To_v1alpha1_VerifierStatus(in, out, s) } diff --git a/api/v1beta1/certificatestore_types.go b/api/v1beta1/certificatestore_types.go index 755187502..95cc14850 100644 --- a/api/v1beta1/certificatestore_types.go +++ b/api/v1beta1/certificatestore_types.go @@ -83,3 +83,7 @@ type CertificateStoreList struct { func init() { SchemeBuilder.Register(&CertificateStore{}, &CertificateStoreList{}) } + +// func (c *CertificateStore) SetupWebhookWithManager(mgr ctrl.Manager) error { +// return ctrl.(mgr).For(c).Complete() +// } diff --git a/api/v1beta1/certificatestore_webhook.go b/api/v1beta1/certificatestore_webhook.go new file mode 100644 index 000000000..81bf82e5d --- /dev/null +++ b/api/v1beta1/certificatestore_webhook.go @@ -0,0 +1,23 @@ +/* +Copyright The Ratify 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 v1beta1 + +import ctrl "sigs.k8s.io/controller-runtime" + +func (c *CertificateStore) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr).For(c).Complete() +} diff --git a/api/unversioned/doc.go b/api/v1beta1/conversion.go similarity index 75% rename from api/unversioned/doc.go rename to api/v1beta1/conversion.go index ef32ea5a0..6d4467bbc 100644 --- a/api/unversioned/doc.go +++ b/api/v1beta1/conversion.go @@ -5,7 +5,7 @@ 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 + 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, @@ -13,7 +13,9 @@ 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 v1beta1 -package unversioned - -// +kubebuilder:object:generate=true +func (*Policy) Hub() {} +func (*CertificateStore) Hub() {} +func (*Verifier) Hub() {} +func (*Store) Hub() {} \ No newline at end of file diff --git a/api/v1beta1/doc.go b/api/v1beta1/doc.go index 7d2226e2b..c21cf479f 100644 --- a/api/v1beta1/doc.go +++ b/api/v1beta1/doc.go @@ -14,5 +14,4 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:conversion-gen=github.com/deislabs/ratify/api/unversioned package v1beta1 diff --git a/api/v1beta1/groupversion_info.go b/api/v1beta1/groupversion_info.go index 97a2a6d8e..edf402756 100644 --- a/api/v1beta1/groupversion_info.go +++ b/api/v1beta1/groupversion_info.go @@ -20,7 +20,6 @@ limitations under the License. package v1beta1 import ( - runtime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "sigs.k8s.io/controller-runtime/pkg/scheme" ) @@ -35,5 +34,5 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme - localSchemeBuilder = runtime.NewSchemeBuilder(SchemeBuilder.AddToScheme) + localSchemeBuilder = SchemeBuilder.SchemeBuilder ) diff --git a/api/v1beta1/policy_webhook.go b/api/v1beta1/policy_webhook.go new file mode 100644 index 000000000..6414a2ee6 --- /dev/null +++ b/api/v1beta1/policy_webhook.go @@ -0,0 +1,25 @@ +/* +Copyright The Ratify 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 v1beta1 + +import ctrl "sigs.k8s.io/controller-runtime" + +func (r *Policy) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} \ No newline at end of file diff --git a/api/v1beta1/store_webhook.go b/api/v1beta1/store_webhook.go new file mode 100644 index 000000000..a41ed388f --- /dev/null +++ b/api/v1beta1/store_webhook.go @@ -0,0 +1,25 @@ +/* +Copyright The Ratify 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 v1beta1 + +import ctrl "sigs.k8s.io/controller-runtime" + +func (r *Store) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} \ No newline at end of file diff --git a/api/v1beta1/verifier_webhook.go b/api/v1beta1/verifier_webhook.go new file mode 100644 index 000000000..89b8ebde4 --- /dev/null +++ b/api/v1beta1/verifier_webhook.go @@ -0,0 +1,25 @@ +/* +Copyright The Ratify 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 v1beta1 + +import ctrl "sigs.k8s.io/controller-runtime" + +func (r *Verifier) SetupWebhookWithManager(mgr ctrl.Manager) error { + return ctrl.NewWebhookManagedBy(mgr). + For(r). + Complete() +} \ No newline at end of file diff --git a/api/v1beta1/zz_generated.conversion.go b/api/v1beta1/zz_generated.conversion.go deleted file mode 100644 index fbaa094f1..000000000 --- a/api/v1beta1/zz_generated.conversion.go +++ /dev/null @@ -1,634 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Ratify 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 conversion-gen. DO NOT EDIT. - -package v1beta1 - -import ( - unsafe "unsafe" - - unversioned "github.com/deislabs/ratify/api/unversioned" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*CertificateStore)(nil), (*unversioned.CertificateStore)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CertificateStore_To_unversioned_CertificateStore(a.(*CertificateStore), b.(*unversioned.CertificateStore), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.CertificateStore)(nil), (*CertificateStore)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_CertificateStore_To_v1beta1_CertificateStore(a.(*unversioned.CertificateStore), b.(*CertificateStore), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CertificateStoreList)(nil), (*unversioned.CertificateStoreList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CertificateStoreList_To_unversioned_CertificateStoreList(a.(*CertificateStoreList), b.(*unversioned.CertificateStoreList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.CertificateStoreList)(nil), (*CertificateStoreList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_CertificateStoreList_To_v1beta1_CertificateStoreList(a.(*unversioned.CertificateStoreList), b.(*CertificateStoreList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CertificateStoreSpec)(nil), (*unversioned.CertificateStoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CertificateStoreSpec_To_unversioned_CertificateStoreSpec(a.(*CertificateStoreSpec), b.(*unversioned.CertificateStoreSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.CertificateStoreSpec)(nil), (*CertificateStoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_CertificateStoreSpec_To_v1beta1_CertificateStoreSpec(a.(*unversioned.CertificateStoreSpec), b.(*CertificateStoreSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*CertificateStoreStatus)(nil), (*unversioned.CertificateStoreStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_CertificateStoreStatus_To_unversioned_CertificateStoreStatus(a.(*CertificateStoreStatus), b.(*unversioned.CertificateStoreStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.CertificateStoreStatus)(nil), (*CertificateStoreStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_CertificateStoreStatus_To_v1beta1_CertificateStoreStatus(a.(*unversioned.CertificateStoreStatus), b.(*CertificateStoreStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*PluginSource)(nil), (*unversioned.PluginSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_PluginSource_To_unversioned_PluginSource(a.(*PluginSource), b.(*unversioned.PluginSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.PluginSource)(nil), (*PluginSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_PluginSource_To_v1beta1_PluginSource(a.(*unversioned.PluginSource), b.(*PluginSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Policy)(nil), (*unversioned.Policy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Policy_To_unversioned_Policy(a.(*Policy), b.(*unversioned.Policy), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.Policy)(nil), (*Policy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_Policy_To_v1beta1_Policy(a.(*unversioned.Policy), b.(*Policy), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*PolicyList)(nil), (*unversioned.PolicyList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_PolicyList_To_unversioned_PolicyList(a.(*PolicyList), b.(*unversioned.PolicyList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.PolicyList)(nil), (*PolicyList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_PolicyList_To_v1beta1_PolicyList(a.(*unversioned.PolicyList), b.(*PolicyList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*PolicySpec)(nil), (*unversioned.PolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_PolicySpec_To_unversioned_PolicySpec(a.(*PolicySpec), b.(*unversioned.PolicySpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.PolicySpec)(nil), (*PolicySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_PolicySpec_To_v1beta1_PolicySpec(a.(*unversioned.PolicySpec), b.(*PolicySpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*PolicyStatus)(nil), (*unversioned.PolicyStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_PolicyStatus_To_unversioned_PolicyStatus(a.(*PolicyStatus), b.(*unversioned.PolicyStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.PolicyStatus)(nil), (*PolicyStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_PolicyStatus_To_v1beta1_PolicyStatus(a.(*unversioned.PolicyStatus), b.(*PolicyStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Store)(nil), (*unversioned.Store)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Store_To_unversioned_Store(a.(*Store), b.(*unversioned.Store), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.Store)(nil), (*Store)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_Store_To_v1beta1_Store(a.(*unversioned.Store), b.(*Store), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*StoreList)(nil), (*unversioned.StoreList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_StoreList_To_unversioned_StoreList(a.(*StoreList), b.(*unversioned.StoreList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.StoreList)(nil), (*StoreList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_StoreList_To_v1beta1_StoreList(a.(*unversioned.StoreList), b.(*StoreList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*StoreSpec)(nil), (*unversioned.StoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_StoreSpec_To_unversioned_StoreSpec(a.(*StoreSpec), b.(*unversioned.StoreSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.StoreSpec)(nil), (*StoreSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_StoreSpec_To_v1beta1_StoreSpec(a.(*unversioned.StoreSpec), b.(*StoreSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*StoreStatus)(nil), (*unversioned.StoreStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_StoreStatus_To_unversioned_StoreStatus(a.(*StoreStatus), b.(*unversioned.StoreStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.StoreStatus)(nil), (*StoreStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_StoreStatus_To_v1beta1_StoreStatus(a.(*unversioned.StoreStatus), b.(*StoreStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Verifier)(nil), (*unversioned.Verifier)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Verifier_To_unversioned_Verifier(a.(*Verifier), b.(*unversioned.Verifier), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.Verifier)(nil), (*Verifier)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_Verifier_To_v1beta1_Verifier(a.(*unversioned.Verifier), b.(*Verifier), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*VerifierList)(nil), (*unversioned.VerifierList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_VerifierList_To_unversioned_VerifierList(a.(*VerifierList), b.(*unversioned.VerifierList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.VerifierList)(nil), (*VerifierList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_VerifierList_To_v1beta1_VerifierList(a.(*unversioned.VerifierList), b.(*VerifierList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*VerifierSpec)(nil), (*unversioned.VerifierSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_VerifierSpec_To_unversioned_VerifierSpec(a.(*VerifierSpec), b.(*unversioned.VerifierSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.VerifierSpec)(nil), (*VerifierSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_VerifierSpec_To_v1beta1_VerifierSpec(a.(*unversioned.VerifierSpec), b.(*VerifierSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*VerifierStatus)(nil), (*unversioned.VerifierStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_VerifierStatus_To_unversioned_VerifierStatus(a.(*VerifierStatus), b.(*unversioned.VerifierStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*unversioned.VerifierStatus)(nil), (*VerifierStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_unversioned_VerifierStatus_To_v1beta1_VerifierStatus(a.(*unversioned.VerifierStatus), b.(*VerifierStatus), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1beta1_CertificateStore_To_unversioned_CertificateStore(in *CertificateStore, out *unversioned.CertificateStore, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_CertificateStoreSpec_To_unversioned_CertificateStoreSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_CertificateStoreStatus_To_unversioned_CertificateStoreStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_CertificateStore_To_unversioned_CertificateStore is an autogenerated conversion function. -func Convert_v1beta1_CertificateStore_To_unversioned_CertificateStore(in *CertificateStore, out *unversioned.CertificateStore, s conversion.Scope) error { - return autoConvert_v1beta1_CertificateStore_To_unversioned_CertificateStore(in, out, s) -} - -func autoConvert_unversioned_CertificateStore_To_v1beta1_CertificateStore(in *unversioned.CertificateStore, out *CertificateStore, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_unversioned_CertificateStoreSpec_To_v1beta1_CertificateStoreSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_unversioned_CertificateStoreStatus_To_v1beta1_CertificateStoreStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_unversioned_CertificateStore_To_v1beta1_CertificateStore is an autogenerated conversion function. -func Convert_unversioned_CertificateStore_To_v1beta1_CertificateStore(in *unversioned.CertificateStore, out *CertificateStore, s conversion.Scope) error { - return autoConvert_unversioned_CertificateStore_To_v1beta1_CertificateStore(in, out, s) -} - -func autoConvert_v1beta1_CertificateStoreList_To_unversioned_CertificateStoreList(in *CertificateStoreList, out *unversioned.CertificateStoreList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]unversioned.CertificateStore)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_CertificateStoreList_To_unversioned_CertificateStoreList is an autogenerated conversion function. -func Convert_v1beta1_CertificateStoreList_To_unversioned_CertificateStoreList(in *CertificateStoreList, out *unversioned.CertificateStoreList, s conversion.Scope) error { - return autoConvert_v1beta1_CertificateStoreList_To_unversioned_CertificateStoreList(in, out, s) -} - -func autoConvert_unversioned_CertificateStoreList_To_v1beta1_CertificateStoreList(in *unversioned.CertificateStoreList, out *CertificateStoreList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]CertificateStore)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_unversioned_CertificateStoreList_To_v1beta1_CertificateStoreList is an autogenerated conversion function. -func Convert_unversioned_CertificateStoreList_To_v1beta1_CertificateStoreList(in *unversioned.CertificateStoreList, out *CertificateStoreList, s conversion.Scope) error { - return autoConvert_unversioned_CertificateStoreList_To_v1beta1_CertificateStoreList(in, out, s) -} - -func autoConvert_v1beta1_CertificateStoreSpec_To_unversioned_CertificateStoreSpec(in *CertificateStoreSpec, out *unversioned.CertificateStoreSpec, s conversion.Scope) error { - out.Provider = in.Provider - out.Parameters = in.Parameters - return nil -} - -// Convert_v1beta1_CertificateStoreSpec_To_unversioned_CertificateStoreSpec is an autogenerated conversion function. -func Convert_v1beta1_CertificateStoreSpec_To_unversioned_CertificateStoreSpec(in *CertificateStoreSpec, out *unversioned.CertificateStoreSpec, s conversion.Scope) error { - return autoConvert_v1beta1_CertificateStoreSpec_To_unversioned_CertificateStoreSpec(in, out, s) -} - -func autoConvert_unversioned_CertificateStoreSpec_To_v1beta1_CertificateStoreSpec(in *unversioned.CertificateStoreSpec, out *CertificateStoreSpec, s conversion.Scope) error { - out.Provider = in.Provider - out.Parameters = in.Parameters - return nil -} - -// Convert_unversioned_CertificateStoreSpec_To_v1beta1_CertificateStoreSpec is an autogenerated conversion function. -func Convert_unversioned_CertificateStoreSpec_To_v1beta1_CertificateStoreSpec(in *unversioned.CertificateStoreSpec, out *CertificateStoreSpec, s conversion.Scope) error { - return autoConvert_unversioned_CertificateStoreSpec_To_v1beta1_CertificateStoreSpec(in, out, s) -} - -func autoConvert_v1beta1_CertificateStoreStatus_To_unversioned_CertificateStoreStatus(in *CertificateStoreStatus, out *unversioned.CertificateStoreStatus, s conversion.Scope) error { - out.IsSuccess = in.IsSuccess - out.Error = in.Error - out.BriefError = in.BriefError - out.LastFetchedTime = (*v1.Time)(unsafe.Pointer(in.LastFetchedTime)) - out.Properties = in.Properties - return nil -} - -// Convert_v1beta1_CertificateStoreStatus_To_unversioned_CertificateStoreStatus is an autogenerated conversion function. -func Convert_v1beta1_CertificateStoreStatus_To_unversioned_CertificateStoreStatus(in *CertificateStoreStatus, out *unversioned.CertificateStoreStatus, s conversion.Scope) error { - return autoConvert_v1beta1_CertificateStoreStatus_To_unversioned_CertificateStoreStatus(in, out, s) -} - -func autoConvert_unversioned_CertificateStoreStatus_To_v1beta1_CertificateStoreStatus(in *unversioned.CertificateStoreStatus, out *CertificateStoreStatus, s conversion.Scope) error { - out.IsSuccess = in.IsSuccess - out.Error = in.Error - out.BriefError = in.BriefError - out.LastFetchedTime = (*v1.Time)(unsafe.Pointer(in.LastFetchedTime)) - out.Properties = in.Properties - return nil -} - -// Convert_unversioned_CertificateStoreStatus_To_v1beta1_CertificateStoreStatus is an autogenerated conversion function. -func Convert_unversioned_CertificateStoreStatus_To_v1beta1_CertificateStoreStatus(in *unversioned.CertificateStoreStatus, out *CertificateStoreStatus, s conversion.Scope) error { - return autoConvert_unversioned_CertificateStoreStatus_To_v1beta1_CertificateStoreStatus(in, out, s) -} - -func autoConvert_v1beta1_PluginSource_To_unversioned_PluginSource(in *PluginSource, out *unversioned.PluginSource, s conversion.Scope) error { - out.Artifact = in.Artifact - out.AuthProvider = in.AuthProvider - return nil -} - -// Convert_v1beta1_PluginSource_To_unversioned_PluginSource is an autogenerated conversion function. -func Convert_v1beta1_PluginSource_To_unversioned_PluginSource(in *PluginSource, out *unversioned.PluginSource, s conversion.Scope) error { - return autoConvert_v1beta1_PluginSource_To_unversioned_PluginSource(in, out, s) -} - -func autoConvert_unversioned_PluginSource_To_v1beta1_PluginSource(in *unversioned.PluginSource, out *PluginSource, s conversion.Scope) error { - out.Artifact = in.Artifact - out.AuthProvider = in.AuthProvider - return nil -} - -// Convert_unversioned_PluginSource_To_v1beta1_PluginSource is an autogenerated conversion function. -func Convert_unversioned_PluginSource_To_v1beta1_PluginSource(in *unversioned.PluginSource, out *PluginSource, s conversion.Scope) error { - return autoConvert_unversioned_PluginSource_To_v1beta1_PluginSource(in, out, s) -} - -func autoConvert_v1beta1_Policy_To_unversioned_Policy(in *Policy, out *unversioned.Policy, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_PolicySpec_To_unversioned_PolicySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_PolicyStatus_To_unversioned_PolicyStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_Policy_To_unversioned_Policy is an autogenerated conversion function. -func Convert_v1beta1_Policy_To_unversioned_Policy(in *Policy, out *unversioned.Policy, s conversion.Scope) error { - return autoConvert_v1beta1_Policy_To_unversioned_Policy(in, out, s) -} - -func autoConvert_unversioned_Policy_To_v1beta1_Policy(in *unversioned.Policy, out *Policy, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_unversioned_PolicySpec_To_v1beta1_PolicySpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_unversioned_PolicyStatus_To_v1beta1_PolicyStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_unversioned_Policy_To_v1beta1_Policy is an autogenerated conversion function. -func Convert_unversioned_Policy_To_v1beta1_Policy(in *unversioned.Policy, out *Policy, s conversion.Scope) error { - return autoConvert_unversioned_Policy_To_v1beta1_Policy(in, out, s) -} - -func autoConvert_v1beta1_PolicyList_To_unversioned_PolicyList(in *PolicyList, out *unversioned.PolicyList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]unversioned.Policy)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_PolicyList_To_unversioned_PolicyList is an autogenerated conversion function. -func Convert_v1beta1_PolicyList_To_unversioned_PolicyList(in *PolicyList, out *unversioned.PolicyList, s conversion.Scope) error { - return autoConvert_v1beta1_PolicyList_To_unversioned_PolicyList(in, out, s) -} - -func autoConvert_unversioned_PolicyList_To_v1beta1_PolicyList(in *unversioned.PolicyList, out *PolicyList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]Policy)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_unversioned_PolicyList_To_v1beta1_PolicyList is an autogenerated conversion function. -func Convert_unversioned_PolicyList_To_v1beta1_PolicyList(in *unversioned.PolicyList, out *PolicyList, s conversion.Scope) error { - return autoConvert_unversioned_PolicyList_To_v1beta1_PolicyList(in, out, s) -} - -func autoConvert_v1beta1_PolicySpec_To_unversioned_PolicySpec(in *PolicySpec, out *unversioned.PolicySpec, s conversion.Scope) error { - out.Type = in.Type - out.Parameters = in.Parameters - return nil -} - -// Convert_v1beta1_PolicySpec_To_unversioned_PolicySpec is an autogenerated conversion function. -func Convert_v1beta1_PolicySpec_To_unversioned_PolicySpec(in *PolicySpec, out *unversioned.PolicySpec, s conversion.Scope) error { - return autoConvert_v1beta1_PolicySpec_To_unversioned_PolicySpec(in, out, s) -} - -func autoConvert_unversioned_PolicySpec_To_v1beta1_PolicySpec(in *unversioned.PolicySpec, out *PolicySpec, s conversion.Scope) error { - out.Type = in.Type - out.Parameters = in.Parameters - return nil -} - -// Convert_unversioned_PolicySpec_To_v1beta1_PolicySpec is an autogenerated conversion function. -func Convert_unversioned_PolicySpec_To_v1beta1_PolicySpec(in *unversioned.PolicySpec, out *PolicySpec, s conversion.Scope) error { - return autoConvert_unversioned_PolicySpec_To_v1beta1_PolicySpec(in, out, s) -} - -func autoConvert_v1beta1_PolicyStatus_To_unversioned_PolicyStatus(in *PolicyStatus, out *unversioned.PolicyStatus, s conversion.Scope) error { - out.IsSuccess = in.IsSuccess - out.Error = in.Error - out.BriefError = in.BriefError - return nil -} - -// Convert_v1beta1_PolicyStatus_To_unversioned_PolicyStatus is an autogenerated conversion function. -func Convert_v1beta1_PolicyStatus_To_unversioned_PolicyStatus(in *PolicyStatus, out *unversioned.PolicyStatus, s conversion.Scope) error { - return autoConvert_v1beta1_PolicyStatus_To_unversioned_PolicyStatus(in, out, s) -} - -func autoConvert_unversioned_PolicyStatus_To_v1beta1_PolicyStatus(in *unversioned.PolicyStatus, out *PolicyStatus, s conversion.Scope) error { - out.IsSuccess = in.IsSuccess - out.Error = in.Error - out.BriefError = in.BriefError - return nil -} - -// Convert_unversioned_PolicyStatus_To_v1beta1_PolicyStatus is an autogenerated conversion function. -func Convert_unversioned_PolicyStatus_To_v1beta1_PolicyStatus(in *unversioned.PolicyStatus, out *PolicyStatus, s conversion.Scope) error { - return autoConvert_unversioned_PolicyStatus_To_v1beta1_PolicyStatus(in, out, s) -} - -func autoConvert_v1beta1_Store_To_unversioned_Store(in *Store, out *unversioned.Store, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_StoreSpec_To_unversioned_StoreSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_StoreStatus_To_unversioned_StoreStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_Store_To_unversioned_Store is an autogenerated conversion function. -func Convert_v1beta1_Store_To_unversioned_Store(in *Store, out *unversioned.Store, s conversion.Scope) error { - return autoConvert_v1beta1_Store_To_unversioned_Store(in, out, s) -} - -func autoConvert_unversioned_Store_To_v1beta1_Store(in *unversioned.Store, out *Store, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_unversioned_StoreSpec_To_v1beta1_StoreSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_unversioned_StoreStatus_To_v1beta1_StoreStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_unversioned_Store_To_v1beta1_Store is an autogenerated conversion function. -func Convert_unversioned_Store_To_v1beta1_Store(in *unversioned.Store, out *Store, s conversion.Scope) error { - return autoConvert_unversioned_Store_To_v1beta1_Store(in, out, s) -} - -func autoConvert_v1beta1_StoreList_To_unversioned_StoreList(in *StoreList, out *unversioned.StoreList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]unversioned.Store)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_StoreList_To_unversioned_StoreList is an autogenerated conversion function. -func Convert_v1beta1_StoreList_To_unversioned_StoreList(in *StoreList, out *unversioned.StoreList, s conversion.Scope) error { - return autoConvert_v1beta1_StoreList_To_unversioned_StoreList(in, out, s) -} - -func autoConvert_unversioned_StoreList_To_v1beta1_StoreList(in *unversioned.StoreList, out *StoreList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]Store)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_unversioned_StoreList_To_v1beta1_StoreList is an autogenerated conversion function. -func Convert_unversioned_StoreList_To_v1beta1_StoreList(in *unversioned.StoreList, out *StoreList, s conversion.Scope) error { - return autoConvert_unversioned_StoreList_To_v1beta1_StoreList(in, out, s) -} - -func autoConvert_v1beta1_StoreSpec_To_unversioned_StoreSpec(in *StoreSpec, out *unversioned.StoreSpec, s conversion.Scope) error { - out.Name = in.Name - out.Address = in.Address - out.Source = (*unversioned.PluginSource)(unsafe.Pointer(in.Source)) - out.Parameters = in.Parameters - return nil -} - -// Convert_v1beta1_StoreSpec_To_unversioned_StoreSpec is an autogenerated conversion function. -func Convert_v1beta1_StoreSpec_To_unversioned_StoreSpec(in *StoreSpec, out *unversioned.StoreSpec, s conversion.Scope) error { - return autoConvert_v1beta1_StoreSpec_To_unversioned_StoreSpec(in, out, s) -} - -func autoConvert_unversioned_StoreSpec_To_v1beta1_StoreSpec(in *unversioned.StoreSpec, out *StoreSpec, s conversion.Scope) error { - out.Name = in.Name - out.Address = in.Address - out.Source = (*PluginSource)(unsafe.Pointer(in.Source)) - out.Parameters = in.Parameters - return nil -} - -// Convert_unversioned_StoreSpec_To_v1beta1_StoreSpec is an autogenerated conversion function. -func Convert_unversioned_StoreSpec_To_v1beta1_StoreSpec(in *unversioned.StoreSpec, out *StoreSpec, s conversion.Scope) error { - return autoConvert_unversioned_StoreSpec_To_v1beta1_StoreSpec(in, out, s) -} - -func autoConvert_v1beta1_StoreStatus_To_unversioned_StoreStatus(in *StoreStatus, out *unversioned.StoreStatus, s conversion.Scope) error { - return nil -} - -// Convert_v1beta1_StoreStatus_To_unversioned_StoreStatus is an autogenerated conversion function. -func Convert_v1beta1_StoreStatus_To_unversioned_StoreStatus(in *StoreStatus, out *unversioned.StoreStatus, s conversion.Scope) error { - return autoConvert_v1beta1_StoreStatus_To_unversioned_StoreStatus(in, out, s) -} - -func autoConvert_unversioned_StoreStatus_To_v1beta1_StoreStatus(in *unversioned.StoreStatus, out *StoreStatus, s conversion.Scope) error { - return nil -} - -// Convert_unversioned_StoreStatus_To_v1beta1_StoreStatus is an autogenerated conversion function. -func Convert_unversioned_StoreStatus_To_v1beta1_StoreStatus(in *unversioned.StoreStatus, out *StoreStatus, s conversion.Scope) error { - return autoConvert_unversioned_StoreStatus_To_v1beta1_StoreStatus(in, out, s) -} - -func autoConvert_v1beta1_Verifier_To_unversioned_Verifier(in *Verifier, out *unversioned.Verifier, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_VerifierSpec_To_unversioned_VerifierSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_VerifierStatus_To_unversioned_VerifierStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_Verifier_To_unversioned_Verifier is an autogenerated conversion function. -func Convert_v1beta1_Verifier_To_unversioned_Verifier(in *Verifier, out *unversioned.Verifier, s conversion.Scope) error { - return autoConvert_v1beta1_Verifier_To_unversioned_Verifier(in, out, s) -} - -func autoConvert_unversioned_Verifier_To_v1beta1_Verifier(in *unversioned.Verifier, out *Verifier, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_unversioned_VerifierSpec_To_v1beta1_VerifierSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_unversioned_VerifierStatus_To_v1beta1_VerifierStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_unversioned_Verifier_To_v1beta1_Verifier is an autogenerated conversion function. -func Convert_unversioned_Verifier_To_v1beta1_Verifier(in *unversioned.Verifier, out *Verifier, s conversion.Scope) error { - return autoConvert_unversioned_Verifier_To_v1beta1_Verifier(in, out, s) -} - -func autoConvert_v1beta1_VerifierList_To_unversioned_VerifierList(in *VerifierList, out *unversioned.VerifierList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]unversioned.Verifier)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_VerifierList_To_unversioned_VerifierList is an autogenerated conversion function. -func Convert_v1beta1_VerifierList_To_unversioned_VerifierList(in *VerifierList, out *unversioned.VerifierList, s conversion.Scope) error { - return autoConvert_v1beta1_VerifierList_To_unversioned_VerifierList(in, out, s) -} - -func autoConvert_unversioned_VerifierList_To_v1beta1_VerifierList(in *unversioned.VerifierList, out *VerifierList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]Verifier)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_unversioned_VerifierList_To_v1beta1_VerifierList is an autogenerated conversion function. -func Convert_unversioned_VerifierList_To_v1beta1_VerifierList(in *unversioned.VerifierList, out *VerifierList, s conversion.Scope) error { - return autoConvert_unversioned_VerifierList_To_v1beta1_VerifierList(in, out, s) -} - -func autoConvert_v1beta1_VerifierSpec_To_unversioned_VerifierSpec(in *VerifierSpec, out *unversioned.VerifierSpec, s conversion.Scope) error { - out.Name = in.Name - out.ArtifactTypes = in.ArtifactTypes - out.Address = in.Address - out.Source = (*unversioned.PluginSource)(unsafe.Pointer(in.Source)) - out.Parameters = in.Parameters - return nil -} - -// Convert_v1beta1_VerifierSpec_To_unversioned_VerifierSpec is an autogenerated conversion function. -func Convert_v1beta1_VerifierSpec_To_unversioned_VerifierSpec(in *VerifierSpec, out *unversioned.VerifierSpec, s conversion.Scope) error { - return autoConvert_v1beta1_VerifierSpec_To_unversioned_VerifierSpec(in, out, s) -} - -func autoConvert_unversioned_VerifierSpec_To_v1beta1_VerifierSpec(in *unversioned.VerifierSpec, out *VerifierSpec, s conversion.Scope) error { - out.Name = in.Name - out.ArtifactTypes = in.ArtifactTypes - out.Address = in.Address - out.Source = (*PluginSource)(unsafe.Pointer(in.Source)) - out.Parameters = in.Parameters - return nil -} - -// Convert_unversioned_VerifierSpec_To_v1beta1_VerifierSpec is an autogenerated conversion function. -func Convert_unversioned_VerifierSpec_To_v1beta1_VerifierSpec(in *unversioned.VerifierSpec, out *VerifierSpec, s conversion.Scope) error { - return autoConvert_unversioned_VerifierSpec_To_v1beta1_VerifierSpec(in, out, s) -} - -func autoConvert_v1beta1_VerifierStatus_To_unversioned_VerifierStatus(in *VerifierStatus, out *unversioned.VerifierStatus, s conversion.Scope) error { - return nil -} - -// Convert_v1beta1_VerifierStatus_To_unversioned_VerifierStatus is an autogenerated conversion function. -func Convert_v1beta1_VerifierStatus_To_unversioned_VerifierStatus(in *VerifierStatus, out *unversioned.VerifierStatus, s conversion.Scope) error { - return autoConvert_v1beta1_VerifierStatus_To_unversioned_VerifierStatus(in, out, s) -} - -func autoConvert_unversioned_VerifierStatus_To_v1beta1_VerifierStatus(in *unversioned.VerifierStatus, out *VerifierStatus, s conversion.Scope) error { - return nil -} - -// Convert_unversioned_VerifierStatus_To_v1beta1_VerifierStatus is an autogenerated conversion function. -func Convert_unversioned_VerifierStatus_To_v1beta1_VerifierStatus(in *unversioned.VerifierStatus, out *VerifierStatus, s conversion.Scope) error { - return autoConvert_unversioned_VerifierStatus_To_v1beta1_VerifierStatus(in, out, s) -} diff --git a/charts/ratify/crds/certificatestore-customresourcedefinition.yaml b/charts/ratify/crds/certificatestore-customresourcedefinition.yaml index a554e497d..ed055e8dc 100644 --- a/charts/ratify/crds/certificatestore-customresourcedefinition.yaml +++ b/charts/ratify/crds/certificatestore-customresourcedefinition.yaml @@ -1,12 +1,21 @@ ---- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: + cert-manager.io/inject-ca-from: gatekeeper-system/ratify-serving-cert controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null name: certificatestores.config.ratify.deislabs.io spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + name: ratify-webhook-service + namespace: gatekeeper-system + path: /convert + conversionReviewVersions: + - v1 group: config.ratify.deislabs.io names: kind: CertificateStore diff --git a/charts/ratify/crds/policy-customresourcedefinition.yaml b/charts/ratify/crds/policy-customresourcedefinition.yaml index 40f71392c..3af1d5364 100644 --- a/charts/ratify/crds/policy-customresourcedefinition.yaml +++ b/charts/ratify/crds/policy-customresourcedefinition.yaml @@ -1,12 +1,21 @@ ---- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: + cert-manager.io/inject-ca-from: gatekeeper-system/ratify-serving-cert controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null name: policies.config.ratify.deislabs.io spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + name: ratify-webhook-service + namespace: gatekeeper-system + path: /convert + conversionReviewVersions: + - v1 group: config.ratify.deislabs.io names: kind: Policy @@ -15,97 +24,92 @@ spec: singular: policy scope: Cluster versions: - - deprecated: true - deprecationWarning: - v1alpha1 of the Policy API has been deprecated. Please migrate - to v1beta1. - name: v1alpha1 - schema: - openAPIV3Schema: - description: Policy is the Schema for the policies 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: PolicySpec defines the desired state of Policy - properties: - parameters: - description: Parameters for this policy - type: object - x-kubernetes-preserve-unknown-fields: true - type: object - status: - description: PolicyStatus defines the observed state of Policy - type: object - type: object - served: true - storage: false - - additionalPrinterColumns: - - jsonPath: .status.issuccess - name: IsSuccess - type: boolean - - jsonPath: .status.brieferror - name: Error - type: string - name: v1beta1 - schema: - openAPIV3Schema: - description: Policy is the Schema for the policies 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: PolicySpec defines the desired state of Policy - properties: - parameters: - description: Parameters for this policy - type: object - x-kubernetes-preserve-unknown-fields: true - type: - description: Type of the policy - type: string - type: object - status: - description: PolicyStatus defines the observed state of Policy - properties: - brieferror: - description: Truncated error message if the message is too long - type: string - error: - description: Error message if policy is not successfully applied. - type: string - issuccess: - description: Is successful while applying the policy. - type: boolean - required: - - issuccess - type: object - type: object - served: true - storage: true - subresources: - status: {} + - deprecated: true + deprecationWarning: v1alpha1 of the Policy API has been deprecated. Please migrate + to v1beta1. + name: v1alpha1 + schema: + openAPIV3Schema: + description: Policy is the Schema for the policies 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: PolicySpec defines the desired state of Policy + properties: + parameters: + description: Parameters for this policy + type: object + x-kubernetes-preserve-unknown-fields: true + type: object + status: + description: PolicyStatus defines the observed state of Policy + type: object + type: object + served: true + storage: false + - additionalPrinterColumns: + - jsonPath: .status.issuccess + name: IsSuccess + type: boolean + - jsonPath: .status.brieferror + name: Error + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: Policy is the Schema for the policies 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: PolicySpec defines the desired state of Policy + properties: + parameters: + description: Parameters for this policy + type: object + x-kubernetes-preserve-unknown-fields: true + type: + description: Type of the policy + type: string + type: object + status: + description: PolicyStatus defines the observed state of Policy + properties: + brieferror: + description: Truncated error message if the message is too long + type: string + error: + description: Error message if policy is not successfully applied. + type: string + issuccess: + description: Is successful while applying the policy. + type: boolean + required: + - issuccess + type: object + type: object + served: true + storage: true + subresources: + status: {} \ No newline at end of file diff --git a/charts/ratify/crds/store-customresourcedefinition.yaml b/charts/ratify/crds/store-customresourcedefinition.yaml index cfef6bbcf..180632158 100644 --- a/charts/ratify/crds/store-customresourcedefinition.yaml +++ b/charts/ratify/crds/store-customresourcedefinition.yaml @@ -2,10 +2,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: + cert-manager.io/inject-ca-from: gatekeeper-system/ratify-serving-cert controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null name: stores.config.ratify.deislabs.io spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + name: ratify-webhook-service + namespace: gatekeeper-system + path: /convert + conversionReviewVersions: + - v1 group: config.ratify.deislabs.io names: kind: Store @@ -15,7 +25,7 @@ spec: scope: Cluster versions: - deprecated: true - deprecationWarning: v1alpha1 of the eraser API has been deprecated. Please migrate + deprecationWarning: v1alpha1 of the Store API has been deprecated. Please migrate to v1beta1. name: v1alpha1 schema: @@ -114,4 +124,4 @@ spec: type: object type: object served: true - storage: true + storage: true \ No newline at end of file diff --git a/charts/ratify/crds/verifier-customresourcedefinition.yaml b/charts/ratify/crds/verifier-customresourcedefinition.yaml index f5da1f4d0..02420a48f 100644 --- a/charts/ratify/crds/verifier-customresourcedefinition.yaml +++ b/charts/ratify/crds/verifier-customresourcedefinition.yaml @@ -2,10 +2,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: + cert-manager.io/inject-ca-from: gatekeeper-system/ratify-serving-cert controller-gen.kubebuilder.io/version: v0.9.2 - creationTimestamp: null name: verifiers.config.ratify.deislabs.io spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + name: ratify-webhook-service + namespace: gatekeeper-system + path: /convert + conversionReviewVersions: + - v1 group: config.ratify.deislabs.io names: kind: Verifier @@ -14,110 +24,117 @@ spec: singular: verifier scope: Cluster versions: - - deprecated: true - deprecationWarning: v1alpha1 of the eraser API has been deprecated. Please migrate - to v1beta1. - name: v1alpha1 - schema: - openAPIV3Schema: - description: Verifier is the Schema for the verifiers 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: VerifierSpec defines the desired state of Verifier - properties: - address: - description: '# Optional. URL/file path' - type: string - artifactTypes: - description: The type of artifact this verifier handles - type: string - name: - description: Name of the verifier - type: string - parameters: - description: Parameters for this verifier - type: object - x-kubernetes-preserve-unknown-fields: true - source: - description: OCI Artifact source to download the plugin from, optional - properties: - artifact: - description: OCI Artifact source to download the plugin from - type: string - authProvider: - description: AuthProvider to use to authenticate to the OCI Artifact - source, optional - type: object - x-kubernetes-preserve-unknown-fields: true - type: object - type: object - status: - description: VerifierStatus defines the observed state of Verifier - type: object - type: object - served: true - storage: false - - name: v1beta1 - schema: - openAPIV3Schema: - description: Verifier is the Schema for the verifiers 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: VerifierSpec defines the desired state of Verifier - properties: - address: - description: '# Optional. URL/file path' - type: string - artifactTypes: - description: The type of artifact this verifier handles - type: string - name: - description: Name of the verifier - type: string - parameters: - description: Parameters for this verifier - type: object - x-kubernetes-preserve-unknown-fields: true - source: - description: OCI Artifact source to download the plugin from, optional - properties: - artifact: - description: OCI Artifact source to download the plugin from - type: string - authProvider: - description: AuthProvider to use to authenticate to the OCI Artifact - source, optional - type: object - x-kubernetes-preserve-unknown-fields: true - type: object - type: object - status: - description: VerifierStatus defines the observed state of Verifier - type: object - type: object - served: true - storage: true + - deprecated: true + deprecationWarning: + v1alpha1 of the Verifier API has been deprecated. Please migrate + to v1beta1. + name: v1alpha1 + schema: + openAPIV3Schema: + description: Verifier is the Schema for the verifiers 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: VerifierSpec defines the desired state of Verifier + properties: + address: + description: "# Optional. URL/file path" + type: string + artifactTypes: + description: The type of artifact this verifier handles + type: string + name: + description: Name of the verifier + type: string + parameters: + description: Parameters for this verifier + type: object + x-kubernetes-preserve-unknown-fields: true + source: + description: OCI Artifact source to download the plugin from, optional + properties: + artifact: + description: OCI Artifact source to download the plugin from + type: string + authProvider: + description: + AuthProvider to use to authenticate to the OCI Artifact + source, optional + type: object + x-kubernetes-preserve-unknown-fields: true + type: object + type: object + status: + description: VerifierStatus defines the observed state of Verifier + type: object + type: object + served: true + storage: false + - name: v1beta1 + schema: + openAPIV3Schema: + description: Verifier is the Schema for the verifiers 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: VerifierSpec defines the desired state of Verifier + properties: + address: + description: "# Optional. URL/file path" + type: string + artifactTypes: + description: The type of artifact this verifier handles + type: string + name: + description: Name of the verifier + type: string + parameters: + description: Parameters for this verifier + type: object + x-kubernetes-preserve-unknown-fields: true + source: + description: OCI Artifact source to download the plugin from, optional + properties: + artifact: + description: OCI Artifact source to download the plugin from + type: string + authProvider: + description: + AuthProvider to use to authenticate to the OCI Artifact + source, optional + type: object + x-kubernetes-preserve-unknown-fields: true + type: object + type: object + status: + description: VerifierStatus defines the observed state of Verifier + type: object + type: object + served: true + storage: true diff --git a/charts/ratify/templates/certificate.yaml b/charts/ratify/templates/certificate.yaml new file mode 100644 index 000000000..94bc04ddb --- /dev/null +++ b/charts/ratify/templates/certificate.yaml @@ -0,0 +1,36 @@ +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + labels: + app.kubernetes.io/component: certificate + app.kubernetes.io/created-by: ratify + app.kubernetes.io/instance: serving-cert + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: certificate + app.kubernetes.io/part-of: ratify + name: ratify-serving-cert + namespace: gatekeeper-system +spec: + dnsNames: + - ratify-webhook-service.gatekeeper-system.svc + - ratify-webhook-service.gatekeeper-system.svc.cluster.local + issuerRef: + kind: Issuer + name: ratify-selfsigned-issuer + secretName: webhook-server-cert + +--- +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + labels: + app.kuberentes.io/name: issuer + app.kubernetes.io/component: certificate + app.kubernetes.io/created-by: ratify + app.kubernetes.io/instance: selfsigned-issuer + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/part-of: ratify + name: ratify-selfsigned-issuer + namespace: gatekeeper-system +spec: + selfSigned: {} \ No newline at end of file diff --git a/charts/ratify/templates/deployment.yaml b/charts/ratify/templates/deployment.yaml index 0df4017c4..32a5546a8 100644 --- a/charts/ratify/templates/deployment.yaml +++ b/charts/ratify/templates/deployment.yaml @@ -10,6 +10,7 @@ spec: selector: matchLabels: {{- include "ratify.selectorLabels" . | nindent 6 }} + control-plane: controller-manager template: metadata: labels: @@ -17,6 +18,7 @@ spec: {{- if .Values.oras.authProviders.azureWorkloadIdentityEnabled }} azure.workload.identity/use: "true" {{- end }} + control-plane: controller-manager annotations: {{- if eq .Values.instrumentation.metricsType "prometheus" }} prometheus.io/scrape: "true" @@ -87,7 +89,10 @@ spec: - containerPort: {{ required "You must provide .Values.healthPort" .Values.healthPort }} name: healthz protocol: TCP - volumeMounts: + volumeMounts: + - mountPath: /tmp/k8s-webhook-server/serving-certs + name: cert + readOnly: true {{- if .Values.cosign.enabled }} - mountPath: "/usr/local/ratify-certs/cosign" name: cosign-certs @@ -150,6 +155,10 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} volumes: + - name: cert + secret: + defaultMode: 420 + secretName: webhook-server-cert {{- if .Values.cosign.enabled }} - name: cosign-certs secret: diff --git a/charts/ratify/templates/ratify-manager-role-role.yaml b/charts/ratify/templates/ratify-manager-role-role.yaml index f0dec9bd6..0121bb15a 100644 --- a/charts/ratify/templates/ratify-manager-role-role.yaml +++ b/charts/ratify/templates/ratify-manager-role-role.yaml @@ -4,6 +4,7 @@ kind: Role metadata: creationTimestamp: null name: ratify-manager-role + namespace: '{{ .Release.Namespace }}' rules: - apiGroups: - "" @@ -21,4 +22,35 @@ rules: - list - update - watch +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete +- apiGroups: + - "" + resources: + - events + verbs: + - create + - patch {{- end }} diff --git a/charts/ratify/templates/service.yaml b/charts/ratify/templates/service.yaml index e15dd5dfc..b50b9f235 100644 --- a/charts/ratify/templates/service.yaml +++ b/charts/ratify/templates/service.yaml @@ -11,3 +11,25 @@ spec: targetPort: 6001 selector: {{- include "ratify.selectorLabels" . | nindent 4 }} + +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: webhook + app.kubernetes.io/created-by: ratify + app.kubernetes.io/instance: webhook-service + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: service + app.kubernetes.io/part-of: ratify + name: ratify-webhook-service + namespace: gatekeeper-system +spec: + ports: + - port: 443 + protocol: TCP + targetPort: 9443 + selector: + control-plane: controller-manager + app.kubernetes.io/name: ratify diff --git a/config/certmanager/certificate.yaml b/config/certmanager/certificate.yaml new file mode 100644 index 000000000..0a8c26c2d --- /dev/null +++ b/config/certmanager/certificate.yaml @@ -0,0 +1,39 @@ +# The following manifests contain a self-signed issuer CR and a certificate CR. +# More document can be found at https://docs.cert-manager.io +# WARNING: Targets CertManager v1.0. Check https://cert-manager.io/docs/installation/upgrading/ for breaking changes. +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + labels: + app.kuberentes.io/name: issuer + app.kubernetes.io/instance: selfsigned-issuer + app.kubernetes.io/component: certificate + app.kubernetes.io/created-by: ratify + app.kubernetes.io/part-of: ratify + app.kubernetes.io/managed-by: kustomize + name: selfsigned-issuer + namespace: system +spec: + selfSigned: {} +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + labels: + app.kubernetes.io/name: certificate + app.kubernetes.io/instance: serving-cert + app.kubernetes.io/component: certificate + app.kubernetes.io/created-by: ratify + app.kubernetes.io/part-of: ratify + app.kubernetes.io/managed-by: kustomize + name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml + namespace: system +spec: + # $(SERVICE_NAME) and $(SERVICE_NAMESPACE) will be substituted by kustomize + dnsNames: + - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc + - $(SERVICE_NAME).$(SERVICE_NAMESPACE).svc.cluster.local + issuerRef: + kind: Issuer + name: selfsigned-issuer + secretName: webhook-server-cert # this secret will not be prefixed, since it's not managed by kustomize diff --git a/config/certmanager/kustomization.yaml b/config/certmanager/kustomization.yaml new file mode 100644 index 000000000..bebea5a59 --- /dev/null +++ b/config/certmanager/kustomization.yaml @@ -0,0 +1,5 @@ +resources: +- certificate.yaml + +configurations: +- kustomizeconfig.yaml diff --git a/config/certmanager/kustomizeconfig.yaml b/config/certmanager/kustomizeconfig.yaml new file mode 100644 index 000000000..90d7c313c --- /dev/null +++ b/config/certmanager/kustomizeconfig.yaml @@ -0,0 +1,16 @@ +# This configuration is for teaching kustomize how to update name ref and var substitution +nameReference: +- kind: Issuer + group: cert-manager.io + fieldSpecs: + - kind: Certificate + group: cert-manager.io + path: spec/issuerRef/name + +varReference: +- kind: Certificate + group: cert-manager.io + path: spec/commonName +- kind: Certificate + group: cert-manager.io + path: spec/dnsNames diff --git a/config/crd/bases/config.ratify.deislabs.io_certificatestores.yaml b/config/crd/bases/config.ratify.deislabs.io_certificatestores.yaml index ffd466817..abafa948b 100644 --- a/config/crd/bases/config.ratify.deislabs.io_certificatestores.yaml +++ b/config/crd/bases/config.ratify.deislabs.io_certificatestores.yaml @@ -111,7 +111,7 @@ spec: format: date-time type: string properties: - description: provider specific parameters of the each individual certificate + description: provider specific properties of the each individual certificate type: object x-kubernetes-preserve-unknown-fields: true required: diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index df29c21ed..6ec308a76 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -11,20 +11,20 @@ resources: patchesStrategicMerge: # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. # patches here are for enabling the conversion webhook for each CRD - #- patches/webhook_in_verifiers.yaml - #- patches/webhook_in_stores.yaml - #- patches/webhook_in_certificatestores.yaml - #- patches/webhook_in_policies.yaml + - patches/webhook_in_verifiers.yaml + - patches/webhook_in_stores.yaml + - patches/webhook_in_certificatestores.yaml + - patches/webhook_in_policies.yaml #+kubebuilder:scaffold:crdkustomizewebhookpatch # [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix. # patches here are for enabling the CA injection for each CRD - #- patches/cainjection_in_verifiers.yaml - #- patches/cainjection_in_stores.yaml - #- patches/cainjection_in_certificatestores.yaml - #- patches/cainjection_in_policies.yaml + - patches/cainjection_in_verifiers.yaml + - patches/cainjection_in_stores.yaml + - patches/cainjection_in_certificatestores.yaml + - patches/cainjection_in_policies.yaml #+kubebuilder:scaffold:crdkustomizecainjectionpatch # the following config is for teaching kustomize how to do kustomization for CRDs. configurations: -- kustomizeconfig.yaml + - kustomizeconfig.yaml diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 25249491c..d2a020865 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -1,5 +1,5 @@ # Adds namespace to all resources. -namespace: ratify-system +namespace: gatekeeper-system # Value of this field is prepended to the # names of all resources, e.g. a deployment named @@ -13,22 +13,22 @@ namePrefix: ratify- # someName: someValue bases: -- ../crd -- ../rbac -- ../manager -# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in -# crd/kustomization.yaml -#- ../webhook -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. -#- ../certmanager + - ../crd + - ../rbac + - ../manager + # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in + # crd/kustomization.yaml + - ../webhook + # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. + - ../certmanager # [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. #- ../prometheus patchesStrategicMerge: -# Protect the /metrics endpoint by putting it behind auth. -# If you want your controller-manager to expose the /metrics -# endpoint w/o any authn/z, please comment the following line. -- manager_auth_proxy_patch.yaml + # Protect the /metrics endpoint by putting it behind auth. + # If you want your controller-manager to expose the /metrics + # endpoint w/o any authn/z, please comment the following line. + - manager_auth_proxy_patch.yaml # Mount the controller config file for loading manager configurations # through a ComponentConfig type @@ -36,39 +36,39 @@ patchesStrategicMerge: # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml -#- manager_webhook_patch.yaml + - manager_webhook_patch.yaml # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. # Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks. # 'CERTMANAGER' needs to be enabled to use ca injection -#- webhookcainjection_patch.yaml +# - webhookcainjection_patch.yaml # the following config is for teaching kustomize how to do var substitution vars: -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. -#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR -# objref: -# kind: Certificate -# group: cert-manager.io -# version: v1 -# name: serving-cert # this name should match the one in certificate.yaml -# fieldref: -# fieldpath: metadata.namespace -#- name: CERTIFICATE_NAME -# objref: -# kind: Certificate -# group: cert-manager.io -# version: v1 -# name: serving-cert # this name should match the one in certificate.yaml -#- name: SERVICE_NAMESPACE # namespace of the service -# objref: -# kind: Service -# version: v1 -# name: webhook-service -# fieldref: -# fieldpath: metadata.namespace -#- name: SERVICE_NAME -# objref: -# kind: Service -# version: v1 -# name: webhook-service + # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. + - name: CERTIFICATE_NAMESPACE # namespace of the certificate CR + objref: + kind: Certificate + group: cert-manager.io + version: v1 + name: serving-cert # this name should match the one in certificate.yaml + fieldref: + fieldpath: metadata.namespace + - name: CERTIFICATE_NAME + objref: + kind: Certificate + group: cert-manager.io + version: v1 + name: serving-cert # this name should match the one in certificate.yaml + - name: SERVICE_NAMESPACE # namespace of the service + objref: + kind: Service + version: v1 + name: webhook-service + fieldref: + fieldpath: metadata.namespace + - name: SERVICE_NAME + objref: + kind: Service + version: v1 + name: webhook-service diff --git a/config/default/manager_webhook_patch.yaml b/config/default/manager_webhook_patch.yaml new file mode 100644 index 000000000..738de350b --- /dev/null +++ b/config/default/manager_webhook_patch.yaml @@ -0,0 +1,23 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: controller-manager + namespace: system +spec: + template: + spec: + containers: + - name: manager + ports: + - containerPort: 9443 + name: webhook-server + protocol: TCP + volumeMounts: + - mountPath: /tmp/k8s-webhook-server/serving-certs + name: cert + readOnly: true + volumes: + - name: cert + secret: + defaultMode: 420 + secretName: webhook-server-cert diff --git a/config/default/webhookcainjection_patch.yaml b/config/default/webhookcainjection_patch.yaml new file mode 100644 index 000000000..16bf6acd6 --- /dev/null +++ b/config/default/webhookcainjection_patch.yaml @@ -0,0 +1,29 @@ +# This patch add annotation to admission webhook config and +# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize. +apiVersion: admissionregistration.k8s.io/v1 +kind: MutatingWebhookConfiguration +metadata: + labels: + app.kubernetes.io/name: mutatingwebhookconfiguration + app.kubernetes.io/instance: mutating-webhook-configuration + app.kubernetes.io/component: webhook + app.kubernetes.io/created-by: ratify + app.kubernetes.io/part-of: ratify + app.kubernetes.io/managed-by: kustomize + name: mutating-webhook-configuration + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) +--- +apiVersion: admissionregistration.k8s.io/v1 +kind: ValidatingWebhookConfiguration +metadata: + labels: + app.kubernetes.io/name: validatingwebhookconfiguration + app.kubernetes.io/instance: validating-webhook-configuration + app.kubernetes.io/component: webhook + app.kubernetes.io/created-by: ratify + app.kubernetes.io/part-of: ratify + app.kubernetes.io/managed-by: kustomize + name: validating-webhook-configuration + annotations: + cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 2bcd3eeaa..508f8ccde 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -5,6 +5,6 @@ generatorOptions: disableNameSuffixHash: true configMapGenerator: -- name: manager-config - files: +- files: - controller_manager_config.yaml + name: manager-config \ No newline at end of file diff --git a/config/samples/config_v1beta1_certstore_inline.yaml b/config/samples/config_v1beta1_certstore_inline.yaml index 17156645c..651859ae5 100644 --- a/config/samples/config_v1beta1_certstore_inline.yaml +++ b/config/samples/config_v1beta1_certstore_inline.yaml @@ -1,4 +1,4 @@ -apiVersion: config.ratify.deislabs.io/v1beta1 +apiVersion: config.ratify.deislabs.io/v1alpha1 kind: CertificateStore metadata: name: certstore-inline diff --git a/config/samples/policy/config_v1alpha1_policy_rego.yaml b/config/samples/policy/config_v1alpha1_policy_rego.yaml index f80978309..a54f7a5ab 100644 --- a/config/samples/policy/config_v1alpha1_policy_rego.yaml +++ b/config/samples/policy/config_v1alpha1_policy_rego.yaml @@ -1,7 +1,7 @@ apiVersion: config.ratify.deislabs.io/v1alpha1 kind: Policy metadata: - name: "regopolicy" + name: "rego-policy" spec: parameters: passthroughEnabled: false @@ -28,4 +28,3 @@ spec: path[count(path) - 1] == "verifierReports" count(value) == 0 } - diff --git a/config/webhook/kustomization.yaml b/config/webhook/kustomization.yaml new file mode 100644 index 000000000..4a7236df1 --- /dev/null +++ b/config/webhook/kustomization.yaml @@ -0,0 +1,6 @@ +resources: +# - manifests.yaml +- service.yaml + +configurations: +- kustomizeconfig.yaml diff --git a/config/webhook/kustomizeconfig.yaml b/config/webhook/kustomizeconfig.yaml new file mode 100644 index 000000000..25e21e3c9 --- /dev/null +++ b/config/webhook/kustomizeconfig.yaml @@ -0,0 +1,25 @@ +# the following config is for teaching kustomize where to look at when substituting vars. +# It requires kustomize v2.1.0 or newer to work properly. +nameReference: +- kind: Service + version: v1 + fieldSpecs: + - kind: MutatingWebhookConfiguration + group: admissionregistration.k8s.io + path: webhooks/clientConfig/service/name + - kind: ValidatingWebhookConfiguration + group: admissionregistration.k8s.io + path: webhooks/clientConfig/service/name + +namespace: +- kind: MutatingWebhookConfiguration + group: admissionregistration.k8s.io + path: webhooks/clientConfig/service/namespace + create: true +- kind: ValidatingWebhookConfiguration + group: admissionregistration.k8s.io + path: webhooks/clientConfig/service/namespace + create: true + +varReference: +- path: metadata/annotations diff --git a/config/webhook/service.yaml b/config/webhook/service.yaml new file mode 100644 index 000000000..71c62b285 --- /dev/null +++ b/config/webhook/service.yaml @@ -0,0 +1,20 @@ + +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/name: service + app.kubernetes.io/instance: webhook-service + app.kubernetes.io/component: webhook + app.kubernetes.io/created-by: ratify + app.kubernetes.io/part-of: ratify + app.kubernetes.io/managed-by: kustomize + name: webhook-service + namespace: system +spec: + ports: + - port: 443 + protocol: TCP + targetPort: 9443 + selector: + control-plane: controller-manager diff --git a/pkg/controllers/certificatestore_controller.go b/pkg/controllers/certificatestore_controller.go index b7c040930..78c494e9d 100644 --- a/pkg/controllers/certificatestore_controller.go +++ b/pkg/controllers/certificatestore_controller.go @@ -125,7 +125,7 @@ func (r *CertificateStoreReconciler) SetupWithManager(mgr ctrl.Manager) error { // status updates will trigger a reconcile event // if there are no changes to spec of CRD, this event should be filtered out by using the predicate - // see more discussions at https://github.com/kubernetes-sigs/kubebuilder/issues/618 + // see more discussions at https://github.com/kubernetes-sigs/kubebuilder/issues/618NewWebhookManagedBy return ctrl.NewControllerManagedBy(mgr). For(&configv1beta1.CertificateStore{}).WithEventFilter(pred). Complete(r) diff --git a/pkg/manager/manager.go b/pkg/manager/manager.go index ea045df62..a0e7b80bd 100644 --- a/pkg/manager/manager.go +++ b/pkg/manager/manager.go @@ -47,7 +47,9 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/healthz" + "github.com/deislabs/ratify/api/v1alpha1" configv1alpha1 "github.com/deislabs/ratify/api/v1alpha1" + "github.com/deislabs/ratify/api/v1beta1" configv1beta1 "github.com/deislabs/ratify/api/v1beta1" "github.com/deislabs/ratify/pkg/controllers" ef "github.com/deislabs/ratify/pkg/executor/core" @@ -253,6 +255,39 @@ func StartManager(certRotatorReady chan struct{}, probeAddr string) { } //+kubebuilder:scaffold:builder + if err := (&v1alpha1.CertificateStore{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "CertificateStore") + os.Exit(1) + } + if err := (&v1beta1.CertificateStore{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "CertificateStore") + os.Exit(1) + } + if err := (&v1alpha1.Policy{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "Policy") + os.Exit(1) + } + if err := (&v1beta1.Policy{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "Policy") + os.Exit(1) + } + if err := (&v1alpha1.Verifier{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "Verifier") + os.Exit(1) + } + if err := (&v1beta1.Verifier{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "Verifier") + os.Exit(1) + } + if err := (&v1alpha1.Store{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "Store") + os.Exit(1) + } + if err := (&v1beta1.Store{}).SetupWebhookWithManager(mgr); err != nil { + setupLog.Error(err, "unable to create webhook", "webhook", "Store") + os.Exit(1) + } + if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil { setupLog.Error(err, "unable to set up health check") os.Exit(1)