spinframework / spinframework/spin-operator

Unable to reconcile deployment: Duplicate value: http-app in an attempt to edit the deployment

Open
#327 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
289
Forks
34
PR merge metrics
No merged PRs in 30d

Description

Steps to repro:

  1. Follow the Running a local development environment section on README to prepare a k3d cluster.
  2. After apply the sample application, run kubectl edit deploy to change the port number from 80 to something else (i.e. 83).
  3. See the error from the terminal that's running spin-operator.
2024-10-14T06:58:10Z    ERROR   Unable to reconcile Deployment  {"controller": "spinapp", "controllerGroup": "core.spinoperator.dev", "controllerKind": "SpinApp", "SpinApp": {"name":"simple-spinapp","namespace":"default"}, "namespace": "default", "name": "simple-spinapp", "reconcileID": "72640040-ef1e-437c-accb-2815effe4d84", "deployment": "simple-spinapp", "error": "Deployment.apps \"simple-spinapp\" is invalid: spec.template.spec.containers[0].ports[1].name: Duplicate value: \"http-app\""}
github.com/spinkube/spin-operator/internal/logging.logrLogger.Error
        /home/mossaka/developer/spinkube/spin-operator-msk/internal/logging/logr_logger.go:72
github.com/spinkube/spin-operator/internal/controller.(*SpinAppReconciler).reconcileDeployment
        /home/mossaka/developer/spinkube/spin-operator-msk/internal/controller/spinapp_controller.go:337
github.com/spinkube/spin-operator/internal/controller.(*SpinAppReconciler).Reconcile
        /home/mossaka/developer/spinkube/spin-operator-msk/internal/controller/spinapp_controller.go:133
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
        /home/mossaka/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:114
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
        /home/mossaka/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:311
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
        /home/mossaka/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:261
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
        /home/mossaka/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.18.4/pkg/internal/controller/controller.go:222

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with internal/controller/spinapp_controller.go at reconcileDeployment (around line 337), then review the local development setup in the README and reproduce the kubectl edit flow. Done means editing the deployment's port no longer causes the SpinApp reconciliation to fail with a duplicate http-app name.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.