Skip to content

Commit

Permalink
fix: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Hunter-Thompson committed Oct 22, 2022
1 parent 0c0797a commit 16b8777
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apis/mattermost/v1beta1/mattermost_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ type Ingress struct {
type AWSLoadBalancerController struct {
// An AWS ALB Ingress will be created instead of nginx
// +optional
Enable bool `json:"enable,omitempty"`
Enabled bool `json:"enable,omitempty"`

// Certificate arn for the ALB, required if SSL enabled
// +optional
Expand Down
2 changes: 1 addition & 1 deletion controllers/mattermost/mattermost/mattermost.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func (r *MattermostReconciler) checkMattermostIngress(mattermost *mmv1beta.Matte
var desired *networkingv1.Ingress
desired = mattermostApp.GenerateIngressV1Beta(mattermost)

if mattermost.Spec.AWSLoadBalancerController.Enable {
if mattermost.Spec.AWSLoadBalancerController.Enabled {
desired = mattermostApp.GenerateALBIngressV1Beta(mattermost)
}

Expand Down
10 changes: 6 additions & 4 deletions pkg/mattermost/mattermost_v1beta.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ func GenerateServiceV1Beta(mattermost *mmv1beta.Mattermost) *corev1.Service {
"service.alpha.kubernetes.io/tolerate-unready-endpoints": "true",
}

if mattermost.Spec.AWSLoadBalancerController.Enable {
// Create a NodePort service because the ALB requires it
service := newServiceV1Beta(mattermost, mergeStringMaps(baseAnnotations, mattermost.Spec.ServiceAnnotations))
return configureMattermostServiceNodePort(service)
if mattermost.Spec.AWSLoadBalancerController != nil {
if mattermost.Spec.AWSLoadBalancerController.Enabled {
// Create a NodePort service because the ALB requires it
service := newServiceV1Beta(mattermost, mergeStringMaps(baseAnnotations, mattermost.Spec.ServiceAnnotations))
return configureMattermostServiceNodePort(service)
}
}

if mattermost.Spec.UseServiceLoadBalancer {
Expand Down

0 comments on commit 16b8777

Please sign in to comment.