Skip to content

Commit

Permalink
MGMT-5255 KubeAPI Update event URL only once (#1804)
Browse files Browse the repository at this point in the history
The API Key for auth in the event URL is regenerated every call, causing
a change in the CRD every reconcile loop.
Signed-off-by: Fred Rolland <[email protected]>
  • Loading branch information
rollandf authored May 24, 2021
1 parent b5ff39d commit 7ed84e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions internal/controller/controllers/clusterdeployments_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,12 +842,12 @@ func (r *ClusterDeploymentsReconciler) updateStatus(ctx context.Context, cluster
clusterSpecSynced(clusterInstall, syncErr)
if c != nil {
clusterInstall.Status.ConnectivityMajorityGroups = c.ConnectivityMajorityGroups
eventUrl, err := r.eventsURL(string(*c.ID))
if err != nil {
return ctrl.Result{Requeue: true}, nil
}
clusterInstall.Status.DebugInfo = hiveext.DebugInfo{
EventsURL: eventUrl,
if clusterInstall.Status.DebugInfo.EventsURL == "" {
eventUrl, err := r.eventsURL(string(*c.ID))
if err != nil {
return ctrl.Result{Requeue: true}, nil
}
clusterInstall.Status.DebugInfo.EventsURL = eventUrl
}
if c.Status != nil {
status := *c.Status
Expand Down
2 changes: 1 addition & 1 deletion subsystem/kubeapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ var _ = Describe("[kube-api]cluster installation", func() {
Eventually(func() string {
aci := getAgentClusterInstallCRD(ctx, kubeClient, installkey)
return aci.Status.DebugInfo.EventsURL
}, "30s", "10s").Should(Equal(""))
}, "1m", "10s").Should(Equal(""))
})

It("None SNO deploy clusterDeployment full install and validate MetaData", func() {
Expand Down

0 comments on commit 7ed84e4

Please sign in to comment.