Skip to content
This repository was archived by the owner on Feb 4, 2026. It is now read-only.
This repository was archived by the owner on Feb 4, 2026. It is now read-only.

Design K8sClient abstract interface that will abstract underlying calls #355

Description

The goal of this design is to create a proposal for a high level abstraction for use in writing tests against Kubernetes in Benchpress.

Parent: #353

Initial spike:

BeforeAll {
  Import-Module BenchPress.Kubernetes

}

Describe 'Verify Pods' {
  It "Should contain 5 pods, when a kubeconfig is explicitly provided" {
    # arrange
    $params = @{
      KubeConfigFile     = "<path>"
    }

    $pods = Get-Pods $params

    # act and assert
    $pods.length | Should -Be 5
  }

  It "Should contain 5 pods, when the environment variable KUBECONFIG is set" {
    # arrange
    $Env:KUBECONFIG = "<path to kubeconfig file"

    $pods = Get-Pods 

    # act and assert
    $pods.length | Should -Be 5
  }  

  It "Should contain 5 pods and use the default kubeconfig when no file or environment variable is set" {
    # arrange

    # should use the default kubeconfig
    $pods = Get-Pods 

    # act and assert
    $pods.length | Should -Be 5
  }    
}

AfterAll {
  Get-Module BenchPress.Kubernetes | Remove-Module
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions