Skip to content

Commit dff5ef1

Browse files
committed
Remove unused Sonic agent
Remove the unauthenticated agent implementation, controller integration, and build and deployment wiring. Preserve declarative Switch readiness and finalizer cleanup, and keep SwitchInterface resources pending without a device backend. Update documentation and provisioning examples, remove unused dependencies, and add lifecycle regression coverage. Fixes #199 Signed-off-by: Hardik Dodiya <hardik.dodiya@sap.com>
1 parent 6584a33 commit dff5ef1

56 files changed

Lines changed: 202 additions & 5349 deletions

Some content is hidden

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

‎.github/workflows/publish-docker.yml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ jobs:
2525
image:
2626
- name: sonic-operator-controller-manager
2727
target: manager
28-
- name: sonic-agent
29-
target: sonic-agent
3028
permissions:
3129
contents: read
3230
packages: write

‎Dockerfile‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,3 @@ COPY --from=manager-builder /workspace/manager .
3232
USER 65532:65532
3333

3434
ENTRYPOINT ["/manager"]
35-
36-
37-
# State 1: Build agent binaries
38-
FROM builder AS agent-builder
39-
RUN --mount=type=cache,target=/root/.cache/go-build \
40-
--mount=type=cache,target=/go/pkg \
41-
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o switch-agent-server cmd/agent/main.go && \
42-
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o switch-agent-client cmd/agent_cli/main.go
43-
44-
# Stage 2: Final image based on SONiC VS (Arm only right now)
45-
FROM gcr.io/distroless/static:nonroot AS sonic-agent
46-
47-
WORKDIR /
48-
49-
# Copy the built binaries from builder stage
50-
COPY --from=agent-builder /workspace/switch-agent-server .
51-
COPY --from=agent-builder /workspace/switch-agent-client .
52-
53-
# Expose the service ports
54-
EXPOSE 50051 50051
55-
56-
ENTRYPOINT ["/switch-agent-server"]
57-
58-

‎Makefile‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ else
1212
GOBIN=$(shell go env GOBIN)
1313
endif
1414

15-
16-
PROTO_DIR=./pkg/agent/proto
17-
1815
# CONTAINER_TOOL defines the container tool to be used for building images.
1916
# Be aware that the target commands are only tested with Docker which is
2017
# scaffolded by default. However, you might want to replace it to use other
@@ -144,33 +141,19 @@ cleandocs: ## Cleanup local docs Docker artifacts (image + dangling layers).
144141
-$(CONTAINER_TOOL) image rm --force $(DOCS_IMAGE)
145142
-$(CONTAINER_TOOL) image prune --force --filter "label=project=sonic_operator"
146143

147-
##@ proto
148-
.PHONY: proto
149-
proto:
150-
@echo "Generating protobuf files..."
151-
protoc --go_out=. --go_opt=paths=source_relative \
152-
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
153-
$(PROTO_DIR)/switch_agent.proto
154-
155-
156144
##@ Build
157145

158146
.PHONY: docs
159147
docs: crd-ref-docs ## Generate API reference documentation.
160148
$(CRD_REF_DOCS) --source-path=./api/v1alpha1 --config=./hack/api-reference/config.yaml --renderer=markdown --output-path=./docs/api-reference/api.md
161149

162150

163-
.PHONY: build-agent
164-
build-agent: fmt vet ## Build agent binary.
165-
go build -o bin/agent_server cmd/agent/main.go
166-
go build -o bin/agent_cli cmd/agent_cli/main.go
167-
168151
.PHONY: provisioning-server
169152
provisioning-server: fmt vet ## Build provisioning-server binary.
170153
go build -o bin/provisioning-server cmd/provisioning-server/main.go
171154

172155
.PHONY: build
173-
build: manifests generate fmt vet build-agent provisioning-server ## Build manager binary.
156+
build: manifests generate fmt vet provisioning-server ## Build manager binary.
174157
go build -o bin/manager cmd/main.go
175158

176159

‎README.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ A Kubernetes-native operator for onboarding and managing bare-metal network swit
77

88
## What it does
99
- Manages switches and interfaces as declarative Kubernetes resources.
10-
- Deploys a switch agent on the device to read and enforce state.
1110
- Serves ZTP scripts and ONIE installer artifacts for zero-touch provisioning.
1211

1312
## Components
1413
- **Controller manager**: reconciles CRDs and updates status.
15-
- **Switch agent**: runs on the switch; gRPC API for device/interface operations.
1614
- **Provisioning server**: serves ZTP scripts and ONIE installers over HTTP.
1715

16+
The former unauthenticated Sonic agent has been removed. Switch readiness reflects
17+
declarative acceptance for provisioning; device discovery and interface state
18+
enforcement are currently unavailable. `SwitchInterface` resources remain `Pending`.
19+
1820
## CRDs
1921
- `Switch`: physical switch and management connectivity.
2022
- `SwitchInterface`: per-interface admin/operational state.

‎REUSE.toml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ SPDX-PackageDownloadLocation = "https://github.com/ironcore-dev/sonic-operator"
2525
".devcontainer/**",
2626
"docs/**",
2727
"README.md",
28-
"internal/agent/hack/**",
29-
"internal/agent/proto/**",
30-
"pkg/agent/proto/**",
3128
"test/emulation/**",
3229
]
3330
precedence = "aggregate"

‎cmd/agent/main.go‎

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎cmd/agent_cli/main.go‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎config/rbac/role.yaml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ rules:
1515
- apiGroups:
1616
- sonic.networking.metal.ironcore.dev
1717
resources:
18-
- interfaces
1918
- switches
2019
- switchinterfaces
2120
verbs:

‎docs/.vitepress/config.mts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ export default withMermaid({
7575
items: [
7676
{ text: 'Getting started', link: '/usage/getting-started' },
7777
{ text: 'Provisioning', link: '/usage/provisioning' },
78-
{ text: 'Agent', link: '/usage/agent' },
7978
]
8079
},
8180
{

‎docs/README.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ This directory contains the main documentation for sonic-operator.
99
## Usage
1010
- `usage/getting-started.md` — install, deploy, and first resources.
1111
- `usage/provisioning.md` — ZTP scripts and ONIE installer delivery.
12-
- `usage/agent.md` — switch agent deployment and gRPC API behavior.
1312

1413
## Development
1514
- `development/dev-workflow.md` — build, lint, test, and docs generation.

0 commit comments

Comments
 (0)