Skip to content

Commit

Permalink
Merge pull request #103 from kloeckner-i/METAL-3195/deprecation_perco…
Browse files Browse the repository at this point in the history
…na_instance

METAL-3195/no more support for percona type instance
  • Loading branch information
hyunysmile authored Dec 10, 2021
2 parents 0523cc8 + f1b1f0c commit ecbebbc
Show file tree
Hide file tree
Showing 16 changed files with 93 additions and 757 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
version: v1.43.0
# Until we fix up linting completely
continue-on-error: true

unit-test:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ DB Operator provides following features:
* [Creating Instances](docs/creatinginstances.md) - make database instances available for the operator
* [Creating Databases](docs/creatingdatabases.md) - creating databases in those instances
* [Enabling regular Backup](docs/enablingbackup.md) - and schedule cronjob
* [Upgrade guide](docs/upgradeguide.md) - breaking changes and guide for the upgrade

## Quickstart

Expand Down Expand Up @@ -137,4 +138,4 @@ microsetup is used for our integration test in pipeline.

```
$ make test
```
```
17 changes: 1 addition & 16 deletions api/v1alpha1/dbinstance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ type DbInstanceSpec struct {
type DbInstanceSource struct {
Google *GoogleInstance `json:"google,omitempty" protobuf:"bytes,1,opt,name=google"`
Generic *GenericInstance `json:"generic,omitempty" protobuf:"bytes,2,opt,name=generic"`
Percona *PerconaCluster `json:"percona,omitempty" protobuf:"bytes,3,opt,name=percona"`
}

// DbInstanceStatus defines the observed state of DbInstance
Expand All @@ -60,12 +59,6 @@ type GoogleInstance struct {
APIEndpoint string `json:"apiEndpoint,omitempty"`
}

// PerconaCluster is used when instance type is percona cluster
type PerconaCluster struct {
ServerList []BackendServer `json:"servers"` // hostgroup: host address
MonitorUserSecret NamespacedName `json:"monitorUserSecretRef"`
}

// BackendServer defines backend database server
type BackendServer struct {
Host string `json:"host"`
Expand Down Expand Up @@ -147,7 +140,7 @@ func (dbin *DbInstance) ValidateEngine() error {
func (dbin *DbInstance) ValidateBackend() error {
source := dbin.Spec.DbInstanceSource

if (source.Google == nil) && (source.Generic == nil) && (source.Percona == nil) {
if (source.Google == nil) && (source.Generic == nil) {
return errors.New("no instance type defined")
}

Expand All @@ -161,10 +154,6 @@ func (dbin *DbInstance) ValidateBackend() error {
numSources++
}

if source.Percona != nil {
numSources++
}

if numSources > 1 {
return errors.New("may not specify more than 1 instance type")
}
Expand All @@ -190,10 +179,6 @@ func (dbin *DbInstance) GetBackendType() (string, error) {
return "generic", nil
}

if source.Percona != nil {
return "percona", nil
}

return "", errors.New("no backend type defined")
}

Expand Down
27 changes: 1 addition & 26 deletions api/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion charts/db-instances/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: "1.0"
description: Database Instances for db operator
name: db-instances
version: 0.5.1
version: 1.0.0
30 changes: 0 additions & 30 deletions charts/db-instances/templates/dbinstance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,6 @@ spec:
backupHost: {{ $value.generic.backupHost }}
{{- end }}
{{- end }}
{{- if $value.percona }}
percona:
servers:
{{- range $server := $value.percona.servers }}
- host: {{ $server.host }}
port: {{ $server.port }}
maxConn: {{ $server.maxConn }}
{{- if $server.readonly }}
readonly: {{ $server.readonly }}
{{- end }}
{{- end }}
monitorUserSecretRef:
Name: {{ $name }}-monitoruser-secret
Namespace: {{ $operatorNs }}
{{- end }}
{{- if not $value.existingAdminSecret }}
---
apiVersion: v1
Expand Down Expand Up @@ -103,20 +88,5 @@ data:
config: |
{{ $value.google.configMap.data | indent 4 }}
{{- end }}
{{- if $value.percona }}
apiVersion: v1
kind: Secret
metadata:
name: {{ $name }}-monitoruser-secret
namespace: {{ $operatorNs }}
labels:
chart: {{ $chart }}
release: {{ $release.Name }}
heritage: {{ $heritage }}
type: Opaque
data:
user: {{ $value.percona.monitoruser.name | b64enc }}
password: {{ $value.percona.monitoruser.password | b64enc }}
{{- end }}
{{- end }}
{{- end }}
41 changes: 0 additions & 41 deletions charts/db-operator/files/gen/crd/kci.rocks_databases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,47 +197,6 @@ spec:
required:
- enabled
type: object
percona:
description: PerconaCluster is used when instance type is
percona cluster
properties:
monitorUserSecretRef:
description: NamespacedName is a fork of the kubernetes
api type of the same name. Sadly this is required because
CRD structs must have all fields json tagged and the
kubernetes type is not tagged.
properties:
Name:
type: string
Namespace:
type: string
required:
- Name
- Namespace
type: object
servers:
items:
description: BackendServer defines backend database
server
properties:
host:
type: string
maxConn:
type: integer
port:
type: integer
readonly:
type: boolean
required:
- host
- maxConn
- port
type: object
type: array
required:
- monitorUserSecretRef
- servers
type: object
sslConnection:
description: DbInstanceSSLConnection defines weather connection
from db-operator to instance has to be ssl or not
Expand Down
40 changes: 0 additions & 40 deletions charts/db-operator/files/gen/crd/kci.rocks_dbinstances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,46 +130,6 @@ spec:
required:
- enabled
type: object
percona:
description: PerconaCluster is used when instance type is percona
cluster
properties:
monitorUserSecretRef:
description: NamespacedName is a fork of the kubernetes api type
of the same name. Sadly this is required because CRD structs
must have all fields json tagged and the kubernetes type is
not tagged.
properties:
Name:
type: string
Namespace:
type: string
required:
- Name
- Namespace
type: object
servers:
items:
description: BackendServer defines backend database server
properties:
host:
type: string
maxConn:
type: integer
port:
type: integer
readonly:
type: boolean
required:
- host
- maxConn
- port
type: object
type: array
required:
- monitorUserSecretRef
- servers
type: object
sslConnection:
description: DbInstanceSSLConnection defines weather connection from
db-operator to instance has to be ssl or not
Expand Down
41 changes: 0 additions & 41 deletions config/crd/bases/kci.rocks_databases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -197,47 +197,6 @@ spec:
required:
- enabled
type: object
percona:
description: PerconaCluster is used when instance type is
percona cluster
properties:
monitorUserSecretRef:
description: NamespacedName is a fork of the kubernetes
api type of the same name. Sadly this is required because
CRD structs must have all fields json tagged and the
kubernetes type is not tagged.
properties:
Name:
type: string
Namespace:
type: string
required:
- Name
- Namespace
type: object
servers:
items:
description: BackendServer defines backend database
server
properties:
host:
type: string
maxConn:
type: integer
port:
type: integer
readonly:
type: boolean
required:
- host
- maxConn
- port
type: object
type: array
required:
- monitorUserSecretRef
- servers
type: object
sslConnection:
description: DbInstanceSSLConnection defines weather connection
from db-operator to instance has to be ssl or not
Expand Down
40 changes: 0 additions & 40 deletions config/crd/bases/kci.rocks_dbinstances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,46 +130,6 @@ spec:
required:
- enabled
type: object
percona:
description: PerconaCluster is used when instance type is percona
cluster
properties:
monitorUserSecretRef:
description: NamespacedName is a fork of the kubernetes api type
of the same name. Sadly this is required because CRD structs
must have all fields json tagged and the kubernetes type is
not tagged.
properties:
Name:
type: string
Namespace:
type: string
required:
- Name
- Namespace
type: object
servers:
items:
description: BackendServer defines backend database server
properties:
host:
type: string
maxConn:
type: integer
port:
type: integer
readonly:
type: boolean
required:
- host
- maxConn
- port
type: object
type: array
required:
- monitorUserSecretRef
- servers
type: object
sslConnection:
description: DbInstanceSSLConnection defines weather connection from
db-operator to instance has to be ssl or not
Expand Down
Loading

0 comments on commit ecbebbc

Please sign in to comment.