Skip to content
Snippets Groups Projects

Draft: Updating ConsoleLinks related to SSO/Portal

Open Francisco Borges Aurindo Barros requested to merge improving-user-experience into master
All threads resolved!
2 files
+ 24
15
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -19,6 +19,8 @@ package controllers
@@ -19,6 +19,8 @@ package controllers
import (
import (
"context"
"context"
"fmt"
"fmt"
 
"os"
 
"path"
"time"
"time"
"github.com/go-logr/logr"
"github.com/go-logr/logr"
@@ -87,6 +89,8 @@ type ProjectLifecyclePolicyReconciler struct {
@@ -87,6 +89,8 @@ type ProjectLifecyclePolicyReconciler struct {
// The text to show in the NamespaceDashboard ConsoleLink providing info about the current application category
// The text to show in the NamespaceDashboard ConsoleLink providing info about the current application category
// in the Application Portal when category is Official
// in the Application Portal when category is Official
ApplicationCategoryOfficialLinkText string
ApplicationCategoryOfficialLinkText string
 
// The link to the Webservices Portal
 
WebservicesPortalLink string
}
}
// +kubebuilder:rbac:groups=webservices.cern.ch,resources=projectlifecyclepolicies,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=webservices.cern.ch,resources=projectlifecyclepolicies,verbs=get;list;watch;create;update;patch;delete
@@ -243,8 +247,11 @@ func (r *ProjectLifecyclePolicyReconciler) Reconcile(ctx context.Context, req ct
@@ -243,8 +247,11 @@ func (r *ProjectLifecyclePolicyReconciler) Reconcile(ctx context.Context, req ct
// Undefined or empty string
// Undefined or empty string
categoryLinkText = r.ApplicationCategoryUndefinedLinkText
categoryLinkText = r.ApplicationCategoryUndefinedLinkText
}
}
 
// Generate the Link for the specific application in the webservices portal
 
// The current format is {WebservicesPortalLink}/{Cluster_name}/{ApplicationName}
 
webservicesPortalLinkOfApplication := r.WebservicesPortalLink + path.Join(os.Getenv("CLUSTER_NAME"), policy.Namespace)
if err := r.ensureConsoleLink(*policy, policy.Namespace+"-category-management",
if err := r.ensureConsoleLink(*policy, policy.Namespace+"-category-management",
categoryLinkText, appManagementUrl, policy.Spec.ApplicationCategoryLink); err != nil {
categoryLinkText, webservicesPortalLinkOfApplication, policy.Spec.ApplicationCategoryLink); err != nil {
r.logErrorAndSetFailedStatus(ctx, log, policy, err, "Failed to set ConsoleLink for category management")
r.logErrorAndSetFailedStatus(ctx, log, policy, err, "Failed to set ConsoleLink for category management")
return ctrl.Result{}, err
return ctrl.Result{}, err
}
}
Loading