Skip to content

Commit c87f650

Browse files
refactor: rename legacy control plane to standard and update related scripts and docs (#1259)
# Description This pull request includes significant changes to transition from the "legacy" to the "standard" directory and package structure. The changes involve updates to Helm charts, Makefile commands, package imports, and file paths. Directory and package structure updates: * [`.github/workflows/release-charts.yaml`](diffhunk://#diff-711012dcc1f315d20ef98e04b14cbc0cb1a388641934c2151ac99f74ff11f62cL43-R43): Updated the Helm package path from `legacy` to `standard`. * [`Makefile`](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L447-R447): Updated multiple Helm install commands to use the `standard` directory instead of `legacy`. [[1]](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L447-R447) [[2]](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L460-R460) [[3]](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L477-R477) [[4]](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L496-R496) * [`cmd/root.go`](diffhunk://#diff-ab967ab1a2f3a1b769106eeb7bfe892ef0e81d1d27811fa15be08e6749feee1fL9-R9): Changed package imports and daemon initialization from `legacy` to `standard`. [[1]](diffhunk://#diff-ab967ab1a2f3a1b769106eeb7bfe892ef0e81d1d27811fa15be08e6749feee1fL9-R9) [[2]](diffhunk://#diff-ab967ab1a2f3a1b769106eeb7bfe892ef0e81d1d27811fa15be08e6749feee1fL31-R31) * Renamed files from `legacy` to `standard`: * `cmd/legacy/daemon.go` to `cmd/standard/daemon.go` * `cmd/legacy/daemon_linux.go` to `cmd/standard/daemon_linux.go` * `cmd/legacy/daemon_windows.go` to `cmd/standard/daemon_windows.go` * [`crd/Makefile`](diffhunk://#diff-414956f6f35c3bc4a93c4c08592ee22397d76d99a1b728e1e33c65075a2a99c8L7-R7): Updated the `HELM_CRD_DIR` path to use the `standard` directory. File deletions and renames: * Deleted `deploy/legacy/prometheus/retina/create-cm.sh`. * Renamed `deploy/legacy/manifests/controller/helm/retina/templates/NOTES.txt` to `deploy/standard/manifests/controller/helm/retina/templates/NOTES.txt` with updated paths inside the file. ## Related Issue This PR will close #1115 ## Checklist - [x] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [x] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [x] I have correctly attributed the author(s) of the code. - [x] I have tested the changes locally. - [x] I have followed the project's style guidelines. - [x] I have updated the documentation, if necessary. - [x] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --------- Signed-off-by: Ritwik Ranjan <[email protected]> Co-authored-by: kamilprz <[email protected]>
1 parent 387a905 commit c87f650

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+47
-47
lines changed

.github/workflows/release-charts.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: |
4141
set -euo pipefail
4242
export TAG=$(make version)
43-
helm package ./deploy/legacy/manifests/controller/helm/retina --version $TAG
43+
helm package ./deploy/standard/manifests/controller/helm/retina --version $TAG
4444
# Get Helm chart's SHA digest from helm push cmd output
4545
helm push retina-$TAG.tgz oci://ghcr.io/${{ github.repository }}/charts >> helm_push_result.txt 2>&1
4646
cat helm_push_result.txt

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ HELM_IMAGE_TAG ?= $(LATEST_TAG)
444444

445445
# basic/node-level mode
446446
helm-install: manifests
447-
helm upgrade --install retina ./deploy/legacy/manifests/controller/helm/retina/ \
447+
helm upgrade --install retina ./deploy/standard/manifests/controller/helm/retina/ \
448448
--namespace kube-system \
449449
--set image.repository=$(IMAGE_REGISTRY)/$(RETINA_IMAGE) \
450450
--set image.initRepository=$(IMAGE_REGISTRY)/$(RETINA_INIT_IMAGE) \
@@ -457,7 +457,7 @@ helm-install: manifests
457457
--set enabledPlugin_linux="\[dropreason\,packetforward\,linuxutil\,dns\]"
458458

459459
helm-install-with-operator: manifests
460-
helm upgrade --install retina ./deploy/legacy/manifests/controller/helm/retina/ \
460+
helm upgrade --install retina ./deploy/standard/manifests/controller/helm/retina/ \
461461
--namespace kube-system \
462462
--set image.repository=$(IMAGE_REGISTRY)/$(RETINA_IMAGE) \
463463
--set image.initRepository=$(IMAGE_REGISTRY)/$(RETINA_INIT_IMAGE) \
@@ -474,7 +474,7 @@ helm-install-with-operator: manifests
474474

475475
# advanced/pod-level mode with scale limitations, where metrics are aggregated by source and destination Pod
476476
helm-install-advanced-remote-context: manifests
477-
helm upgrade --install retina ./deploy/legacy/manifests/controller/helm/retina/ \
477+
helm upgrade --install retina ./deploy/standard/manifests/controller/helm/retina/ \
478478
--namespace kube-system \
479479
--set image.repository=$(IMAGE_REGISTRY)/$(RETINA_IMAGE) \
480480
--set image.initRepository=$(IMAGE_REGISTRY)/$(RETINA_INIT_IMAGE) \
@@ -493,7 +493,7 @@ helm-install-advanced-remote-context: manifests
493493

494494
# advanced/pod-level mode designed for scale, where metrics are aggregated by "local" Pod (source for outgoing traffic, destination for incoming traffic)
495495
helm-install-advanced-local-context: manifests
496-
helm upgrade --install retina ./deploy/legacy/manifests/controller/helm/retina/ \
496+
helm upgrade --install retina ./deploy/standard/manifests/controller/helm/retina/ \
497497
--namespace kube-system \
498498
--set image.repository=$(IMAGE_REGISTRY)/$(RETINA_IMAGE) \
499499
--set image.initRepository=$(IMAGE_REGISTRY)/$(RETINA_INIT_IMAGE) \

cmd/root.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77
"os"
88

9-
"github.com/microsoft/retina/cmd/legacy"
9+
"github.com/microsoft/retina/cmd/standard"
1010
"github.com/spf13/cobra"
1111
)
1212

