Skip to content

Commit

Permalink
Move annotation format string to constants module
Browse files Browse the repository at this point in the history
  • Loading branch information
kupson committed Mar 26, 2019
1 parent 6279942 commit 01a007a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 5 additions & 2 deletions pkg/cluster/k8sres.go
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,11 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*v1beta1.State
tolerationSpec := tolerations(&spec.Tolerations, c.OpConfig.PodToleration)
effectivePodPriorityClassName := util.Coalesce(spec.PodPriorityClassName, c.OpConfig.PodPriorityClassName)

secretEnvVarsAnnKey := fmt.Sprintf("follow.acid.zalan.do/secret.%s", c.OpConfig.PodEnvironmentSecretName)
var customPodAnnotations = map[string]string{ secretEnvVarsAnnKey: fmt.Sprintf("%x", secretEnvVarsHash) }
secretEnvVarsAnnKey := fmt.Sprintf(constants.PodEnvironmentSecretFollowAnnotationFmt,
c.OpConfig.PodEnvironmentSecretName)
var customPodAnnotations = map[string]string{
secretEnvVarsAnnKey: fmt.Sprintf("%x", secretEnvVarsHash),
}

// generate pod template for the statefulset, based on the spilo container and sidecars
if podTemplate, err = generatePodTemplate(
Expand Down
11 changes: 6 additions & 5 deletions pkg/util/constants/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package constants

// Names and values in Kubernetes annotation for services, statefulsets and volumes
const (
ZalandoDNSNameAnnotation = "external-dns.alpha.kubernetes.io/hostname"
ElbTimeoutAnnotationName = "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout"
ElbTimeoutAnnotationValue = "3600"
KubeIAmAnnotation = "iam.amazonaws.com/role"
VolumeStorateProvisionerAnnotation = "pv.kubernetes.io/provisioned-by"
ZalandoDNSNameAnnotation = "external-dns.alpha.kubernetes.io/hostname"
ElbTimeoutAnnotationName = "service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout"
ElbTimeoutAnnotationValue = "3600"
KubeIAmAnnotation = "iam.amazonaws.com/role"
VolumeStorateProvisionerAnnotation = "pv.kubernetes.io/provisioned-by"
PodEnvironmentSecretFollowAnnotationFmt = "follow.acid.zalan.do/secret.%s"
)

0 comments on commit 01a007a

Please sign in to comment.