-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force payer service to use 1 replica (#19)
Force the helm charts to only ever run 1 replica. Some drive-by test cleanup.
- Loading branch information
Showing
9 changed files
with
143 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ type: application | |
maintainers: | ||
- name: XMTPD | ||
version: 0.1.0 | ||
appVersion: "v0.1.1" | ||
appVersion: "v0.1.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ type: application | |
maintainers: | ||
- name: XMTPD | ||
version: 0.1.0 | ||
appVersion: "v0.1.1" | ||
appVersion: "v0.1.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
package testlib | ||
|
||
import ( | ||
"fmt" | ||
"github.com/gruntwork-io/terratest/modules/helm" | ||
appsv1 "k8s.io/api/apps/v1" | ||
corev1 "k8s.io/api/core/v1" | ||
netv1 "k8s.io/api/networking/v1" | ||
"strings" | ||
"testing" | ||
) | ||
|
||
func ExtractIngressE(t *testing.T, output string) *netv1.Ingress { | ||
parts := strings.Split(output, "---") | ||
for _, part := range parts { | ||
if len(part) == 0 { | ||
continue | ||
} | ||
|
||
if !strings.Contains(part, "kind: Ingress") { | ||
continue | ||
} | ||
|
||
var object netv1.Ingress | ||
helm.UnmarshalK8SYaml(t, part, &object) | ||
|
||
return &object | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func ExtractIngress(t *testing.T, output string) *netv1.Ingress { | ||
ingress := ExtractIngressE(t, output) | ||
|
||
if ingress == nil { | ||
t.Fatalf("Could not extract ingress from template") | ||
} | ||
|
||
return ingress | ||
} | ||
|
||
func ExtractNamedSecretE(t *testing.T, output string, secretName string) *corev1.Secret { | ||
parts := strings.Split(output, "---") | ||
for _, part := range parts { | ||
if len(part) == 0 { | ||
continue | ||
} | ||
|
||
if !strings.Contains(part, "kind: Secret") { | ||
continue | ||
} | ||
|
||
if !strings.Contains(part, fmt.Sprintf("name: %s", secretName)) { | ||
continue | ||
} | ||
|
||
var object corev1.Secret | ||
helm.UnmarshalK8SYaml(t, part, &object) | ||
|
||
return &object | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func ExtractDeploymentE(t *testing.T, output string, deploymentName string) *appsv1.Deployment { | ||
parts := strings.Split(output, "---") | ||
for _, part := range parts { | ||
if len(part) == 0 { | ||
continue | ||
} | ||
|
||
if !strings.Contains(part, "kind: Deployment") { | ||
continue | ||
} | ||
|
||
if !strings.Contains(part, fmt.Sprintf("name: %s", deploymentName)) { | ||
continue | ||
} | ||
|
||
var object appsv1.Deployment | ||
helm.UnmarshalK8SYaml(t, part, &object) | ||
|
||
return &object | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func ExtractDeployment(t *testing.T, output string, deploymentName string) *appsv1.Deployment { | ||
deployment := ExtractDeploymentE(t, output, deploymentName) | ||
|
||
if deployment == nil { | ||
t.Fatalf("Could not extract deployment from template") | ||
} | ||
|
||
return deployment | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters