From 8d24435a9e7eb72f7a88b6eb50aa5e7d53e89c5d Mon Sep 17 00:00:00 2001 From: Francisc Munteanu Date: Thu, 7 Dec 2023 12:21:12 +0100 Subject: [PATCH 1/5] remove spacebinding request migration controller --- ...pacebindingrequest_migration_controller.go | 176 --------- ...indingrequest_migration_controller_test.go | 335 ------------------ ...spacebindingrequest_spacebinding_mapper.go | 44 --- ...bindingrequest_spacebinding_mapper_test.go | 47 --- main.go | 14 - 5 files changed, 616 deletions(-) delete mode 100644 controllers/spacebindingrequestmigration/spacebindingrequest_migration_controller.go delete mode 100644 controllers/spacebindingrequestmigration/spacebindingrequest_migration_controller_test.go delete mode 100644 controllers/spacebindingrequestmigration/spacebindingrequest_spacebinding_mapper.go delete mode 100644 controllers/spacebindingrequestmigration/spacebindingrequest_spacebinding_mapper_test.go diff --git a/controllers/spacebindingrequestmigration/spacebindingrequest_migration_controller.go b/controllers/spacebindingrequestmigration/spacebindingrequest_migration_controller.go deleted file mode 100644 index 4e5036da0..000000000 --- a/controllers/spacebindingrequestmigration/spacebindingrequest_migration_controller.go +++ /dev/null @@ -1,176 +0,0 @@ -package spacebindingrequestmigration - -import ( - "context" - "fmt" - - toolchainv1alpha1 "github.com/codeready-toolchain/api/api/v1alpha1" - "github.com/codeready-toolchain/host-operator/pkg/cluster" - errs "github.com/pkg/errors" - "github.com/redhat-cop/operator-utils/pkg/util" - "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/types" - ctrl "sigs.k8s.io/controller-runtime" - runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "sigs.k8s.io/controller-runtime/pkg/source" -) - -// Reconciler reconciles a SpaceBindingRequestMigration object -type Reconciler struct { - Client runtimeclient.Client - Scheme *runtime.Scheme - Namespace string - MemberClusters map[string]cluster.Cluster -} - -// SetupWithManager sets up the controller with the Manager. -func (r *Reconciler) SetupWithManager(mgr ctrl.Manager, memberClusters map[string]cluster.Cluster) error { - // Watch SpaceBindings from host cluster. - b := ctrl.NewControllerManagedBy(mgr). - For(&toolchainv1alpha1.SpaceBinding{}) - - // Watch SpaceBindingRequests in all member clusters and all namespaces and map those to their respective SpaceBinding resources. - for _, memberCluster := range memberClusters { - b = b.Watches( - source.NewKindWithCache(&toolchainv1alpha1.SpaceBindingRequest{}, memberCluster.Cache), - handler.EnqueueRequestsFromMapFunc(MapSpaceBindingRequestToSpaceBinding(r.Client, r.Namespace))) - } - return b.Complete(r) -} - -//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=spacebindingrequests,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=spacebindingrequests/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=spacebindingrequests/finalizers,verbs=update - -// Reconcile converts all the SpaceBindings created using the sandbox-cli to SpaceBindingRequests -func (r *Reconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error) { - logger := log.FromContext(ctx) - logger.Info("reconciling SpaceBindingRequestMigration") - - // Fetch the SpaceBinding instance - spaceBinding := &toolchainv1alpha1.SpaceBinding{} - err := r.Client.Get(ctx, request.NamespacedName, spaceBinding) - if err != nil { - if errors.IsNotFound(err) { - // Request object not found, could have been deleted after reconcile request. - // Return and don't requeue - return reconcile.Result{}, nil - } - // Error reading the object - requeue the request. - return reconcile.Result{}, errs.Wrapf(err, "unable to get spacebinding") - } - if util.IsBeingDeleted(spaceBinding) { - logger.Info("the SpaceBinding is already being deleted") - return reconcile.Result{}, nil - } - // check if spaceBinding was created from SpaceBindingRequest, - // in that case we can skip it - if hasSpaceBindingRequest(spaceBinding) { - return reconcile.Result{}, nil - } - - spaceName := types.NamespacedName{Namespace: spaceBinding.Namespace, Name: spaceBinding.Spec.Space} - space := &toolchainv1alpha1.Space{} - if err := r.Client.Get(ctx, spaceName, space); err != nil { - if errors.IsNotFound(err) { - // space was deleted - return reconcile.Result{}, nil - } - // error while reading space - return ctrl.Result{}, errs.Wrapf(err, "unable to get the bound Space") - } - - murName := types.NamespacedName{Namespace: spaceBinding.Namespace, Name: spaceBinding.Spec.MasterUserRecord} - mur := &toolchainv1alpha1.MasterUserRecord{} - if err := r.Client.Get(ctx, murName, mur); err != nil { - if errors.IsNotFound(err) { - // mur was deleted - return reconcile.Result{}, nil - } - // error while reading MUR - return ctrl.Result{}, errs.Wrapf(err, "unable to get the bound MUR") - } - - // error when mur has no owner label (should not happen in prod) - if _, ok := mur.Labels[toolchainv1alpha1.MasterUserRecordOwnerLabelKey]; !ok { - return ctrl.Result{}, errs.New("mur has no MasterUserRecordOwnerLabelKey set") - } - // error when space has no creator label (should not happen in prod) - if _, ok := space.Labels[toolchainv1alpha1.SpaceCreatorLabelKey]; !ok { - return ctrl.Result{}, errs.New("space has no SpaceCreatorLabelKey set") - } - - // skip workspace creator spacebinding - // the controller will convert only spacebindings created by system admins using the sandbox-cli. - // If the creator label on the space matches the owner label on the MUR then this is the owner of the space - // and the spacebinding should not be migrated. - if space.Labels[toolchainv1alpha1.SpaceCreatorLabelKey] == mur.Labels[toolchainv1alpha1.MasterUserRecordOwnerLabelKey] { - return reconcile.Result{}, nil - } - - // get the spaceRole - spaceRole := spaceBinding.Spec.SpaceRole - - // get member cluster name where the space was provisioned - targetCluster := space.Spec.TargetCluster - memberCluster, memberClusterFound := r.MemberClusters[targetCluster] - if !memberClusterFound { - return ctrl.Result{}, errs.New(fmt.Sprintf("unable to find member cluster: %s", targetCluster)) - } - - // get the home namespace from space - defaultNamespace := getDefaultNamespace(space.Status.ProvisionedNamespaces) - - // construct a SpaceBindingRequest object - sbrName := mur.GetName() + "-" + spaceRole - sbr := &toolchainv1alpha1.SpaceBindingRequest{ - ObjectMeta: metav1.ObjectMeta{ - Name: sbrName, - Namespace: defaultNamespace, - }, - } - - result, err := controllerutil.CreateOrUpdate(ctx, memberCluster.Client, sbr, func() error { - sbr.Spec = toolchainv1alpha1.SpaceBindingRequestSpec{ - MasterUserRecord: mur.GetName(), - SpaceRole: spaceRole, - } - return nil - }) - - if err != nil { - // something happened when we tried to read or write the sbr - return ctrl.Result{}, errs.Wrapf(err, "Failed to create or update space binding request %v", sbrName) - } - - if result == controllerutil.OperationResultCreated { - // let's requeue after we created the SBR, so that in next loop the migrated SpaceBinding object will be deleted - return ctrl.Result{Requeue: true}, nil - } - // if the SBR was found (was created from the previous reconcile loop), we can now delete the SpaceBinding object - if err := r.Client.Delete(ctx, spaceBinding); err != nil && !errors.IsNotFound(err) { - return ctrl.Result{}, errs.Wrapf(err, "unable to delete the SpaceBinding") - } - - return ctrl.Result{}, nil -} - -func getDefaultNamespace(provisionedNamespaces []toolchainv1alpha1.SpaceNamespace) string { - for _, namespaceObj := range provisionedNamespaces { - if namespaceObj.Type == "default" { - return namespaceObj.Name - } - } - return "" -} - -func hasSpaceBindingRequest(spaceBinding *toolchainv1alpha1.SpaceBinding) bool { - _, sbrNameFound := spaceBinding.Labels[toolchainv1alpha1.SpaceBindingRequestLabelKey] - return sbrNameFound -} diff --git a/controllers/spacebindingrequestmigration/spacebindingrequest_migration_controller_test.go b/controllers/spacebindingrequestmigration/spacebindingrequest_migration_controller_test.go deleted file mode 100644 index 0fe58206a..000000000 --- a/controllers/spacebindingrequestmigration/spacebindingrequest_migration_controller_test.go +++ /dev/null @@ -1,335 +0,0 @@ -package spacebindingrequestmigration_test - -import ( - "context" - "fmt" - "testing" - - toolchainv1alpha1 "github.com/codeready-toolchain/api/api/v1alpha1" - "github.com/codeready-toolchain/host-operator/controllers/spacebindingrequestmigration" - "github.com/codeready-toolchain/host-operator/pkg/apis" - "github.com/codeready-toolchain/host-operator/pkg/cluster" - . "github.com/codeready-toolchain/host-operator/test" - spacebindingtest "github.com/codeready-toolchain/host-operator/test/spacebinding" - spacebindingrequesttest "github.com/codeready-toolchain/host-operator/test/spacebindingrequest" - commoncluster "github.com/codeready-toolchain/toolchain-common/pkg/cluster" - "github.com/codeready-toolchain/toolchain-common/pkg/test" - "github.com/codeready-toolchain/toolchain-common/pkg/test/masteruserrecord" - spacetest "github.com/codeready-toolchain/toolchain-common/pkg/test/space" - "github.com/stretchr/testify/require" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes/scheme" - runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - "sigs.k8s.io/controller-runtime/pkg/reconcile" -) - -func TestMigrateSpaceBindingToSBR(t *testing.T) { - // given - logf.SetLogger(zap.New(zap.UseDevMode(true))) - err := apis.AddToScheme(scheme.Scheme) - require.NoError(t, err) - janeSpace := spacetest.NewSpace(test.HostOperatorNs, "jane", - spacetest.WithSpecTargetCluster("member-1"), - spacetest.WithStatusProvisionedNamespaces([]toolchainv1alpha1.SpaceNamespace{{ - Name: "jane-tenant", - Type: "default", - }}), - spacetest.WithLabel(toolchainv1alpha1.SpaceCreatorLabelKey, "jane"), - ) - - janeMur := masteruserrecord.NewMasterUserRecord(t, "jane", masteruserrecord.WithLabel(toolchainv1alpha1.MasterUserRecordOwnerLabelKey, "jane")) - sbForCreator := spacebindingtest.NewSpaceBinding(janeMur.Name, janeSpace.Name, "admin", janeMur.Name) - // we have a user which was added to the space via sandbox-cli - johnMur := masteruserrecord.NewMasterUserRecord(t, "john", masteruserrecord.WithLabel(toolchainv1alpha1.MasterUserRecordOwnerLabelKey, "john")) - sbForJohn := spacebindingtest.NewSpaceBinding(johnMur.Name, janeSpace.Name, "admin", janeMur.GetName()) - t.Run("success", func(t *testing.T) { - - t.Run("create sbr for sb added via sandbox-cli", func(t *testing.T) { - // given - member1 := NewMemberClusterWithClient(test.NewFakeClient(t), "member-1", corev1.ConditionTrue) - hostClient := test.NewFakeClient(t, janeSpace, janeMur, johnMur, sbForCreator, sbForJohn) - ctrl := newReconciler(t, hostClient, member1) - - // when - res, err := ctrl.Reconcile(context.TODO(), requestFor(sbForJohn)) - - // then - require.NoError(t, err) - require.True(t, res.Requeue) // requeue should be triggered once SBR is created - // spaceBindingRequest with expected name, namespace and spec should be created - spacebindingrequesttest.AssertThatSpaceBindingRequest(t, "jane-tenant", johnMur.Name+"-admin", member1.Client). - HasSpecSpaceRole("admin"). - HasSpecMasterUserRecord(johnMur.Name) - // the migrated spacebinding is still there, it will be deleted at the next reconcile loop - spacebindingtest.AssertThatSpaceBinding(t, test.HostOperatorNs, johnMur.Name, janeSpace.Name, hostClient). - Exists() - // the spacebinding for the space creator is still there - spacebindingtest.AssertThatSpaceBinding(t, test.HostOperatorNs, janeMur.Name, janeSpace.Name, hostClient). - Exists() - - t.Run("the next reconcile deletes the migrated spacebinding", func(t *testing.T) { - // when - res, err := ctrl.Reconcile(context.TODO(), requestFor(sbForJohn)) - - // then - require.NoError(t, err) - require.False(t, res.Requeue) // no requeue this time - // the migrated spacebinding was deleted - spacebindingtest.AssertThatSpaceBinding(t, test.HostOperatorNs, johnMur.Name, janeSpace.Name, hostClient). - DoesNotExist() - // spaceBindingRequest with expected name, namespace and spec is still there - spacebindingrequesttest.AssertThatSpaceBindingRequest(t, "jane-tenant", johnMur.Name+"-admin", member1.Client). - HasSpecSpaceRole("admin"). - HasSpecMasterUserRecord(johnMur.Name) - // the spacebinding for the space creator is still there - spacebindingtest.AssertThatSpaceBinding(t, test.HostOperatorNs, janeMur.Name, janeSpace.Name, hostClient). - Exists() - }) - }) - - t.Run("skip space creator spacebinding ", func(t *testing.T) { - // given - // we have the workspace creator spacebinding, it should not be migrated to SpaceBindingRequest - member1 := NewMemberClusterWithClient(test.NewFakeClient(t), "member-1", corev1.ConditionTrue) - hostClient := test.NewFakeClient(t, janeSpace, janeMur, sbForCreator) - ctrl := newReconciler(t, hostClient, member1) - - // when - _, err = ctrl.Reconcile(context.TODO(), requestFor(sbForCreator)) - - // then - require.NoError(t, err) - // the spacebinding for the space creator is still there - spacebindingtest.AssertThatSpaceBinding(t, test.HostOperatorNs, janeMur.Name, janeSpace.Name, hostClient). - Exists() - // the spaceBindingRequest wasn't created - spacebindingrequesttest.AssertThatSpaceBindingRequest(t, "jane-tenant", janeMur.Name+"-admin", member1.Client). - DoesNotExist() - }) - - t.Run("space creator name is different than mur name", func(t *testing.T) { - // given - batmanSpace := spacetest.NewSpace(test.HostOperatorNs, "batman", - spacetest.WithStatusTargetCluster("member-1"), - spacetest.WithStatusProvisionedNamespaces([]toolchainv1alpha1.SpaceNamespace{{ - Name: "batman-tenant", - Type: "default", - }}), - spacetest.WithLabel(toolchainv1alpha1.SpaceCreatorLabelKey, "batman"), - ) - // mur name differs from the space creator label - // but the usersignup matches the space creator name - batmanMur := masteruserrecord.NewMasterUserRecord(t, "batman123", masteruserrecord.WithLabel(toolchainv1alpha1.MasterUserRecordOwnerLabelKey, "batman")) - sbForBatman := spacebindingtest.NewSpaceBinding(batmanMur.GetName(), batmanSpace.GetName(), "admin", "batman") - member1 := NewMemberClusterWithClient(test.NewFakeClient(t), "member-1", corev1.ConditionTrue) - hostClient := test.NewFakeClient(t, batmanSpace, batmanMur, sbForBatman) - ctrl := newReconciler(t, hostClient, member1) - - // when - _, err = ctrl.Reconcile(context.TODO(), requestFor(sbForBatman)) - - // then - require.NoError(t, err) - // the spacebinding for the space creator is still there - spacebindingtest.AssertThatSpaceBinding(t, test.HostOperatorNs, batmanMur.Name, batmanSpace.Name, hostClient). - Exists() - // the spaceBindingRequest wasn't created - spacebindingrequesttest.AssertThatSpaceBindingRequest(t, "batman-tenant", batmanMur.Name+"-admin", member1.Client). - DoesNotExist() - }) - - t.Run("space not found", func(t *testing.T) { - // given - member1 := NewMemberClusterWithClient(test.NewFakeClient(t), "member-1", corev1.ConditionTrue) - // let's not load the space object - hostClient := test.NewFakeClient(t, janeMur, johnMur, sbForCreator, sbForJohn) - ctrl := newReconciler(t, hostClient, member1) - - // when - _, err = ctrl.Reconcile(context.TODO(), requestFor(sbForJohn)) - - // then - require.NoError(t, err) - // the spacebinding for the space creator is still there - spacebindingtest.AssertThatSpaceBinding(t, test.HostOperatorNs, janeMur.Name, janeSpace.Name, hostClient). - Exists() - // the spacebinding for john user is still there - spacebindingtest.AssertThatSpaceBinding(t, test.HostOperatorNs, johnMur.Name, janeSpace.Name, hostClient). - Exists() - // the spaceBindingRequest wasn't created - spacebindingrequesttest.AssertThatSpaceBindingRequest(t, "jane-tenant", johnMur.Name+"-admin", member1.Client). - DoesNotExist() - }) - - t.Run("mur not found", func(t *testing.T) { - // given - member1 := NewMemberClusterWithClient(test.NewFakeClient(t), "member-1", corev1.ConditionTrue) - // let's not load the mur object - hostClient := test.NewFakeClient(t, janeMur, janeSpace, sbForCreator, sbForJohn) - ctrl := newReconciler(t, hostClient, member1) - - // when - _, err = ctrl.Reconcile(context.TODO(), requestFor(sbForJohn)) - - // then - require.NoError(t, err) - // the spacebinding for the space creator is still there - spacebindingtest.AssertThatSpaceBinding(t, test.HostOperatorNs, janeMur.Name, janeSpace.Name, hostClient). - Exists() - // the spacebinding for john user is still there - spacebindingtest.AssertThatSpaceBinding(t, test.HostOperatorNs, johnMur.Name, janeSpace.Name, hostClient). - Exists() - // the spaceBindingRequest wasn't created - spacebindingrequesttest.AssertThatSpaceBindingRequest(t, "jane-tenant", johnMur.Name+"-admin", member1.Client). - DoesNotExist() - }) - - t.Run("spacebinding has spacebindingrequest", func(t *testing.T) { - // given - // the spacebinding has a spacebindingrequest - sbrForJohn := spacebindingrequesttest.NewSpaceBindingRequest("john-admin", "jane-tenant", spacebindingrequesttest.WithLabel(toolchainv1alpha1.SpaceCreatorLabelKey, "somevalue")) - sbForJohnWithSBR := spacebindingtest.NewSpaceBinding(johnMur.Name, janeSpace.Name, "admin", janeMur.GetName(), spacebindingtest.WithSpaceBindingRequest(sbrForJohn)) - member1 := NewMemberClusterWithClient(test.NewFakeClient(t, sbrForJohn), "member-1", corev1.ConditionTrue) - hostClient := test.NewFakeClient(t, janeMur, janeSpace, johnMur, sbForJohnWithSBR) - ctrl := newReconciler(t, hostClient, member1) - - // when - _, err = ctrl.Reconcile(context.TODO(), requestFor(sbForJohnWithSBR)) - - // then - require.NoError(t, err) - // the spacebinding for john user is still there - spacebindingtest.AssertThatSpaceBinding(t, test.HostOperatorNs, johnMur.Name, janeSpace.Name, hostClient). - Exists() - // the spaceBindingRequest is unchanged - // no migration label as creator - spacebindingrequesttest.AssertThatSpaceBindingRequest(t, "jane-tenant", johnMur.Name+"-admin", member1.Client). - HasLabelWithValue(toolchainv1alpha1.SpaceCreatorLabelKey, "somevalue"). - Exists() - }) - - t.Run("spacebinding is being deleted", func(t *testing.T) { - // given - member1 := NewMemberClusterWithClient(test.NewFakeClient(t), "member-1", corev1.ConditionTrue) - // the spacebinding is being deleted - sbForJohn := spacebindingtest.NewSpaceBinding(johnMur.Name, janeSpace.Name, "admin", janeMur.GetName(), spacebindingtest.WithDeletionTimestamp()) - hostClient := test.NewFakeClient(t, janeMur, janeSpace, sbForCreator, johnMur, sbForJohn) - ctrl := newReconciler(t, hostClient, member1) - - // when - _, err = ctrl.Reconcile(context.TODO(), requestFor(sbForJohn)) - - // then - require.NoError(t, err) - // the spacebinding for the space creator is still there - spacebindingtest.AssertThatSpaceBinding(t, test.HostOperatorNs, janeMur.Name, janeSpace.Name, hostClient). - Exists() - // the spacebinding for john user is still there - spacebindingtest.AssertThatSpaceBinding(t, test.HostOperatorNs, johnMur.Name, janeSpace.Name, hostClient). - Exists() - // the spaceBindingRequest wasn't created - spacebindingrequesttest.AssertThatSpaceBindingRequest(t, "jane-tenant", johnMur.Name+"-admin", member1.Client). - DoesNotExist() - }) - }) - - t.Run("error", func(t *testing.T) { - t.Run("unable to get spacebinding", func(t *testing.T) { - hostClient := test.NewFakeClient(t, sbForCreator) - hostClient.MockGet = mockGetSpaceBindingFail(hostClient) - ctrl := newReconciler(t, hostClient) - - // when - _, err := ctrl.Reconcile(context.TODO(), requestFor(sbForCreator)) - - // then - // space binding request should not be there - require.EqualError(t, err, "unable to get spacebinding: mock error") - }) - - t.Run("member cluster not found", func(t *testing.T) { - spaceWithInvalidTargetCluster := spacetest.NewSpace(test.HostOperatorNs, "jane", - spacetest.WithSpecTargetCluster("invalid"), - spacetest.WithLabel(toolchainv1alpha1.SpaceCreatorLabelKey, "jane"), - ) - sb := spacebindingtest.NewSpaceBinding(johnMur.Name, spaceWithInvalidTargetCluster.Name, "admin", janeMur.Name) - hostClient := test.NewFakeClient(t, sb, spaceWithInvalidTargetCluster, johnMur) - ctrl := newReconciler(t, hostClient) - - // when - _, err := ctrl.Reconcile(context.TODO(), requestFor(sb)) - - // then - // space binding request should not be there - require.EqualError(t, err, "unable to find member cluster: invalid") - }) - - t.Run("mur has no owner label", func(t *testing.T) { - murWithNoOwnership := masteruserrecord.NewMasterUserRecord(t, "jane") - sb := spacebindingtest.NewSpaceBinding(murWithNoOwnership.Name, janeSpace.Name, "admin", janeMur.Name) - hostClient := test.NewFakeClient(t, sb, janeSpace, murWithNoOwnership) - ctrl := newReconciler(t, hostClient) - - // when - _, err := ctrl.Reconcile(context.TODO(), requestFor(sb)) - - // then - // space binding request should not be there - require.EqualError(t, err, "mur has no MasterUserRecordOwnerLabelKey set") - }) - - }) -} - -func newReconciler(t *testing.T, hostCl runtimeclient.Client, memberClusters ...*commoncluster.CachedToolchainCluster) *spacebindingrequestmigration.Reconciler { - s := scheme.Scheme - err := apis.AddToScheme(s) - require.NoError(t, err) - - clusters := map[string]cluster.Cluster{} - for _, c := range memberClusters { - clusters[c.Name] = cluster.Cluster{ - Config: &commoncluster.Config{ - Type: commoncluster.Member, - OperatorNamespace: c.OperatorNamespace, - OwnerClusterName: test.MemberClusterName, - }, - Client: c.Client, - } - } - return &spacebindingrequestmigration.Reconciler{ - Client: hostCl, - Scheme: s, - Namespace: test.HostOperatorNs, - MemberClusters: clusters, - } -} - -func requestFor(s *toolchainv1alpha1.SpaceBinding) reconcile.Request { - if s != nil { - return reconcile.Request{ - NamespacedName: types.NamespacedName{ - Namespace: s.Namespace, - Name: s.Name, - }, - } - } - return reconcile.Request{ - NamespacedName: types.NamespacedName{ - Namespace: test.HostOperatorNs, - Name: "unknown", - }, - } -} - -func mockGetSpaceBindingFail(cl runtimeclient.Client) func(ctx context.Context, key runtimeclient.ObjectKey, obj runtimeclient.Object, opts ...runtimeclient.GetOption) error { - return func(ctx context.Context, key runtimeclient.ObjectKey, obj runtimeclient.Object, opts ...runtimeclient.GetOption) error { - if _, ok := obj.(*toolchainv1alpha1.SpaceBinding); ok { - return fmt.Errorf("mock error") - } - return cl.Get(ctx, key, obj, opts...) - } -} diff --git a/controllers/spacebindingrequestmigration/spacebindingrequest_spacebinding_mapper.go b/controllers/spacebindingrequestmigration/spacebindingrequest_spacebinding_mapper.go deleted file mode 100644 index 051ad3c07..000000000 --- a/controllers/spacebindingrequestmigration/spacebindingrequest_spacebinding_mapper.go +++ /dev/null @@ -1,44 +0,0 @@ -package spacebindingrequestmigration - -import ( - "context" - - toolchainv1alpha1 "github.com/codeready-toolchain/api/api/v1alpha1" - ctrl "sigs.k8s.io/controller-runtime" - - "k8s.io/apimachinery/pkg/types" - runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/reconcile" -) - -// MapSpaceBindingRequestToSpaceBinding returns an event for the spacebinding that owns. -func MapSpaceBindingRequestToSpaceBinding(cl runtimeclient.Client, watchNamespace string) func(spaceBindingRequest runtimeclient.Object) []reconcile.Request { - mapperLog := ctrl.Log.WithName("SpaceBindingRequestToSpaceBinding") - return func(obj runtimeclient.Object) []reconcile.Request { - spaceBindings := &toolchainv1alpha1.SpaceBindingList{} - err := cl.List(context.TODO(), spaceBindings, - runtimeclient.InNamespace(watchNamespace), - runtimeclient.MatchingLabels{ - toolchainv1alpha1.SpaceBindingRequestLabelKey: obj.GetName(), - toolchainv1alpha1.SpaceBindingRequestNamespaceLabelKey: obj.GetNamespace(), - }) - if err != nil { - mapperLog.Error(err, "cannot list spacebindings") - return []reconcile.Request{} - } - if len(spaceBindings.Items) == 0 { - return []reconcile.Request{} - } - - req := make([]reconcile.Request, len(spaceBindings.Items)) - for i, item := range spaceBindings.Items { - req[i] = reconcile.Request{ - NamespacedName: types.NamespacedName{ - Namespace: item.Namespace, - Name: item.Name, - }, - } - } - return req - } -} diff --git a/controllers/spacebindingrequestmigration/spacebindingrequest_spacebinding_mapper_test.go b/controllers/spacebindingrequestmigration/spacebindingrequest_spacebinding_mapper_test.go deleted file mode 100644 index b9e70ae3a..000000000 --- a/controllers/spacebindingrequestmigration/spacebindingrequest_spacebinding_mapper_test.go +++ /dev/null @@ -1,47 +0,0 @@ -package spacebindingrequestmigration_test - -import ( - "testing" - - "github.com/codeready-toolchain/api/api/v1alpha1" - "github.com/codeready-toolchain/host-operator/controllers/spacebindingrequestmigration" - sb "github.com/codeready-toolchain/host-operator/test/spacebinding" - spacebindingrequesttest "github.com/codeready-toolchain/host-operator/test/spacebindingrequest" - "github.com/codeready-toolchain/toolchain-common/pkg/test" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/reconcile" -) - -func TestMapSpaceBindingRequestToSpaceBinding(t *testing.T) { - // given - restore := test.SetEnvVarAndRestore(t, "WATCH_NAMESPACE", test.HostOperatorNs) - defer restore() - spaceBindingRequest := spacebindingrequesttest.NewSpaceBindingRequest("mySpaceBindingRequest", "jane") - // following spaceBinding has a spaceBindingRequest associated - spaceBinding := sb.NewSpaceBinding("jane", "jane", "admin", "signupAdmin") - spaceBinding.Labels[v1alpha1.SpaceBindingRequestLabelKey] = spaceBindingRequest.Name - spaceBinding.Labels[v1alpha1.SpaceBindingRequestNamespaceLabelKey] = spaceBindingRequest.Namespace - - cl := test.NewFakeClient(t, spaceBinding) - - t.Run("should return SpaceBinding requests for SpaceBindingRequest", func(t *testing.T) { - // when - requests := spacebindingrequestmigration.MapSpaceBindingRequestToSpaceBinding(cl, test.HostOperatorNs)(spaceBindingRequest) - - // then - require.Len(t, requests, 1) - assert.Contains(t, requests, newRequest(spaceBinding.Name)) - }) - -} - -func newRequest(name string) reconcile.Request { - return reconcile.Request{ - NamespacedName: types.NamespacedName{ - Namespace: test.HostOperatorNs, - Name: name, - }, - } -} diff --git a/main.go b/main.go index aec7519a1..8e97464a7 100644 --- a/main.go +++ b/main.go @@ -16,7 +16,6 @@ import ( "github.com/codeready-toolchain/host-operator/controllers/space" "github.com/codeready-toolchain/host-operator/controllers/spacebindingcleanup" "github.com/codeready-toolchain/host-operator/controllers/spacebindingrequest" - "github.com/codeready-toolchain/host-operator/controllers/spacebindingrequestmigration" "github.com/codeready-toolchain/host-operator/controllers/spacecleanup" "github.com/codeready-toolchain/host-operator/controllers/spacecompletion" "github.com/codeready-toolchain/host-operator/controllers/spacerequest" @@ -324,19 +323,6 @@ func main() { // nolint:gocyclo os.Exit(1) } } - // TEMPORARY controller that converts spacebindings created via sandbox-cli into spacebinding requests - // once the migration effort is completed , the controller can be disabled and deleted. - if crtConfig.SpaceConfig().SpaceBindingRequestIsEnabled() { - if err = (&spacebindingrequestmigration.Reconciler{ - Client: mgr.GetClient(), - Namespace: namespace, - MemberClusters: clusterScopedMemberClusters, - Scheme: mgr.GetScheme(), - }).SetupWithManager(mgr, clusterScopedMemberClusters); err != nil { - setupLog.Error(err, "unable to create controller", "controller", "SpaceBindingRequestMigration") - os.Exit(1) - } - } if err = (&space.Reconciler{ Client: mgr.GetClient(), Namespace: namespace, From 7447d68fd2ce1282310e01dd059299e75d9b77cd Mon Sep 17 00:00:00 2001 From: Devtools Date: Mon, 5 May 2025 14:16:28 +0200 Subject: [PATCH 2/5] add new ui config --- ...olchain.dev.openshift.com_bannedusers.yaml | 19 +- ...n.dev.openshift.com_masteruserrecords.yaml | 57 ++-- ...chain.dev.openshift.com_notifications.yaml | 62 ++-- ...ain.dev.openshift.com_nstemplatetiers.yaml | 54 +-- ...lchain.dev.openshift.com_proxyplugins.yaml | 43 +-- ...lchain.dev.openshift.com_socialevents.yaml | 45 ++- ...ev.openshift.com_spacebindingrequests.yaml | 31 +- ...chain.dev.openshift.com_spacebindings.yaml | 19 +- ...openshift.com_spaceprovisionerconfigs.yaml | 57 ++-- ...chain.dev.openshift.com_spacerequests.yaml | 63 ++-- .../toolchain.dev.openshift.com_spaces.yaml | 86 +++-- ...v.openshift.com_tiertemplaterevisions.yaml | 41 ++- ...chain.dev.openshift.com_tiertemplates.yaml | 156 +++++---- ...n.dev.openshift.com_toolchainclusters.yaml | 44 ++- ...in.dev.openshift.com_toolchainconfigs.yaml | 318 +++++++++--------- ...n.dev.openshift.com_toolchainstatuses.yaml | 104 +++--- ...olchain.dev.openshift.com_usersignups.yaml | 55 +-- ...toolchain.dev.openshift.com_usertiers.yaml | 19 +- 18 files changed, 705 insertions(+), 568 deletions(-) diff --git a/config/crd/bases/toolchain.dev.openshift.com_bannedusers.yaml b/config/crd/bases/toolchain.dev.openshift.com_bannedusers.yaml index f4e155bb2..35630c514 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_bannedusers.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_bannedusers.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: bannedusers.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -24,14 +24,19 @@ spec: description: BannedUser is used to maintain a list of banned e-mail addresses properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object diff --git a/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml b/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml index 88d1eb782..3eb99b3e2 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_masteruserrecords.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: masteruserrecords.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -44,14 +44,19 @@ spec: and namespaces provisioned in CodeReady Toolchain properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -59,14 +64,14 @@ spec: description: MasterUserRecordSpec defines the desired state of MasterUserRecord properties: disabled: - description: If set to true then the corresponding user should not - be able to login (but the underlying UserAccounts still exists) + description: |- + If set to true then the corresponding user should not be able to login (but the underlying UserAccounts still exists) "false" is assumed by default type: boolean propagatedClaims: - description: PropagatedClaims contains a selection of claim values - from the SSO Identity Provider which are intended to be "propagated" - down the resource dependency chain + description: |- + PropagatedClaims contains a selection of claim values from the SSO Identity Provider which are intended to + be "propagated" down the resource dependency chain properties: accountID: description: AccountID contains the value of the 'account_id' @@ -76,9 +81,9 @@ spec: description: Email contains the user's email address type: string originalSub: - description: OriginalSub is an optional property temporarily introduced - for the purpose of migrating the users to a new IdP provider - client, and contains the user's "original-sub" claim + description: |- + OriginalSub is an optional property temporarily introduced for the purpose of migrating the users to + a new IdP provider client, and contains the user's "original-sub" claim type: string sub: description: Sub contains the value of the 'sub' claim @@ -91,11 +96,11 @@ spec: - sub type: object tierName: - description: TierName is an optional property introduced to retain - the name of the tier for which the Dev Sandbox user is provisioned, - so we can still deal with deactivation once the NSTemplateSet field - has been removed from `[]spec.UserAccounts` temporarily marked as - optional until the migration took place (CRT-1321) + description: |- + TierName is an optional property introduced to retain the name of the tier + for which the Dev Sandbox user is provisioned, so we can still deal with deactivation + once the NSTemplateSet field has been removed from `[]spec.UserAccounts` + temporarily marked as optional until the migration took place (CRT-1321) type: string userAccounts: description: The list of user accounts in the member clusters which @@ -117,9 +122,10 @@ spec: description: MasterUserRecordStatus defines the observed state of MasterUserRecord properties: conditions: - description: 'Conditions is an array of current Master User Record - conditions Supported condition types: Provisioning, UserAccountNotReady - and Ready' + description: |- + Conditions is an array of current Master User Record conditions + Supported condition types: + Provisioning, UserAccountNotReady and Ready items: properties: lastTransitionTime: @@ -172,8 +178,9 @@ spec: - name type: object conditions: - description: 'Conditions is an array of current User Account - conditions Supported condition types: ConditionReady' + description: |- + Conditions is an array of current User Account conditions + Supported condition types: ConditionReady items: properties: lastTransitionTime: diff --git a/config/crd/bases/toolchain.dev.openshift.com_notifications.yaml b/config/crd/bases/toolchain.dev.openshift.com_notifications.yaml index 3d21e8513..0b6d4cda3 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_notifications.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_notifications.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: notifications.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -28,14 +28,19 @@ spec: description: Notification registers a notification in the CodeReady Toolchain properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -43,47 +48,48 @@ spec: description: NotificationSpec defines the desired state of Notification properties: content: - description: Content is used when no template value is specified, - in cases where the complete notification content is specified at - notification creation time + description: |- + Content is used when no template value is specified, in cases where the complete notification content is + specified at notification creation time type: string context: additionalProperties: type: string - description: Context is used to set a number of arbitrary values to - be passed to the notification content text formatter, for inclusion - in the body of the notification. + description: |- + Context is used to set a number of arbitrary values to be passed to the notification content text formatter, + for inclusion in the body of the notification. type: object recipient: - description: Recipient is used to specify the email address where - the notification will be delivered. It must comply with section - 3.4.1 of RFC2822, and should be formatted to include the user's - first and last names, e.g. "John Smith " + description: |- + Recipient is used to specify the email address where the notification will be delivered. It must comply with + section 3.4.1 of RFC2822, and should be formatted to include the user's first and last names, + e.g. "John Smith " type: string subject: - description: Subject is used when no template value is specified, - in cases where the complete notification subject is specified at - notification creation time + description: |- + Subject is used when no template value is specified, in cases where the complete notification subject is + specified at notification creation time type: string template: description: Template is the name of the NotificationTemplate resource that will be used to generate the notification type: string userID: - description: 'UserID is the user ID from RHD Identity Provider token - (“sub” claim). The UserID is used by the notification service (i.e. - the NotificationController) to lookup the UserSignup resource for - the user, and extract from it the values required to generate the - notification content and to deliver the notification Deprecated: - replaced by Context' + description: |- + UserID is the user ID from RHD Identity Provider token (“sub” claim). The UserID is used by + the notification service (i.e. the NotificationController) to lookup the UserSignup resource for the user, + and extract from it the values required to generate the notification content and to deliver the notification + Deprecated: replaced by Context type: string type: object status: description: NotificationStatus defines the observed state of Notification properties: conditions: - description: 'Conditions is an array of current Notification conditions - Supported condition types: Sent' + description: |- + Conditions is an array of current Notification conditions + Supported condition types: + Sent items: properties: lastTransitionTime: diff --git a/config/crd/bases/toolchain.dev.openshift.com_nstemplatetiers.yaml b/config/crd/bases/toolchain.dev.openshift.com_nstemplatetiers.yaml index efba07949..b7b112d7a 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_nstemplatetiers.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_nstemplatetiers.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: nstemplatetiers.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -23,14 +23,19 @@ spec: for namespaces the user has access to properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -70,16 +75,19 @@ spec: to replace "global" variables defined in the TierTemplate CRs of the NSTemplateTier. items: - description: Parameter defines a name/value variable that is to - be processed during TierTemplate creation. + description: |- + Parameter defines a name/value variable that is to be processed during + TierTemplate creation. properties: name: - description: Name must be set and it can be referenced in the - TierTemplate content using {{.NAME}} + description: |- + Name must be set and it can be referenced in the TierTemplate + content using {{.NAME}} type: string value: - description: Value holds the Parameter data. The value replaces - all occurrences of the Parameter {{.NAME}}. + description: |- + Value holds the Parameter data. + The value replaces all occurrences of the Parameter {{.NAME}}. type: string required: - name @@ -121,8 +129,9 @@ spec: description: NSTemplateTierStatus defines the observed state of NSTemplateTier properties: conditions: - description: 'Conditions is an array of current NSTemplateTier conditions - Supported condition types: ConditionReady' + description: |- + Conditions is an array of current NSTemplateTier conditions + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -158,15 +167,12 @@ spec: revisions: additionalProperties: type: string - description: Revisions is a map of TierTemplate CR names (as the keys) - and TierTemplateRevision CR names (as the values) The map represents - the current content of the TierTemplate CRs combined with the parameters - defined in the tier. Each of the referenced TierTemplateRevision - CRs represents the content of the associated TierTemplate CR processed - with the parameters. If the content of the already referenced TierTemplateRevision - CR doesn't match the expected outcome of the processed TierTemplate - CR, then a new TierTemplateRevision CR is created and the name here - is updated. + description: |- + Revisions is a map of TierTemplate CR names (as the keys) and TierTemplateRevision CR names (as the values) + The map represents the current content of the TierTemplate CRs combined with the parameters defined in the tier. + Each of the referenced TierTemplateRevision CRs represents the content of the associated TierTemplate CR processed with the parameters. + If the content of the already referenced TierTemplateRevision CR doesn't match the expected outcome of the processed TierTemplate CR, + then a new TierTemplateRevision CR is created and the name here is updated. type: object x-kubernetes-map-type: atomic type: object diff --git a/config/crd/bases/toolchain.dev.openshift.com_proxyplugins.yaml b/config/crd/bases/toolchain.dev.openshift.com_proxyplugins.yaml index 7b0c56b14..4cc4949a4 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_proxyplugins.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_proxyplugins.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: proxyplugins.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -24,21 +24,26 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: 'ProxyPlugin represents the configuration to handle GET''s to - k8s services in member clusters that first route through the registration - service running in the sandbox host cluster. Two forms of URL are supported: + description: |- + ProxyPlugin represents the configuration to handle GET's to k8s services in member clusters that first route through + the registration service running in the sandbox host cluster. Two forms of URL are supported: https:///plugins//v1alpha2// - https:///plugins//workspaces//v1alpha2/' + https:///plugins//workspaces//v1alpha2/ properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -46,12 +51,11 @@ spec: description: ProxyPluginSpec defines the desired state of ProxyPlugin properties: openShiftRouteTargetEndpoint: - description: OpenShiftRouteTargetEndpoint is an optional field that - represents the look up information for an OpenShift Route as the - endpoint for the registration service to proxy requests to that - have the https:///plugins/ - in its incoming URL. As we add more types besides OpenShift Routes, - we will add more optional fields to this spec object + description: |- + OpenShiftRouteTargetEndpoint is an optional field that represents the look up information for an OpenShift Route + as the endpoint for the registration service to proxy requests to that have the https:///plugins/ + in its incoming URL. As we add more types besides OpenShift Routes, we will add more optional fields to this spec + object properties: name: type: string @@ -66,8 +70,9 @@ spec: description: ProxyPluginStatus defines the observed state of ProxyPlugin properties: conditions: - description: 'Conditions is an array of current Proxy Plugin conditions - Supported condition types: ConditionReady' + description: |- + Conditions is an array of current Proxy Plugin conditions + Supported condition types: ConditionReady items: properties: lastTransitionTime: diff --git a/config/crd/bases/toolchain.dev.openshift.com_socialevents.yaml b/config/crd/bases/toolchain.dev.openshift.com_socialevents.yaml index ad8132743..5738a56a0 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_socialevents.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_socialevents.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: socialevents.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -36,21 +36,26 @@ spec: description: SocialEvent registers a social event in Dev Sandbox properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object spec: - description: SocialEventSpec defines the parameters for a Social event, - such as a training session or workshop. Users may register for the event - by using the event's unique activation code + description: |- + SocialEventSpec defines the parameters for a Social event, such as a training session or workshop. Users + may register for the event by using the event's unique activation code properties: description: description: An optional description that may be provided describing @@ -65,9 +70,9 @@ spec: description: The maximum number of attendees type: integer spaceTier: - description: The tier to assign to spaces created for users who registered - for the event. This must be the valid name of an nstemplatetier - resource. + description: |- + The tier to assign to spaces created for users who registered for the event. + This must be the valid name of an nstemplatetier resource. type: string startTime: description: The timestamp from which users may register via this @@ -75,11 +80,13 @@ spec: format: date-time type: string targetCluster: - description: The cluster in which the user/space should be provisioned - in If not set then the target cluster will be picked automatically + description: |- + The cluster in which the user/space should be provisioned in + If not set then the target cluster will be picked automatically type: string userTier: - description: The tier to assign to users registering for the event. + description: |- + The tier to assign to users registering for the event. This must be the valid name of an nstemplatetier resource. type: string verificationRequired: @@ -99,8 +106,10 @@ spec: activationCount: type: integer conditions: - description: 'Conditions is an array of current SocialEventStatus - conditions Supported condition types: Ready' + description: |- + Conditions is an array of current SocialEventStatus conditions + Supported condition types: + Ready items: properties: lastTransitionTime: diff --git a/config/crd/bases/toolchain.dev.openshift.com_spacebindingrequests.yaml b/config/crd/bases/toolchain.dev.openshift.com_spacebindingrequests.yaml index be9e8c747..a3aaec98a 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_spacebindingrequests.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_spacebindingrequests.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: spacebindingrequests.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -34,14 +34,19 @@ spec: API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -49,8 +54,9 @@ spec: description: SpaceBindingRequestSpec defines the desired state of SpaceBindingRequest properties: masterUserRecord: - description: MasterUserRecord is a required property introduced to - retain the name of the MUR for which this SpaceBinding is provisioned. + description: |- + MasterUserRecord is a required property introduced to retain the name of the MUR + for which this SpaceBinding is provisioned. type: string spaceRole: description: SpaceRole is a required property which defines the role @@ -65,9 +71,10 @@ spec: description: SpaceBindingRequestStatus defines the observed state of SpaceBinding properties: conditions: - description: 'Conditions is an array of SpaceBindingRequest conditions - Supported condition types: Provisioning, SpaceBindingNotReady and - Ready' + description: |- + Conditions is an array of SpaceBindingRequest conditions + Supported condition types: + Provisioning, SpaceBindingNotReady and Ready items: properties: lastTransitionTime: diff --git a/config/crd/bases/toolchain.dev.openshift.com_spacebindings.yaml b/config/crd/bases/toolchain.dev.openshift.com_spacebindings.yaml index 8f55dc380..4968f6d03 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_spacebindings.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_spacebindings.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: spacebindings.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -31,14 +31,19 @@ spec: relationship between Spaces and MasterUserRecords properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object diff --git a/config/crd/bases/toolchain.dev.openshift.com_spaceprovisionerconfigs.yaml b/config/crd/bases/toolchain.dev.openshift.com_spaceprovisionerconfigs.yaml index 76c356d20..94bf7673c 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_spaceprovisionerconfigs.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_spaceprovisionerconfigs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: spaceprovisionerconfigs.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -28,14 +28,19 @@ spec: in the member clusters. properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -46,16 +51,21 @@ spec: in this provisioner properties: maxMemoryUtilizationPercent: - description: "MaxMemoryUtilizationPercent is the maximum memory - utilization of the cluster to permit provisioning new spaces - to it. \n 0 or undefined value means no limit." + description: |- + MaxMemoryUtilizationPercent is the maximum memory utilization of the cluster to permit provisioning + new spaces to it. + + + 0 or undefined value means no limit. maximum: 100 minimum: 0 type: integer maxNumberOfSpaces: - description: "MaxNumberOfSpaces is the maximum number of spaces - that can be provisioned to the referenced cluster. \n 0 or undefined - value means no limit." + description: |- + MaxNumberOfSpaces is the maximum number of spaces that can be provisioned to the referenced cluster. + + + 0 or undefined value means no limit. minimum: 0 type: integer type: object @@ -65,8 +75,9 @@ spec: (and therefore can hold spaces) or not. type: boolean placementRoles: - description: PlacementRoles is the list of roles, or flavors, that - the provisioner possesses that influence the space scheduling decisions. + description: |- + PlacementRoles is the list of roles, or flavors, that the provisioner possesses that influence + the space scheduling decisions. items: type: string type: array @@ -81,11 +92,11 @@ spec: status: properties: conditions: - description: 'Conditions describes the state of the configuration - (its validity). The only known condition type is "Ready". The SpaceProvisionerConfig - is ready when the following is true: * the referenced ToolchainCluster - object exists and is itself ready * the consumed capacity doesn''t - breach the thresholds defined in the spec' + description: |- + Conditions describes the state of the configuration (its validity). + The only known condition type is "Ready". The SpaceProvisionerConfig is ready when the following is true: + * the referenced ToolchainCluster object exists and is itself ready + * the consumed capacity doesn't breach the thresholds defined in the spec items: properties: lastTransitionTime: @@ -119,9 +130,9 @@ spec: - type x-kubernetes-list-type: map consumedCapacity: - description: ConsumedCapacity reflects the runtime state of the cluster - and the capacity it currently consumes. Nil if the consumed capacity - is not known + description: |- + ConsumedCapacity reflects the runtime state of the cluster and the capacity it currently consumes. + Nil if the consumed capacity is not known properties: memoryUsagePercentPerNodeRole: additionalProperties: diff --git a/config/crd/bases/toolchain.dev.openshift.com_spacerequests.yaml b/config/crd/bases/toolchain.dev.openshift.com_spacerequests.yaml index dae6c4bb8..755b1f5eb 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_spacerequests.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_spacerequests.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: spacerequests.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -33,14 +33,19 @@ spec: description: SpaceRequest is the Schema for the space request API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -48,23 +53,27 @@ spec: description: SpaceRequestSpec defines the desired state of Space properties: disableInheritance: - description: "DisableInheritance indicates whether or not SpaceBindings - from the parent-spaces are automatically inherited to all sub-spaces - in the tree. \n Set to True to disable SpaceBinding inheritance - from the parent-spaces. Default is False." + description: |- + DisableInheritance indicates whether or not SpaceBindings from the parent-spaces are + automatically inherited to all sub-spaces in the tree. + + + Set to True to disable SpaceBinding inheritance from the parent-spaces. + Default is False. type: boolean targetClusterRoles: - description: TargetClusterRoles one or more label keys that define - a set of clusters where the Space can be provisioned. The target - cluster has to match ALL the roles defined in this field in order - for the space to be provisioned there. + description: |- + TargetClusterRoles one or more label keys that define a set of clusters + where the Space can be provisioned. + The target cluster has to match ALL the roles defined in this field in order for the space to be provisioned there. items: type: string type: array x-kubernetes-list-type: atomic tierName: - description: TierName is a required property introduced to retain - the name of the tier for which this Space is provisioned. + description: |- + TierName is a required property introduced to retain the name of the tier + for which this Space is provisioned. type: string required: - tierName @@ -73,8 +82,10 @@ spec: description: SpaceRequestStatus defines the observed state of Space properties: conditions: - description: 'Conditions is an array of SpaceRequest conditions Supported - condition types: Provisioning, SpaceNotReady and Ready' + description: |- + Conditions is an array of SpaceRequest conditions + Supported condition types: + Provisioning, SpaceNotReady and Ready items: properties: lastTransitionTime: @@ -119,9 +130,9 @@ spec: namespace type: string secretRef: - description: SecretRef is the name of the secret with a SA token - that has admin-like (or whatever we set in the tier template) - permissions in the namespace + description: |- + SecretRef is the name of the secret with a SA token that has admin-like + (or whatever we set in the tier template) permissions in the namespace type: string required: - name @@ -130,10 +141,10 @@ spec: type: array x-kubernetes-list-type: atomic targetClusterURL: - description: TargetClusterURL The API URL of the cluster where Space - is currently provisioned Can be empty if provisioning did not start - or failed The URL is just for informative purposes for developers - and controllers that are placed in member clusters. + description: |- + TargetClusterURL The API URL of the cluster where Space is currently provisioned + Can be empty if provisioning did not start or failed + The URL is just for informative purposes for developers and controllers that are placed in member clusters. type: string type: object type: object diff --git a/config/crd/bases/toolchain.dev.openshift.com_spaces.yaml b/config/crd/bases/toolchain.dev.openshift.com_spaces.yaml index cb576c05d..d6e854db1 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_spaces.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_spaces.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: spaces.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -33,14 +33,19 @@ spec: description: Space is the Schema for the spaces API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -48,46 +53,53 @@ spec: description: SpaceSpec defines the desired state of Space properties: disableInheritance: - description: "DisableInheritance indicates whether or not SpaceBindings - from the parent-spaces are automatically inherited to all sub-spaces - in the tree. \n Set to True to disable SpaceBinding inheritance - from the parent-spaces. Default is False." + description: |- + DisableInheritance indicates whether or not SpaceBindings from the parent-spaces are + automatically inherited to all sub-spaces in the tree. + + + Set to True to disable SpaceBinding inheritance from the parent-spaces. + Default is False. type: boolean parentSpace: - description: "ParentSpace holds the name of the context (Space) from - which this space was created (requested), enabling hierarchy relationships - between different Spaces. \n Keeping this association brings two - main benefits: 1. SpaceBindings are inherited from the parent Space - 2. Ability to easily monitor quota for the requested sub-spaces" + description: |- + ParentSpace holds the name of the context (Space) from which this space was created (requested), + enabling hierarchy relationships between different Spaces. + + + Keeping this association brings two main benefits: + 1. SpaceBindings are inherited from the parent Space + 2. Ability to easily monitor quota for the requested sub-spaces type: string targetCluster: - description: TargetCluster The cluster in which this Space is going - to be provisioned If not set then the target cluster will be picked - automatically + description: |- + TargetCluster The cluster in which this Space is going to be provisioned + If not set then the target cluster will be picked automatically type: string targetClusterRoles: - description: TargetClusterRoles one or more label keys that define - a set of clusters where the Space can be provisioned. The target - cluster has to match ALL the roles defined in this field in order - for the space to be provisioned there. It can be used as an alternative - to targetCluster field, which has precedence in case both roles - and name are provided. + description: |- + TargetClusterRoles one or more label keys that define a set of clusters + where the Space can be provisioned. + The target cluster has to match ALL the roles defined in this field in order for the space to be provisioned there. + It can be used as an alternative to targetCluster field, which has precedence in case both roles and name are provided. items: type: string type: array x-kubernetes-list-type: atomic tierName: - description: TierName is introduced to retain the name of the tier - for which this Space is provisioned If not set then the tier name - will be set automatically + description: |- + TierName is introduced to retain the name of the tier + for which this Space is provisioned + If not set then the tier name will be set automatically type: string type: object status: description: SpaceStatus defines the observed state of Space properties: conditions: - description: 'Conditions is an array of current Space conditions Supported - condition types: ConditionReady' + description: |- + Conditions is an array of current Space conditions + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -124,9 +136,9 @@ spec: description: ProvisionedNamespaces is a list of Namespaces that were provisioned for the Space. items: - description: SpaceNamespace is a common type to define the information - about a namespace within a Space Used in NSTemplateSet, Space - and Workspace status + description: |- + SpaceNamespace is a common type to define the information about a namespace within a Space + Used in NSTemplateSet, Space and Workspace status properties: name: description: Name the name of the namespace. @@ -138,10 +150,10 @@ spec: type: array x-kubernetes-list-type: atomic targetCluster: - description: TargetCluster The cluster in which this Space is currently - provisioned Can be empty if provisioning did not start or failed - To be used to de-provision the NSTemplateSet if the Spec.TargetCluster - is either changed or removed + description: |- + TargetCluster The cluster in which this Space is currently provisioned + Can be empty if provisioning did not start or failed + To be used to de-provision the NSTemplateSet if the Spec.TargetCluster is either changed or removed type: string type: object type: object diff --git a/config/crd/bases/toolchain.dev.openshift.com_tiertemplaterevisions.yaml b/config/crd/bases/toolchain.dev.openshift.com_tiertemplaterevisions.yaml index 7d1825ae3..974a59a2e 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_tiertemplaterevisions.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_tiertemplaterevisions.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: tiertemplaterevisions.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -25,14 +25,19 @@ spec: API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -44,16 +49,19 @@ spec: be used to replace the variables present in the TemplateObjects list when provisioning a Space. items: - description: Parameter defines a name/value variable that is to - be processed during TierTemplate creation. + description: |- + Parameter defines a name/value variable that is to be processed during + TierTemplate creation. properties: name: - description: Name must be set and it can be referenced in the - TierTemplate content using {{.NAME}} + description: |- + Name must be set and it can be referenced in the TierTemplate + content using {{.NAME}} type: string value: - description: Value holds the Parameter data. The value replaces - all occurrences of the Parameter {{.NAME}}. + description: |- + Value holds the Parameter data. + The value replaces all occurrences of the Parameter {{.NAME}}. type: string required: - name @@ -64,10 +72,9 @@ spec: - name x-kubernetes-list-type: map templateObjects: - description: TemplateObjects contains list of Unstructured Objects - that can be parsed at runtime and will be applied as part of the - tier provisioning. The template parameters values will be defined - in the NSTemplateTier CRD. + description: |- + TemplateObjects contains list of Unstructured Objects that can be parsed at runtime and will be applied as part of the tier provisioning. + The template parameters values will be defined in the NSTemplateTier CRD. items: type: object x-kubernetes-preserve-unknown-fields: true diff --git a/config/crd/bases/toolchain.dev.openshift.com_tiertemplates.yaml b/config/crd/bases/toolchain.dev.openshift.com_tiertemplates.yaml index cdc064de2..55d28dfe0 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_tiertemplates.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_tiertemplates.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: tiertemplates.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -27,14 +27,19 @@ spec: description: TierTemplate is the Schema for the tiertemplates API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -45,58 +50,67 @@ spec: description: The revision of the corresponding template type: string template: - description: 'Template contains an OpenShift Template to be used to - provision either a user''s namespace or cluster-wide resources Note: - this field will be removed in favor of the new TemplateObjects below.' + description: |- + Template contains an OpenShift Template to be used to provision either a user's namespace or cluster-wide resources + Note: this field will be removed in favor of the new TemplateObjects below. properties: apiVersion: - description: 'APIVersion defines the versioned schema of this - representation of an object. Servers should convert recognized - schemas to the latest internal value, and may reject unrecognized - values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource - this object represents. Servers may infer this from the endpoint - the client submits requests to. Cannot be updated. In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string labels: additionalProperties: type: string - description: labels is a optional set of labels that are applied - to every object during the Template to Config transformation. + description: |- + labels is a optional set of labels that are applied to every + object during the Template to Config transformation. type: object message: - description: message is an optional instructional message that - will be displayed when this template is instantiated. This field - should inform the user how to utilize the newly created resources. - Parameter substitution will be performed on the message before - being displayed so that generated credentials and other parameters - can be included in the output. + description: |- + message is an optional instructional message that will + be displayed when this template is instantiated. + This field should inform the user how to utilize the newly created resources. + Parameter substitution will be performed on the message before being + displayed so that generated credentials and other parameters can be + included in the output. type: string metadata: - description: 'metadata is the standard object''s metadata. More - info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' + description: |- + metadata is the standard object's metadata. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata type: object objects: - description: objects is an array of resources to include in this - template. If a namespace value is hardcoded in the object, it - will be removed during template instantiation, however if the - namespace value is, or contains, a ${PARAMETER_REFERENCE}, the - resolved value after parameter substitution will be respected - and the object will be created in that namespace. + description: |- + objects is an array of resources to include in this template. + If a namespace value is hardcoded in the object, it will be removed + during template instantiation, however if the namespace value + is, or contains, a ${PARAMETER_REFERENCE}, the resolved + value after parameter substitution will be respected and the object + will be created in that namespace. items: type: object x-kubernetes-preserve-unknown-fields: true type: array x-kubernetes-preserve-unknown-fields: true parameters: - description: parameters is an optional array of Parameters used - during the Template to Config transformation. + description: |- + parameters is an optional array of Parameters used during the + Template to Config transformation. items: - description: Parameter defines a name/value variable that is - to be processed during the Template to Config transformation. + description: |- + Parameter defines a name/value variable that is to be processed during + the Template to Config transformation. properties: description: description: Description of a parameter. Optional. @@ -109,32 +123,42 @@ spec: description: From is an input value for the generator. Optional. type: string generate: - description: "generate specifies the generator to be used - to generate random string from an input value specified - by From field. The result string is stored into Value - field. If empty, no generator is being used, leaving the - result Value untouched. Optional. \n The only supported - generator is \"expression\", which accepts a \"from\" - value in the form of a simple regular expression containing - the range expression \"[a-zA-Z0-9]\", and the length expression - \"a{length}\". \n Examples: \n from | value - ----------------------------- \"test[0-9]{1}x\" | \"test7x\" - \"[0-1]{8}\" | \"01001100\" \"0x[A-F0-9]{4}\" | - \"0xB3AF\" \"[a-zA-Z0-9]{8}\" | \"hW4yQU5i\"" + description: |- + generate specifies the generator to be used to generate random string + from an input value specified by From field. The result string is + stored into Value field. If empty, no generator is being used, leaving + the result Value untouched. Optional. + + + The only supported generator is "expression", which accepts a "from" + value in the form of a simple regular expression containing the + range expression "[a-zA-Z0-9]", and the length expression "a{length}". + + + Examples: + + + from | value + ----------------------------- + "test[0-9]{1}x" | "test7x" + "[0-1]{8}" | "01001100" + "0x[A-F0-9]{4}" | "0xB3AF" + "[a-zA-Z0-9]{8}" | "hW4yQU5i" type: string name: - description: Name must be set and it can be referenced in - Template Items using ${PARAMETER_NAME}. Required. + description: |- + Name must be set and it can be referenced in Template + Items using ${PARAMETER_NAME}. Required. type: string required: description: 'Optional: Indicates the parameter must have a value. Defaults to false.' type: boolean value: - description: Value holds the Parameter data. If specified, - the generator will be ignored. The value replaces all - occurrences of the Parameter ${Name} expression during - the Template to Config transformation. Optional. + description: |- + Value holds the Parameter data. If specified, the generator will be + ignored. The value replaces all occurrences of the Parameter ${Name} + expression during the Template to Config transformation. Optional. type: string required: - name @@ -144,16 +168,16 @@ spec: - objects type: object templateObjects: - description: "TemplateObjects contains list of Unstructured Objects - that can be parsed at runtime and will be applied as part of the - tier provisioning. \n NOTE: when specifying variables as part of - the objects list , those concatenated as part of other strings do - not need to be wrapped inside quotes, while those that are not part - of other strings do need to be wrapped in single quotes. This is - required otherwise the yaml parser will error while trying to parse - those resources containing variables. eg: https://docs.google.com/document/d/1x5SoBT80df9fmVsaDgAE6DE7hE6lzmNIK087JUmgaJs/edit#heading=h.2iuytpfnmul5 - \n The template parameters values will be defined in the NSTemplateTier - CRD." + description: |- + TemplateObjects contains list of Unstructured Objects that can be parsed at runtime and will be applied as part of the tier provisioning. + + + NOTE: when specifying variables as part of the objects list , those concatenated as part of other strings do not need to be wrapped inside quotes, + while those that are not part of other strings do need to be wrapped in single quotes. This is required otherwise the yaml parser will error while trying to parse those resources containing variables. + eg: https://docs.google.com/document/d/1x5SoBT80df9fmVsaDgAE6DE7hE6lzmNIK087JUmgaJs/edit#heading=h.2iuytpfnmul5 + + + The template parameters values will be defined in the NSTemplateTier CRD. items: type: object x-kubernetes-preserve-unknown-fields: true diff --git a/config/crd/bases/toolchain.dev.openshift.com_toolchainclusters.yaml b/config/crd/bases/toolchain.dev.openshift.com_toolchainclusters.yaml index f62c1b7a3..005463450 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_toolchainclusters.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_toolchainclusters.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: toolchainclusters.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -24,18 +24,25 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: ToolchainCluster configures Toolchain to be aware of a Kubernetes - cluster and encapsulates the details necessary to communicate with the cluster. + description: |- + ToolchainCluster configures Toolchain to be aware of a Kubernetes + cluster and encapsulates the details necessary to communicate with + the cluster. properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -43,11 +50,14 @@ spec: description: ToolchainClusterSpec defines the desired state of ToolchainCluster properties: secretRef: - description: Name of the secret containing the kubeconfig required - to connect to the cluster. + description: |- + Name of the secret containing the kubeconfig required to connect + to the cluster. properties: name: - description: Name of a secret within the enclosing namespace + description: |- + Name of a secret within the enclosing + namespace type: string required: - name @@ -56,12 +66,14 @@ spec: - secretRef type: object status: - description: ToolchainClusterStatus contains information about the current - status of a cluster updated periodically by cluster controller. + description: |- + ToolchainClusterStatus contains information about the current status of a + cluster updated periodically by cluster controller. properties: apiEndpoint: - description: APIEndpoint is the API endpoint of the remote cluster. - This can be a hostname, hostname:port, IP or IP:port. + description: |- + APIEndpoint is the API endpoint of the remote cluster. This can be a hostname, + hostname:port, IP or IP:port. type: string conditions: description: Conditions is an array of current cluster conditions. diff --git a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml index 3db312683..fd2f3a69f 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: toolchainconfigs.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -25,14 +25,19 @@ spec: host and member operators properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -47,13 +52,12 @@ spec: description: Keeps parameters necessary for automatic approval properties: domains: - description: 'Comma-separated email domains to consider for - auto-approval. For example: "domain.com,anotherdomain.org" - If domains is not set and enabled is true, it will default - to auto approving all authenticated emails. If domains is - set and enabled is true, it will allow auto approving only - for authenticated emails under the domains entered. If enabled - is false domains will be ignored.' + description: |- + Comma-separated email domains to consider for auto-approval. + For example: "domain.com,anotherdomain.org" + If domains is not set and enabled is true, it will default to auto approving all authenticated emails. + If domains is set and enabled is true, it will allow auto approving only for authenticated emails under + the domains entered. If enabled is false domains will be ignored. type: string enabled: description: Defines if the automatic approval is enabled @@ -64,32 +68,27 @@ spec: description: Keeps parameters concerned with user deactivation properties: deactivatingNotificationDays: - description: DeactivatingNotificationDays is the number of - days after a pre-deactivating notification is sent that - actual deactivation occurs. If this parameter is set to - zero, then there will be no delay + description: |- + DeactivatingNotificationDays is the number of days after a pre-deactivating notification is sent that actual + deactivation occurs. If this parameter is set to zero, then there will be no delay type: integer deactivationDomainsExcluded: - description: 'DeactivationDomainsExcluded is a string of comma-separated - domains that should be excluded from automatic user deactivation - For example: "@redhat.com,@ibm.com"' + description: |- + DeactivationDomainsExcluded is a string of comma-separated domains that should be excluded from automatic user deactivation + For example: "@redhat.com,@ibm.com" type: string userSignupDeactivatedRetentionDays: - description: UserSignupDeactivatedRetentionDays is used to - configure how many days we should keep deactivated UserSignup - resources before deleting them. This parameter value should - reflect an extended period of time sufficient for gathering - user metrics before removing the resources from the cluster. + description: |- + UserSignupDeactivatedRetentionDays is used to configure how many days we should keep deactivated UserSignup + resources before deleting them. This parameter value should reflect an extended period of time sufficient for + gathering user metrics before removing the resources from the cluster. type: integer userSignupUnverifiedRetentionDays: - description: UserSignupUnverifiedRetentionDays is used to - configure how many days we should keep unverified (i.e. - the user hasn't completed the user verification process - via the registration service) UserSignup resources before - deleting them. It is intended for this parameter to define - an aggressive cleanup schedule for unverified user signups, - and the default configuration value for this parameter reflects - this. + description: |- + UserSignupUnverifiedRetentionDays is used to configure how many days we should keep unverified (i.e. the user + hasn't completed the user verification process via the registration service) UserSignup resources before deleting + them. It is intended for this parameter to define an aggressive cleanup schedule for unverified user signups, + and the default configuration value for this parameter reflects this. type: integer type: object environment: @@ -100,9 +99,9 @@ spec: description: Keeps parameters concerned with metrics properties: forceSynchronization: - description: ForceSynchronization is a flag used to trigger - synchronization of the metrics based on the resources rather - than on the content of `ToolchainStatus.status.metrics` + description: |- + ForceSynchronization is a flag used to trigger synchronization of the metrics + based on the resources rather than on the content of `ToolchainStatus.status.metrics` type: boolean type: object notifications: @@ -152,10 +151,11 @@ spec: type: string type: object publicViewerConfig: - description: 'Contains the PublicViewer configuration. IMPORTANT: - To provide a consistent User-Experience, each user the space - has been directly shared with should have at least the same - permissions the kubesaw-authenticated user has.' + description: |- + Contains the PublicViewer configuration. + IMPORTANT: To provide a consistent User-Experience, each user + the space has been directly shared with should have at least + the same permissions the kubesaw-authenticated user has. properties: enabled: default: false @@ -222,10 +222,9 @@ spec: description: LogLevel specifies the logging level type: string namespace: - description: Namespace specifies the namespace in which the - registration service and host operator is running Consumed - by host operator and set as env var on registration-service - deployment + description: |- + Namespace specifies the namespace in which the registration service and host operator is running + Consumed by host operator and set as env var on registration-service deployment type: string registrationServiceURL: description: RegistrationServiceURL is the URL used to a ccess @@ -236,24 +235,35 @@ spec: use for the registration service deployment format: int32 type: integer + uiCanaryDeploymentWeight: + description: |- + UICanaryDeploymentWeight specifies the threshold of users that will be using the new UI. + This configuration option is just a temporary solution for rolling out our new RHDH based UI using canary deployment strategy. + Once we switch all our users to the new UI this will be removed. + How this works: + - backend returns a weight + - old UI assigns a sticky random number for each user + - if the user has a number within the weight returned from the backend than user get's redirect to to new UI + - if the user has a number above the weight they keep using the current UI + format: int32 + type: integer verification: description: Keeps parameters necessary for the registration service verification config properties: attemptsAllowed: - description: VerificationAttemptsAllowed specifies the - number of times a user may attempt to correctly enter - a verification code, if they fail then they must request - another code + description: |- + VerificationAttemptsAllowed specifies the number of times a user may attempt to correctly enter a verification code, + if they fail then they must request another code type: integer awsRegion: description: AWSRegion to use when sending notification SMS type: string awsSMSType: - description: AWSSMSType is the type of SMS message to - send, either `Promotional` or `Transactional` See https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html - for details + description: |- + AWSSMSType is the type of SMS message to send, either `Promotional` or `Transactional` + See https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html for details type: string awsSenderID: description: AWSSenderID the Alphanumeric Sender ID to @@ -278,19 +288,14 @@ spec: that has the recaptcha service enabled. type: string requiredScore: - description: RequiredScore defines the lowest captcha - score, below this score the user cannot proceed - with the signup process at all. Users with captcha - score lower than the required one can still be approved - manually. + description: |- + RequiredScore defines the lowest captcha score, below this score the user cannot proceed with the signup process at all. + Users with captcha score lower than the required one can still be approved manually. type: string scoreThreshold: - description: ScoreThreshold defines the captcha assessment - score threshold. A score equal to or above the threshold - means the user is most likely human and can proceed - signing up but a score below the threshold means - the score is suspicious and further verification - may be required. + description: |- + ScoreThreshold defines the captcha assessment score threshold. A score equal to or above the threshold means the user is most likely human and + can proceed signing up but a score below the threshold means the score is suspicious and further verification may be required. type: string siteKey: description: SiteKey defines the recaptcha site key @@ -300,42 +305,41 @@ spec: type: string type: object codeExpiresInMin: - description: VerificationCodeExpiresInMin specifies an - int representing the number of minutes before a verification - code should be expired + description: |- + VerificationCodeExpiresInMin specifies an int representing the number of minutes before a verification code should + be expired type: integer dailyLimit: - description: VerificationDailyLimit specifies the number - of times a user may initiate a phone verification request - within a 24 hour period + description: |- + VerificationDailyLimit specifies the number of times a user may initiate a phone verification request within a + 24 hour period type: integer enabled: - description: 'VerificationEnabled specifies whether verification - is enabled or not Verification enablement works in the - following way: 1. verification.enabled == false No verification - during the signup process at all. (no phone, no captcha) - 2. verification.enabled == true && verification.captcha.enabled - == true Captcha is enabled and will bypass phone verification - if the score is above the threshold but if the score - is below the threshold then phone verification kicks - in. 3. verification.enabled == true && verification.captcha.enabled - == false Only phone verification is effect.' + description: |- + VerificationEnabled specifies whether verification is enabled or not + Verification enablement works in the following way: + 1. verification.enabled == false + No verification during the signup process at all. (no phone, no captcha) + 2. verification.enabled == true && verification.captcha.enabled == true + Captcha is enabled and will bypass phone verification if the score is above the threshold but if the score is + below the threshold then phone verification kicks in. + 3. verification.enabled == true && verification.captcha.enabled == false + Only phone verification is effect. type: boolean excludedEmailDomains: - description: VerificationExcludedEmailDomains specifies - the list of email address domains for which phone verification + description: |- + VerificationExcludedEmailDomains specifies the list of email address domains for which phone verification is not required type: string messageTemplate: - description: VerificationMessageTemplate specifies the - message template used to generate the content sent to - users via SMS for phone verification + description: |- + VerificationMessageTemplate specifies the message template used to generate the content sent to users via SMS for + phone verification type: string notificationSender: - description: NotificationSender is used to specify which - service should be used to send verification notifications. - Allowed values are "twilio", "aws". If not specified, - the Twilio sender will be used. + description: |- + NotificationSender is used to specify which service should be used to send verification notifications. Allowed + values are "twilio", "aws". If not specified, the Twilio sender will be used. type: string secret: description: Defines all secrets related to the registration @@ -350,9 +354,9 @@ spec: used to authenticate in order to access AWS services type: string recaptchaServiceAccountFile: - description: RecaptchaServiceAccountFile is the GCP - service account file contents encoded in base64, - it is to be used with the recaptcha client for authentication + description: |- + RecaptchaServiceAccountFile is the GCP service account file contents encoded in base64, it is + to be used with the recaptcha client for authentication type: string ref: description: Reference is the name of the secret resource @@ -378,18 +382,15 @@ spec: description: TwilioSenderConfigs is an array of TwilioSenderConfig objects items: - description: "TwilioSenderConfig is used to associate - a particular sender ID (a sender ID is a text value - that appears instead of a phone number when receiving - an SMS message), for example \"RED HAT\", with an - array of country code values for which the Sender - ID value will be set via the Twilio API when sending - a verification code to a user in any of the country - codes specified. \n Since some countries are starting - to block long form phone numbers (i.e. SMS messages - from international phone numbers) the Sender ID may - be an acceptable alternative to requiring the verification - message to be sent from a local phone number." + description: |- + TwilioSenderConfig is used to associate a particular sender ID (a sender ID is a text value that appears instead of + a phone number when receiving an SMS message), for example "RED HAT", with an array of country + code values for which the Sender ID value will be set via the Twilio API when sending a verification code to a user in + any of the country codes specified. + + + Since some countries are starting to block long form phone numbers (i.e. SMS messages from international phone numbers) + the Sender ID may be an acceptable alternative to requiring the verification message to be sent from a local phone number. properties: countryCodes: description: CountryCodes @@ -412,18 +413,14 @@ spec: provisioning functionality properties: spaceBindingRequestEnabled: - description: SpaceBindingRequestEnabled specifies whether - the SpaceBindingRequest controller should start or not. - This is specifically useful in order to enable/disable this - functionality from configuration (e.g. disabled by default - in Sandbox and enabled only for AppStudio stage/prod ...). + description: |- + SpaceBindingRequestEnabled specifies whether the SpaceBindingRequest controller should start or not. + This is specifically useful in order to enable/disable this functionality from configuration (e.g. disabled by default in Sandbox and enabled only for AppStudio stage/prod ...). type: boolean spaceRequestEnabled: - description: SpaceRequestEnabled specifies whether the SpaceRequest - controller should start or not. This is specifically useful - in order to enable/disable this functionality from configuration - (e.g. disabled by default in Sandbox and enabled only for - AppStudio stage/prod ...). + description: |- + SpaceRequestEnabled specifies whether the SpaceRequest controller should start or not. + This is specifically useful in order to enable/disable this functionality from configuration (e.g. disabled by default in Sandbox and enabled only for AppStudio stage/prod ...). type: boolean type: object tiers: @@ -445,41 +442,35 @@ spec: description: FeatureToggles specifies the list of feature toggles/flags items: - description: 'FeatureToggle defines a feature toggle/flag. - Each feature is supposed to have a unique name. Features - are represented by kube object manifests in space and - user templates. Such manifests must have an annotation - which refers to the corresponding feature name. For example - a manifest for a RoleBinding object in a space tier template - with the following annotation: "toolchain.dev.openshift.com/feature: - os-lightspeed" would refer to a feature with "os-lightspeed" - name. When that template is applied for a new space then - that RoleBinding object would be applied conditionally, - according to its weight.' + description: |- + FeatureToggle defines a feature toggle/flag. Each feature is supposed to have a unique name. + Features are represented by kube object manifests in space and user templates. + Such manifests must have an annotation which refers to the corresponding feature name. + For example a manifest for a RoleBinding object in a space tier template with the following annotation: + "toolchain.dev.openshift.com/feature: os-lightspeed" would refer to a feature with "os-lightspeed" name. + When that template is applied for a new space then that RoleBinding object would be applied conditionally, + according to its weight. properties: name: description: A unique name of the feature type: string weight: default: 100 - description: 'Rollout weight of the feature. An integer - between 0-100. If not set then 100 is used by default. - 0 means the corresponding feature should not be enabled - at all, which means that corresponding template objects - should not be applied at all. 100 means the feature - should be always enabled (the template is always applied). + description: |- + Rollout weight of the feature. An integer between 0-100. + If not set then 100 is used by default. + 0 means the corresponding feature should not be enabled at all, which means + that corresponding template objects should not be applied at all. + 100 means the feature should be always enabled (the template is always applied). The features are weighted independently of each other. - For example if there are two features: - feature1, - weight=5 - feature2, weight=90 And tiers (one or many) - contain the following object manifests: - RoleBinding - with "toolchain.dev.openshift.com/feature: feature1" - annotation - ConfigMap with "toolchain.dev.openshift.com/feature: - feature2" annotation Then the RoleBinding will be - created for the corresponding tiers with probability - of 0.05 (around 5 out of every 100 spaces would have - it) And the ConfigMap will be created with probability - of 0.9 (around 90 out of every 100 spaces would have - it)' + For example if there are two features: + - feature1, weight=5 + - feature2, weight=90 + And tiers (one or many) contain the following object manifests: + - RoleBinding with "toolchain.dev.openshift.com/feature: feature1" annotation + - ConfigMap with "toolchain.dev.openshift.com/feature: feature2" annotation + Then the RoleBinding will be created for the corresponding tiers with probability of 0.05 (around 5 out of every 100 spaces would have it) + And the ConfigMap will be created with probability of 0.9 (around 90 out of every 100 spaces would have it) maximum: 100 minimum: 0 type: integer @@ -491,9 +482,9 @@ spec: - name x-kubernetes-list-type: map templateUpdateRequestMaxPoolSize: - description: TemplateUpdateRequestMaxPoolSize specifies the - maximum number of concurrent TemplateUpdateRequests when - updating MasterUserRecords + description: |- + TemplateUpdateRequestMaxPoolSize specifies the maximum number of concurrent TemplateUpdateRequests + when updating MasterUserRecords type: integer type: object toolchainStatus: @@ -521,16 +512,14 @@ spec: description: Keeps parameters concerned with user management properties: forbiddenUsernamePrefixes: - description: ForbiddenUsernamePrefixes is a comma-separated - string that defines the prefixes that a username may not - have when signing up. If a username has a forbidden prefix, - then the username compliance prefix is added to the username + description: |- + ForbiddenUsernamePrefixes is a comma-separated string that defines the prefixes that a username may not have when signing up. + If a username has a forbidden prefix, then the username compliance prefix is added to the username type: string forbiddenUsernameSuffixes: - description: ForbiddenUsernameSuffixes is a comma-separated - string that defines the suffixes that a username may not - have when signing up. If a username has a forbidden suffix, - then the username compliance suffix is added to the username + description: |- + ForbiddenUsernameSuffixes is a comma-separated string that defines the suffixes that a username may not have when signing up. If a + username has a forbidden suffix, then the username compliance suffix is added to the username type: string masterUserRecordUpdateFailureThreshold: description: MasterUserRecordUpdateFailureThreshold specifies @@ -664,10 +653,9 @@ spec: description: Keeps parameters concerned with the webhook properties: deploy: - description: Defines the flag that determines whether - to deploy the Webhook. If the deploy flag is set to - False and the Webhook was deployed previously it will - be deleted by the memberoperatorconfig controller. + description: |- + Defines the flag that determines whether to deploy the Webhook. + If the deploy flag is set to False and the Webhook was deployed previously it will be deleted by the memberoperatorconfig controller. type: boolean secret: description: Defines all secrets related to webhook configuration @@ -805,10 +793,9 @@ spec: description: Keeps parameters concerned with the webhook properties: deploy: - description: Defines the flag that determines whether - to deploy the Webhook. If the deploy flag is set to - False and the Webhook was deployed previously it will - be deleted by the memberoperatorconfig controller. + description: |- + Defines the flag that determines whether to deploy the Webhook. + If the deploy flag is set to False and the Webhook was deployed previously it will be deleted by the memberoperatorconfig controller. type: boolean secret: description: Defines all secrets related to webhook @@ -835,8 +822,9 @@ spec: description: ToolchainConfigStatus defines the observed state of ToolchainConfig properties: conditions: - description: 'Conditions is an array of the current ToolchainConfig - conditions Supported condition types: ConditionReady' + description: |- + Conditions is an array of the current ToolchainConfig conditions + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -872,9 +860,9 @@ spec: syncErrors: additionalProperties: type: string - description: SyncErrors is a map of sync errors indexed by toolchaincluster - name that indicates whether an attempt to sync configuration to - a member cluster failed + description: |- + SyncErrors is a map of sync errors indexed by toolchaincluster name that indicates whether + an attempt to sync configuration to a member cluster failed type: object x-kubernetes-map-type: atomic type: object diff --git a/config/crd/bases/toolchain.dev.openshift.com_toolchainstatuses.yaml b/config/crd/bases/toolchain.dev.openshift.com_toolchainstatuses.yaml index c8260bac1..3364a77bf 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_toolchainstatuses.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_toolchainstatuses.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: toolchainstatuses.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -30,14 +30,19 @@ spec: description: ToolchainStatus is used to track overall toolchain status properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -49,8 +54,9 @@ spec: including host cluster and member cluster components properties: conditions: - description: 'Conditions is an array of the current overall toolchain - status conditions Supported condition types: ConditionReady' + description: |- + Conditions is an array of the current overall toolchain status conditions + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -90,8 +96,9 @@ spec: description: The timestamp of the host operator build type: string conditions: - description: 'Conditions is an array of current host operator - status conditions Supported condition types: ConditionReady' + description: |- + Conditions is an array of current host operator status conditions + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -137,9 +144,9 @@ spec: deployment properties: conditions: - description: 'Conditions is an array of status conditions - for the health of the registration service Supported condition - types: ConditionReady' + description: |- + Conditions is an array of status conditions for the health of the registration service + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -188,8 +195,9 @@ spec: description: HostRoutes/URLs of the host cluster, such as Proxy URL properties: conditions: - description: 'Conditions is an array of current member operator - status conditions Supported condition types: ConditionReady' + description: |- + Conditions is an array of current member operator status conditions + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -246,8 +254,9 @@ spec: and whether the member configuration is correct properties: conditions: - description: 'Conditions is an array of current Che - status conditions Supported condition types: ConditionReady' + description: |- + Conditions is an array of current Che status conditions + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -284,8 +293,9 @@ spec: x-kubernetes-list-type: map type: object conditions: - description: 'Conditions is an array of current toolchain - status conditions Supported condition types: ConditionReady' + description: |- + Conditions is an array of current toolchain status conditions + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -325,9 +335,9 @@ spec: host cluster properties: conditions: - description: 'Conditions is an array of current member - operator status conditions Supported condition types: - ConditionReady' + description: |- + Conditions is an array of current member operator status conditions + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -368,9 +378,9 @@ spec: with the host cluster properties: apiEndpoint: - description: APIEndpoint is the API endpoint of the - remote cluster. This can be a hostname, hostname:port, - IP or IP:port. + description: |- + APIEndpoint is the API endpoint of the remote cluster. This can be a hostname, + hostname:port, IP or IP:port. type: string conditions: description: Conditions is an array of current cluster @@ -422,9 +432,9 @@ spec: description: The timestamp of the member operator build type: string conditions: - description: 'Conditions is an array of current member - operator status conditions Supported condition types: - ConditionReady' + description: |- + Conditions is an array of current member operator status conditions + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -471,9 +481,9 @@ spec: operator's deployment properties: conditions: - description: 'Conditions is an array of status conditions - for the health of the registration service Supported - condition types: ConditionReady' + description: |- + Conditions is an array of status conditions for the health of the registration service + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -537,9 +547,9 @@ spec: of the cluster if Che is installed type: string conditions: - description: 'Conditions is an array of current member - operator status conditions Supported condition types: - ConditionReady' + description: |- + Conditions is an array of current member operator status conditions + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -609,9 +619,9 @@ spec: deployment properties: conditions: - description: 'Conditions is an array of current deployment - status conditions for a host operator Supported condition - types: Available, Progressing' + description: |- + Conditions is an array of current deployment status conditions for a host operator + Supported condition types: Available, Progressing items: properties: lastTransitionTime: @@ -661,9 +671,9 @@ spec: buildTime: type: string conditions: - description: 'Conditions is an array of status conditions - for the health of the registration service Supported condition - types: ConditionReady' + description: |- + Conditions is an array of status conditions for the health of the registration service + Supported condition types: ConditionReady items: properties: lastTransitionTime: @@ -716,9 +726,9 @@ spec: created for the registration service properties: conditions: - description: 'Conditions is an array of current registration - service resource status conditions Supported condition types: - Deployed, Deploying, DeployingFailed' + description: |- + Conditions is an array of current registration service resource status conditions + Supported condition types: Deployed, Deploying, DeployingFailed items: properties: lastTransitionTime: @@ -759,9 +769,9 @@ spec: service properties: conditions: - description: 'Conditions is an array of status conditions - for the health of the registration service Supported condition - types: ConditionReady' + description: |- + Conditions is an array of status conditions for the health of the registration service + Supported condition types: ConditionReady items: properties: lastTransitionTime: diff --git a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml index dd52e2346..c7bec4b60 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_usersignups.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: usersignups.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -64,14 +64,19 @@ spec: description: UserSignup registers a user in the CodeReady Toolchain properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -101,9 +106,9 @@ spec: claim type: string originalSub: - description: OriginalSub is an optional property temporarily introduced - for the purpose of migrating the users to a new IdP provider - client, and contains the user's "original-sub" claim + description: |- + OriginalSub is an optional property temporarily introduced for the purpose of migrating the users to + a new IdP provider client, and contains the user's "original-sub" claim type: string preferredUsername: description: PreferredUsername contains the user's username @@ -127,8 +132,9 @@ spec: type: array x-kubernetes-list-type: atomic targetCluster: - description: The cluster in which the user is provisioned in If not - set then the target cluster will be picked automatically + description: |- + The cluster in which the user is provisioned in + If not set then the target cluster will be picked automatically type: string required: - identityClaims @@ -141,8 +147,10 @@ spec: compliant username type: string conditions: - description: 'Conditions is an array of current UserSignup conditions - Supported condition types: PendingApproval, Provisioning, Complete' + description: |- + Conditions is an array of current UserSignup conditions + Supported condition types: + PendingApproval, Provisioning, Complete items: properties: lastTransitionTime: @@ -176,18 +184,17 @@ spec: - type x-kubernetes-list-type: map homeSpace: - description: HomeSpace is the name of the Space that is created for - the user immediately after their account is approved. This is used - by the proxy when no workspace context is provided. + description: |- + HomeSpace is the name of the Space that is created for the user + immediately after their account is approved. + This is used by the proxy when no workspace context is provided. type: string scheduledDeactivationTimestamp: - description: ScheduledDeactivationTimestamp is the calculated timestamp - after which the user's account will be deactivated, typically after - the expiry of their trial and based on the term specific by their - UserTier. This property may be used as a convenience to determine - the amount of time an account has left before deactivation, without - requiring a separate lookup for the UserTier and subsequent calculation. It - is managed by the Deactivation controller in the host operator. + description: |- + ScheduledDeactivationTimestamp is the calculated timestamp after which the user's account will be deactivated, typically + after the expiry of their trial and based on the term specific by their UserTier. This property may be used as + a convenience to determine the amount of time an account has left before deactivation, without requiring a separate + lookup for the UserTier and subsequent calculation. It is managed by the Deactivation controller in the host operator. format: date-time type: string type: object diff --git a/config/crd/bases/toolchain.dev.openshift.com_usertiers.yaml b/config/crd/bases/toolchain.dev.openshift.com_usertiers.yaml index f1c8fafc7..3ffe63638 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_usertiers.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_usertiers.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.0 + controller-gen.kubebuilder.io/version: v0.15.0 name: usertiers.toolchain.dev.openshift.com spec: group: toolchain.dev.openshift.com @@ -20,14 +20,19 @@ spec: description: UserTier contains user-specific configuration properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object From c7df7046ada5f87527c5efc4fb8bea0b1f4d5da1 Mon Sep 17 00:00:00 2001 From: Devtools Date: Mon, 5 May 2025 14:53:32 +0200 Subject: [PATCH 3/5] switch to in --- .../crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml index fd2f3a69f..a50dd1fed 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml @@ -245,7 +245,6 @@ spec: - old UI assigns a sticky random number for each user - if the user has a number within the weight returned from the backend than user get's redirect to to new UI - if the user has a number above the weight they keep using the current UI - format: int32 type: integer verification: description: Keeps parameters necessary for the registration From a2fe2d489af15f4d1606f88383a59d5ab33de19b Mon Sep 17 00:00:00 2001 From: Devtools Date: Tue, 6 May 2025 12:36:38 +0200 Subject: [PATCH 4/5] update --- .../bases/toolchain.dev.openshift.com_toolchainconfigs.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml index 9a0e0fe9e..f3a98d577 100644 --- a/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml +++ b/config/crd/bases/toolchain.dev.openshift.com_toolchainconfigs.yaml @@ -243,8 +243,10 @@ spec: How this works: - backend returns a weight - old UI assigns a sticky random number for each user - - if the user has a number within the weight returned from the backend than user get's redirect to to new UI + - if the user has a number within the weight returned from the backend than user get's redirect to new UI - if the user has a number above the weight they keep using the current UI + maximum: 100 + minimum: 0 type: integer verification: description: Keeps parameters necessary for the registration From 02824c1063ce30c7813c226ce3563e054c55d4f1 Mon Sep 17 00:00:00 2001 From: Devtools Date: Tue, 6 May 2025 14:47:19 +0200 Subject: [PATCH 5/5] Empty-Commit