Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b1fde11a2 | |||
| 8c1403a87b | |||
| 9d4d1a1d03 | |||
| cdaa33a539 | |||
| aaa26cf714 | |||
| e64faa0ab1 |
@@ -1,4 +1,4 @@
|
|||||||
apiVersion: v2
|
apiVersion: v2
|
||||||
description: A Helm chart for cert-manager-webhook-gandi
|
description: A Helm chart for cert-manager-webhook-gandi
|
||||||
name: cert-manager-webhook-gandi
|
name: cert-manager-webhook-gandi
|
||||||
version: v0.4.0
|
version: v0.4.2
|
||||||
|
|||||||
14
main.go
14
main.go
@@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/base64"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -28,7 +29,10 @@ const (
|
|||||||
GandiMinTtl = 300 // Gandi reports an error for values < this value
|
GandiMinTtl = 300 // Gandi reports an error for values < this value
|
||||||
)
|
)
|
||||||
|
|
||||||
var GroupName = os.Getenv("GROUP_NAME")
|
var (
|
||||||
|
DebugHTTP = os.Getenv("DEBUG_HTTP")
|
||||||
|
GroupName = os.Getenv("GROUP_NAME")
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
if GroupName == "" {
|
if GroupName == "" {
|
||||||
@@ -204,6 +208,7 @@ func (c *gandiDNSProviderSolver) newClient(ch *v1alpha1.ChallengeRequest) (*live
|
|||||||
return gandi.NewLiveDNSClient(config.Config{
|
return gandi.NewLiveDNSClient(config.Config{
|
||||||
APIKey: *apiKey,
|
APIKey: *apiKey,
|
||||||
Timeout: time.Second * 30,
|
Timeout: time.Second * 30,
|
||||||
|
Debug: DebugHTTP != "",
|
||||||
}), nil
|
}), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,7 +228,12 @@ func (c *gandiDNSProviderSolver) getApiKey(cfg *gandiDNSProviderConfig, namespac
|
|||||||
return nil, fmt.Errorf("key %q not found in secret \"%s/%s\"", cfg.APIKeySecretRef.Key,
|
return nil, fmt.Errorf("key %q not found in secret \"%s/%s\"", cfg.APIKeySecretRef.Key,
|
||||||
cfg.APIKeySecretRef.LocalObjectReference.Name, namespace)
|
cfg.APIKeySecretRef.LocalObjectReference.Name, namespace)
|
||||||
}
|
}
|
||||||
|
decoded := make([]byte, base64.StdEncoding.DecodedLen(len(secBytes)))
|
||||||
|
_, err = base64.RawStdEncoding.Decode(decoded, secBytes)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to decode api key secret: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
apiKey := string(secBytes)
|
apiKey := string(decoded)
|
||||||
return &apiKey, nil
|
return &apiKey, nil
|
||||||
}
|
}
|
||||||
|
|||||||
33
scripts/release.sh
Executable file
33
scripts/release.sh
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/sh -eux
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
version="$(yq '.version' ../deploy/cert-manager-webhook-gandi/Chart.yaml)"
|
||||||
|
version="${version#v}"
|
||||||
|
major="$(echo "$version" | cut -d'.' -f1)"
|
||||||
|
minor="$(echo "$version" | cut -d'.' -f2)"
|
||||||
|
patch="$(echo "$version" | cut -d'.' -f3)"
|
||||||
|
case "${1:-""}" in
|
||||||
|
major)
|
||||||
|
major=$((major + 1))
|
||||||
|
minor=0
|
||||||
|
patch=0
|
||||||
|
;;
|
||||||
|
minor)
|
||||||
|
minor=$((minor + 1))
|
||||||
|
patch=0
|
||||||
|
;;
|
||||||
|
patch)
|
||||||
|
patch=$((patch + 1))
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown release type"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
version="$major.$minor.$patch"
|
||||||
|
|
||||||
|
yq -i ".version |= \"v$version\"" ../deploy/cert-manager-webhook-gandi/Chart.yaml
|
||||||
|
git add ../deploy/
|
||||||
|
git commit -m "Bump version to v$version"
|
||||||
|
git tag -a "v$version"
|
||||||
Reference in New Issue
Block a user