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

Add schema #3

Merged
merged 1 commit into from
Jul 16, 2024
Merged
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
82 changes: 82 additions & 0 deletions apis/ui/v1alpha1/dbgate_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
Copyright AppsCode Inc. and Contributors

Licensed under the AppsCode Community License 1.0.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md

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 (
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
ResourceKindDbgate = "Dbgate"
ResourceDbgate = "dbgate"
ResourceDbgates = "dbgates"
)

// Dbgate defines the schama for Dbgate operator installer.

// +genclient
// +genclient:skipVerbs=updateStatus
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
type Dbgate struct {
metav1.TypeMeta `json:",inline,omitempty"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec DbgateSpec `json:"spec,omitempty"`
}

type DbgateSpec struct {
ReplicaCount int `json:"replicaCount"`
Image ImageRef `json:"image"`
ImagePullSecrets []string `json:"imagePullSecrets"`
NameOverride string `json:"nameOverride"`
FullnameOverride string `json:"fullnameOverride"`
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
PodAnnotations map[string]string `json:"podAnnotations"`
PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"`
SecurityContext *core.SecurityContext `json:"securityContext"`
Service ServiceSpec `json:"service"`
Resources core.ResourceRequirements `json:"resources"`
NodeSelector map[string]string `json:"nodeSelector"`
Tolerations []core.Toleration `json:"tolerations"`
Affinity *core.Affinity `json:"affinity"`
Namespace CreateFlag `json:"namespace"`
Gateway GatewaySpec `json:"gateway"`
Keda KedaSpec `json:"keda"`
TargetPendingRequests int `json:"targetPendingRequests"`
Autoscaling Autoscaling `json:"autoscaling"`
App DBRef `json:"app"`
Bind ObjectRef `json:"bind"`
Authzproxy AuthzproxySpec `json:"authzproxy"`
}

type DBRef struct {
AppRef `json:",inline"`
Kind string `json:"kind"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// DbgateList is a list of Dbgates
type DbgateList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
// Items is a list of Dbgate CRD objects
Items []Dbgate `json:"items,omitempty"`
}
88 changes: 88 additions & 0 deletions apis/ui/v1alpha1/mongo_ui_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
/*
Copyright AppsCode Inc. and Contributors

Licensed under the AppsCode Community License 1.0.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md

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 (
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
ResourceKindMongoUi = "MongoUi"
ResourceMongoUi = "mongoui"
ResourceMongoUis = "mongouis"
)

// MongoUi defines the schama for MongoUi operator installer.

// +genclient
// +genclient:skipVerbs=updateStatus
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
type MongoUi struct {
metav1.TypeMeta `json:",inline,omitempty"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec MongoUiSpec `json:"spec,omitempty"`
}

type MongoUiSpec struct {
ReplicaCount int `json:"replicaCount"`
Image ImageRef `json:"image"`
ImagePullSecrets []string `json:"imagePullSecrets"`
NameOverride string `json:"nameOverride"`
FullnameOverride string `json:"fullnameOverride"`
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
PodAnnotations map[string]string `json:"podAnnotations"`
PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"`
SecurityContext *core.SecurityContext `json:"securityContext"`
Service ServiceSpec `json:"service"`
Resources core.ResourceRequirements `json:"resources"`
NodeSelector map[string]string `json:"nodeSelector"`
Tolerations []core.Toleration `json:"tolerations"`
Affinity *core.Affinity `json:"affinity"`
Namespace CreateFlag `json:"namespace"`
Gateway GatewaySpec `json:"gateway"`
Keda KedaSpec `json:"keda"`
TargetPendingRequests int `json:"targetPendingRequests"`
Autoscaling Autoscaling `json:"autoscaling"`
App MongoRef `json:"app"`
TLS MongoUiTLS `json:"tls"`
Bind ObjectRef `json:"bind"`
Authzproxy AuthzproxySpec `json:"authzproxy"`
}

type MongoRef struct {
AppRef `json:",inline"`
Url string `json:"url"`
}

