diff --git a/deploy/sthome-webhook/Chart.yaml b/deploy/sthome-webhook/Chart.yaml index d3b840d..7a87f0b 100644 --- a/deploy/sthome-webhook/Chart.yaml +++ b/deploy/sthome-webhook/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: v0.0.4-alpha.107 +appVersion: v0.0.4-alpha.109 description: Cert-Manager webhook for sthome name: sthome-webhook -version: 0.0.4-alpha.107 +version: 0.0.4-alpha.109 diff --git a/deploy/sthome-webhook/values.yaml b/deploy/sthome-webhook/values.yaml index a6e4b70..2650acf 100644 --- a/deploy/sthome-webhook/values.yaml +++ b/deploy/sthome-webhook/values.yaml @@ -31,7 +31,7 @@ clusterIssuer: image: repository: stuurmcp/cert-manager-webhook-sthome #repository: wstat.sthome.net:5000/cert-manager-webhook-sthome - tag: 0.0.4-alpha.107 + tag: 0.0.4-alpha.109 #pullPolicy should be IfNotPresent. Set to Always for testing purposes pullPolicy: IfNotPresent diff --git a/pkg/dns/solver_local.go b/pkg/dns/solver_local.go index 2fd4d73..e6930d2 100644 --- a/pkg/dns/solver_local.go +++ b/pkg/dns/solver_local.go @@ -3,6 +3,7 @@ package dns import ( "fmt" "net" + "strings" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -53,18 +54,14 @@ func (loc *LocalDNSProviderSolver) Present(ch *v1alpha1.ChallengeRequest) error return err } - klog.InfoS("CZ: Presenting challenge", "dnsName", ch.DNSName, "resolvedZone", ch.ResolvedZone, "resolvedFQDN", ch.ResolvedFQDN) - /* provider, cfg, err := loc.init(ch.Config, ch.ResourceNamespace) if err != nil { return fmt.Errorf("failed initializing sthome provider: %v", err) } - */ - if !cfg.IsAllowedZone(ch.ResolvedZone) { - return fmt.Errorf("zone %s may not be edited per config (allowed zones are %v)", ch.ResolvedZone, cfg.AllowedZones) - } - /* + if !cfg.IsAllowedZone(ch.ResolvedZone) { + return fmt.Errorf("zone %s may not be edited per config (allowed zones are %v)", ch.ResolvedZone, cfg.AllowedZones) + } ctx := context.Background() records, err := loc.getExistingRecords(ctx, provider, ch.ResolvedZone, ch.ResolvedFQDN) if err != nil { @@ -79,8 +76,7 @@ func (loc *LocalDNSProviderSolver) Present(ch *v1alpha1.ChallengeRequest) error } */ // TODO: do something more useful with the decoded configuration - klog.Infof("Decoded configuration %v\n", cfg) - klog.Infof("Presenting record for %s, type: %s, uid: %s, key: %s, ns: %s, fqdn: %s, zone: %s, allowambcred: %t, cfg: %s", + klog.Infof("CZ: Presenting record for %s, type: %s, uid: %s, key: %s, ns: %s, fqdn: %s, zone: %s, allowambcred: %t, cfg.secret: %s, cfg.email: %s, cfg.allowz: %s", ch.DNSName, ch.UID, ch.Type, @@ -89,7 +85,9 @@ func (loc *LocalDNSProviderSolver) Present(ch *v1alpha1.ChallengeRequest) error ch.ResolvedFQDN, ch.ResolvedZone, ch.AllowAmbientCredentials, - ch.Config, + cfg.APIKeySecretRef.Name, + cfg.Email, + strings.Join(cfg.AllowedZones, ","), ) // TODO: convert shell script to golang localip := getOutboundIP(dnsserver_net) diff --git a/version.txt b/version.txt index ea62299..326031e 100644 --- a/version.txt +++ b/version.txt @@ -1,3 +1,3 @@ -0.0.4-alpha.107 -20240405-1950 -107 \ No newline at end of file +0.0.4-alpha.109 +20240405-2325 +109 \ No newline at end of file