Skip to content

Commit 97a29e9

Browse files
authored
[Bugfix] Add GCP Plugin Support (#1925)
1 parent a4977a6 commit 97a29e9

File tree

6 files changed

+66
-29
lines changed

6 files changed

+66
-29
lines changed

.circleci/continue_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ executors:
2727
jobs:
2828
check-code:
2929
executor: golang-executor
30+
resource_class: xlarge
3031
environment:
3132
GOCACHE: "/tmp/go/cache"
3233
GOPATH: "/tmp/go/path"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- (Bugfix) Enable Probes for Single & Gateway
1313
- (Bugfix) Fix Gateway Probes with Auth Enabled
1414
- (Bugfix) Remove Finalizer from Gateway
15+
- (Bugfix) Add GCP Plugin Support
1516

1617
## [1.2.49](https://github.com/arangodb/kube-arangodb/tree/1.2.49) (2025-06-17)
1718
- (Maintenance) Optimize go.mod

pkg/deployment/reconcile/action_runtime_container_image_update.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2025 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -30,7 +30,6 @@ import (
3030
api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
3131
"github.com/arangodb/kube-arangodb/pkg/deployment/rotation"
3232
"github.com/arangodb/kube-arangodb/pkg/util/errors"
33-
"github.com/arangodb/kube-arangodb/pkg/util/k8sutil"
3433
kresources "github.com/arangodb/kube-arangodb/pkg/util/k8sutil/resources"
3534
)
3635

@@ -262,8 +261,6 @@ func (a actionRuntimeContainerImageUpdate) CheckProgress(ctx context.Context) (b
262261
return true, false, nil
263262
}
264263

265-
groupSpec := a.actionCtx.GetSpec().GetServerGroupSpec(a.action.Group)
266-
267264
cache, ok := a.actionCtx.ACS().ClusterCache(m.ClusterID)
268265
if !ok {
269266
a.log.Info("Cluster is not ready")
@@ -276,10 +273,6 @@ func (a actionRuntimeContainerImageUpdate) CheckProgress(ctx context.Context) (b
276273
return true, false, nil
277274
}
278275

279-
if err := k8sutil.EnsureFinalizerAbsent(ctx, cache.PodsModInterface().V1(), pod, k8sutil.GetFinalizers(groupSpec, a.action.Group)...); err != nil {
280-
a.log.Err(err).Error("Unable to enforce finalizer")
281-
}
282-
283276
name, image, ok := a.getContainerDetails()
284277
if !ok {
285278
a.log.Info("Unable to find container details")

pkg/platform/init.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2025 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
21+
package platform
22+
23+
import _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"

pkg/platform/package_install.go

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,13 @@ func packageInstallRunInstallRelease(cmd *cobra.Command, h executor.Handler, cli
123123
return errors.Errorf("Chart %s is not ready", name)
124124
}
125125

126-
if _, err := client.Arango().PlatformV1alpha1().ArangoPlatformServices(deployment.GetNamespace()).Get(ctx, name, meta.GetOptions{}); err != nil {
126+
if svc, err := client.Arango().PlatformV1alpha1().ArangoPlatformServices(deployment.GetNamespace()).Get(ctx, name, meta.GetOptions{}); err != nil {
127127
if !kerrors.IsNotFound(err) {
128128
return err
129129
}
130130

131+
logger.Debug("Installing Service: %s", name)
132+
131133
// Prepare Object
132134
if _, err := client.Arango().PlatformV1alpha1().ArangoPlatformServices(deployment.GetNamespace()).Create(ctx, &platformApi.ArangoPlatformService{
133135
ObjectMeta: meta.ObjectMeta{
@@ -147,31 +149,32 @@ func packageInstallRunInstallRelease(cmd *cobra.Command, h executor.Handler, cli
147149
}, meta.CreateOptions{}); err != nil {
148150
return err
149151
}
150-
}
151152

152-
// Prepare for update
153-
svc, err := client.Arango().PlatformV1alpha1().ArangoPlatformServices(deployment.GetNamespace()).Get(ctx, name, meta.GetOptions{})
154-
if err != nil {
155-
return err
156-
}
153+
logger.Info("Installed Service: %s", name)
154+
} else {
155+
if svc.Spec.Deployment.GetName() != deployment.GetName() {
156+
return errors.Errorf("Unable to change Deployment name for %s", name)
157+
}
157158

158-
if svc.Spec.Deployment.GetName() != deployment.GetName() {
159-
return errors.Errorf("Unable to change Deployment name for %s", name)
160-
}
159+
if svc.Spec.Chart.GetName() != chart.GetName() {
160+
return errors.Errorf("Unable to change Chart name for %s", name)
161+
}
161162

162-
if !svc.Spec.Values.Equals(sharedApi.Any(packageSpec.Overrides)) {
163-
svc.Spec.Values = sharedApi.Any(packageSpec.Overrides)
164-
_, err := client.Arango().PlatformV1alpha1().ArangoPlatformServices(deployment.GetNamespace()).Update(ctx, svc, meta.UpdateOptions{})
165-
if err != nil {
166-
return err
163+
if !svc.Spec.Values.Equals(sharedApi.Any(packageSpec.Overrides)) {
164+
svc.Spec.Values = sharedApi.Any(packageSpec.Overrides)
165+
_, err := client.Arango().PlatformV1alpha1().ArangoPlatformServices(deployment.GetNamespace()).Update(ctx, svc, meta.UpdateOptions{})
166+
if err != nil {
167+
return err
168+
}
169+
logger.Info("Updated Service: %s", name)
167170
}
168171
}
169172

170173
// Ensure we wait for reconcile
171174
time.Sleep(time.Second)
172175

173-
return h.Timeout(ctx, t, func(ctx context.Context, log logging.Logger, t executor.Thread, h executor.Handler) error {
174-
svc, err := client.Arango().PlatformV1alpha1().ArangoPlatformServices(svc.GetNamespace()).Get(ctx, svc.GetName(), meta.GetOptions{})
176+
if err := h.Timeout(ctx, t, func(ctx context.Context, log logging.Logger, t executor.Thread, h executor.Handler) error {
177+
svc, err := client.Arango().PlatformV1alpha1().ArangoPlatformServices(deployment.GetNamespace()).Get(ctx, name, meta.GetOptions{})
175178
if err != nil {
176179
return err
177180
}
@@ -189,7 +192,15 @@ func packageInstallRunInstallRelease(cmd *cobra.Command, h executor.Handler, cli
189192
}
190193

191194
return io.EOF
192-
}, 5*time.Minute, time.Second)
195+
}, 5*time.Minute, time.Second); err != nil {
196+
if errors.Is(err, io.EOF) {
197+
return errors.Errorf("Service %s is not ready", name)
198+
}
199+
200+
return err
201+
}
202+
203+
return nil
193204
})
194205
}
195206

@@ -247,7 +258,7 @@ func packageInstallRunInstallChart(cmd *cobra.Command, h executor.Handler, clien
247258
}
248259
}
249260

250-
return h.Timeout(ctx, t, func(ctx context.Context, log logging.Logger, t executor.Thread, h executor.Handler) error {
261+
if err := h.Timeout(ctx, t, func(ctx context.Context, log logging.Logger, t executor.Thread, h executor.Handler) error {
251262
c, err := client.Arango().PlatformV1alpha1().ArangoPlatformCharts(ns).Get(ctx, name, meta.GetOptions{})
252263
if err != nil {
253264
return err
@@ -262,7 +273,15 @@ func packageInstallRunInstallChart(cmd *cobra.Command, h executor.Handler, clien
262273
}
263274

264275
return io.EOF
265-
}, 5*time.Minute, time.Second)
276+
}, 5*time.Minute, time.Second); err != nil {
277+
if errors.Is(err, io.EOF) {
278+
return errors.Errorf("Chart %s is not ready", name)
279+
}
280+
281+
return err
282+
}
283+
284+
return nil
266285
})
267286
}
268287

pkg/util/k8sutil/helm/chart_manager_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func limitArray[T any](in []T, max int) []T {
3636
}
3737

3838
func Test_Manager(t *testing.T) {
39-
mgr, err := NewChartManager(context.Background(), nil, "https://arangodb-platform-dev-chart-registry.s3.amazonaws.com/index.yaml")
39+
mgr, err := NewChartManager(context.Background(), nil, "https://arangodb-platform-qa-chart-registry.s3.amazonaws.com/index.yaml")
4040
require.NoError(t, err)
4141

4242
for _, repo := range limitArray(mgr.Repositories(), 5) {

0 commit comments

Comments
 (0)