doks.go 450 B

12345678910111213141516171819202122232425
  1. package doks
  2. import (
  3. v1 "k8s.io/api/core/v1"
  4. )
  5. // Conf is just a DO token
  6. type Conf struct {
  7. DORegion, DOKSClusterName string
  8. }
  9. // AttachDOKSEnv adds the relevant DO env for the provisioner
  10. func (conf *Conf) AttachDOKSEnv(env []v1.EnvVar) []v1.EnvVar {
  11. env = append(env, v1.EnvVar{
  12. Name: "DO_REGION",
  13. Value: conf.DORegion,
  14. })
  15. env = append(env, v1.EnvVar{
  16. Name: "DOKS_CLUSTER_NAME",
  17. Value: conf.DOKSClusterName,
  18. })
  19. return env
  20. }