Skip to content

Commit

Permalink
Merge pull request #37 from cybozu-go/support-repl-of-mb-and-pvc-objects
Browse files Browse the repository at this point in the history
support replication of MantleBackup and PVC objects
  • Loading branch information
satoru-takeuchi authored Sep 12, 2024
2 parents a18b772 + 17ea4f2 commit ced1d71
Show file tree
Hide file tree
Showing 14 changed files with 468 additions and 87 deletions.
2 changes: 1 addition & 1 deletion api/v1/mantlebackup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type MantleBackupStatus struct {
PVManifest string `json:"pvManifest,omitempty"`

// 'snapID' indicates SNAPID of `rbd snap ls`
SnapID int `json:"snapID,omitempty"`
SnapID *int `json:"snapID,omitempty"`
}

const (
Expand Down
5 changes: 5 additions & 0 deletions api/v1/zz_generated.deepcopy.go

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

16 changes: 16 additions & 0 deletions charts/mantle/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if eq .Values.controller.role "secondary" }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "mantle.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
type: {{ .Values.secondaryService.type }}
ports:
- port: {{ .Values.secondaryService.port }}
targetPort: {{ .Values.secondaryService.targetPort }}
protocol: TCP
name: grpc
selector:
{{- include "mantle.selectorLabels" . | nindent 4 }}
{{ end }}
5 changes: 5 additions & 0 deletions charts/mantle/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ affinity: {}
controller:
role: standalone
ports: []

secondaryService:
# type:
# port:
# targetPort:
2 changes: 1 addition & 1 deletion cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func setupSecondary(ctx context.Context, mgr manager.Manager, wg *sync.WaitGroup
),
))

proto.RegisterMantleServiceServer(serv, &controller.SecondaryServer{})
proto.RegisterMantleServiceServer(serv, controller.NewSecondaryServer(mgr.GetClient(), mgr.GetAPIReader()))

l, err := net.Listen("tcp", mantleServiceEndpoint)
if err != nil {
Expand Down
Loading

0 comments on commit ced1d71

Please sign in to comment.