Skip to content

feat(ske): support audit log configuration - #1578

Open
tobias-pfaffelmoser-ske wants to merge 9 commits into
stackitcloud:mainfrom
tobias-pfaffelmoser-ske:feat/ske-audit-logs
Open

feat(ske): support audit log configuration#1578
tobias-pfaffelmoser-ske wants to merge 9 commits into
stackitcloud:mainfrom
tobias-pfaffelmoser-ske:feat/ske-audit-logs

Conversation

@tobias-pfaffelmoser-ske

@tobias-pfaffelmoser-ske tobias-pfaffelmoser-ske commented Jul 10, 2026

Copy link
Copy Markdown

Description

Adds support for configuring SKE cluster audit log forwarding via a new optional
audit block on the stackit_ske_cluster resource (and as a read-only attribute
on the data source):

resource "stackit_ske_cluster" "example" {
  # ...
  audit = {
    enabled = true
  }
}

The audit.enabled flag is passed through to the SKE API (ske.Audit) on create/update and mapped back into state on read. This feature is in private preview and can only be enabled for accounts/projects that have been enabled for audit log forwarding to a Telemetry Router.

This also bumps the stackit-sdk-go/services/ske dependency to v1.19.0, which introduces the audit field.

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@tobias-pfaffelmoser-ske
tobias-pfaffelmoser-ske requested a review from a team as a code owner July 10, 2026 12:41
Comment thread stackit/internal/services/ske/cluster/resource.go Outdated
Comment thread stackit/internal/services/ske/cluster/resource.go Outdated
Comment thread stackit/internal/services/ske/cluster/resource.go

@rubenhoenle rubenhoenle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As written in the PR template checklist, the Acceptance tests / E2E tests need to be adjusted to include your new field: ske_acc_test.go

Min test

In the min test only required fields must be set in the test configuration.

Since your field is optional you only have to add checks that the new field has the correct default value.

