Skip to content

Commit

Permalink
gateway deployment template inherits annotation of gateway spec (#129)
Browse files Browse the repository at this point in the history
* gateway deployment template inherits annotation of gateway spec

* gateway and sensor deployment template inherits annotation of gateway/sensor spec
  • Loading branch information
Tayfun Wiechert authored and magaldima committed Nov 26, 2018
1 parent bcbbbf4 commit 3d4b06b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 5 additions & 4 deletions controllers/gateway/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ func (goc *gwOperationCtx) operate() error {
},
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: goc.gw.ObjectMeta.Labels,
Labels: goc.gw.ObjectMeta.Labels,
Annotations: goc.gw.Annotations,
},
Spec: *goc.gw.Spec.DeploySpec,
},
Expand Down Expand Up @@ -421,11 +422,11 @@ func (goc *gwOperationCtx) getContainersForGatewayPod() *[]corev1.Container {
Value: common.GatewayProcessorHTTPServerEventEndpoint,
},
{
Name: common.EnvVarGatewayProcessorHTTPServerConfigActivated,
Name: common.EnvVarGatewayProcessorHTTPServerConfigActivated,
Value: common.GatewayProcessorHTTPServerConfigActivatedEndpoint,
},
{
Name: common.EnvVarGatewayProcessorHTTPServerConfigError,
Name: common.EnvVarGatewayProcessorHTTPServerConfigError,
Value: common.GatewayProcessorHTTPServerConfigErrorEndpoint,
},
}
Expand Down Expand Up @@ -485,4 +486,4 @@ func (goc *gwOperationCtx) getContainersForGatewayPod() *[]corev1.Container {
containers = append(containers, gatewayTransformerContainer)

return &containers
}
}
7 changes: 5 additions & 2 deletions controllers/sensor/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ func (soc *sOperationCtx) operate() error {
},
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Name: common.DefaultSensorDeploymentName(soc.s.Name),
Namespace: soc.s.Name,
Name: common.DefaultSensorDeploymentName(soc.s.Name),
Namespace: soc.s.Name,
Annotations: soc.s.Annotations,

Labels: map[string]string{
common.LabelSensorName: soc.s.Name,
},
Expand Down Expand Up @@ -187,6 +189,7 @@ func (soc *sOperationCtx) operate() error {
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
GenerateName: common.DefaultSensorJobName(soc.s.Name),
Annotations: soc.s.Annotations,
Labels: map[string]string{
common.LabelSensorName: soc.s.Name,
},
Expand Down

0 comments on commit 3d4b06b

Please sign in to comment.