Files
netbird-kubernetes-operator/internal/version/version_test.go
T
Philip LaineandGitHub 5dd73dcc80 Add new resource for Kubernetes API proxy (#279)
This adds a new resource which deploys a Kubernetes API server proxy
that can be used to access the API server without tokens through
Netbird.

Part of #274 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added ClusterProxy custom resource for cluster API proxying
capabilities

* **Documentation**
  * Added ClusterProxy API reference documentation with schema details

* **Examples**
* Added example ClusterProxy configuration and RBAC setup for cluster
proxy targets

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/netbirdio/kubernetes-operator/pull/279?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-01 11:41:48 +02:00

35 lines
789 B
Go

// SPDX-License-Identifier: BSD-3-Clause
package version
import (
"os"
"slices"
"strings"
"testing"
"golang.org/x/mod/modfile"
"github.com/go-openapi/testify/v2/require"
)
func TestNetbirdClientImage(t *testing.T) {
t.Parallel()
b, err := os.ReadFile("../../go.mod")
require.NoError(t, err)
f, err := modfile.Parse("go.mod", b, nil)
require.NoError(t, err)
idx := slices.IndexFunc(f.Require, func(r *modfile.Require) bool {
return r.Mod.Path == "github.com/netbirdio/netbird"
})
require.GreaterT(t, idx, -1)
modVersion := strings.TrimPrefix(f.Require[idx].Mod.Version, "v")
start := strings.Index(NetbirdClientImage, ":") + 1
end := strings.Index(NetbirdClientImage, "@")
imgVersion := NetbirdClientImage[start:end]
require.EqualT(t, modVersion, imgVersion)
}