Skip to content

Commit

Permalink
re-generate sources
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Hoß <[email protected]>
  • Loading branch information
sebhoss committed Sep 12, 2024
1 parent 8188e28 commit 57e6a0f
Show file tree
Hide file tree
Showing 12 changed files with 3,563 additions and 2 deletions.
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
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"
}
}
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
}
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
}
}

Large diffs are not rendered by default.

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)
}
}
2 changes: 2 additions & 0 deletions internal/provider/provider_data_sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -2324,6 +2324,8 @@ func allDataSources() []func() datasource.DataSource {
kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaMirrorMaker2V1Beta2Manifest,
// kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaMirrorMakerV1Beta2DataSource,
kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaMirrorMakerV1Beta2Manifest,
// kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaNodePoolV1Beta2DataSource,
kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaNodePoolV1Beta2Manifest,
// kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaRebalanceV1Beta2DataSource,
kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaRebalanceV1Beta2Manifest,
// kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaTopicV1Beta2DataSource,
Expand Down
1 change: 1 addition & 0 deletions internal/provider/provider_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,7 @@ func allResources() []func() resource.Resource {
//kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaConnectorV1Beta2Resource,
//kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaMirrorMaker2V1Beta2Resource,
//kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaMirrorMakerV1Beta2Resource,
//kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaNodePoolV1Beta2Resource,
//kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaRebalanceV1Beta2Resource,
//kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaTopicV1Beta2Resource,
//kafka_strimzi_io_v1beta2.NewKafkaStrimziIoKafkaUserV1Beta2Resource,
Expand Down
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 }}
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))
}
}
6 changes: 5 additions & 1 deletion terratests.mk

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion tests.mk

Large diffs are not rendered by default.

0 comments on commit 57e6a0f

Please sign in to comment.