Skip to content

Commit 715899d

Browse files
authored
Merge pull request #443 from vshn/master
🔀 Merge master into develop (Hotfixes)
2 parents 0c196b9 + 4dd727f commit 715899d

File tree

29 files changed

+196
-83
lines changed

29 files changed

+196
-83
lines changed

.github/workflows/merge.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,21 @@ jobs:
260260
echo "✅ Created and pushed tag: $NEW_TAG"
261261
echo "appcat-tag=$NEW_TAG" >> $GITHUB_OUTPUT
262262
263+
- name: Trigger Release Workflow
264+
uses: actions/github-script@v7
265+
with:
266+
github-token: ${{ secrets.GITHUB_TOKEN }}
267+
script: |
268+
await github.rest.actions.createWorkflowDispatch({
269+
owner: context.repo.owner,
270+
repo: context.repo.repo,
271+
workflow_id: 'release.yml',
272+
ref: 'master',
273+
inputs: {
274+
tag: '${{ steps.tag.outputs.appcat-tag }}'
275+
}
276+
});
277+
263278
- name: Clone and patch component repo
264279
run: |
265280
COMPONENT_BRANCH="${{ needs.check-conditions.outputs.comp-feature-branch }}"
@@ -311,7 +326,7 @@ jobs:
311326
gh pr merge -R "$COMPONENT_REPO" ${{ needs.check-conditions.outputs.comp-pr-number }} --merge --delete-branch
312327
313328
merge-hotfix-update-develop:
314-
needs: merge-hotfix
329+
needs: [merge-hotfix, check-conditions]
315330
runs-on: ubuntu-latest
316331
steps:
317332
- name: Create PR to merge master into develop in appcat repo
@@ -322,7 +337,7 @@ jobs:
322337
--repo "$APPCAT_REPO" \
323338
--base develop \
324339
--head master \
325-
--reviewer ${{ needs.check-conditions.outputs.author }} \ \
340+
--reviewer ${{ needs.check-conditions.outputs.author }} \
326341
--title "🔀 Merge master into develop (sync hotfixes)" \
327342
--body "This PR synchronizes the hotfixes from master back into develop." || true
328343

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
push:
55
tags:
66
- "*"
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Tag to release'
11+
required: true
12+
type: string
713

814
env:
915
APP_NAME: appcat

pkg/comp-functions/functions/common/maintenance/maintenance.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ func (m *Maintenance) createMaintenanceJob(_ context.Context, cronSchedule strin
253253
Name: "RELEASE_MANAGEMENT_ENABLED",
254254
Value: m.svc.Config.Data["releaseManagementEnabled"],
255255
},
256+
{
257+
Name: "MAINTENANCE_URL",
258+
Value: m.svc.Config.Data["maintenanceURL"],
259+
},
256260
}
257261

