Skip to content

Commit 0a9f998

Browse files
Zone cache (#77)
* Zone cache Uniformed bash headers and implemented the zones cache and its unit tests. Additionally, the existing unit tests for the provider were updated. The changes were applied both to the cloud driver and the dns one. * Updated README.md * Updated copyright notice * Saving sum * Renamed zone cache * Added cache
1 parent 5015a8a commit 0a9f998

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+384
-123
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2023 Marco Confalonieri
189+
Copyright 2026 Marco Confalonieri
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
> **This software is experimental.**
55
66
> [!NOTE]
7-
> The latest version is **v0.9.2**.
7+
> The latest version is **v0.10.0**.
88
99
[ExternalDNS](https://github.com/kubernetes-sigs/external-dns) is a Kubernetes
1010
add-on for automatically DNS records for Kubernetes services using different
@@ -80,7 +80,7 @@ provider:
8080
webhook:
8181
image:
8282
repository: ghcr.io/mconfalonieri/external-dns-hetzner-webhook
83-
tag: v0.9.2
83+
tag: v0.10.0
8484
env:
8585
- name: HETZNER_API_KEY
8686
valueFrom:
@@ -140,7 +140,7 @@ extraArgs:
140140

141141
sidecars:
142142
- name: hetzner-webhook
143-
image: ghcr.io/mconfalonieri/external-dns-hetzner-webhook:v0.9.2
143+
image: ghcr.io/mconfalonieri/external-dns-hetzner-webhook:v0.10.0
144144
ports:
145145
- containerPort: 8888
146146
name: webhook
@@ -217,6 +217,13 @@ This can be changed using the **SLASH_ESC_SEQ** environment variable.
217217

218218
## Upgrading from previous versions
219219

220+
### 0.9.x to 0.10.x
221+
222+
The configuration is fully compatible. There is a new configuration parameter
223+
**ZONE_CACHE_TTL** that controls the TTL of the newly implemented zones
224+
cache, that is aimed to reduce API calls. The parameter is expressed in
225+
seconds.
226+
220227
### 0.8.x to 0.9.x
221228

222229
The configuration is fully compatible. A new configuration parameter
@@ -278,6 +285,7 @@ Hetzner DNS API.
278285
| USE_CLOUD_API | Use the new cloud API | Default: `false` |
279286
| SLASH_ESC_SEQ | Escape sequence for label annotations | Default: `--slash--` |
280287
| MAX_FAIL_COUNT | Number of failed calls before shutdown | Default: `-1` (disabled) |
288+
| ZONE_CACHE_TTL | TTL for the zone cache in seconds | Default: `0` (disabled) |
281289

282290
> [!IMPORTANT]
283291
> Please notice that when **USE_CLOUD_API** is set to `true`, the token stored

README.md.gotmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ This can be changed using the **SLASH_ESC_SEQ** environment variable.
217217

218218
## Upgrading from previous versions
219219

220+
### 0.9.x to 0.10.x
221+
222+
The configuration is fully compatible. There is a new configuration parameter
223+
**ZONE_CACHE_TTL** that controls the TTL of the newly implemented zones
224+
cache, that is aimed to reduce API calls. The parameter is expressed in
225+
seconds.
226+
220227
### 0.8.x to 0.9.x
221228

222229
The configuration is fully compatible. A new configuration parameter
@@ -278,6 +285,7 @@ Hetzner DNS API.
278285
| USE_CLOUD_API | Use the new cloud API | Default: `false` |
279286
| SLASH_ESC_SEQ | Escape sequence for label annotations | Default: `--slash--` |
280287
| MAX_FAIL_COUNT | Number of failed calls before shutdown | Default: `-1` (disabled) |
288+
| ZONE_CACHE_TTL | TTL for the zone cache in seconds | Default: `0` (disabled) |
281289

282290
> [!IMPORTANT]
283291
> Please notice that when **USE_CLOUD_API** is set to `true`, the token stored

cmd/webhook/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Main - webhook program.
33
*
4-
* Copyright 2023 Marco Confalonieri.
4+
* Copyright 2026 Marco Confalonieri.
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.

cmd/webhook/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Main - unit tests
33
*
4-
* Copyright 2023 Marco Confalonieri.
4+
* Copyright 2026 Marco Confalonieri.
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.

go.work.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,7 @@ golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR
934934
golang.org/x/crypto v0.44.0/go.mod h1:013i+Nw79BMiQiMsOPcVCB5ZIJbYkerPrGnOa00tvmc=
935935
golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
936936
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
937+
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
937938
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
938939
golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw=
939940
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=

internal/hetzner/cloud/change_processors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Change processors - this file contains the code for processing changes and
33
* queue them.
44
*
5-
* Copyright 2023 Marco Confalonieri.
5+
* Copyright 2026 Marco Confalonieri.
66
* Copyright 2017 The Kubernetes Authors.
77
*
88
* Licensed under the Apache License, Version 2.0 (the "License");

internal/hetzner/cloud/change_processors_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Change processors - unit tests.
33
*
4-
* Copyright 2023 Marco Confalonieri.
4+
* Copyright 2026 Marco Confalonieri.
55
* Copyright 2017 The Kubernetes Authors.
66
*
77
* Licensed under the Apache License, Version 2.0 (the "License");

internal/hetzner/cloud/changes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Changes - Code for storing changes and sending them to the DNS API.
33
*
4-
* Copyright 2024 Marco Confalonieri.
4+
* Copyright 2026 Marco Confalonieri.
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.

internal/hetzner/cloud/changes_internals.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Changes Internals - Internal structures for processing changes.
33
*
4-
* Copyright 2024 Marco Confalonieri.
4+
* Copyright 2026 Marco Confalonieri.
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.

0 commit comments

Comments
 (0)