2 ==================================================================================
4 Copyright (c) 2023 Samsung
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
18 This source code is part of the near-RT RIC (RAN Intelligent Controller)
19 platform project (RICP).
21 ==================================================================================
28 "k8s.io/apimachinery/pkg/runtime"
29 ctrl "sigs.k8s.io/controller-runtime"
30 "sigs.k8s.io/controller-runtime/pkg/client"
32 ricdeployv1 "ricdeploy/api/v1"
35 // RicPlatformReconciler reconciles a RicPlatform object
36 type RicPlatformReconciler struct {
38 Scheme *runtime.Scheme
41 //+kubebuilder:rbac:groups=ricdeploy.ricplt.com,resources=ricplatforms,verbs=get;list;watch;create;update;patch;delete
42 //+kubebuilder:rbac:groups=ricdeploy.ricplt.com,resources=ricplatforms/status,verbs=get;update;patch
43 //+kubebuilder:rbac:groups=ricdeploy.ricplt.com,resources=ricplatforms/finalizers,verbs=update
45 // Reconcile is part of the main kubernetes reconciliation loop which aims to
46 // move the current state of the cluster closer to the desired state.
47 // TODO(user): Modify the Reconcile function to compare the state specified by
48 // the RicPlatform object against the actual cluster state, and then
49 // perform operations to make the cluster state reflect the state specified by
52 // For more details, check Reconcile and its Result here:
53 // - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile
54 func (r *RicPlatformReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
56 // TODO(user): your logic here
57 return ctrl.Result{}, nil
60 // SetupWithManager sets up the controller with the Manager.
61 func (r *RicPlatformReconciler) SetupWithManager(mgr ctrl.Manager) error {
62 return ctrl.NewControllerManagedBy(mgr).
63 For(&ricdeployv1.RicPlatform{}).