Skip to content

Commit

Permalink
Revert manifest change
Browse files Browse the repository at this point in the history
  • Loading branch information
zalbiraw committed Apr 24, 2024
1 parent 2fbbf6f commit 9530368
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 55 deletions.
58 changes: 29 additions & 29 deletions modules/tests/httpbin/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,37 @@ terraform {
}
}

resource "kubectl_manifest" "httpbin-configmap" {
yaml_body = <<YAML
apiVersion: v1
kind: ConfigMap
metadata:
name: "httpbin-${var.name}-configmap"
namespace: ${var.name}
data:
httpbin.js: |
import http from 'k6/http';
resource "kubernetes_config_map" "httpbin-configmap" {
metadata {
name = "httpbin-${var.name}-configmap"
namespace = var.name
}

export const options = {
discardResponseBodies: true,
scenarios: {
success: {
executor: 'constant-vus',
exec: 'success',
vus: 50,
duration: '15m',
}
}
};
data = {
"httpbin.js" = <<EOF
import http from 'k6/http';
function sendStatus(status) {
http.get('http://${var.url}/httpbin/status/' + status);
export const options = {
discardResponseBodies: true,
scenarios: {
success: {
executor: 'constant-vus',
exec: 'success',
vus: 50,
duration: '15m',
}
}
};
export function success() {
sendStatus(200);
}
YAML
function sendStatus(status) {
http.get('http://${var.url}/httpbin/status/' + status);
}
export function success() {
sendStatus(200);
}
EOF
}
}

resource "kubectl_manifest" "httpbin" {
Expand Down Expand Up @@ -95,5 +95,5 @@ spec:
file: httpbin.js
YAML

depends_on = [kubectl_manifest.httpbin-configmap]
}
depends_on = [kubernetes_config_map.httpbin-configmap]
}
52 changes: 26 additions & 26 deletions modules/tests/timestamp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,33 @@ terraform {
}
}

resource "kubectl_manifest" "timestamp-configmap" {
yaml_body = <<YAML
apiVersion: v1
kind: ConfigMap
metadata:
name: "timestamp-${var.name}-configmap"
namespace: ${var.name}
data:
timestamp.js: |
import http from 'k6/http';
resource "kubernetes_config_map" "timestamp-configmap" {
metadata {
name = "timestamp-${var.name}-configmap"
namespace = var.name
}

export const options = {
discardResponseBodies: true,
scenarios: {
success: {
executor: 'constant-vus',
exec: 'get',
vus: 50,
duration: '15m',
}
}
};
data = {
"timestamp.js" = <<EOF
import http from 'k6/http';
export function get() {
http.get('http://${var.url}/timestamp/json');
export const options = {
discardResponseBodies: true,
scenarios: {
success: {
executor: 'constant-vus',
exec: 'get',
vus: 50,
duration: '15m',
}
YAML
}
};
export function get() {
http.get('http://${var.url}/timestamp/json');
}
EOF
}
}

resource "kubectl_manifest" "timestamp" {
Expand Down Expand Up @@ -91,5 +91,5 @@ spec:
file: timestamp.js
YAML

depends_on = [kubectl_manifest.timestamp-configmap]
}
depends_on = [kubernetes_config_map.timestamp-configmap]
}

0 comments on commit 9530368

Please sign in to comment.