Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,15 @@ chainsaw: ## Find or download chainsaw
$(call go-install-tool,$(CHAINSAW),github.com/kyverno/chainsaw,$(CHAINSAW_VERSION))

.PHONY: chainsaw-test
chainsaw-test: chainsaw chainsaw-prepare-kubeconfigs ## Run Chainsaw tests (requires dev/kind.*.kubeconfig to exist)
CHAINSAW_TEST_DIR ?= .
CHAINSAW_DEFAULT_ARGS ?=
CHAINSAW_ARGS ?=

.PHONY: chainsaw-test
chainsaw-test: chainsaw chainsaw-prepare-kubeconfigs ## Run Chainsaw tests (set CHAINSAW_TEST_DIR=./tsig and/or CHAINSAW_ARGS="--include-test-regex <name>")
@test -f dev/kind.upstream.kubeconfig || { echo "Missing dev/kind.upstream.kubeconfig. Bootstrap clusters first."; exit 1; }
@test -f dev/kind.downstream.kubeconfig || { echo "Missing dev/kind.downstream.kubeconfig. Bootstrap clusters first."; exit 1; }
cd test/e2e && $(CHAINSAW) test .
cd test/e2e && $(CHAINSAW) test $(CHAINSAW_DEFAULT_ARGS) $(CHAINSAW_ARGS) $(CHAINSAW_TEST_DIR)

.PHONY: chainsaw-prepare-kubeconfigs
chainsaw-prepare-kubeconfigs: ## Copy dev kind kubeconfigs into test/e2e for stable relative resolution
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "DNSRecordSetPowerDNS")
os.Exit(1)
}
if err := (&controller.DNSZoneTSIGKeyPowerDNSReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "DNSZoneTSIGKeyPowerDNS")
os.Exit(1)
}

if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
setupLog.Error(err, "unable to set up health check")
Expand Down Expand Up @@ -306,6 +313,12 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "DNSZoneDiscoveryReplicator")
os.Exit(1)
}
if err := (&controller.DNSZoneTSIGKeyReplicator{
DownstreamClient: downstreamCluster.GetClient(),
}).SetupWithManager(mcmgr, downstreamCluster); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "DNSZoneTSIGKeyReplicator")
os.Exit(1)
}

if err := mcmgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
setupLog.Error(err, "unable to set up health check")
Expand Down
3 changes: 2 additions & 1 deletion config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ resources:
- bases/dns.networking.miloapis.com_dnszonetsigkeys.yaml
# +kubebuilder:scaffold:crdkustomizeresource

patches:
# kustomize expects this to be an array; keep empty by default.
patches: []
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
# +kubebuilder:scaffold:crdkustomizewebhookpatch
Expand Down
4 changes: 4 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ rules:
- ""
resources:
- configmaps
- secrets
verbs:
- create
- delete
Expand Down Expand Up @@ -44,6 +45,7 @@ rules:
- dns.networking.miloapis.com
resources:
- dnsrecordsets/finalizers
- dnszonetsigkeys/finalizers
verbs:
- update
- apiGroups:
Expand All @@ -52,6 +54,7 @@ rules:
- dnsrecordsets/status
- dnszonediscoveries/status
- dnszones/status
- dnszonetsigkeys/status
verbs:
- get
- patch
Expand All @@ -68,6 +71,7 @@ rules:
- dns.networking.miloapis.com
resources:
- dnszonediscoveries
- dnszonetsigkeys
verbs:
- get
- list
Expand Down
2 changes: 1 addition & 1 deletion config/samples/dns_v1alpha1_dnszonetsigkey.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ spec:
# algorithm: hmac-sha256
# Optional (BYO secret):
# secretRef:
# name: existing-upstream-tsig
# name: existing-upstream

1 change: 1 addition & 0 deletions internal/controller/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const (
ReasonAccepted = "Accepted"
ReasonPending = "Pending"
ReasonInvalidDNSRecordSet = "InvalidDNSRecordSet"
ReasonInvalidSecret = "InvalidSecret"
ReasonProgrammed = "Programmed"
ReasonDiscovered = "Discovered"
ReasonDNSZoneInUse = "DNSZoneInUse"
Expand Down
Loading