type MongoUiTLS struct {
Enabled bool `json:"enabled"`
SecretName string `json:"secretName"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// MongoUiList is a list of MongoUis
type MongoUiList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
// Items is a list of MongoUi CRD objects
Items []MongoUi `json:"items,omitempty"`
}
77 changes: 77 additions & 0 deletions apis/ui/v1alpha1/pgadmin_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
Copyright AppsCode Inc. and Contributors

Licensed under the AppsCode Community License 1.0.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md

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 (
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
ResourceKindPgadmin = "Pgadmin"
ResourcePgadmin = "pgadmin"
ResourcePgadmins = "pgadmins"
)

// Pgadmin defines the schama for Pgadmin operator installer.

// +genclient
// +genclient:skipVerbs=updateStatus
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
type Pgadmin struct {
metav1.TypeMeta `json:",inline,omitempty"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec PgadminSpec `json:"spec,omitempty"`
}

type PgadminSpec struct {
ReplicaCount int `json:"replicaCount"`
Image ImageRef `json:"image"`
ImagePullSecrets []string `json:"imagePullSecrets"`
NameOverride string `json:"nameOverride"`
FullnameOverride string `json:"fullnameOverride"`
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
PodAnnotations map[string]string `json:"podAnnotations"`
PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"`
SecurityContext *core.SecurityContext `json:"securityContext"`
Service ServiceSpec `json:"service"`
Resources core.ResourceRequirements `json:"resources"`
NodeSelector map[string]string `json:"nodeSelector"`
Tolerations []core.Toleration `json:"tolerations"`
Affinity *core.Affinity `json:"affinity"`
Namespace CreateFlag `json:"namespace"`
Gateway GatewaySpec `json:"gateway"`
Keda KedaSpec `json:"keda"`
TargetPendingRequests int `json:"targetPendingRequests"`
Autoscaling Autoscaling `json:"autoscaling"`
App AppRef `json:"app"`
Bind ObjectRef `json:"bind"`
Authzproxy AuthzproxySpec `json:"authzproxy"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// PgadminList is a list of Pgadmins
type PgadminList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
// Items is a list of Pgadmin CRD objects
Items []Pgadmin `json:"items,omitempty"`
}
77 changes: 77 additions & 0 deletions apis/ui/v1alpha1/phpmyadmin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
Copyright AppsCode Inc. and Contributors

Licensed under the AppsCode Community License 1.0.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md

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 (
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
ResourceKindPhpmyadmin = "Phpmyadmin"
ResourcePhpmyadmin = "phpmyadmin"
ResourcePhpmyadmins = "phpmyadmins"
)

// Phpmyadmin defines the schama for Phpmyadmin operator installer.

// +genclient
// +genclient:skipVerbs=updateStatus
// +k8s:openapi-gen=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// +kubebuilder:object:root=true
type Phpmyadmin struct {
metav1.TypeMeta `json:",inline,omitempty"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec PhpmyadminSpec `json:"spec,omitempty"`
}

type PhpmyadminSpec struct {
ReplicaCount int `json:"replicaCount"`
Image ImageRef `json:"image"`
ImagePullSecrets []string `json:"imagePullSecrets"`
NameOverride string `json:"nameOverride"`
FullnameOverride string `json:"fullnameOverride"`
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
PodAnnotations map[string]string `json:"podAnnotations"`
PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"`
SecurityContext *core.SecurityContext `json:"securityContext"`
Service ServiceSpec `json:"service"`
Resources core.ResourceRequirements `json:"resources"`
NodeSelector map[string]string `json:"nodeSelector"`
Tolerations []core.Toleration `json:"tolerations"`
Affinity *core.Affinity `json:"affinity"`
Namespace CreateFlag `json:"namespace"`
Gateway GatewaySpec `json:"gateway"`
Keda KedaSpec `json:"keda"`
TargetPendingRequests int `json:"targetPendingRequests"`
Autoscaling Autoscaling `json:"autoscaling"`
App AppRef `json:"app"`
Bind ObjectRef `json:"bind"`
Authzproxy AuthzproxySpec `json:"authzproxy"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// PhpmyadminList is a list of Phpmyadmins
type PhpmyadminList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
// Items is a list of Phpmyadmin CRD objects
Items []Phpmyadmin `json:"items,omitempty"`
}
11 changes: 10 additions & 1 deletion apis/ui/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@ func Resource(resource string) schema.GroupResource {

// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion)
scheme.AddKnownTypes(SchemeGroupVersion,
&Dbgate{},
&DbgateList{},
&MongoUi{},
&MongoUiList{},
&Pgadmin{},
&PgadminList{},
&Phpmyadmin{},
&PhpmyadminList{},
)

scheme.AddKnownTypes(SchemeGroupVersion,
&metav1.Status{},
Expand Down
Loading
Loading