Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update crd #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions api/v1/assetdb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions api/v1/shard_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand All @@ -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
Expand Down
95 changes: 92 additions & 3 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 5 additions & 7 deletions config/crd/bases/admiral.io_assetdbs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions config/crd/bases/admiral.io_shards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down