uselagoon / remote-controller

A group of controllers for handling Lagoon builds and tasks in Kubernetes or Openshift
5 stars 1 forks source link

Controller injects wrong harbor credentials into container #57

Closed Schnitzel closed 3 years ago

Schnitzel commented 3 years ago

with the recent fix to append harbor credentials instead of replacing them: https://github.com/amazeeio/lagoon-kbd/pull/56 there is now a possibility that the controller injects the wrong credentials into the build container: https://github.com/amazeeio/lagoon-kbd/blob/12419865e6ffc971d73befcc2b251420303b781f/controllers/lagoonbuild_controller.go#L451-L462 basically the code above loads the registries defined in the lagoon-internal-registry-secret secret and injects them into the docker container. If there are multiple registries defined in the lagoon-internal-registry-secret secret (like it can happen now) it's possible that the wrong registry is injected.

We probably should filter for the actual defined harbor registry to the controller and only inject that one into the build pods