Skip to content

Commit

Permalink
🔨 fix: empty CA Certificate when update https listener, lb4 sync afte…
Browse files Browse the repository at this point in the history
…r 60s init
  • Loading branch information
anngdinh committed Jun 25, 2024
1 parent 755044a commit 65691cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/utils/vngcloud/loadbalancer_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ func CompareListenerOptions(ilis *lObjects.Listener, lisOptions *listener.Create
CertificateAuthorities: lisOptions.CertificateAuthorities,

// not support update these fields
Headers: ilis.Headers, // L7: if this field is nil, it will update empty ? => set it nil in L4
ClientCertificate: nil,
Headers: ilis.Headers, // L7: if this field is nil, it will update empty ? => set it nil in L4
ClientCertificate: ilis.ClientCertificateAuthentication, // L7: if this field is nil, it will update empty ? => set it nil in L4
}
if ilis.AllowedCidrs != lisOptions.AllowedCidrs ||
ilis.TimeoutClient != lisOptions.TimeoutClient ||
Expand Down
5 changes: 5 additions & 0 deletions pkg/vngcloud/vlb.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func (c *vLB) Init() {
return
}

time.Sleep(60 * time.Second)
go wait.Until(c.nodeSyncLoop, 60*time.Second, c.stopCh)
<-c.stopCh
}
Expand Down Expand Up @@ -876,6 +877,10 @@ func (c *vLB) ensureListenerV2(lbID, lisName string, listenerOpts listener.Creat
updateOpts := vngcloudutil.CompareListenerOptions(lis, &listenerOpts)
if updateOpts != nil {
updateOpts.Headers = nil
updateOpts.ClientCertificate = nil
updateOpts.DefaultCertificateAuthority = nil
updateOpts.CertificateAuthorities = nil

err := vngcloudutil.UpdateListener(c.vLBSC, c.getProjectID(), lbID, lis.UUID, updateOpts)
if err != nil {
klog.Error("error when update listener: ", err)
Expand Down

0 comments on commit 65691cc

Please sign in to comment.