Skip to content

Commit 9387126

Browse files
egegunesjvpasinatto
authored andcommitted
K8SPSMDB-1249: Fix smart update for pods that are not member of replset
1 parent 2d231b7 commit 9387126

File tree

11 files changed

+126
-91
lines changed

11 files changed

+126
-91
lines changed

config/crd/bases/psmdb.percona.com_perconaservermongodbs.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18849,14 +18849,16 @@ spec:
1884918849
initialized:
1885018850
type: boolean
1885118851
members:
18852-
items:
18852+
additionalProperties:
1885318853
properties:
1885418854
name:
1885518855
type: string
18856-
version:
18856+
state:
18857+
type: integer
18858+
stateStr:
1885718859
type: string
1885818860
type: object
18859-
type: array
18861+
type: object
1886018862
message:
1886118863
type: string
1886218864
ready:

deploy/bundle.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19545,14 +19545,16 @@ spec:
1954519545
initialized:
1954619546
type: boolean
1954719547
members:
19548-
items:
19548+
additionalProperties:
1954919549
properties:
1955019550
name:
1955119551
type: string
19552-
version:
19552+
state:
19553+
type: integer
19554+
stateStr:
1955319555
type: string
1955419556
type: object
19555-
type: array
19557+
type: object
1955619558
message:
1955719559
type: string
1955819560
ready:

deploy/crd.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19545,14 +19545,16 @@ spec:
1954519545
initialized:
1954619546
type: boolean
1954719547
members:
19548-
items:
19548+
additionalProperties:
1954919549
properties:
1955019550
name:
1955119551
type: string
19552-
version:
19552+
state:
19553+
type: integer
19554+
stateStr:
1955319555
type: string
1955419556
type: object
19555-
type: array
19557+
type: object
1955619558
message:
1955719559
type: string
1955819560
ready:

deploy/cw-bundle.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19545,14 +19545,16 @@ spec:
1954519545
initialized:
1954619546
type: boolean
1954719547
members:
19548-
items:
19548+
additionalProperties:
1954919549
properties:
1955019550
name:
1955119551
type: string
19552-
version:
19552+
state:
19553+
type: integer
19554+
stateStr:
1955319555
type: string
1955419556
type: object
19555-
type: array
19557+
type: object
1955619558
message:
1955719559
type: string
1955819560
ready:

e2e-tests/version-service/conf/crd.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19545,14 +19545,16 @@ spec:
1954519545
initialized:
1954619546
type: boolean
1954719547
members:
19548-
items:
19548+
additionalProperties:
1954919549
properties:
1955019550
name:
1955119551
type: string
19552-
version:
19552+
state:
19553+
type: integer
19554+
stateStr:
1955319555
type: string
1955419556
type: object
19555-
type: array
19557+
type: object
1955619558
message:
1955719559
type: string
1955819560
ready:

pkg/apis/psmdb/v1/psmdb_types.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/percona/percona-backup-mongodb/pbm/defs"
2929

3030
"github.com/percona/percona-server-mongodb-operator/pkg/mcs"
31+
"github.com/percona/percona-server-mongodb-operator/pkg/psmdb/mongo"
3132
"github.com/percona/percona-server-mongodb-operator/pkg/util/numstr"
3233
"github.com/percona/percona-server-mongodb-operator/version"
3334
)
@@ -234,8 +235,9 @@ type UpgradeOptions struct {
234235
}
235236

236237
type ReplsetMemberStatus struct {
237-
Name string `json:"name,omitempty"`
238-
Version string `json:"version,omitempty"`
238+
Name string `json:"name,omitempty"`
239+
State mongo.MemberState `json:"state,omitempty"`
240+
StateStr string `json:"stateStr,omitempty"`
239241
}
240242

241243
type MongosStatus struct {
@@ -246,8 +248,8 @@ type MongosStatus struct {
246248
}
247249

248250
type ReplsetStatus struct {
249-
Members []*ReplsetMemberStatus `json:"members,omitempty"`
250-
ClusterRole ClusterRole `json:"clusterRole,omitempty"`
251+
Members map[string]ReplsetMemberStatus `json:"members,omitempty"`
252+
ClusterRole ClusterRole `json:"clusterRole,omitempty"`
251253

252254
Initialized bool `json:"initialized,omitempty"`
253255
AddedAsShard *bool `json:"added_as_shard,omitempty"`

pkg/apis/psmdb/v1/zz_generated.deepcopy.go

Lines changed: 3 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)