Skip to content

Commit 31802fd

Browse files
authored
[Feature] Switch ID to be IP based (#800)
1 parent a7f8b47 commit 31802fd

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
44
- Replace `beta.kubernetes.io/arch` Pod label with `kubernetes.io/arch` using Silent Rotation
55
- Add "Short Names" feature
6+
- Switch ArangoDB Image Discovery process from Headless Service to Pod IP
67

78
## [1.2.3](https://github.com/arangodb/kube-arangodb/tree/1.2.3) (2021-09-24)
89
- Update UBI Image to 8.4

pkg/deployment/images.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func (ib *imagesBuilder) fetchArangoDBImageIDAndVersion(ctx context.Context, cac
170170
}
171171

172172
// Try fetching the ArangoDB version
173-
client, err := arangod.CreateArangodImageIDClient(ctx, ib.APIObject, role, id)
173+
client, err := arangod.CreateArangodImageIDClient(ctx, ib.APIObject, pod.Status.PodIP)
174174
if err != nil {
175175
log.Warn().Err(err).Msg("Failed to create Image ID Pod client")
176176
return true, nil

pkg/util/arangod/client.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,9 @@ func CreateArangodDatabaseClient(ctx context.Context, cli corev1.CoreV1Interface
168168

169169
// CreateArangodImageIDClient creates a go-driver client for an ArangoDB instance
170170
// running in an Image-ID pod.
171-
func CreateArangodImageIDClient(ctx context.Context, deployment k8sutil.APIObject, role, id string) (driver.Client, error) {
171+
func CreateArangodImageIDClient(ctx context.Context, deployment k8sutil.APIObject, ip string) (driver.Client, error) {
172172
// Create connection
173-
dnsName := k8sutil.CreatePodDNSNameWithDomain(deployment, nil, role, id)
174-
c, err := createArangodClientForDNSName(ctx, nil, nil, dnsName, false)
173+
c, err := createArangodClientForDNSName(ctx, nil, nil, ip, false)
175174
if err != nil {
176175
return nil, errors.WithStack(err)
177176
}

0 commit comments

Comments
 (0)