From 7c7953d3c2f17ed5e442efd00546c9e26b94b10c Mon Sep 17 00:00:00 2001 From: Evan Baker Date: Tue, 12 Mar 2024 15:23:11 -0700 Subject: [PATCH] fix: retina.sh (#26) Signed-off-by: Evan Baker --- .golangci.yaml | 2 +- controller/main.go | 2 +- crd/api/v1alpha1/groupversion_info.go | 4 ++-- ....io_captures.yaml => retina.sh_captures.yaml} | 4 ++-- ...yaml => retina.sh_metricsconfigurations.yaml} | 4 ++-- ...oints.yaml => retina.sh_retinaendpoints.yaml} | 4 ++-- ....yaml => retina.sh_tracesconfigurations.yaml} | 4 ++-- .../helm/retina/templates/operator.yaml | 16 ++++++++-------- .../controller/helm/retina/templates/rbac.yaml | 10 +++++----- deploy/registercrd.go | 12 ++++++------ deploy/registercrd_test.go | 10 +++++----- docs/CRDs/Capture.md | 6 +++--- docs/CRDs/MetricsConfiguration.md | 6 +++--- docs/CRDs/RetinaEndpoint.md | 6 +++--- docs/captures/readme.md | 2 +- docs/installation/config.md | 2 +- operator/main.go | 2 +- .../metricsconfiguration_controller.go | 6 +++--- .../daemon/retinaendpoint/controller.go | 2 +- pkg/controllers/operator/capture/controller.go | 6 +++--- .../metricsconfiguration_controller.go | 6 +++--- pkg/controllers/operator/pod/pod_controller.go | 6 +++--- .../retinaendpoint_controller_test.go | 4 ++-- .../tracesconfiguration_controller.go | 6 +++--- pkg/label/k8s.go | 2 +- pkg/utils/flow_utils.go | 4 ++-- .../capture/capture-specific-pod-on-a-node.yaml | 2 +- samples/capture/nodeblobupload.yaml | 2 +- samples/capture/podblobupload.yaml | 2 +- samples/metricsconfiguration.yaml | 2 +- .../advanced/crd/metrics_config_crd.yaml | 2 +- test/testcrds/metrics-config-goldpinger.yaml | 2 +- 32 files changed, 75 insertions(+), 75 deletions(-) rename deploy/manifests/controller/helm/retina/crds/{retina.io_captures.yaml => retina.sh_captures.yaml} (99%) rename deploy/manifests/controller/helm/retina/crds/{retina.io_metricsconfigurations.yaml => retina.sh_metricsconfigurations.yaml} (99%) rename deploy/manifests/controller/helm/retina/crds/{retina.io_retinaendpoints.yaml => retina.sh_retinaendpoints.yaml} (98%) rename deploy/manifests/controller/helm/retina/crds/{retina.io_tracesconfigurations.yaml => retina.sh_tracesconfigurations.yaml} (99%) diff --git a/.golangci.yaml b/.golangci.yaml index b0d9e59c04..8457366f8d 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,7 +1,7 @@ issues: max-same-issues: 0 max-issues-per-linter: 0 - new-from-rev: origin/master + new-from-rev: origin/main linters: presets: - bugs diff --git a/controller/main.go b/controller/main.go index 1666fb6108..931000d3fc 100644 --- a/controller/main.go +++ b/controller/main.go @@ -138,7 +138,7 @@ func main() { // Port: 9443, // retina-agent is host-networked, we don't want to abuse the port for conflicts. HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, - LeaderElectionID: "ecaf1259.retina.io", + LeaderElectionID: "ecaf1259.retina.sh", } // Local context has its meaning only when pod level(advanced) metrics is enabled. diff --git a/crd/api/v1alpha1/groupversion_info.go b/crd/api/v1alpha1/groupversion_info.go index 5ddc970e67..c5c6f10eb8 100644 --- a/crd/api/v1alpha1/groupversion_info.go +++ b/crd/api/v1alpha1/groupversion_info.go @@ -3,7 +3,7 @@ // Package v1alpha1 contains API Schema definitions for the retina v1alpha1 API group // +kubebuilder:object:generate=true -// +groupName=retina.io +// +groupName=retina.sh package v1alpha1 import ( @@ -13,7 +13,7 @@ import ( var ( // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "retina.io", Version: "v1alpha1"} + GroupVersion = schema.GroupVersion{Group: "retina.sh", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} diff --git a/deploy/manifests/controller/helm/retina/crds/retina.io_captures.yaml b/deploy/manifests/controller/helm/retina/crds/retina.sh_captures.yaml similarity index 99% rename from deploy/manifests/controller/helm/retina/crds/retina.io_captures.yaml rename to deploy/manifests/controller/helm/retina/crds/retina.sh_captures.yaml index e92c6226b2..e5f3d31012 100644 --- a/deploy/manifests/controller/helm/retina/crds/retina.io_captures.yaml +++ b/deploy/manifests/controller/helm/retina/crds/retina.sh_captures.yaml @@ -4,9 +4,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 - name: captures.retina.io + name: captures.retina.sh spec: - group: retina.io + group: retina.sh names: categories: - retina diff --git a/deploy/manifests/controller/helm/retina/crds/retina.io_metricsconfigurations.yaml b/deploy/manifests/controller/helm/retina/crds/retina.sh_metricsconfigurations.yaml similarity index 99% rename from deploy/manifests/controller/helm/retina/crds/retina.io_metricsconfigurations.yaml rename to deploy/manifests/controller/helm/retina/crds/retina.sh_metricsconfigurations.yaml index a950a2a817..39d1f68586 100644 --- a/deploy/manifests/controller/helm/retina/crds/retina.io_metricsconfigurations.yaml +++ b/deploy/manifests/controller/helm/retina/crds/retina.sh_metricsconfigurations.yaml @@ -4,9 +4,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 - name: metricsconfigurations.retina.io + name: metricsconfigurations.retina.sh spec: - group: retina.io + group: retina.sh names: categories: - retina diff --git a/deploy/manifests/controller/helm/retina/crds/retina.io_retinaendpoints.yaml b/deploy/manifests/controller/helm/retina/crds/retina.sh_retinaendpoints.yaml similarity index 98% rename from deploy/manifests/controller/helm/retina/crds/retina.io_retinaendpoints.yaml rename to deploy/manifests/controller/helm/retina/crds/retina.sh_retinaendpoints.yaml index 89b89cde72..91ec0100e2 100644 --- a/deploy/manifests/controller/helm/retina/crds/retina.io_retinaendpoints.yaml +++ b/deploy/manifests/controller/helm/retina/crds/retina.sh_retinaendpoints.yaml @@ -4,9 +4,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 - name: retinaendpoints.retina.io + name: retinaendpoints.retina.sh spec: - group: retina.io + group: retina.sh names: kind: RetinaEndpoint listKind: RetinaEndpointList diff --git a/deploy/manifests/controller/helm/retina/crds/retina.io_tracesconfigurations.yaml b/deploy/manifests/controller/helm/retina/crds/retina.sh_tracesconfigurations.yaml similarity index 99% rename from deploy/manifests/controller/helm/retina/crds/retina.io_tracesconfigurations.yaml rename to deploy/manifests/controller/helm/retina/crds/retina.sh_tracesconfigurations.yaml index 755c6b697d..001717f8d7 100644 --- a/deploy/manifests/controller/helm/retina/crds/retina.io_tracesconfigurations.yaml +++ b/deploy/manifests/controller/helm/retina/crds/retina.sh_tracesconfigurations.yaml @@ -4,9 +4,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.14.0 - name: tracesconfigurations.retina.io + name: tracesconfigurations.retina.sh spec: - group: retina.io + group: retina.sh names: categories: - retina diff --git a/deploy/manifests/controller/helm/retina/templates/operator.yaml b/deploy/manifests/controller/helm/retina/templates/operator.yaml index 4cc9a5ba3f..8f37447cb2 100644 --- a/deploy/manifests/controller/helm/retina/templates/operator.yaml +++ b/deploy/manifests/controller/helm/retina/templates/operator.yaml @@ -135,7 +135,7 @@ rules: - list - watch - apiGroups: - - retina.io + - retina.sh resources: - retinaendpoints verbs: @@ -147,7 +147,7 @@ rules: - update - watch - apiGroups: - - retina.io + - retina.sh resources: - metricsconfigurations verbs: @@ -159,7 +159,7 @@ rules: - update - watch - apiGroups: - - retina.io + - retina.sh resources: - metricsconfigurations/status verbs: @@ -171,13 +171,13 @@ rules: - update - watch - apiGroups: - - retina.io + - retina.sh resources: - retinaendpoints/finalizers verbs: - update - apiGroups: - - retina.io + - retina.sh resources: - retinaendpoints/status verbs: @@ -214,7 +214,7 @@ rules: verbs: - get - apiGroups: - - retina.io + - retina.sh resources: - captures verbs: @@ -226,13 +226,13 @@ rules: - update - watch - apiGroups: - - retina.io + - retina.sh resources: - captures/finalizers verbs: - update - apiGroups: - - retina.io + - retina.sh resources: - captures/status verbs: diff --git a/deploy/manifests/controller/helm/retina/templates/rbac.yaml b/deploy/manifests/controller/helm/retina/templates/rbac.yaml index da0fab1aa9..edbbc4f519 100644 --- a/deploy/manifests/controller/helm/retina/templates/rbac.yaml +++ b/deploy/manifests/controller/helm/retina/templates/rbac.yaml @@ -14,7 +14,7 @@ rules: resources: ["clusterobservers"] verbs: ["get", "list", "watch"] - apiGroups: - - retina.io + - retina.sh resources: - retinaendpoints verbs: @@ -31,7 +31,7 @@ rules: - list - watch - apiGroups: - - retina.io + - retina.sh resources: - retinaendpoints verbs: @@ -43,7 +43,7 @@ rules: - update - watch - apiGroups: - - retina.io + - retina.sh resources: - metricsconfigurations verbs: @@ -55,13 +55,13 @@ rules: - update - watch - apiGroups: - - retina.io + - retina.sh resources: - retinaendpoints/finalizers verbs: - update - apiGroups: - - retina.io + - retina.sh resources: - retinaendpoints/status verbs: diff --git a/deploy/registercrd.go b/deploy/registercrd.go index 70f1244e39..c6beb18a49 100644 --- a/deploy/registercrd.go +++ b/deploy/registercrd.go @@ -15,18 +15,18 @@ import ( ) const ( - RetinaCapturesYAMLpath = "retina.io_captures.yaml" - RetinaEndpointsYAMLpath = "retina.io_retinaendpoints.yaml" - MetricsConfigurationYAMLpath = "retina.io_metricsconfigurations.yaml" + RetinaCapturesYAMLpath = "retina.sh_captures.yaml" + RetinaEndpointsYAMLpath = "retina.sh_retinaendpoints.yaml" + MetricsConfigurationYAMLpath = "retina.sh_metricsconfigurations.yaml" ) -//go:embed manifests/controller/helm/retina/crds/retina.io_captures.yaml +//go:embed manifests/controller/helm/retina/crds/retina.sh_captures.yaml var RetinaCapturesYAML []byte -//go:embed manifests/controller/helm/retina/crds/retina.io_retinaendpoints.yaml +//go:embed manifests/controller/helm/retina/crds/retina.sh_retinaendpoints.yaml var RetinaEndpointsYAML []byte -//go:embed manifests/controller/helm/retina/crds/retina.io_metricsconfigurations.yaml +//go:embed manifests/controller/helm/retina/crds/retina.sh_metricsconfigurations.yaml var MetricsConfgurationYAML []byte func GetRetinaCapturesCRD() (*apiextensionsv1.CustomResourceDefinition, error) { diff --git a/deploy/registercrd_test.go b/deploy/registercrd_test.go index a837b77ddb..247d4cc613 100644 --- a/deploy/registercrd_test.go +++ b/deploy/registercrd_test.go @@ -55,17 +55,17 @@ func TestInstallOrUpdateCRDs(t *testing.T) { name: "install all CRDs", enableRetinaEndpoint: true, want: map[string]*apiextensionsv1.CustomResourceDefinition{ - "captures.retina.io": capture, - "retinaendpoints.retina.io": endpoint, - "metricsconfigurations.retina.io": metrics, + "captures.retina.sh": capture, + "retinaendpoints.retina.sh": endpoint, + "metricsconfigurations.retina.sh": metrics, }, }, { name: "disable retina endpoint", enableRetinaEndpoint: false, want: map[string]*apiextensionsv1.CustomResourceDefinition{ - "captures.retina.io": capture, - "metricsconfigurations.retina.io": metrics, + "captures.retina.sh": capture, + "metricsconfigurations.retina.sh": metrics, }, }, } diff --git a/docs/CRDs/Capture.md b/docs/CRDs/Capture.md index 641a3ff99d..272799d3e3 100644 --- a/docs/CRDs/Capture.md +++ b/docs/CRDs/Capture.md @@ -9,11 +9,11 @@ To use the `Capture` CRD, [install Retina](../installation/setup.md) with captur ## CRD Specification -The full specification for the `Capture` CRD can be found in the [Capture CRD](https://github.com/microsoft/retina/blob/main/deploy/manifests/controller/helm/retina/crds/retina.io_captures.yaml) file. +The full specification for the `Capture` CRD can be found in the [Capture CRD](https://github.com/microsoft/retina/blob/main/deploy/manifests/controller/helm/retina/crds/retina.sh_captures.yaml) file. The `Capture` CRD is defined with the following specifications: -- **API Group:** retina.io +- **API Group:** retina.sh - **API Version:** v1alpha1 - **Kind:** Capture - **Plural:** captures @@ -43,7 +43,7 @@ The `Capture` CRD is defined with the following specifications: To create a `Capture`, create a YAML manifest file with the desired specifications and apply it to the cluster using `kubectl apply`: ```yaml -apiVersion: retina.io/v1alpha1 +apiVersion: retina.sh/v1alpha1 kind: Capture metadata: name: example-capture diff --git a/docs/CRDs/MetricsConfiguration.md b/docs/CRDs/MetricsConfiguration.md index 23c7371408..99de9d7e25 100644 --- a/docs/CRDs/MetricsConfiguration.md +++ b/docs/CRDs/MetricsConfiguration.md @@ -6,11 +6,11 @@ Retina by default emits node level metrics, however, customers can apply `Metric ## CRD Specification -The full specification for the `MetricsConfiguration` CRD can be found in the [MetricsConfiguration CRD](https://github.com/microsoft/retina/blob/main/deploy/manifests/controller/helm/retina/crds/retina.io_metricsconfigurations.yaml) file. +The full specification for the `MetricsConfiguration` CRD can be found in the [MetricsConfiguration CRD](https://github.com/microsoft/retina/blob/main/deploy/manifests/controller/helm/retina/crds/retina.sh_metricsconfigurations.yaml) file. The `MetricsConfiguration` CRD is defined with the following specifications: -- **API Group:** retina.io +- **API Group:** retina.sh - **API Version:** v1alpha1 - **Kind:** MetricsConfiguration - **Plural:** metricsconfigurations @@ -38,7 +38,7 @@ The `MetricsConfiguration` CRD is defined with the following specifications: To create a `MetricsConfiguration`, create a YAML manifest file with the desired specifications and apply it to the cluster using `kubectl apply`: ```yaml -apiVersion: retina.io/v1alpha1 +apiVersion: retina.sh/v1alpha1 kind: MetricsConfiguration metadata: name: metricsconfigcrd diff --git a/docs/CRDs/RetinaEndpoint.md b/docs/CRDs/RetinaEndpoint.md index 0711fec09e..434beb6d88 100644 --- a/docs/CRDs/RetinaEndpoint.md +++ b/docs/CRDs/RetinaEndpoint.md @@ -8,11 +8,11 @@ In large-scale API servers, each Retina Pod needs to learn about cluster state, ## CRD Specification -The full specification for the `RetinaEndpoint` CRD can be found in the [RetinaEndpoint CRD]( https://github.com/microsoft/retina/blob/main/deploy/manifests/controller/helm/retina/crds/retina.io_retinaendpoints.yaml) file. +The full specification for the `RetinaEndpoint` CRD can be found in the [RetinaEndpoint CRD]( https://github.com/microsoft/retina/blob/main/deploy/manifests/controller/helm/retina/crds/retina.sh_retinaendpoints.yaml) file. The `RetinaEndpoint` CRD is defined with the following specifications: -- **API Group:** retina.io +- **API Group:** retina.sh - **API Version:** v1alpha1 - **Kind:** RetinaEndpoint - **Plural:** retinaendpoints @@ -38,7 +38,7 @@ The `RetinaEndpoint` CRD is defined with the following specifications: To create a `RetinaEndpoint`, create a YAML manifest file with the desired specifications and apply it to the cluster using `kubectl apply`: ```yaml -apiVersion: retina.io/v1alpha1 +apiVersion: retina.sh/v1alpha1 kind: RetinaEndpoint metadata: name: example-retinaendpoint diff --git a/docs/captures/readme.md b/docs/captures/readme.md index 557f7c8e53..226079d9bb 100644 --- a/docs/captures/readme.md +++ b/docs/captures/readme.md @@ -64,7 +64,7 @@ type: Opaque Create a Capture specifying the secret created as blobUpload, this example will also store the artifact on the node host path ```yaml -apiVersion: retina.io/v1alpha1 +apiVersion: retina.sh/v1alpha1 kind: Capture metadata: name: capture-test diff --git a/docs/installation/config.md b/docs/installation/config.md index a63f0b173e..64d73c213e 100644 --- a/docs/installation/config.md +++ b/docs/installation/config.md @@ -9,7 +9,7 @@ Defaults are specified for each component in *deploy/manifests/controller/helm/r * `enablePodLevel`: When this toggle is set to true, Retina will gather Advanced/Pod-Level metrics. Advanced metrics can attach Pod metadata to Retina's metrics. * `remoteContext`: When this toggle is set to true, retina will watch Pods on the cluster. -* `enableAnnotations`: When this toggle is set to true, retina will gather metrics for the annotated resources. Namespaces or Pods can be annotated with "retina.io/v1alpha=observe". The operator and enableRetinaEndpoint for the operator should be enabled. +* `enableAnnotations`: When this toggle is set to true, retina will gather metrics for the annotated resources. Namespaces or Pods can be annotated with "retina.sh/v1alpha=observe". The operator and enableRetinaEndpoint for the operator should be enabled. * `enabledPlugin_linux`: Array of enabled plugins for linux. * `enabledPlugin_win`: Array of enabled plugins for windows. * `metricsInterval`: the interval for which metrics will be gathered. diff --git a/operator/main.go b/operator/main.go index 86e41e1007..0bda8e1a4b 100644 --- a/operator/main.go +++ b/operator/main.go @@ -115,7 +115,7 @@ func main() { Port: 9443, HealthProbeBindAddress: probeAddr, LeaderElection: enableLeaderElection, - LeaderElectionID: "16937e39.retina.io", + LeaderElectionID: "16937e39.retina.sh", // LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily // when the Manager ends. This requires the binary to immediately end when the diff --git a/pkg/controllers/daemon/metricsconfiguration/metricsconfiguration_controller.go b/pkg/controllers/daemon/metricsconfiguration/metricsconfiguration_controller.go index 78d58dc85e..afcc51136b 100644 --- a/pkg/controllers/daemon/metricsconfiguration/metricsconfiguration_controller.go +++ b/pkg/controllers/daemon/metricsconfiguration/metricsconfiguration_controller.go @@ -50,9 +50,9 @@ func New(client client.Client, scheme *runtime.Scheme, metricsModule *mm.Module) } } -//+kubebuilder:rbac:groups=operator.retina.io,resources=metricsconfiguration,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=operator.retina.io,resources=metricsconfiguration/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=operator.retina.io,resources=metricsconfiguration/finalizers,verbs=update +//+kubebuilder:rbac:groups=operator.retina.sh,resources=metricsconfiguration,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=operator.retina.sh,resources=metricsconfiguration/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=operator.retina.sh,resources=metricsconfiguration/finalizers,verbs=update func (r *MetricsConfigurationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { mcc := &retinav1alpha1.MetricsConfiguration{} diff --git a/pkg/controllers/daemon/retinaendpoint/controller.go b/pkg/controllers/daemon/retinaendpoint/controller.go index 0f909ebfc8..ba008a2d21 100644 --- a/pkg/controllers/daemon/retinaendpoint/controller.go +++ b/pkg/controllers/daemon/retinaendpoint/controller.go @@ -35,7 +35,7 @@ func New(client client.Client, cache *cache.Cache) *RetinaEndpointReconciler { } } -// +kubebuilder:rbac:groups=retina.io,resources=retinaendpoints,verbs=get;list;watch +// +kubebuilder:rbac:groups=retina.sh,resources=retinaendpoints,verbs=get;list;watch func (r *RetinaEndpointReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { startTime := time.Now() r.l.Info("Reconciling RetinaEndpoint", zap.String("RetinaEndpoint", req.NamespacedName.String())) diff --git a/pkg/controllers/operator/capture/controller.go b/pkg/controllers/operator/capture/controller.go index 89d1552c0a..d8e94e71d9 100644 --- a/pkg/controllers/operator/capture/controller.go +++ b/pkg/controllers/operator/capture/controller.go @@ -69,9 +69,9 @@ func NewCaptureReconciler(client client.Client, scheme *runtime.Scheme, kubeClie return cr } -//+kubebuilder:rbac:groups=retina.io,resources=captures,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=retina.io,resources=captures/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=retina.io,resources=captures/finalizers,verbs=update +//+kubebuilder:rbac:groups=retina.sh,resources=captures,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=retina.sh,resources=captures/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=retina.sh,resources=captures/finalizers,verbs=update //+kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete;deletecollection //+kubebuilder:rbac:groups=batch,resources=jobs/status,verbs=get //+kubebuilder:rbac:groups="",resources=secrets,verbs=get;list diff --git a/pkg/controllers/operator/metricsconfiguration/metricsconfiguration_controller.go b/pkg/controllers/operator/metricsconfiguration/metricsconfiguration_controller.go index 785f83af21..f74a2fecf9 100644 --- a/pkg/controllers/operator/metricsconfiguration/metricsconfiguration_controller.go +++ b/pkg/controllers/operator/metricsconfiguration/metricsconfiguration_controller.go @@ -54,9 +54,9 @@ func New(client client.Client, scheme *runtime.Scheme) *MetricsConfigurationReco } } -//+kubebuilder:rbac:groups=operator.retina.io,resources=metricsconfigurations,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=operator.retina.io,resources=metricsconfigurations/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=operator.retina.io,resources=metricsconfigurations/finalizers,verbs=update +//+kubebuilder:rbac:groups=operator.retina.sh,resources=metricsconfigurations,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=operator.retina.sh,resources=metricsconfigurations/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=operator.retina.sh,resources=metricsconfigurations/finalizers,verbs=update func (r *MetricsConfigurationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { mcc := &retinav1alpha1.MetricsConfiguration{} diff --git a/pkg/controllers/operator/pod/pod_controller.go b/pkg/controllers/operator/pod/pod_controller.go index 05ba45278f..ac00ee1319 100644 --- a/pkg/controllers/operator/pod/pod_controller.go +++ b/pkg/controllers/operator/pod/pod_controller.go @@ -63,9 +63,9 @@ func New(client client.Client, scheme *k8sruntime.Scheme, podchannel chan<- cach } } -//+kubebuilder:rbac:groups=operator.retina.io,resources=pods,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=operator.retina.io,resources=pods/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=operator.retina.io,resources=pods/finalizers,verbs=update +//+kubebuilder:rbac:groups=operator.retina.sh,resources=pods,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=operator.retina.sh,resources=pods/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=operator.retina.sh,resources=pods/finalizers,verbs=update func (r *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { pod := &corev1.Pod{} diff --git a/pkg/controllers/operator/retinaendpoint/retinaendpoint_controller_test.go b/pkg/controllers/operator/retinaendpoint/retinaendpoint_controller_test.go index 59e38abf06..fd7468be0a 100644 --- a/pkg/controllers/operator/retinaendpoint/retinaendpoint_controller_test.go +++ b/pkg/controllers/operator/retinaendpoint/retinaendpoint_controller_test.go @@ -90,7 +90,7 @@ func TestRetinaEndpointReconciler_ReconcilePod(t *testing.T) { }, TypeMeta: metav1.TypeMeta{ Kind: "RetinaEndpoint", - APIVersion: "retina.io/v1alpha1", + APIVersion: "retina.sh/v1alpha1", }, }, }, @@ -150,7 +150,7 @@ func TestRetinaEndpointReconciler_ReconcilePod(t *testing.T) { wantedRetinaEndpoint: &retinav1alpha1.RetinaEndpoint{ TypeMeta: metav1.TypeMeta{ Kind: "RetinaEndpoint", - APIVersion: "retina.io/v1alpha1", + APIVersion: "retina.sh/v1alpha1", }, ObjectMeta: metav1.ObjectMeta{ Name: "pod", diff --git a/pkg/controllers/operator/tracesconfiguration/tracesconfiguration_controller.go b/pkg/controllers/operator/tracesconfiguration/tracesconfiguration_controller.go index ef3157a78f..a4bad75577 100644 --- a/pkg/controllers/operator/tracesconfiguration/tracesconfiguration_controller.go +++ b/pkg/controllers/operator/tracesconfiguration/tracesconfiguration_controller.go @@ -30,9 +30,9 @@ type TracesConfigurationReconciler struct { Scheme *runtime.Scheme } -//+kubebuilder:rbac:groups=operator.retina.io,resources=tracesconfiguration,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=operator.retina.io,resources=tracesconfiguration/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=operator.retina.io,resources=tracesconfiguration/finalizers,verbs=update +//+kubebuilder:rbac:groups=operator.retina.sh,resources=tracesconfiguration,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=operator.retina.sh,resources=tracesconfiguration/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=operator.retina.sh,resources=tracesconfiguration/finalizers,verbs=update // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. diff --git a/pkg/label/k8s.go b/pkg/label/k8s.go index d4bd144a50..fe1e1fe196 100644 --- a/pkg/label/k8s.go +++ b/pkg/label/k8s.go @@ -6,7 +6,7 @@ package label const ( // LabelPrefix is the prefix for all Retina owned labels. - LabelPrefix = "retina.io" + LabelPrefix = "retina.sh" // AppLabel indicates the Retina-owned application AppLabel = LabelPrefix + "/app" diff --git a/pkg/utils/flow_utils.go b/pkg/utils/flow_utils.go index e99e616b1e..917a9d508b 100644 --- a/pkg/utils/flow_utils.go +++ b/pkg/utils/flow_utils.go @@ -6,9 +6,9 @@ import ( "net" "time" - "github.com/microsoft/retina/pkg/log" "github.com/cilium/cilium/api/v1/flow" "github.com/cilium/cilium/pkg/monitor/api" + "github.com/microsoft/retina/pkg/log" "go.uber.org/zap" "google.golang.org/protobuf/types/known/anypb" "google.golang.org/protobuf/types/known/timestamppb" @@ -19,7 +19,7 @@ import ( const ( Verdict_RETRANSMISSION flow.Verdict = 15 Verdict_DNS flow.Verdict = 16 - TypeUrl string = "retina.io" + TypeUrl string = "retina.sh" ) // ToFlow returns a flow.Flow object. diff --git a/samples/capture/capture-specific-pod-on-a-node.yaml b/samples/capture/capture-specific-pod-on-a-node.yaml index 0380a1c005..d404e0ebfe 100644 --- a/samples/capture/capture-specific-pod-on-a-node.yaml +++ b/samples/capture/capture-specific-pod-on-a-node.yaml @@ -1,4 +1,4 @@ -apiVersion: retina.io/v1alpha1 +apiVersion: retina.sh/v1alpha1 kind: Capture metadata: name: capture-pod-blobupload diff --git a/samples/capture/nodeblobupload.yaml b/samples/capture/nodeblobupload.yaml index a4a9e17488..80cae35c01 100644 --- a/samples/capture/nodeblobupload.yaml +++ b/samples/capture/nodeblobupload.yaml @@ -1,4 +1,4 @@ -apiVersion: retina.io/v1alpha1 +apiVersion: retina.sh/v1alpha1 kind: Capture metadata: name: capture-node-blobupload diff --git a/samples/capture/podblobupload.yaml b/samples/capture/podblobupload.yaml index edd7e9dec9..88260f86c4 100644 --- a/samples/capture/podblobupload.yaml +++ b/samples/capture/podblobupload.yaml @@ -1,4 +1,4 @@ -apiVersion: retina.io/v1alpha1 +apiVersion: retina.sh/v1alpha1 kind: Capture metadata: name: capture-pod-blobupload diff --git a/samples/metricsconfiguration.yaml b/samples/metricsconfiguration.yaml index b08bdb260a..97d4a94a64 100644 --- a/samples/metricsconfiguration.yaml +++ b/samples/metricsconfiguration.yaml @@ -1,4 +1,4 @@ -apiVersion: retina.io/v1alpha1 +apiVersion: retina.sh/v1alpha1 kind: MetricsConfiguration metadata: name: sample-metricsconfig diff --git a/test/profiles/advanced/crd/metrics_config_crd.yaml b/test/profiles/advanced/crd/metrics_config_crd.yaml index 318c6a8ff4..f4bd926594 100644 --- a/test/profiles/advanced/crd/metrics_config_crd.yaml +++ b/test/profiles/advanced/crd/metrics_config_crd.yaml @@ -1,4 +1,4 @@ -apiVersion: retina.io/v1alpha1 +apiVersion: retina.sh/v1alpha1 kind: MetricsConfiguration metadata: name: metricsconfigcrd diff --git a/test/testcrds/metrics-config-goldpinger.yaml b/test/testcrds/metrics-config-goldpinger.yaml index ec1eb88944..53d86402e9 100644 --- a/test/testcrds/metrics-config-goldpinger.yaml +++ b/test/testcrds/metrics-config-goldpinger.yaml @@ -1,4 +1,4 @@ -apiVersion: retina.io/v1alpha1 +apiVersion: retina.sh/v1alpha1 kind: MetricsConfiguration metadata: name: metricsconfigurationaaaaa