Skip to content

Commit

Permalink
pass on the sidecarDbName when creating a keyspace
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Crauwels <matthias.crauwels@planetscale.com>
  • Loading branch information
mcrauwel committed Feb 11, 2025
1 parent 35233a3 commit f31cb56
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions deploy/crds/planetscale.com_vitesskeyspaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,8 @@ spec:
maxItems: 2
minItems: 1
type: array
sidecarDbName:
type: string
topologyReconciliation:
properties:
pruneCells:
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/planetscale/v2/vitesskeyspace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ type VitessKeyspaceTemplate struct {
// example: migrating from MySQL 5.7 to MySQL 8.0 via a `MoveTables`
// operation, after which the source keyspace is destroyed.
Images VitessKeyspaceTemplateImages `json:"images,omitempty"`

// SidecarDbName can optionally be used when calling CreateKeyspace
SidecarDbName string `json:"sidecarDbName,omitempty"`
}

// VitessKeyspaceTemplateImages specifies user-definable container images to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ func (r *reconcileHandler) reconcileKeyspaceInformation(ctx context.Context) (re
topoServer := r.ts.Server
keyspaceName := r.vtk.Spec.Name
durabilityPolicy := r.vtk.Spec.DurabilityPolicy
sidecarDbName := r.vtk.Spec.SidecarDbName

keyspaceInfo, err := topoServer.GetKeyspace(ctx, keyspaceName)
if err != nil {
// The keyspace information record does not exist in the topo server.
Expand All @@ -53,6 +55,7 @@ func (r *reconcileHandler) reconcileKeyspaceInformation(ctx context.Context) (re
Name: keyspaceName,
Type: topodatapb.KeyspaceType_NORMAL,
DurabilityPolicy: durabilityPolicy,
SidecarDbName: sidecarDbName,
})
if err != nil {
resultBuilder.Error(err)
Expand Down

0 comments on commit f31cb56

Please sign in to comment.