Skip to content

Commit a7ef56b

Browse files
authored
feat: implement evaluate lifecycle hook (#222)
This patch allows the plugin trigger a rolling deployment on existing clusters, enabling seamless migration between the in-tree barman cloud support and the plugin. Signed-off-by: Leonardo Cecchi <[email protected]>
1 parent bcfe1fd commit a7ef56b

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

docs/examples/cluster-example-legacy.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ metadata:
44
name: cluster-example
55
spec:
66
instances: 3
7-
imagePullPolicy: Always
87

98
backup:
109
barmanObjectStore:
10+
endpointCA:
11+
name: minio-server-tls
12+
key: tls.crt
1113
destinationPath: s3://backups/
12-
endpointURL: http://minio:9000
14+
endpointURL: https://minio:9000
1315
s3Credentials:
1416
accessKeyId:
1517
name: minio

docs/examples/cluster-example.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ metadata:
44
name: cluster-example
55
spec:
66
instances: 3
7-
imagePullPolicy: Always
87
plugins:
98
- name: barman-cloud.cloudnative-pg.io
109
isWALArchiver: true

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/cloudnative-pg/api v1.25.1
1010
github.com/cloudnative-pg/barman-cloud v0.3.0
1111
github.com/cloudnative-pg/cloudnative-pg v1.25.1
12-
github.com/cloudnative-pg/cnpg-i v0.1.0
12+
github.com/cloudnative-pg/cnpg-i v0.1.1-0.20250321093050-de4ab51537cb
1313
github.com/cloudnative-pg/cnpg-i-machinery v0.2.0
1414
github.com/cloudnative-pg/machinery v0.1.0
1515
github.com/onsi/ginkgo/v2 v2.23.1

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ github.com/cloudnative-pg/cloudnative-pg v1.25.1 h1:Yc6T7ikQ1AiWXBQht+6C3DoihrIp
2626
github.com/cloudnative-pg/cloudnative-pg v1.25.1/go.mod h1:96b9bRFLSr3uFWHjhytPdcvKIKwy9H6AG7cH0O6jefs=
2727
github.com/cloudnative-pg/cnpg-i v0.1.0 h1:QH2xTsrODMhEEc6B25GbOYe7ZIttDmSkYvXotfU5dfs=
2828
github.com/cloudnative-pg/cnpg-i v0.1.0/go.mod h1:G28BhgUEHqrxEyyQeHz8BbpMVAsGuLhJm/tHUbDi8Sw=
29+
github.com/cloudnative-pg/cnpg-i v0.1.1-0.20250321093050-de4ab51537cb h1:FPORwCxjZwlnKnF7dOkuOAz0GBSQ3Hrn+8lm4uMiWeM=
30+
github.com/cloudnative-pg/cnpg-i v0.1.1-0.20250321093050-de4ab51537cb/go.mod h1:n+kbHm3rzRCY5IJKuE1tGMbG6JaeYz8yycYoLt7BeKo=
2931
github.com/cloudnative-pg/cnpg-i-machinery v0.2.0 h1:htNuKirdAOYrc7Hu5mLDoOES+nKSyPaXNDLgbV5dLSI=
3032
github.com/cloudnative-pg/cnpg-i-machinery v0.2.0/go.mod h1:MHVxMMbLeCRnEM8PLWW4C2CsHqOeAU2OsrwWMKy3tPA=
3133
github.com/cloudnative-pg/machinery v0.1.0 h1:tjRmsqQmsO/OlaT0uFmkEtVqgr+SGPM88cKZOHYKLBo=

internal/cnpgi/operator/lifecycle.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ func (impl LifecycleImplementation) GetCapabilities(
4444
{
4545
Type: lifecycle.OperatorOperationType_TYPE_PATCH,
4646
},
47+
{
48+
Type: lifecycle.OperatorOperationType_TYPE_EVALUATE,
49+
},
4750
},
4851
},
4952
{

0 commit comments

Comments
 (0)