Skip to content

Commit

Permalink
Merged with main
Browse files Browse the repository at this point in the history
  • Loading branch information
mazin-s committed Nov 7, 2023
2 parents 33a611a + f246dec commit f9adf48
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# VERSION defines the project version for the bundle.
# Update this value when you upgrade the version of your project.
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.7)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.7)
VERSION ?= 0.0.7
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.8)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.8)
VERSION ?= 0.5.0

# CHANNELS define the bundle channels used in the bundle.
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
Expand Down
16 changes: 8 additions & 8 deletions api/v1alpha1/webhook_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
// Get specific implementation of the DBProvisionRequestAppender interface based on the provided databaseType
func getDatabaseWebhookHandler(database *Database) DatabaseWebhookHandler {
if database.Spec.IsClone {
return &CloningHandler{}
return &CloningWebhookHandler{}
} else {
return &ProvisoningHandler{}
return &ProvisioningWebhookHandler{}
}
}

Expand All @@ -30,13 +30,13 @@ type DatabaseWebhookHandler interface {

// +kubebuilder:object:generate:=false
// Implements webhook.Validator, webhook.Defaulter
type CloningHandler struct{}
type CloningWebhookHandler struct{}

// +kubebuilder:object:generate:=false
// Implements webhook.Validator, webhook.Defaulter
type ProvisoningHandler struct{}
type ProvisioningWebhookHandler struct{}

func (v *CloningHandler) defaulter(spec *DatabaseSpec) {
func (v *CloningWebhookHandler) defaulter(spec *DatabaseSpec) {
databaselog.Info("Entering defaulter for clone")

initializeObjects(spec)
Expand All @@ -50,7 +50,7 @@ func (v *CloningHandler) defaulter(spec *DatabaseSpec) {
databaselog.Info("Exiting defaulter for clone")
}

func (v *CloningHandler) validateCreate(spec *DatabaseSpec, errors *field.ErrorList, clonePath *field.Path) {
func (v *CloningWebhookHandler) validateCreate(spec *DatabaseSpec, errors *field.ErrorList, clonePath *field.Path) {
databaselog.Info("Entering validateCreate for clone")

clone := spec.Clone
Expand Down Expand Up @@ -97,7 +97,7 @@ func (v *CloningHandler) validateCreate(spec *DatabaseSpec, errors *field.ErrorL
databaselog.Info("Exiting validateCreate for clone")
}

func (v *ProvisoningHandler) defaulter(spec *DatabaseSpec) {
func (v *ProvisioningWebhookHandler) defaulter(spec *DatabaseSpec) {
databaselog.Info("Entering defaulter for provisioning")

initializeObjects(spec)
Expand Down Expand Up @@ -163,7 +163,7 @@ func (v *ProvisoningHandler) defaulter(spec *DatabaseSpec) {
databaselog.Info("Exiting defaulter for provisioning")
}

func (v *ProvisoningHandler) validateCreate(spec *DatabaseSpec, errors *field.ErrorList, instancePath *field.Path) {
func (v *ProvisioningWebhookHandler) validateCreate(spec *DatabaseSpec, errors *field.ErrorList, instancePath *field.Path) {
databaselog.Info("Entering validateCreate for provisioning")

instance := spec.Instance
Expand Down
4 changes: 4 additions & 0 deletions automation/tests/cloning/mongo-si_test/mongo_si_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<<<<<<<< HEAD:automation/tests/cloning/mongo-si_test/mongo_si_test.go

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'package', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'package', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'IDENT', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected ';', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'package', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'IDENT', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected ';', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'package', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'IDENT', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected ';', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'package', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'package', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'IDENT', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected ';', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'package', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'IDENT', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected ';', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'package', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected 'IDENT', found '<<'

Check failure on line 1 in automation/tests/cloning/mongo-si_test/mongo_si_test.go

View workflow job for this annotation

GitHub Actions / build-binary

expected ';', found '<<'
package mongo_cloning_si
========
package postgres_si_provisoning
>>>>>>>> main:automation/tests/provisioning/pg-si_test/pg_si_test.go

// Basic imports
import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
ndbRef: ndb-pg
databaseInstance:
name: db-pg-si41
Name: db-pg-si
databaseNames:
- database_one
- database_two
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ kind: Kustomization
images:
- name: controller
newName: ghcr.io/nutanix-cloud-native/ndb-operator/controller
newTag: v0.0.7
newTag: v0.5.0
2 changes: 1 addition & 1 deletion ndb_api/clone_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func GenerateCloningRequest(ctx context.Context, ndb_client *ndb_client.NDBClien
func (a *MSSQLRequestAppender) appendCloningRequest(req *DatabaseCloneRequest, database DatabaseInterface, reqData map[string]interface{}) (*DatabaseCloneRequest, error) {
req.SSHPublicKey = reqData[common.NDB_PARAM_SSH_PUBLIC_KEY].(string)
vmName := req.Name
dbName := "DATABASE_NAME" // TODO
dbName := database.GetName()
dbPassword := reqData[common.NDB_PARAM_PASSWORD].(string)

// Default action arguments
Expand Down

0 comments on commit f9adf48

Please sign in to comment.