@@ -28,7 +28,7 @@ var (
2828
RunE: func(cmd *cobra.Command, args []string) error {
2929
// Do Stuff Here
3030
fmt.Println("Starting Retina Agent")
31-
d := legacy.NewDaemon(metricsAddr, probeAddr, cfgFile, enableLeaderElection)
31+
d := standard.NewDaemon(metricsAddr, probeAddr, cfgFile, enableLeaderElection)
3232
if err := d.Start(); err != nil {
3333
return fmt.Errorf("starting daemon: %w", err)
3434
}

cmd/legacy/daemon.go renamed to cmd/standard/daemon.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT license.
3-
package legacy
3+
package standard
44

55
import (
66
"fmt"

cmd/legacy/daemon_linux.go renamed to cmd/standard/daemon_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package legacy
1+
package standard
22

33
import "github.com/cilium/ebpf/rlimit"
44

cmd/legacy/daemon_windows.go renamed to cmd/standard/daemon_windows.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package legacy
1+
package standard
22

33
func (d *Daemon) RemoveMemlock() error {
44
// This function is a no-op on Windows.

crd/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ REPO_ROOT = $(shell git rev-parse --show-toplevel)
44
TOOLS_DIR = $(REPO_ROOT)/hack/tools
55
TOOLS_BIN_DIR = $(TOOLS_DIR)/bin
66
CONTROLLER_GEN = $(TOOLS_BIN_DIR)/controller-gen
7-
HELM_CRD_DIR = $(REPO_ROOT)/deploy/legacy/manifests/controller/helm/retina/crds
7+
HELM_CRD_DIR = $(REPO_ROOT)/deploy/standard/manifests/controller/helm/retina/crds
88

99
.PHONY: generate manifests
1010

deploy/legacy/prometheus/retina/create-cm.sh

-3
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
1. Installing retina service using helm: helm install retina ./deploy/legacy/manifests/controller/helm/retina/ --namespace kube-system --dependency-update
1+
1. Installing retina service using helm: helm install retina ./deploy/standard/manifests/controller/helm/retina/ --namespace kube-system --dependency-update
22
2. Cleaning up/uninstalling/deleting retina and dependencies related:
33
helm uninstall retina -n kube-system
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

33
kubectl delete cm ama-metrics-prometheus-config-node -n kube-system
4-
kubectl create configmap ama-metrics-prometheus-config-node --from-file=./deploy/legacy/prometheus/cilium/prometheus-config -n kube-system
4+
kubectl create configmap ama-metrics-prometheus-config-node --from-file=./deploy/standard/prometheus/cilium/prometheus-config -n kube-system
55
k rollout restart ds ama-metrics-node -n kube-system

deploy/legacy/prometheus/retina-windows/create-cm.sh renamed to deploy/standard/prometheus/retina-windows/create-cm.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
kubectl delete cm ama-metrics-prometheus-config-node -n kube-system
44

5-
kubectl create configmap ama-metrics-prometheus-config-node --from-file=./deploy/legacy/prometheus/retina-windows/prometheus-config -n kube-system
5+
kubectl create configmap ama-metrics-prometheus-config-node --from-file=./deploy/standard/prometheus/retina-windows/prometheus-config -n kube-system
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
kubectl create configmap ama-metrics-prometheus-config-node --from-file=./deploy/standard/prometheus/retina/prometheus-config -n kube-system
File renamed without changes.

docs/02-Installation/01-Setup.md

+2-2

docs/02-Installation/03-Config.md

+1-1

docs/02-Installation/04-prometheus.md

+3-3

docs/02-Installation/05-grafana.md

+1-1

docs/02-Installation/aks-setup.md

+1-1

docs/03-Metrics/01-metrics-intro.md

+3-3

docs/03-Metrics/modes/modes.md

+1-1

docs/04-Captures/managed-storage-account.md

+2-2

docs/05-Concepts/CRDs/Capture.md

+1-1

docs/05-Concepts/CRDs/MetricsConfiguration.md

+1-1

docs/05-Concepts/CRDs/RetinaEndpoint.md

+1-1

operator/cmd/cilium-crds/cells_linux.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ var (
9090
// Provides Clientset, API for accessing Kubernetes objects.
9191
k8sClient.Cell,
9292

93-
// Provides the modular metrics registry, metric HTTP server and legacy metrics cell.
93+
// Provides the modular metrics registry, metric HTTP server and standard metrics cell.
9494
// NOTE: no server/metrics are created when --enable-metrics=false (default)
9595
operatorMetrics.Cell,
9696
cell.Provide(func(
@@ -175,7 +175,7 @@ var (
175175
// isLeader.Load,
176176
// ),
177177

178-
// NOTE: might need to uncomment to support metrics? Code might be legacy though?
178+
// NOTE: might need to uncomment to support metrics? Code might be standard though?
179179
// api.MetricsHandlerCell,
180180

181181
controller.Cell,

operator/cmd/root.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"fmt"
88
"os"
99

10-
"github.com/microsoft/retina/operator/cmd/legacy"
10+
"github.com/microsoft/retina/operator/cmd/standard"
1111
"github.com/spf13/cobra"
1212
)
1313

@@ -27,7 +27,7 @@ var (
2727
Long: "Start Retina Operator",
2828
Run: func(cmd *cobra.Command, args []string) {
2929
fmt.Println("Starting Retina Operator")
30-
d := legacy.NewOperator(metricsAddr, probeAddr, cfgFile, enableLeaderElection)
30+
d := standard.NewOperator(metricsAddr, probeAddr, cfgFile, enableLeaderElection)
3131
d.Start()
3232
},
3333
}

operator/cmd/legacy/deployment.go renamed to operator/cmd/standard/deployment.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT license.
33

4-
package legacy
4+
package standard
55

66
import (
77
"context"
@@ -29,7 +29,7 @@ import (
2929
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
3030

3131
retinav1alpha1 "github.com/microsoft/retina/crd/api/v1alpha1"
32-
deploy "github.com/microsoft/retina/deploy/legacy"
32+
deploy "github.com/microsoft/retina/deploy/standard"
3333
"github.com/microsoft/retina/internal/buildinfo"
3434
"github.com/microsoft/retina/operator/cache"
3535
config "github.com/microsoft/retina/operator/config"
@@ -84,7 +84,7 @@ func NewOperator(metricsAddr, probeAddr, configFile string, enableLeaderElection
8484
func (o *Operator) Start() {
8585
mainLogger = log.Logger().Named("main")
8686

87-
mainLogger.Sugar().Infof("Starting legacy operator")
87+
mainLogger.Sugar().Infof("Starting standard operator")
8888

8989
opts := &crzap.Options{
9090
Development: false,

pkg/controllers/daemon/retinaendpoint/suite_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var _ = BeforeSuite(func() {
5454

5555
By("Bootstrapping test environment")
5656
testEnv = &envtest.Environment{
57-
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "..", "deploy", "legacy", "manifests", "controller", "helm", "retina", "crds")},
57+
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "..", "deploy", "standard", "manifests", "controller", "helm", "retina", "crds")},
5858
ErrorIfCRDPathMissing: true,
5959
}
6060

pkg/controllers/operator/capture/suite_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var _ = BeforeSuite(func() {
4848

4949
By("Bootstrapping test environment")
5050
testEnv = &envtest.Environment{
51-
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "..", "deploy", "legacy", "manifests", "controller", "helm", "retina", "crds")},
51+
CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "..", "deploy", "standard", "manifests", "controller", "helm", "retina", "crds")},
5252
ErrorIfCRDPathMissing: true,
5353
}
5454

pkg/monitoragent/monitoragent_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (a *monitorAgent) SendEvent(typ int, event interface{}) error {
7171
return nil
7272
}
7373

74-
// marshal notifications into JSON format for legacy listeners
74+
// marshal notifications into JSON format for standard listeners
7575
if typ == api.MessageTypeAgent {
7676
msg, ok := event.(api.AgentNotifyMessage)
7777
if !ok {

test/e2e/common/common.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var (
3939

4040
var (
4141
RetinaChartPath = func(rootDir string) string {
42-
return filepath.Join(rootDir, "deploy", "legacy", "manifests", "controller", "helm", "retina")
42+
return filepath.Join(rootDir, "deploy", "standard", "manifests", "controller", "helm", "retina")
4343
}
4444
RetinaAdvancedProfilePath = func(rootDir string) string {
4545
return filepath.Join(rootDir, "test", "profiles", "advanced", "values.yaml")

test/profiles/localctx/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
operator:
22
enabled: false
3-
# Plugins will default to deploy/legacy/manifests/controller/helm/retina/values.yaml
3+
# Plugins will default to deploy/standard/manifests/controller/helm/retina/values.yaml
44
# TODO add all plugins that we want to test here for local context.
55
remoteContext: false
66
enablePodLevel: true

windows/readme.md

+1-1

0 commit comments

Comments
 (0)