func TestAccSKEMin(t *testing.T) {
resource.Test(t, resource.TestCase{
ProtoV6ProviderFactories: testutil.TestAccProtoV6ProviderFactories,
CheckDestroy: testAccCheckSKEDestroy,
Steps: []resource.TestStep{
// 1) Creation
{
Config: testutil.NewConfigBuilder().BuildProviderConfig() + "\n" + resourceMin,
ConfigVariables: testConfigVarsMin,
Check: resource.ComposeAggregateTestCheckFunc(
// cluster data
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "project_id", testutil.ConvertConfigVariable(testConfigVarsMin["project_id"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "name", testutil.ConvertConfigVariable(testConfigVarsMin["name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.0", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_availability_zone1"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.machine_type", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_machine_type"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.maximum", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_maximum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.minimum", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_minimum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.name", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_name"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "node_pools.0.os_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "kubernetes_version_min", testutil.ConvertConfigVariable(testConfigVarsMin["kubernetes_version_min"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_kubernetes_version_updates", testutil.ConvertConfigVariable(testConfigVarsMin["maintenance_enable_kubernetes_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_machine_image_version_updates", testutil.ConvertConfigVariable(testConfigVarsMin["maintenance_enable_machine_image_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.start", testutil.ConvertConfigVariable(testConfigVarsMin["maintenance_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(testConfigVarsMin["maintenance_end"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "region", testutil.ConvertConfigVariable(testConfigVarsMin["region"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "kubernetes_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "network.control_plane.access_scope", testutil.ConvertConfigVariable(testConfigVarsMin["network_control_plane_access_scope"])),
// Kubeconfig
resource.TestCheckResourceAttrPair(
"stackit_ske_kubeconfig.kubeconfig", "project_id",
"stackit_ske_cluster.cluster", "project_id",
),
resource.TestCheckResourceAttrPair(
"stackit_ske_kubeconfig.kubeconfig", "cluster_name",
"stackit_ske_cluster.cluster", "name",
),
// Access: resource-min does not define an access block, we expect idp: { enabled: false, type: stackit } here because of the default
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "access.idp.enabled", "false"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "access.idp.type", "stackit"),
),
},
// 2) Data source
{
Config: resourceMin,
ConfigVariables: testConfigVarsMin,
Check: resource.ComposeAggregateTestCheckFunc(
// cluster data
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "id", fmt.Sprintf("%s,%s,%s",
testutil.ConvertConfigVariable(testConfigVarsMin["project_id"]),
testutil.Region,
testutil.ConvertConfigVariable(testConfigVarsMin["name"]),
)),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.availability_zones.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.availability_zones.0", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_availability_zone1"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.machine_type", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_machine_type"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.maximum", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_maximum"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.minimum", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_minimum"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.name", testutil.ConvertConfigVariable(testConfigVarsMin["nodepool_name"])),
resource.TestCheckResourceAttrSet("data.stackit_ske_cluster.cluster", "kubernetes_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_kubernetes_version_updates", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_enable_kubernetes_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_machine_image_version_updates", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_enable_machine_image_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.start", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_end"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "region"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "network.control_plane.access_scope", testutil.ConvertConfigVariable(testConfigVarsMin["network_control_plane_access_scope"])),
),
},
// 3) Import cluster
{
ResourceName: "stackit_ske_cluster.cluster",
ConfigVariables: testConfigVarsMin,
ImportStateIdFunc: func(s *terraform.State) (string, error) {
r, ok := s.RootModule().Resources["stackit_ske_cluster.cluster"]
if !ok {
return "", fmt.Errorf("couldn't find resource stackit_ske_cluster.cluster")
}
_, ok = r.Primary.Attributes["project_id"]
if !ok {
return "", fmt.Errorf("couldn't find attribute project_id")
}
name, ok := r.Primary.Attributes["name"]
if !ok {
return "", fmt.Errorf("couldn't find attribute name")
}
return fmt.Sprintf("%s,%s,%s", testutil.ProjectId, testutil.Region, name), nil
},
ImportState: true,
ImportStateVerify: true,
// The fields are not provided in the SKE API when disabled, although set actively.
ImportStateVerifyIgnore: []string{"kubernetes_version_min", "node_pools.0.os_version_min", "extensions.observability.%", "extensions.observability.instance_id", "extensions.observability.enabled"},
},
// 4) Update kubernetes version, OS version and maintenance end, downgrade of kubernetes version
{
Config: resourceMin,
ConfigVariables: configVarsMinUpdated(),
ConfigPlanChecks: resource.ConfigPlanChecks{
PreApply: []plancheck.PlanCheck{
plancheck.ExpectResourceAction("stackit_ske_cluster.cluster", plancheck.ResourceActionUpdate),
},
},
Check: resource.ComposeAggregateTestCheckFunc(
// cluster data
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "project_id", testutil.ConvertConfigVariable(configVarsMinUpdated()["project_id"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "name", testutil.ConvertConfigVariable(configVarsMinUpdated()["name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.0", testutil.ConvertConfigVariable(configVarsMinUpdated()["nodepool_availability_zone1"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.machine_type", testutil.ConvertConfigVariable(configVarsMinUpdated()["nodepool_machine_type"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.maximum", testutil.ConvertConfigVariable(configVarsMinUpdated()["nodepool_maximum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.minimum", testutil.ConvertConfigVariable(configVarsMinUpdated()["nodepool_minimum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.name", testutil.ConvertConfigVariable(configVarsMinUpdated()["nodepool_name"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "node_pools.0.os_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "kubernetes_version_min", testutil.ConvertConfigVariable(configVarsMinUpdated()["kubernetes_version_min"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_kubernetes_version_updates", testutil.ConvertConfigVariable(configVarsMinUpdated()["maintenance_enable_kubernetes_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_machine_image_version_updates", testutil.ConvertConfigVariable(configVarsMinUpdated()["maintenance_enable_machine_image_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.start", testutil.ConvertConfigVariable(configVarsMinUpdated()["maintenance_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(configVarsMinUpdated()["maintenance_end"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "region", testutil.ConvertConfigVariable(configVarsMinUpdated()["region"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "kubernetes_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "network.control_plane.access_scope", testutil.ConvertConfigVariable(configVarsMinUpdated()["network_control_plane_access_scope"])),
// Kubeconfig
resource.TestCheckResourceAttrPair(
"stackit_ske_kubeconfig.kubeconfig", "project_id",
"stackit_ske_cluster.cluster", "project_id",
),
resource.TestCheckResourceAttrPair(
"stackit_ske_kubeconfig.kubeconfig", "cluster_name",
"stackit_ske_cluster.cluster", "name",
),
),
},
// Deletion is done by the framework implicitly
},
})
}

Max test

For the Max test you have to add your field to the Terraform config:

resource "stackit_ske_cluster" "cluster" {
project_id = var.project_id
name = var.name
node_pools = [{
availability_zones = [var.nodepool_availability_zone1]
machine_type = var.nodepool_machine_type
maximum = var.nodepool_maximum
minimum = var.nodepool_minimum
name = var.nodepool_name
allow_system_components = var.nodepool_allow_system_components
cri = var.nodepool_cri
labels = {
"label_key" = var.nodepool_label_value
}
max_surge = var.nodepool_max_surge
max_unavailable = var.nodepool_max_unavailable
os_name = var.nodepool_os_name
os_version_min = var.nodepool_os_version_min
taints = [{
effect = var.nodepool_taints_effect
key = var.nodepool_taints_key
value = var.nodepool_taints_value
}]
volume_size = var.nodepool_volume_size
volume_type = var.nodepool_volume_type
}
]
extensions = {
acl = {
enabled = var.ext_acl_enabled
allowed_cidrs = [var.ext_acl_allowed_cidr1]
}
observability = {
enabled = var.ext_observability_enabled
}
dns = {
enabled = var.ext_dns_enabled
zones = [stackit_dns_zone.dns-zone.dns_name]
}
}
hibernations = [{
start = var.nodepool_hibernations1_start
end = var.nodepool_hibernations1_end
timezone = var.nodepool_hibernations1_timezone
}]
kubernetes_version_min = var.kubernetes_version_min
maintenance = {
enable_kubernetes_version_updates = var.maintenance_enable_kubernetes_version_updates
enable_machine_image_version_updates = var.maintenance_enable_machine_image_version_updates
start = var.maintenance_start
end = var.maintenance_end
}
region = var.region
network = {
control_plane = {
access_scope = var.network_control_plane_access_scope
}
}
access = {
idp = {
enabled = var.access_idp_enabled
type = "stackit"
}
}
}

Afterwards add a new variable for your field:

var testConfigVarsMax = config.Variables{
"project_id": config.StringVariable(testutil.ProjectId),
"name": config.StringVariable(maxTestName),
"nodepool_availability_zone1": config.StringVariable(fmt.Sprintf("%s-1", testutil.Region)),
"nodepool_machine_type": config.StringVariable("g2i.2"),
"nodepool_minimum": config.StringVariable("1"),
"nodepool_maximum": config.StringVariable("2"),
"nodepool_name": config.StringVariable("np-acc-test"),
"nodepool_allow_system_components": config.StringVariable("true"),
"nodepool_cri": config.StringVariable("containerd"),
"nodepool_label_value": config.StringVariable("value"),
"nodepool_max_surge": config.StringVariable("1"),
"nodepool_max_unavailable": config.StringVariable("1"),
"nodepool_os_name": config.StringVariable(skeProviderOptions.nodePoolOsName),
"nodepool_os_version_min": config.StringVariable(skeProviderOptions.GetCreateMachineVersion()),
"nodepool_taints_effect": config.StringVariable("PreferNoSchedule"),
"nodepool_taints_key": config.StringVariable("tkey"),
"nodepool_taints_value": config.StringVariable("tvalue"),
"nodepool_volume_size": config.StringVariable("20"),
"nodepool_volume_type": config.StringVariable("storage_premium_perf0"),
"ext_acl_enabled": config.StringVariable("true"),
"ext_acl_allowed_cidr1": config.StringVariable("10.0.100.0/24"),
"ext_observability_enabled": config.StringVariable("false"),
"ext_dns_enabled": config.StringVariable("true"),
"nodepool_hibernations1_start": config.StringVariable("0 18 * * *"),
"nodepool_hibernations1_end": config.StringVariable("59 23 * * *"),
"nodepool_hibernations1_timezone": config.StringVariable("Europe/Berlin"),
"kubernetes_version_min": config.StringVariable(skeProviderOptions.GetCreateK8sVersion()),
"maintenance_enable_machine_image_version_updates": config.StringVariable("true"),
"maintenance_enable_kubernetes_version_updates": config.StringVariable("true"),
"maintenance_start": config.StringVariable("02:00:00+01:00"),
"maintenance_end": config.StringVariable("04:00:00+01:00"),
"region": config.StringVariable(testutil.Region),
"expiration": config.StringVariable("3600"),
"refresh": config.StringVariable("true"),
"refresh_before": config.StringVariable("600"),
"dns_zone_name": config.StringVariable("acc-" + acctest.RandStringFromCharSet(6, acctest.CharSetAlpha)),
"dns_name": config.StringVariable("acc-" + acctest.RandStringFromCharSet(6, acctest.CharSetAlpha) + ".runs.onstackit.cloud"),
"network_control_plane_access_scope": config.StringVariable("PUBLIC"),
"access_idp_enabled": config.BoolVariable(true),
}

Also update the field to test not only the create operation but also the update operation:

func configVarsMaxUpdated() config.Variables {
updatedConfig := maps.Clone(testConfigVarsMax)
updatedConfig["kubernetes_version_min"] = config.StringVariable(skeProviderOptions.GetUpdateK8sVersion())
updatedConfig["nodepool_os_version_min"] = config.StringVariable(skeProviderOptions.GetUpdateMachineVersion())
updatedConfig["maintenance_end"] = config.StringVariable("03:03:03+00:00")
updatedConfig["access_idp_enabled"] = config.BoolVariable(false)
return updatedConfig
}

Then add the checks for your new field to the text steps:

func TestAccSKEMax(t *testing.T) {
resource.Test(t, resource.TestCase{
ProtoV6ProviderFactories: testutil.TestAccProtoV6ProviderFactories,
CheckDestroy: testAccCheckSKEDestroy,
Steps: []resource.TestStep{
// 1) Creation
{
Config: testutil.NewConfigBuilder().BuildProviderConfig() + "\n" + resourceMax,
ConfigVariables: testConfigVarsMax,
Check: resource.ComposeAggregateTestCheckFunc(
// cluster data
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "project_id", testutil.ConvertConfigVariable(testConfigVarsMax["project_id"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "name", testutil.ConvertConfigVariable(testConfigVarsMax["name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.0", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_availability_zone1"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.machine_type", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_machine_type"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.maximum", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_maximum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.minimum", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_minimum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.name", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.allow_system_components", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_allow_system_components"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.cri", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_cri"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.labels.label_key", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_label_value"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.max_surge", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_max_surge"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.max_unavailable", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_max_unavailable"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.os_name", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_os_name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.os_version_min", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_os_version_min"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "node_pools.0.os_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.0.effect", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_taints_effect"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.0.key", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_taints_key"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.0.value", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_taints_value"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.volume_size", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_volume_size"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.volume_type", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_volume_type"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.acl.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["ext_acl_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.acl.allowed_cidrs.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.acl.allowed_cidrs.0", testutil.ConvertConfigVariable(testConfigVarsMax["ext_acl_allowed_cidr1"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.observability.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["ext_observability_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.dns.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["ext_dns_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.dns.zones.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.dns.zones.0", testutil.ConvertConfigVariable(testConfigVarsMax["dns_name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.0.start", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_hibernations1_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.0.end", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_hibernations1_end"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.0.timezone", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_hibernations1_timezone"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "kubernetes_version_min", testutil.ConvertConfigVariable(testConfigVarsMax["kubernetes_version_min"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_kubernetes_version_updates", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_enable_kubernetes_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_machine_image_version_updates", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_enable_machine_image_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.start", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_end"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "region", testutil.ConvertConfigVariable(testConfigVarsMax["region"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "egress_address_ranges.#", "1"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "egress_address_ranges.0"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "pod_address_ranges.#", "1"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "pod_address_ranges.0"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "service_account_issuer"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "kubernetes_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "network.control_plane.access_scope", testutil.ConvertConfigVariable(testConfigVarsMax["network_control_plane_access_scope"])),
// Access
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "access.idp.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["access_idp_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "access.idp.type", "stackit"),
// Kubeconfig
resource.TestCheckResourceAttrPair(
"stackit_ske_kubeconfig.kubeconfig", "project_id",
"stackit_ske_cluster.cluster", "project_id",
),
resource.TestCheckResourceAttrPair(
"stackit_ske_kubeconfig.kubeconfig", "cluster_name",
"stackit_ske_cluster.cluster", "name",
),
resource.TestCheckResourceAttr("stackit_ske_kubeconfig.kubeconfig", "expiration", testutil.ConvertConfigVariable(testConfigVarsMax["expiration"])),
resource.TestCheckResourceAttr("stackit_ske_kubeconfig.kubeconfig", "refresh", testutil.ConvertConfigVariable(testConfigVarsMax["refresh"])),
resource.TestCheckResourceAttr("stackit_ske_kubeconfig.kubeconfig", "refresh_before", testutil.ConvertConfigVariable(testConfigVarsMax["refresh_before"])),
resource.TestCheckResourceAttrSet("stackit_ske_kubeconfig.kubeconfig", "expires_at"),
),
},
// 2) Data source
{
Config: resourceMax,
ConfigVariables: testConfigVarsMax,
Check: resource.ComposeAggregateTestCheckFunc(
// cluster data
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "id", fmt.Sprintf("%s,%s,%s",
testutil.ConvertConfigVariable(testConfigVarsMax["project_id"]),
testutil.Region,
testutil.ConvertConfigVariable(testConfigVarsMax["name"]),
)),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.availability_zones.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.availability_zones.0", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_availability_zone1"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.machine_type", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_machine_type"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.maximum", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_maximum"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.minimum", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_minimum"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.name", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_name"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.allow_system_components", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_allow_system_components"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.cri", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_cri"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.labels.label_key", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_label_value"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.max_surge", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_max_surge"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.max_unavailable", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_max_unavailable"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.os_name", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_os_name"])),
resource.TestCheckResourceAttrSet("data.stackit_ske_cluster.cluster", "node_pools.0.os_version_used"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.taints.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.taints.0.effect", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_taints_effect"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.taints.0.key", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_taints_key"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.taints.0.value", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_taints_value"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.volume_size", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_volume_size"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "node_pools.0.volume_type", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_volume_type"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "extensions.acl.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["ext_acl_enabled"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "extensions.acl.allowed_cidrs.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "extensions.acl.allowed_cidrs.0", testutil.ConvertConfigVariable(testConfigVarsMax["ext_acl_allowed_cidr1"])),
// no check for observability, as it was disabled in the setup
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "extensions.dns.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["ext_dns_enabled"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "extensions.dns.zones.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "extensions.dns.zones.0", testutil.ConvertConfigVariable(testConfigVarsMax["dns_name"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "hibernations.#", "1"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "hibernations.0.start", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_hibernations1_start"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "hibernations.0.end", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_hibernations1_end"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "hibernations.0.timezone", testutil.ConvertConfigVariable(testConfigVarsMax["nodepool_hibernations1_timezone"])),
resource.TestCheckResourceAttrSet("data.stackit_ske_cluster.cluster", "kubernetes_version_used"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "maintenance.enable_kubernetes_version_updates", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_enable_kubernetes_version_updates"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "maintenance.enable_machine_image_version_updates", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_enable_machine_image_version_updates"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "maintenance.start", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_start"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(testConfigVarsMax["maintenance_end"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "region", testutil.ConvertConfigVariable(testConfigVarsMax["region"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "egress_address_ranges.#", "1"),
resource.TestCheckResourceAttrSet("data.stackit_ske_cluster.cluster", "egress_address_ranges.0"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "pod_address_ranges.#", "1"),
resource.TestCheckResourceAttrSet("data.stackit_ske_cluster.cluster", "pod_address_ranges.0"),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "network.control_plane.access_scope", testutil.ConvertConfigVariable(testConfigVarsMax["network_control_plane_access_scope"])),
resource.TestCheckResourceAttrSet("data.stackit_ske_cluster.cluster", "service_account_issuer"),
// Access
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "access.idp.enabled", testutil.ConvertConfigVariable(testConfigVarsMax["access_idp_enabled"])),
resource.TestCheckResourceAttr("data.stackit_ske_cluster.cluster", "access.idp.type", "stackit"),
),
},
// 3) Import cluster
{
ResourceName: "stackit_ske_cluster.cluster",
ConfigVariables: testConfigVarsMax,
ImportStateIdFunc: func(s *terraform.State) (string, error) {
r, ok := s.RootModule().Resources["stackit_ske_cluster.cluster"]
if !ok {
return "", fmt.Errorf("couldn't find resource stackit_ske_cluster.cluster")
}
_, ok = r.Primary.Attributes["project_id"]
if !ok {
return "", fmt.Errorf("couldn't find attribute project_id")
}
name, ok := r.Primary.Attributes["name"]
if !ok {
return "", fmt.Errorf("couldn't find attribute name")
}
return fmt.Sprintf("%s,%s,%s", testutil.ProjectId, testutil.Region, name), nil
},
ImportState: true,
ImportStateVerify: true,
// The fields are not provided in the SKE API when disabled, although set actively.
ImportStateVerifyIgnore: []string{"kubernetes_version_min", "node_pools.0.os_version_min", "extensions.observability.%", "extensions.observability.instance_id", "extensions.observability.enabled"},
},
// 4) Update kubernetes version, OS version and maintenance end, downgrade of kubernetes version, set access.idp.enabled to false
{
Config: resourceMax,
ConfigVariables: configVarsMaxUpdated(),
ConfigPlanChecks: resource.ConfigPlanChecks{
PreApply: []plancheck.PlanCheck{
plancheck.ExpectResourceAction("stackit_ske_cluster.cluster", plancheck.ResourceActionUpdate),
},
},
Check: resource.ComposeAggregateTestCheckFunc(
// cluster data
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "project_id", testutil.ConvertConfigVariable(configVarsMaxUpdated()["project_id"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "name", testutil.ConvertConfigVariable(configVarsMaxUpdated()["name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.availability_zones.0", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_availability_zone1"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.machine_type", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_machine_type"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.maximum", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_maximum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.minimum", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_minimum"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.name", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.allow_system_components", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_allow_system_components"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.cri", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_cri"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.labels.label_key", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_label_value"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.max_surge", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_max_surge"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.max_unavailable", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_max_unavailable"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.os_name", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_os_name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.os_version_min", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_os_version_min"])),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "node_pools.0.os_version_used"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.0.effect", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_taints_effect"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.0.key", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_taints_key"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.taints.0.value", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_taints_value"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.volume_size", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_volume_size"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "node_pools.0.volume_type", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_volume_type"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.acl.enabled", testutil.ConvertConfigVariable(configVarsMaxUpdated()["ext_acl_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.acl.allowed_cidrs.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.acl.allowed_cidrs.0", testutil.ConvertConfigVariable(configVarsMaxUpdated()["ext_acl_allowed_cidr1"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.observability.enabled", testutil.ConvertConfigVariable(configVarsMaxUpdated()["ext_observability_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.dns.enabled", testutil.ConvertConfigVariable(configVarsMaxUpdated()["ext_dns_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.dns.zones.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "extensions.dns.zones.0", testutil.ConvertConfigVariable(configVarsMaxUpdated()["dns_name"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.#", "1"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.0.start", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_hibernations1_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.0.end", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_hibernations1_end"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "hibernations.0.timezone", testutil.ConvertConfigVariable(configVarsMaxUpdated()["nodepool_hibernations1_timezone"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "kubernetes_version_min", testutil.ConvertConfigVariable(configVarsMaxUpdated()["kubernetes_version_min"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_kubernetes_version_updates", testutil.ConvertConfigVariable(configVarsMaxUpdated()["maintenance_enable_kubernetes_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.enable_machine_image_version_updates", testutil.ConvertConfigVariable(configVarsMaxUpdated()["maintenance_enable_machine_image_version_updates"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.start", testutil.ConvertConfigVariable(configVarsMaxUpdated()["maintenance_start"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "maintenance.end", testutil.ConvertConfigVariable(configVarsMaxUpdated()["maintenance_end"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "region", testutil.ConvertConfigVariable(configVarsMaxUpdated()["region"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "egress_address_ranges.#", "1"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "egress_address_ranges.0"),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "pod_address_ranges.#", "1"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "pod_address_ranges.0"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "kubernetes_version_used"),
resource.TestCheckResourceAttrSet("stackit_ske_cluster.cluster", "service_account_issuer"),
// Access
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "access.idp.enabled", testutil.ConvertConfigVariable(configVarsMaxUpdated()["access_idp_enabled"])),
resource.TestCheckResourceAttr("stackit_ske_cluster.cluster", "access.idp.type", "stackit"),
),
},
// Deletion is done by the framework implicitly
},
})
}

Comment thread stackit/internal/services/ske/ske_acc_test.go
Comment thread stackit/internal/services/ske/ske_acc_test.go

@rubenhoenle rubenhoenle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good besides that ✔️

@rubenhoenle

Copy link
Copy Markdown
Member

@tobias-pfaffelmoser-ske could you please resolve the conflicts so we can merge this? 😅

@rubenhoenle
rubenhoenle force-pushed the feat/ske-audit-logs branch from c24acbe to d79f5ff Compare August 7, 2026 11:23
rubenhoenle
rubenhoenle previously approved these changes Aug 7, 2026

@rubenhoenle rubenhoenle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased the PR and solved the conflicts. Please take care of this next time on your own @tobias-pfaffelmoser-ske .

cgoetz-inovex
cgoetz-inovex previously approved these changes Aug 7, 2026

@cgoetz-inovex cgoetz-inovex left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor cosmetic suggestions, but fine to be merged from my side, if time is an issue.
thx for your contrib

name string
input types.Object
want *ske.Audit
wantErr bool

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
wantErr bool

wantErr is never true

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adapted as suggested

Comment on lines +2493 to +2498
if err != nil && !tt.wantErr {
t.Fatalf("unexpected error: %v", err)
}
if err == nil && tt.wantErr {
t.Fatalf("expected error, but got none")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if err != nil && !tt.wantErr {
t.Fatalf("unexpected error: %v", err)
}
if err == nil && tt.wantErr {
t.Fatalf("expected error, but got none")
}
if err != nil {
t.Fatalf("unexpected error: %v", err)
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adapted as suggested

input *ske.Audit
stateAudit types.Object
want types.Object
wantErr bool

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
wantErr bool

same as above

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adapted as suggested

Comment on lines +2937 to +2942
if !tt.wantErr && err != nil {
t.Fatalf("unexpected error: %v", err)
}
if tt.wantErr && err == nil {
t.Fatalf("expected error, but got none")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if !tt.wantErr && err != nil {
t.Fatalf("unexpected error: %v", err)
}
if tt.wantErr && err == nil {
t.Fatalf("expected error, but got none")
}
if err != nil {
t.Fatalf("unexpected error: %v", err)
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adapted as suggested

@tobias-pfaffelmoser-ske

Copy link
Copy Markdown
Author

I rebased the PR and solved the conflicts. Please take care of this next time on your own @tobias-pfaffelmoser-ske .

Yes - sure. Wasn't able to handle last week due to vacation-absence. Just rebased the PR again.

@tobias-pfaffelmoser-ske

Copy link
Copy Markdown
Author

some minor cosmetic suggestions, but fine to be merged from my side, if time is an issue. thx for your contrib

@cgoetz-inovex Thx! I addressed your comments. Please re-check. Otherwise, fine to be merged from our side ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants