-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sebastian Hoß <[email protected]>
- Loading branch information
Showing
12 changed files
with
3,563 additions
and
2 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
.github/workflows/terratest-kafka_strimzi_io_kafka_node_pool_v1beta2_manifest.yml
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,40 @@ | ||
# SPDX-FileCopyrightText: The terraform-provider-k8s Authors | ||
# SPDX-License-Identifier: 0BSD | ||
|
||
name: KafkaStrimziIoKafkaNodePoolV1Beta2Manifest | ||
on: | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- examples/data-sources/k8s_kafka_strimzi_io_kafka_node_pool_v1beta2_manifest/** | ||
- internal/provider/kafka_strimzi_io_v1beta2/kafka_strimzi_io_kafka_node_pool_v1beta2_manifest.go | ||
- internal/provider/kafka_strimzi_io_v1beta2/kafka_strimzi_io_kafka_node_pool_v1beta2_manifest_test.go | ||
- terratest/kafka_strimzi_io_v1beta2/kafka_strimzi_io_kafka_node_pool_v1beta2_manifest_test.go | ||
jobs: | ||
terraform: | ||
name: Test with Terraform | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: checkout | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- id: setup_go | ||
name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
cache: true | ||
- id: setup_terraform | ||
name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v3 | ||
with: | ||
terraform_wrapper: false | ||
- id: install | ||
name: Install Provider | ||
run: make install | ||
- id: tests | ||
name: Run Unit Tests | ||
run: go test -v -timeout=120s -count=1 ./internal/provider/kafka_strimzi_io_v1beta2/kafka_strimzi_io_kafka_node_pool_v1beta2_manifest_test.go | ||
- id: terratest | ||
name: Run Terratest Tests | ||
run: go test -v -timeout=120s -count=1 -run TestKafkaStrimziIoKafkaNodePoolV1Beta2Manifest ./terratest/kafka_strimzi_io_v1beta2 |
6 changes: 6 additions & 0 deletions
6
examples/data-sources/k8s_kafka_strimzi_io_kafka_node_pool_v1beta2_manifest/data-source.tf
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,6 @@ | ||
data "k8s_kafka_strimzi_io_kafka_node_pool_v1beta2_manifest" "example" { | ||
metadata = { | ||
name = "some-name" | ||
namespace = "some-namespace" | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
examples/data-sources/k8s_kafka_strimzi_io_kafka_node_pool_v1beta2_manifest/main.tf
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,12 @@ | ||
terraform { | ||
required_providers { | ||
k8s = { | ||
source = "localhost/metio/k8s" | ||
version = "9999.99.99" | ||
} | ||
} | ||
} | ||
|
||
provider "k8s" { | ||
offline = true | ||
} |
5 changes: 5 additions & 0 deletions
5
examples/data-sources/k8s_kafka_strimzi_io_kafka_node_pool_v1beta2_manifest/outputs.tf
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,5 @@ | ||
output "manifests" { | ||
value = { | ||
"example" = data.k8s_kafka_strimzi_io_kafka_node_pool_v1beta2_manifest.example.yaml | ||
} | ||
} |
3,401 changes: 3,401 additions & 0 deletions
3,401
...al/provider/kafka_strimzi_io_v1beta2/kafka_strimzi_io_kafka_node_pool_v1beta2_manifest.go
Large diffs are not rendered by default.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
...ovider/kafka_strimzi_io_v1beta2/kafka_strimzi_io_kafka_node_pool_v1beta2_manifest_test.go
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,31 @@ | ||
/* | ||
* SPDX-FileCopyrightText: The terraform-provider-k8s Authors | ||
* SPDX-License-Identifier: 0BSD | ||
*/ | ||
|
||
package kafka_strimzi_io_v1beta2_test | ||
|
||
import ( | ||
"context" | ||
fwdatasource "github.com/hashicorp/terraform-plugin-framework/datasource" | ||
"github.com/metio/terraform-provider-k8s/internal/provider/kafka_strimzi_io_v1beta2" | ||
"testing" | ||
) | ||
|
||
func TestKafkaStrimziIoKafkaNodePoolV1Beta2Manifest_ValidateSchema(t *testing.T) { | ||
ctx := context.Background() | ||
schemaRequest := fwdatasource.SchemaRequest{} | ||
schemaResponse := &fwdatasource.SchemaResponse{} | ||
|
||
kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaNodePoolV1Beta2Manifest().Schema(ctx, schemaRequest, schemaResponse) | ||
|
||
if schemaResponse.Diagnostics.HasError() { | ||
t.Fatalf("Schema method diagnostics: %+v", schemaResponse.Diagnostics) | ||
} | ||
|
||
diagnostics := schemaResponse.Schema.ValidateImplementation(ctx) | ||
|
||
if diagnostics.HasError() { | ||
t.Fatalf("Schema validation diagnostics: %+v", diagnostics) | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
templates/data-sources/kafka_strimzi_io_kafka_node_pool_v1beta2_manifest.md.tmpl
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,19 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" | ||
subcategory: "kafka.strimzi.io" | ||
description: |- | ||
{{ .Description | plainmarkdown | trimspace | prefixlines " " }} | ||
--- | ||
|
||
# {{.Name}} ({{.Type}}) | ||
|
||
{{ .Description | trimspace }} | ||
|
||
{{ if .HasExample -}} | ||
## Example Usage | ||
|
||
{{ tffile (printf "examples/data-sources/%s/data-source.tf" .Name)}} | ||
{{- end }} | ||
|
||
{{ .SchemaMarkdown | trimspace }} |
36 changes: 36 additions & 0 deletions
36
terratest/kafka_strimzi_io_v1beta2/kafka_strimzi_io_kafka_node_pool_v1beta2_manifest_test.go
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,36 @@ | ||
/* | ||
* SPDX-FileCopyrightText: The terraform-provider-k8s Authors | ||
* SPDX-License-Identifier: 0BSD | ||
*/ | ||
|
||
package kafka_strimzi_io_v1beta2 | ||
|
||
import ( | ||
"fmt" | ||
"github.com/gruntwork-io/terratest/modules/terraform" | ||
"github.com/stretchr/testify/assert" | ||
"os" | ||
"testing" | ||
) | ||
|
||
func TestKafkaStrimziIoKafkaNodePoolV1Beta2Manifest(t *testing.T) { | ||
path := "../../examples/data-sources/k8s_kafka_strimzi_io_kafka_node_pool_v1beta2_manifest" | ||
|
||
terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ | ||
TerraformDir: path, | ||
NoColor: true, | ||
}) | ||
|
||
defer os.RemoveAll(path + "/.terraform.lock.hcl") | ||
defer os.RemoveAll(path + "/terraform.tfstate") | ||
defer os.RemoveAll(path + "/terraform.tfstate.backup") | ||
defer os.RemoveAll(path + "/.terraform") | ||
|
||
defer terraform.Destroy(t, terraformOptions) | ||
terraform.InitAndApplyAndIdempotent(t, terraformOptions) | ||
|
||
outputMap := terraform.OutputMap(t, terraformOptions, "manifests") | ||
for key, value := range outputMap { | ||
assert.NotEmpty(t, value, fmt.Sprintf("data %s.%s did not produce an output", "k8s_kafka_strimzi_io_kafka_node_pool_v1beta2_manifest", key)) | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.