Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,8 @@ func buildKonnectivityServerContainer(image string, serverCount int, cipherSuite
cpath(konnectivityVolumeServerCerts().Name, corev1.TLSPrivateKeyKey),
"--server-ca-cert",
cpath(kasVolumeKonnectivityCA().Name, certs.CASignerCertMapKey),
"--cluster-ca-cert",
cpath(kasVolumeKonnectivityCA().Name, certs.CASignerCertMapKey),
"--server-port",
strconv.Itoa(KonnectivityServerLocalPort),
"--agent-port",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
package kas

import (
"slices"
"testing"

. "github.com/onsi/gomega"

hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1"
"github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/manifests"
"github.com/openshift/hypershift/support/config"
"github.com/openshift/hypershift/support/util"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func TestKonnectivityServerAuthenticatesAgents(t *testing.T) {
t.Parallel()
g := NewWithT(t)

c := util.BuildContainer(konnectivityServerContainer(), buildKonnectivityServerContainer("test-image", 3, nil))

clusterCAFlagIndex := slices.Index(c.Args, "--cluster-ca-cert")
if clusterCAFlagIndex == -1 || clusterCAFlagIndex+1 >= len(c.Args) {
t.Fatal("--cluster-ca-cert flag or its value not found in konnectivity-server args")
}
g.Expect(c.Args[clusterCAFlagIndex+1]).To(Equal("/etc/konnectivity/ca/ca.crt"))
}

// Ensure certain deployment fields do not get set
func TestReconcileKubeAPIServerDeploymentNoChanges(t *testing.T) {

Expand Down