diff --git a/infra/v1alpha1/nephio_config_types.go b/infra/v1alpha1/nephio_config_types.go new file mode 100644 index 00000000..00f127ed --- /dev/null +++ b/infra/v1alpha1/nephio_config_types.go @@ -0,0 +1,83 @@ +/* +Copyright 2023 The Nephio 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 ( + "reflect" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// NephioClusterPackageConfigSpec provides the provider-independent +// Nephio configuration information needed by a Nephio cluster package +// to provision clusters. This is information about the Nephio platform +// configuration, not the cluster configuration. +type NephioClusterPackageConfigSpec struct { + // NephioCatalogRepo is the name of the Porch blueprints repository + // containing the Nephio system packages. + // +kubebuilder:default=nephio-catalog + // +optional + NephioCatalogRepo *string `json:"nephioCatalogRepo,omitempty" yaml:"nephioCatalogRepo,omitempty"` + // NephioMgmtRepo is the name of the Porch deployment repository for the + // Nephio management cluster. + // +kubebuilder:default=nephio-mgmt + // +optional + NephioMgmtRepo *string `json:"nephioMgmtRepo,omitempty" yaml:"nephioMgmtRepo,omitempty"` + // NephioStagingRepo is the name of the Porch deployment repository + // used for staging packages for new clusters. + // +kubebuilder:default=nephio-staging + // +optional + NephioStagingRepo *string `json:"nephioStagingRepo,omitempty" yaml:"nephioStagingRepo,omitempty"` +} + +// NephioClusterPackageConfigStatus defines the observed state of NephioClusterPackageConfig +type NephioClusterPackageConfigStatus struct { +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status + +// NephioClusterPackageConfig is the Schema for the Nephio Cluster Package Config API +type NephioClusterPackageConfig struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"` + + Spec NephioClusterPackageConfigSpec `json:"spec,omitempty" yaml:"spec,omitempty"` + Status NephioClusterPackageConfigStatus `json:"status,omitempty" yaml:"status,omitempty"` +} + +//+kubebuilder:object:root=true + +// NephioClusterPackageConfigList contains a list of Repositories +type NephioClusterPackageConfigList struct { + metav1.TypeMeta `json:",inline" yaml:",inline"` + metav1.ListMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"` + Items []NephioClusterPackageConfig `json:"items" yaml:"items"` +} + +func init() { + SchemeBuilder.Register(&NephioClusterPackageConfig{}, &NephioClusterPackageConfigList{}) +} + +// NephioClusterPackageConfig type metadata. +var ( + NephioClusterPackageConfigKind = reflect.TypeOf(NephioClusterPackageConfig{}).Name() + NephioClusterPackageConfigGroupKind = schema.GroupKind{Group: GroupVersion.Group, Kind: NephioClusterPackageConfigKind}.String() + NephioClusterPackageConfigKindAPIVersion = NephioClusterPackageConfigKind + "." + GroupVersion.String() + NephioClusterPackageConfigGroupVersionKind = GroupVersion.WithKind(NephioClusterPackageConfigKind) +) diff --git a/infra/v1alpha1/zz_generated.deepcopy.go b/infra/v1alpha1/zz_generated.deepcopy.go index fee14288..ca3a80cc 100644 --- a/infra/v1alpha1/zz_generated.deepcopy.go +++ b/infra/v1alpha1/zz_generated.deepcopy.go @@ -177,6 +177,110 @@ func (in *ConditionedStatus) DeepCopy() *ConditionedStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NephioClusterPackageConfig) DeepCopyInto(out *NephioClusterPackageConfig) { + *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 NephioClusterPackageConfig. +func (in *NephioClusterPackageConfig) DeepCopy() *NephioClusterPackageConfig { + if in == nil { + return nil + } + out := new(NephioClusterPackageConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NephioClusterPackageConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NephioClusterPackageConfigList) DeepCopyInto(out *NephioClusterPackageConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NephioClusterPackageConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NephioClusterPackageConfigList. +func (in *NephioClusterPackageConfigList) DeepCopy() *NephioClusterPackageConfigList { + if in == nil { + return nil + } + out := new(NephioClusterPackageConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NephioClusterPackageConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NephioClusterPackageConfigSpec) DeepCopyInto(out *NephioClusterPackageConfigSpec) { + *out = *in + if in.NephioCatalogRepo != nil { + in, out := &in.NephioCatalogRepo, &out.NephioCatalogRepo + *out = new(string) + **out = **in + } + if in.NephioMgmtRepo != nil { + in, out := &in.NephioMgmtRepo, &out.NephioMgmtRepo + *out = new(string) + **out = **in + } + if in.NephioStagingRepo != nil { + in, out := &in.NephioStagingRepo, &out.NephioStagingRepo + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NephioClusterPackageConfigSpec. +func (in *NephioClusterPackageConfigSpec) DeepCopy() *NephioClusterPackageConfigSpec { + if in == nil { + return nil + } + out := new(NephioClusterPackageConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NephioClusterPackageConfigStatus) DeepCopyInto(out *NephioClusterPackageConfigStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NephioClusterPackageConfigStatus. +func (in *NephioClusterPackageConfigStatus) DeepCopy() *NephioClusterPackageConfigStatus { + if in == nil { + return nil + } + out := new(NephioClusterPackageConfigStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Repository) DeepCopyInto(out *Repository) { *out = *in