Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Mossaka opened this issue Oct 14, 2024 · 1 comment

Comments

@Mossaka
Copy link
Member

Mossaka commented Oct 14, 2024

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/[email protected]/pkg/internal/controller/controller.go:114
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
        /home/mossaka/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:311
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
        /home/mossaka/go/pkg/mod/sigs.k8s.io/[email protected]/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/[email protected]/pkg/internal/controller/controller.go:222
@endocrimes
Copy link
Contributor

This is expected to some degree (changing fields managed by the operator isn't particularly supported), but i think we're running into a quirk of how patching works for lists: It tries to re-add the port 80 binding rather than overwriting the port 83 binding.

I'm not sure how we'd want to go about overwriting the external change there - without building out specific get/update logic instead of the simpler patching 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants