Skip to content

Commit

Permalink
Fix meta locations
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasjackson committed Mar 5, 2024
1 parent dccdba6 commit cbcf459
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 52 deletions.
14 changes: 7 additions & 7 deletions src/pages/docs/cli/test.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ Scenario: Single Container from Local Blueprint
| consul | container |
| envoy | sidecar |
| consul-container-http | ingress |
And a HTTP call to "http://consul.container.jumppad.dev:8500/v1/status/leader" should result in status 200
And a HTTP call to "http://consul-http.ingress.jumppad.dev:28500/v1/status/leader" should result in status 200
And a HTTP call to "http://consul.container.local.jmpd.in:8500/v1/status/leader" should result in status 200
And a HTTP call to "http://consul-http.ingress.local.jmpd.in:28500/v1/status/leader" should result in status 200
```

### Running Tests
Expand All @@ -85,8 +85,8 @@ Feature: Docker Container
| consul | container |
| envoy | sidecar |
| consul-container-http | ingress |
And a HTTP call to "http://consul.container.jumppad.dev:8500/v1/status/leader" should result in status 200 # test.go:277 -> *CucumberRunner
And a HTTP call to "http://consul-http.ingress.jumppad.dev:28500/v1/status/leader" should result in status 200 # test.go:277 -> *CucumberRunner
And a HTTP call to "http://consul.container.local.jmpd.in:8500/v1/status/leader" should result in status 200 # test.go:277 -> *CucumberRunner
And a HTTP call to "http://consul-http.ingress.local.jmpd.in:28500/v1/status/leader" should result in status 200 # test.go:277 -> *CucumberRunner
```

## Testing Statements
Expand Down Expand Up @@ -219,7 +219,7 @@ This statement allows you to make an HTTP request to a URI and to check the HTTP
```javascript
Scenario: Single Container from Local Blueprint
Given I have a running blueprint
Then a HTTP call to "http://consul-http.ingress.jumppad.dev:8500/v1/status/leader" should result in status 200
Then a HTTP call to "http://consul-http.ingress.local.jmpd.in:8500/v1/status/leader" should result in status 200
And the response body should contain "10.6.0.200"
```

Expand All @@ -230,7 +230,7 @@ In addition to check the HTTP status code you can also check that a paricular te
```javascript
Scenario: Single Container from Local Blueprint
Given I have a running blueprint
Then a HTTP call to "http://consul-http.ingress.jumppad.dev:8500/v1/status/leader" should result in status 200
Then a HTTP call to "http://consul-http.ingress.local.jmpd.in:8500/v1/status/leader" should result in status 200
And the response body should contain "10.6.0.200"
```

