Skip to content

Commit

Permalink
add validate call to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
maleck13 committed Mar 11, 2024
1 parent c900057 commit e65a10c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*.dll
*.so
*.dylib
*.env
bin/*
Dockerfile.cross

Expand Down
4 changes: 3 additions & 1 deletion internal/controller/dnsrecord_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ func (r *DNSRecordReconciler) deleteRecord(ctx context.Context, dnsRecord *v1alp
// DNSRecord (dnsRecord.Status.ParentManagedZone).
func (r *DNSRecordReconciler) publishRecord(ctx context.Context, dnsRecord *v1alpha1.DNSRecord) error {
logger := log.FromContext(ctx)

if err := dnsRecord.Validate(); err != nil {
return fmt.Errorf("failed validation pre publish : %s", err)
}
managedZone := &v1alpha1.ManagedZone{
ObjectMeta: metav1.ObjectMeta{
Name: dnsRecord.Spec.ManagedZoneRef.Name,
Expand Down

0 comments on commit e65a10c

Please sign in to comment.