uselagoon / remote-controller

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

Feature: add lagoon-env configmap to advanced task spec #185

Closed bomoko closed 2 years ago

bomoko commented 2 years ago

Checklist

Currently, advanced tasks don't mount the "lagoon-env" configmap, and so some variables that should legitimately be available to the task aren't. This PR adds it.

bomoko commented 2 years ago

@shreddedbacon - I've just assumed that the configmap will be available. Do we want to do a conditional check before loading?

shreddedbacon commented 2 years ago

@shreddedbacon - I've just assumed that the configmap will be available. Do we want to do a conditional check before loading?

Hmm, good question. Tasks do assume that an environment has deployed successfully to the point where a lagoon-env configmap exists, but an advanced task could theoretically run in an environment that is in a poor state where the lagoon-env configmap doesn't exist yet.

Perhaps something we should do is actually create the lagoon-env configmap when the namespace is created here

We basically do a "create if not exist" operation on the lagoon-env configmap to ensure it always exists?