Expand Down Expand Up @@ -347,7 +347,7 @@ Scenario: Single Container from Local Blueprint with multiple runs
| consul | container |
| envoy | sidecar |
| consul-container-http | ingress |
And a HTTP call to "http://consul-http.ingress.jumppad.dev:8500/v1/status/leader" should result in status 200
And a HTTP call to "http://consul-http.ingress.local.jmpd.in:8500/v1/status/leader" should result in status 200
And the response body should contain "10.6.0.200"
Examples:
| consul | envoy |
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/resources/build/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ resource "container" "app" {
}
network {
id = resource.network.onprem.id
id = resource.network.onprem.meta.id
}
}
```
Expand Down
12 changes: 6 additions & 6 deletions src/pages/docs/resources/cert/certificate_leaf.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ Leaf Certificates have a pre-set Common Name corresponding to the name of the re
dns_names = [
"localhost",
"server.${variable.cd_consul_dc}.consul",
"1.consul.server.container.jumppad.dev",
"2.consul.server.container.jumppad.dev",
"3.consul.server.container.jumppad.dev"
"1.consul.server.container.local.jmpd.in",
"2.consul.server.container.local.jmpd.in",
"3.consul.server.container.local.jmpd.in"
]
```
</Property>
Expand Down Expand Up @@ -109,9 +109,9 @@ resource "certificate_leaf" "cd_consul_server" {
dns_names = [
"localhost",
"server.${var.cd_consul_dc}.consul",
"1.consul.server.container.jumppad.dev",
"2.consul.server.container.jumppad.dev",
"3.consul.server.container.jumppad.dev"
"1.consul.server.container.local.jmpd.in",
"2.consul.server.container.local.jmpd.in",
"3.consul.server.container.local.jmpd.in"
]
output = data("certs")
Expand Down
6 changes: 3 additions & 3 deletions src/pages/docs/resources/container/container.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ The `container` resource allows you to create Docker containers.
of the created Docker container.

```
name.container.jumppad.dev
name.container.local.jmpd.in
```
</Property>
</Properties>
Expand Down Expand Up @@ -362,7 +362,7 @@ The following example creates a container from an existing registry image.
```hcl
resource "container" "unique_name" {
network {
id = resource.network.cloud.id
id = resource.network.cloud.meta.id
ip_address = "10.16.0.203"
aliases = ["my_unique_name_ip_address"]
}
Expand All @@ -380,7 +380,7 @@ resource "container" "unique_name" {
depends_on = ["resource.container.another"]
network {
id = resource.network.cloud.id
id = resource.network.cloud.meta.id
ip_address = "10.16.0.200"
aliases = ["my_unique_name_ip_address"]
}
Expand Down
8 changes: 4 additions & 4 deletions src/pages/docs/resources/container/sidecar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ to the target container.
The id of a container to attach the sidecar to.

```hcl
resource.container.mine.id
resource.container.mine.meta.id
```
</Property>

Expand Down Expand Up @@ -175,7 +175,7 @@ to the target container.
of the created Docker container.

```
name.container.jumppad.dev
name.container.local.jmpd.in
```
</Property>
</Properties>
Expand Down Expand Up @@ -419,7 +419,7 @@ resource "container" "consul" {
}
network {
id = resource.network.onprem.id
id = resource.network.onprem.meta.id
ip_address = "10.6.0.200" // optional
aliases = ["myalias"]
}
Expand All @@ -441,7 +441,7 @@ resource "container" "consul" {
}
resource "sidecar" "envoy" {
target = resource.container.consul.id
target = resource.container.consul.meta.id
image {
name = "envoyproxy/envoy:v${variable.envoy_version}"
Expand Down
4 changes: 2 additions & 2 deletions src/pages/docs/resources/docs/docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Port from "../shared/port.mdx"
The docs resource allows you to embed documentation and guides into your blueprints.
The docs are authored in markdown and can be enriched using React components and html.

Once the docs resource is created, the content will be available at `http://<resource-name>.docs.jumppad.dev:3000`.
Once the docs resource is created, the content will be available at `http://<resource-name>.docs.local.jmpd.in:3000`.
</Intro>

## Properties
Expand Down Expand Up @@ -82,7 +82,7 @@ Logo defines a logo image to use in the docs.
```hcl
resource "docs" "docs" {
network {
id = resource.network.main.id
id = resource.network.main.meta.id
}
image {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/resources/exec/local_exec.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ resource "local_exec" "exec_standalone" {
]
environment = {
CONSUL_HTTP_ADDR = "http://consul.container.jumppad.dev:8500"
CONSUL_HTTP_ADDR = "http://consul.container.local.jmpd.in:8500"
}
timeout = "30s"
Expand Down
4 changes: 2 additions & 2 deletions src/pages/docs/resources/exec/remote_exec.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "remote_exec" "exec_standalone" {
}
network {
id = resource.network.local.id
id = resource.network.local.meta.id
}
command = [
Expand All @@ -52,7 +52,7 @@ resource "remote_exec" "exec_standalone" {

```hcl
resource "remote_exec" "exec_standalone" {
target = resource.container.consul.id
target = resource.container.consul.meta.id
command = [
"consul"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/resources/ingress/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ resource "ingress" "fake_service_1" {
port = 19090
target {
resource = resource.k8s_cluster.k3s.id
resource = resource.k8s_cluster.k3s.meta.id
port = 9090
config = {
Expand Down
8 changes: 7 additions & 1 deletion src/pages/docs/resources/internal/meta.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,14 @@ following properties.
<Property name="disabled" type="bool" required="false" value="false">
If set to false the resource will not be created.
</Property>

<Property name="meta" type="#meta" required="false" value="">
Metadata regarding the resource.
</Property>
</Properties>

### meta
<Properties>
<Property name="id" type="string" required="false" value="" readonly>
The unique `id` for the resource, this value can be used in interpolation
syntax to reference properties for a resource.
Expand All @@ -54,7 +61,6 @@ following properties.
ouput.myoutput
module.mine.submodule.resource.container.nic
module.mine.submodule.ouput.myoutput
```
</Property>

Expand Down
10 changes: 5 additions & 5 deletions src/pages/docs/resources/internal/module.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ All resources contained within a module are scoped to the name of the containing
module. For example, if a module `mine` contains a kubernetes cluster called `dev`
then the FQRN and the name within docker would be:

`server.dev.mine.k8s-cluster.jumppad.dev`
`server.dev.mine.k8s-cluster.local.jmpd.in`

Modules can also contain modules, to ensure that resouce references are unique
resources always take on the name of their module including any parent modules.

For example, if a module `mine` contains a kubernetes cluster called `dev` was
contained in module `parent`. Then the FQRN and the name within docker would be:

`server.dev.parent.mine.k8s-cluster.jumppad.dev`
`server.dev.parent.mine.k8s-cluster.local.jmpd.in`
</Intro>

## Properties
Expand All @@ -37,7 +37,7 @@ contained in module `parent`. Then the FQRN and the name within docker would be:

```hcl
variables = {
network_id = resource.network.cloud.id
network_id = resource.network.cloud.meta.id
consul_port = 18501
}
```
Expand All @@ -61,7 +61,7 @@ module "consul_dc1" {
source = "./module_k3s"
variables = {
network_id = resource.network.cloud.id
network_id = resource.network.cloud.meta.id
consul_port = 18500
}
}
Expand All @@ -74,7 +74,7 @@ module "consul_dc2" {
source = "./module_k3s"
variables = {
network_id = resource.network.cloud.id
network_id = resource.network.cloud.meta.id
consul_port = 18501
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/resources/internal/variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ resource "container" "consul" {
command = ["consul", "agent", "-dev"]
network {
id = resource.network.onprem.id
id = resource.network.onprem.meta.id
ip_address = "10.6.0.200"
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/pages/docs/resources/k8s/kubernetes_cluster.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ resource "network" "cloud" {
resource "k8s_cluster" "k3s" {
network {
id = resource.network.cloud.id
id = resource.network.cloud.meta.id
}
}
Expand All @@ -176,7 +176,7 @@ resource "k8s_cluster" "k3s" {
nodes = 1 // default
network {
id = resource.network.cloud.id
id = resource.network.cloud.meta.id
}
copy_image {
Expand All @@ -185,7 +185,7 @@ resource "k8s_cluster" "k3s" {
}
resource "k8s_config" "fake_service" {
cluster = resource.k8s_cluster.k3s.id
cluster = resource.k8s_cluster.k3s.meta.id
paths = ["./fake_service.yaml"]
Expand All @@ -196,7 +196,7 @@ resource "k8s_config" "fake_service" {
}
resource "helm" "vault" {
cluster = resource.k8s_cluster.k3s.id
cluster = resource.k8s_cluster.k3s.meta.id
repository {
name = "hashicorp"
Expand All @@ -218,7 +218,7 @@ resource "ingress" "vault_http" {
port = 18200
target {
id = resource.k8s_cluster.k3s.id
id = resource.k8s_cluster.k3s.meta.id
port = 8200
config = {
Expand All @@ -232,7 +232,7 @@ resource "ingress" "fake_service" {
port = 19090
target {
id = resource.k8s_cluster.k3s.id
id = resource.k8s_cluster.k3s.meta.id
port = 9090
config = {
Expand Down
8 changes: 4 additions & 4 deletions src/pages/docs/resources/nomad/nomad_cluster.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ resource "network" "cloud" {
}
resource "nomad_cluster" "dev" {
network {
id = resource.network.cloud.id
id = resource.network.cloud.meta.id
}
}
```
Expand All @@ -253,12 +253,12 @@ resource "nomad_cluster" "dev" {
client_nodes=3
network {
id = resource.network.cloud.id
id = resource.network.cloud.meta.id
}
}
resource "nomad_job" "example_1" {
cluster = resource.nomad_cluster.dev.id
cluster = resource.nomad_cluster.dev.meta.id
paths = ["./app_config/example1.nomad"]
Expand All @@ -272,7 +272,7 @@ resource "ingress" "fake_service_1" {
port = 19090
target {
id = resource.nomad_cluster.dev.id
id = resource.nomad_cluster.dev.meta.id
named_port = "http"
config = {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/docs/resources/nomad/nomad_job.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ health_check {
```hcl
resource "nomad_cluster" "dev" {
network {
id = resource.network.cloud.id
id = resource.network.cloud.meta.id
}
}
resource "nomad_job" "example" {
cluster = resource.nomad_cluster.dev.id
cluster = resource.nomad_cluster.dev.meta.id
paths = ["./app_config/example1.nomad"]
Expand Down
6 changes: 3 additions & 3 deletions src/pages/docs/resources/random/random_id.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ resource "random_id" "id" {
}
output "id_base64" {
value = resource.random_id.id.base64
value = resource.random_id.meta.id.base64
}
output "id_hex" {
value = resource.random_id.id.hex
value = resource.random_id.meta.id.hex
}
output "id_dec" {
value = resource.random_id.id.dec
value = resource.random_id.meta.id.dec
}
```
Loading

0 comments on commit cbcf459

Please sign in to comment.