Skip to content

Commit

Permalink
adding flag for cert-manager certs
Browse files Browse the repository at this point in the history
  • Loading branch information
gvicentin committed Aug 5, 2024
1 parent bd61a41 commit fa6bef7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 8 additions & 1 deletion kubernetes/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,10 @@ func (k *IngressService) GetCertificate(ctx context.Context, id router.InstanceI
return nil, err
}

if retSecret.Annotations {

Check failure on line 672 in kubernetes/ingress.go

View workflow job for this annotation

GitHub Actions / Test

non-boolean condition in if statement

}

certificate := string(retSecret.Data["tls.crt"])
key := string(retSecret.Data["tls.key"])
return &router.CertData{Certificate: certificate, Key: key}, err
Expand Down Expand Up @@ -737,7 +741,9 @@ func (s *IngressService) getCertManagerIssuerData(ctx context.Context, issuerNam
}

// TODO: Check if the external issuer exists


// FIX: ASDF
// NOTE: MY NOTE
return CertManagerIssuerData{
Name: parts[0],
Kind: parts[1],
Expand Down Expand Up @@ -890,6 +896,7 @@ func (k *IngressService) RemoveCertManagerCertificate(ctx context.Context, id ro
}

func (s *IngressService) fillIngressMeta(i *networkingV1.Ingress, routerOpts router.Opts, id router.InstanceID) {
// TODO: receive team name and add as an annotation
if i.ObjectMeta.Labels == nil {
i.ObjectMeta.Labels = map[string]string{}
}
Expand Down
7 changes: 5 additions & 2 deletions router/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ type Opts struct {

// CertData user when adding certificates
type CertData struct {
Certificate string `json:"certificate"`
Key string `json:"key"`
Certificate string `json:"certificate"`
Key string `json:"key"`
IsManagedByCertManager bool `json:"isManagedByCertManager"`
}

// Issuer data for CertManager
Expand All @@ -124,7 +125,9 @@ type EnsureBackendOpts struct {
Opts Opts `json:"opts"`
CNames []string `json:"cnames"`
Prefixes []BackendPrefix `json:"prefixes"`
Team string `json:"team,omitempty"`

// TODO: check if can be removed
PreserveOldCNames bool `json:"preserveOldCNames,omitempty"`
}

Expand Down

0 comments on commit fa6bef7

Please sign in to comment.