diff --git a/api/v1/assetdb_types.go b/api/v1/assetdb_types.go index 71f9e5e..c61ad12 100644 --- a/api/v1/assetdb_types.go +++ b/api/v1/assetdb_types.go @@ -28,14 +28,13 @@ type AssetDBSpec struct { // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster // Important: Run "make" to regenerate code after modifying this file - // Foo is an example field of AssetDB. Edit assetdb_types.go to remove/update - AssetName string `json:"assetname,omitempty"` - Clusters []ClusterItem `json:"clusters,omitempty"` + AssetName string `json:"assetname,omitempty"` + AssetClusters []AssetCluster `json:"assetclusters,omitempty"` } -type ClusterItem struct { - Name string `json:"name,omitempty"` - Environment []string `json:"environment,omitempty"` +type AssetCluster struct { + ClusterName string `json:"clustername,omitempty"` + AssetEnvironment []string `json:"assetenvironment,omitempty"` } // AssetDBStatus defines the observed state of AssetDB diff --git a/api/v1/shard_types.go b/api/v1/shard_types.go index 538fc8a..cdca369 100644 --- a/api/v1/shard_types.go +++ b/api/v1/shard_types.go @@ -28,16 +28,15 @@ type ShardSpec struct { // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster // Important: Run "make" to regenerate code after modifying this file - // Foo is an example field of Shard. Edit shard_types.go to remove/update Clusters []ClusterShards `json:"clusters,omitempty"` } type ClusterShards struct { - Name string `json:"name,omitempty"` - Assets []AssetItem `json:"assets,omitempty"` + Name string `json:"name,omitempty"` + Assets []Asset `json:"assets,omitempty"` } -type AssetItem struct { +type Asset struct { Name string `json:"name,omitempty"` Environment string `json:"environment,omitempty"` } @@ -46,6 +45,11 @@ type AssetItem struct { type ShardStatus struct { // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster // Important: Run "make" to regenerate code after modifying this file + Workers []Worker `json:"workers,omitempty"` +} + +type Worker struct { + Name string `json:"name,omitempty"` } //+kubebuilder:object:root=true diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index b4e6370..b146c6d 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -25,12 +25,47 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Asset) DeepCopyInto(out *Asset) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Asset. +func (in *Asset) DeepCopy() *Asset { + if in == nil { + return nil + } + out := new(Asset) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AssetCluster) DeepCopyInto(out *AssetCluster) { + *out = *in + if in.AssetEnvironment != nil { + in, out := &in.AssetEnvironment, &out.AssetEnvironment + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetCluster. +func (in *AssetCluster) DeepCopy() *AssetCluster { + if in == nil { + return nil + } + out := new(AssetCluster) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AssetDB) DeepCopyInto(out *AssetDB) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec + in.Spec.DeepCopyInto(&out.Spec) out.Status = in.Status } @@ -87,6 +122,13 @@ func (in *AssetDBList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AssetDBSpec) DeepCopyInto(out *AssetDBSpec) { *out = *in + if in.AssetClusters != nil { + in, out := &in.AssetClusters, &out.AssetClusters + *out = make([]AssetCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AssetDBSpec. @@ -114,13 +156,33 @@ func (in *AssetDBStatus) DeepCopy() *AssetDBStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterShards) DeepCopyInto(out *ClusterShards) { + *out = *in + if in.Assets != nil { + in, out := &in.Assets, &out.Assets + *out = make([]Asset, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterShards. +func (in *ClusterShards) DeepCopy() *ClusterShards { + if in == nil { + return nil + } + out := new(ClusterShards) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Shard) DeepCopyInto(out *Shard) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Shard. @@ -176,6 +238,13 @@ func (in *ShardList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ShardSpec) DeepCopyInto(out *ShardSpec) { *out = *in + if in.Clusters != nil { + in, out := &in.Clusters, &out.Clusters + *out = make([]ClusterShards, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardSpec. @@ -191,6 +260,11 @@ func (in *ShardSpec) DeepCopy() *ShardSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ShardStatus) DeepCopyInto(out *ShardStatus) { *out = *in + if in.Workers != nil { + in, out := &in.Workers, &out.Workers + *out = make([]Worker, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardStatus. @@ -202,3 +276,18 @@ func (in *ShardStatus) DeepCopy() *ShardStatus { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Worker) DeepCopyInto(out *Worker) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Worker. +func (in *Worker) DeepCopy() *Worker { + if in == nil { + return nil + } + out := new(Worker) + in.DeepCopyInto(out) + return out +} diff --git a/config/crd/bases/admiral.io_assetdbs.yaml b/config/crd/bases/admiral.io_assetdbs.yaml index fd97974..d92acde 100644 --- a/config/crd/bases/admiral.io_assetdbs.yaml +++ b/config/crd/bases/admiral.io_assetdbs.yaml @@ -34,21 +34,19 @@ spec: spec: description: AssetDBSpec defines the desired state of AssetDB properties: - assetname: - description: Foo is an example field of AssetDB. Edit assetdb_types.go - to remove/update - type: string - clusters: + assetclusters: items: properties: - environment: + assetenvironment: items: type: string type: array - name: + clustername: type: string type: object type: array + assetname: + type: string type: object status: description: AssetDBStatus defines the observed state of AssetDB diff --git a/config/crd/bases/admiral.io_shards.yaml b/config/crd/bases/admiral.io_shards.yaml index 78f8eaf..7c09fe6 100644 --- a/config/crd/bases/admiral.io_shards.yaml +++ b/config/crd/bases/admiral.io_shards.yaml @@ -35,8 +35,6 @@ spec: description: ShardSpec defines the desired state of Shard properties: clusters: - description: Foo is an example field of Shard. Edit shard_types.go - to remove/update items: properties: assets: @@ -55,6 +53,17 @@ spec: type: object status: description: ShardStatus defines the observed state of Shard + properties: + workers: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed state + of cluster Important: Run "make" to regenerate code after modifying + this file' + items: + properties: + name: + type: string + type: object + type: array type: object type: object served: true