Skip to content

Commit

Permalink
Pass different ca for gateway & inCluster
Browse files Browse the repository at this point in the history
Signed-off-by: Arnob kumar saha <[email protected]>
  • Loading branch information
ArnobKumarSaha committed Jan 10, 2025
1 parent 9d75517 commit 23f642c
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .config/api-rules/violation_exceptions.list
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ API rule violation: list_type_missing,kmodules.xyz/offshoot-api/api/v1,PodSpec,V
API rule violation: list_type_missing,kmodules.xyz/offshoot-api/api/v1,ServiceSpec,ExternalIPs
API rule violation: list_type_missing,kmodules.xyz/offshoot-api/api/v1,ServiceSpec,LoadBalancerSourceRanges
API rule violation: list_type_missing,kmodules.xyz/offshoot-api/api/v1,ServiceSpec,Ports
API rule violation: list_type_missing,kubedb.dev/apimachinery/apis/ui/v1alpha1,DatabaseConnectionSpec,CACert
API rule violation: list_type_missing,kubedb.dev/apimachinery/apis/ui/v1alpha1,DatabaseConnectionSpec,Databases
API rule violation: list_type_missing,kubedb.dev/apimachinery/apis/ui/v1alpha1,DatabaseConnectionSpec,Gateway
API rule violation: list_type_missing,kubedb.dev/apimachinery/apis/ui/v1alpha1,ElasticsearchNodesStatSpec,Roles
API rule violation: list_type_missing,kubedb.dev/apimachinery/apis/ui/v1alpha1,ElasticsearchNodesStatsSpec,Nodes
API rule violation: list_type_missing,kubedb.dev/apimachinery/apis/ui/v1alpha1,ElasticsearchSchemaOverviewSpec,Indices
API rule violation: list_type_missing,kubedb.dev/apimachinery/apis/ui/v1alpha1,GatewayConnection,CACert
API rule violation: list_type_missing,kubedb.dev/apimachinery/apis/ui/v1alpha1,GenericSchemaOverviewSpec,Databases
API rule violation: list_type_missing,kubedb.dev/apimachinery/apis/ui/v1alpha1,InClusterConnection,CACert
API rule violation: list_type_missing,kubedb.dev/apimachinery/apis/ui/v1alpha1,MariaDBQueriesSpec,Queries
API rule violation: list_type_missing,kubedb.dev/apimachinery/apis/ui/v1alpha1,MongoDBCollectionSpec,TotalSize
API rule violation: list_type_missing,kubedb.dev/apimachinery/apis/ui/v1alpha1,MongoDBQueriesSpec,Queries
Expand Down
3 changes: 2 additions & 1 deletion apis/ui/v1alpha1/database_connection_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ type DatabaseConnectionSpec struct {
//
// And some language specific template strings. Like: Java, C#, Go, Python, Javascript, Ruby etc.
ConnectOptions map[string]string `json:"connectOptions,omitempty"`
CACert []byte `json:"caCert,omitempty"`
}

//type ConnectOption struct {
Expand All @@ -84,6 +83,7 @@ type DatabaseConnectionSpec struct {
type GatewayConnection struct {
*ofst.Gateway `json:",inline"`
SecretRef *kmapi.ObjectReference `json:"secretRef,omitempty"`
CACert []byte `json:"caCert,omitempty"`
}

type InClusterConnection struct {
Expand All @@ -93,6 +93,7 @@ type InClusterConnection struct {
// Example: kubectl exec -it -n default service/mongo-test1 -c mongodb -- bash -c '<the actual command>'
Exec string `json:"exec,omitempty"`
SecretRef *kmapi.ObjectReference `json:"secretRef,omitempty"`
CACert []byte `json:"caCert,omitempty"`
}

// DatabaseConnectionList contains a list of DatabaseConnection
Expand Down
18 changes: 12 additions & 6 deletions apis/ui/v1alpha1/openapi_generated.go

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

15 changes: 10 additions & 5 deletions apis/ui/v1alpha1/zz_generated.deepcopy.go

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

9 changes: 6 additions & 3 deletions crds/ui.kubedb.com_databaseconnections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ spec:
type: object
spec:
properties:
caCert:
format: byte
type: string
connectOptions:
additionalProperties:
type: string
Expand All @@ -40,6 +37,9 @@ spec:
gateway:
items:
properties:
caCert:
format: byte
type: string
hostname:
type: string
ip:
Expand Down Expand Up @@ -128,6 +128,9 @@ spec:
type: array
inCluster:
properties:
caCert:
format: byte
type: string
exec:
type: string
host:
Expand Down

0 comments on commit 23f642c

Please sign in to comment.