Skip to content

Commit

Permalink
Fix infinite recursion on InlineCertificateConfigEntry
Browse files Browse the repository at this point in the history
GetNamespace() + GetMeta() were calling themselves. This change also simplifies by removing nil-checking to match pre-existing config entries

Co-Authored-By: Andrew Stucki <[email protected]>
  • Loading branch information
nathancoleman and andrewstucki committed Feb 15, 2023
1 parent dd0ca48 commit ea4dd2b
Showing 1 changed file with 7 additions and 39 deletions.
46 changes: 7 additions & 39 deletions api/config_entry_inline_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,10 @@ type InlineCertificateConfigEntry struct {
Namespace string `json:",omitempty"`
}

func (a *InlineCertificateConfigEntry) GetKind() string {
return InlineCertificate
}

func (a *InlineCertificateConfigEntry) GetName() string {
if a != nil {
return ""
}
return a.Name
}

func (a *InlineCertificateConfigEntry) GetPartition() string {
if a != nil {
return ""
}
return a.Partition
}

func (a *InlineCertificateConfigEntry) GetNamespace() string {
if a != nil {
return ""
}
return a.GetNamespace()
}

func (a *InlineCertificateConfigEntry) GetMeta() map[string]string {
if a != nil {
return nil
}
return a.GetMeta()
}

func (a *InlineCertificateConfigEntry) GetCreateIndex() uint64 {
return a.CreateIndex
}

func (a *InlineCertificateConfigEntry) GetModifyIndex() uint64 {
return a.ModifyIndex
}
func (a *InlineCertificateConfigEntry) GetKind() string { return InlineCertificate }
func (a *InlineCertificateConfigEntry) GetName() string { return a.Name }
func (a *InlineCertificateConfigEntry) GetPartition() string { return a.Partition }
func (a *InlineCertificateConfigEntry) GetNamespace() string { return a.Namespace }
func (a *InlineCertificateConfigEntry) GetMeta() map[string]string { return a.Meta }
func (a *InlineCertificateConfigEntry) GetCreateIndex() uint64 { return a.CreateIndex }
func (a *InlineCertificateConfigEntry) GetModifyIndex() uint64 { return a.ModifyIndex }

0 comments on commit ea4dd2b

Please sign in to comment.