258262
job := &batchv1.CronJob{

pkg/comp-functions/functions/vshnkeycloak/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ func copyKeycloakCredentials(comp *vshnv1.VSHNKeycloak, svc *runtime.ServiceRunt
10901090
Containers: []v1.Container{
10911091
{
10921092
Name: "copyjob",
1093-
Image: "bitnami/kubectl:latest",
1093+
Image: svc.Config.Data["kubectl_image"],
10941094
Command: []string{"sh", "-c"},
10951095
Args: []string{keycloakCredentialsCopyJobScript},
10961096
Env: []v1.EnvVar{

pkg/comp-functions/functions/vshnmariadb/mariadb_deploy.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,20 @@ func newValues(ctx context.Context, svc *runtime.ServiceRuntime, comp *vshnv1.VS
244244
}
245245
}
246246

247+
if imageRepositoryPrefix := svc.Config.Data["imageRepositoryPrefix"]; imageRepositoryPrefix != "" {
248+
if err := common.SetNestedObjectValue(values, []string{"image"}, map[string]any{
249+
"repository": fmt.Sprintf("%s/mariadb-galera", imageRepositoryPrefix),
250+
}); err != nil {
251+
return nil, err
252+
}
253+
254+
if err := common.SetNestedObjectValue(values, []string{"metrics", "image"}, map[string]any{
255+
"repository": fmt.Sprintf("%s/mysqld-exporter", imageRepositoryPrefix),
256+
}); err != nil {
257+
return nil, err
258+
}
259+
}
260+
247261
return values, nil
248262
}
249263

pkg/comp-functions/functions/vshnpostgres/postgresql_deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ func createCopyJob(comp *vshnv1.VSHNPostgreSQL, svc *runtime.ServiceRuntime) err
664664
Containers: []v1.Container{
665665
{
666666
Name: "copyjob",
667-
Image: "bitnami/kubectl:latest",
667+
Image: svc.Config.Data["kubectl_image"],
668668
Command: []string{"sh", "-c"},
669669
Args: []string{postgresqlCopyJobScript},
670670
Env: []v1.EnvVar{

pkg/comp-functions/functions/vshnredis/backup.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ func updateRelease(ctx context.Context, svc *runtime.ServiceRuntime) error {
7171
}
7272

7373
l.Info("Adding the PVC k8up annotations")
74-
if err := backup.AddPVCAnnotationToValues(values, "master", "persistence", "annotations"); err != nil {
74+
if err := backup.AddPVCAnnotationToValues(values, "replica", "persistence", "annotations"); err != nil {
7575
return err
7676
}
7777

7878
l.Info("Adding the Pod k8up annotations")
79-
if err := backup.AddPodAnnotationToValues(values, "/scripts/backup.sh", ".tar", "master", "podAnnotations"); err != nil {
79+
if err := backup.AddPodAnnotationToValues(values, "/scripts/backup.sh", ".tar", "replica", "podAnnotations"); err != nil {
8080
return err
8181
}
8282

8383
l.Info("Mounting CM into pod")
84-
if err := backup.AddBackupCMToValues(values, []string{"master", "extraVolumes"}, []string{"master", "extraVolumeMounts"}); err != nil {
84+
if err := backup.AddBackupCMToValues(values, []string{"replica", "extraVolumes"}, []string{"replica", "extraVolumeMounts"}); err != nil {
8585
return err
8686
}
8787

pkg/comp-functions/functions/vshnredis/pvcresize.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func ResizePVCs(ctx context.Context, comp *vshnv1.VSHNRedis, svc *runtime.Servic
115115
}
116116

117117
func needReleasePatch(comp *vshnv1.VSHNRedis, values map[string]interface{}) (bool, *xfnproto.Result) {
118-
releaseSizeValue, found, err := unstructured.NestedString(values, "master", "persistence", "size")
118+
releaseSizeValue, found, err := unstructured.NestedString(values, "replica", "persistence", "size")
119119
if !found {
120120
return false, runtime.NewFatalResult(fmt.Errorf("disk size not found in release"))
121121
}
@@ -178,12 +178,12 @@ func addDeletionJob(svc *runtime.ServiceRuntime, comp *vshnv1.VSHNRedis) error {
178178
Containers: []corev1.Container{
179179
{
180180
Name: "sts-deleter",
181-
Image: "bitnami/kubectl",
181+
Image: svc.Config.Data["kubectl_image"],
182182
ImagePullPolicy: corev1.PullIfNotPresent,
183183
Env: []corev1.EnvVar{
184184
{
185185
Name: "STS_NAME",
186-
Value: "redis-master",
186+
Value: "redis-node",
187187
},
188188
{
189189
Name: "STS_NAMESPACE",
@@ -212,17 +212,17 @@ func addDeletionJob(svc *runtime.ServiceRuntime, comp *vshnv1.VSHNRedis) error {
212212
},
213213
}
214214

215-
return svc.SetDesiredKubeObject(job, comp.Name+"-sts-deleter")
215+
return svc.SetDesiredKubeObject(job, comp.Name+"-sts-deleter", runtime.KubeOptionAllowDeletion)
216216
}
217217

218218
func addStsObserver(svc *runtime.ServiceRuntime, comp *vshnv1.VSHNRedis) error {
219219

220220
statefulset := &appsv1.StatefulSet{
221221
ObjectMeta: metav1.ObjectMeta{
222-
Name: "redis-master",
222+
Name: "redis-node",
223223
Namespace: getInstanceNamespace(comp),
224224
},
225225
}
226226

227-
return svc.SetDesiredKubeObject(statefulset, comp.Name+"-sts-observer", runtime.KubeOptionObserve)
227+
return svc.SetDesiredKubeObject(statefulset, comp.Name+"-sts-observer", runtime.KubeOptionObserve, runtime.KubeOptionAllowDeletion)
228228
}

pkg/comp-functions/functions/vshnredis/pvcresize_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func Test_needReleasePatch(t *testing.T) {
6363
},
6464
},
6565
values: map[string]interface{}{
66-
"master": map[string]interface{}{
66+
"replica": map[string]interface{}{
6767
"persistence": map[string]interface{}{
6868
"size": "15Gi",
6969
},
@@ -85,7 +85,7 @@ func Test_needReleasePatch(t *testing.T) {
8585
},
8686
},
8787
values: map[string]interface{}{
88-
"master": map[string]interface{}{
88+
"replica": map[string]interface{}{
8989
"persistence": map[string]interface{}{
9090
"size": "15Gi",
9191
},
@@ -107,7 +107,7 @@ func Test_needReleasePatch(t *testing.T) {
107107
},
108108
},
109109
values: map[string]interface{}{
110-
"master": map[string]interface{}{
110+
"replica": map[string]interface{}{
111111
"persistence": map[string]interface{}{
112112
"size": "15Gi",
113113
},
@@ -130,7 +130,7 @@ func Test_needReleasePatch(t *testing.T) {
130130
},
131131
},
132132
values: map[string]interface{}{
133-
"master": map[string]interface{}{
133+
"replica": map[string]interface{}{
134134
"persistence": map[string]interface{}{
135135
"size": "15Gi",
136136
},
@@ -153,7 +153,7 @@ func Test_needReleasePatch(t *testing.T) {
153153
},
154154
},
155155
values: map[string]interface{}{
156-
"master": map[string]interface{}{
156+
"replica": map[string]interface{}{
157157
"persistence": map[string]interface{}{
158158
"size": "foo",
159159
},
@@ -176,7 +176,7 @@ func Test_needReleasePatch(t *testing.T) {
176176
},
177177
},
178178
values: map[string]interface{}{
179-
"master": map[string]interface{}{
179+
"replica": map[string]interface{}{
180180
"persistence": map[string]interface{}{},
181181
},
182182
},

pkg/comp-functions/functions/vshnredis/redis_deploy.go

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,34 @@ func newValues(ctx context.Context, svc *runtime.ServiceRuntime, comp *vshnv1.VS
273273
if registry := svc.Config.Data["imageRegistry"]; registry != "" {
274274
_ = common.SetNestedObjectValue(values, []string{"global", "imageRegistry"}, registry)
275275
}
276+
277+
if imageRepositoryPrefix := svc.Config.Data["imageRepositoryPrefix"]; imageRepositoryPrefix != "" {
278+
if err := common.SetNestedObjectValue(values, []string{"image"}, map[string]any{
279+
"repository": fmt.Sprintf("%s/redis", imageRepositoryPrefix),
280+
}); err != nil {
281+
return nil, err
282+
}
283+
284+
if err := common.SetNestedObjectValue(values, []string{"sentinel", "image"}, map[string]any{
285+
"repository": fmt.Sprintf("%s/redis-sentinel", imageRepositoryPrefix),
286+
}); err != nil {
287+
return nil, err
288+
}
289+
290+
if err := common.SetNestedObjectValue(values, []string{"metrics", "image"}, map[string]any{
291+
"repository": fmt.Sprintf("%s/redis-exporter", imageRepositoryPrefix),
292+
}); err != nil {
293+
return nil, err
294+
}
295+
296+
if err := common.SetNestedObjectValue(values, []string{"kubectl", "image"}, map[string]any{
297+
"repository": fmt.Sprintf("%s/kubectl", imageRepositoryPrefix),
298+
}); err != nil {
299+
return nil, err
300+
}
301+
302+
}
303+
276304
return values, nil
277305
}
278306

@@ -412,7 +440,7 @@ func migrateRedis(ctx context.Context, svc *runtime.ServiceRuntime, comp *vshnv1
412440
Containers: []corev1.Container{
413441
{
414442
Name: "migrationjob",
415-
Image: "bitnami/kubectl:latest",
443+
Image: svc.Config.Data["kubectl_image"],
416444
Command: []string{"sh", "-c"},
417445
Args: []string{redisScalingScript},
418446
Env: []corev1.EnvVar{

0 commit comments

Comments
 (0)