Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove symlink to crd file in kubernetes e2e test data #10388

Merged
merged 8 commits into from
Nov 22, 2024
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
6 changes: 6 additions & 0 deletions changelog/v1.18.0-rc2/remove-manifest-symlink.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
changelog:
- type: NON_USER_FACING
issueLink: https://github.com/solo-io/solo-projects/issues/7255
resolvesIssue: false
description: >-
Remove `tcproute-crd.yaml` symlink and get the crd location from the crd package.
18 changes: 18 additions & 0 deletions projects/gateway2/crds/crds.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,25 @@ package crds

import (
_ "embed"
"path"
"path/filepath"
"runtime"
)

//go:embed gateway-crds.yaml
var GatewayCrds []byte

func getDirectory() string {
_, filename, _, _ := runtime.Caller(0)
return path.Dir(filename)
}

// directory is the absolute path to the directory containing the crd files
// It can't change at runtime, so we can cache it
var directory = getDirectory()

// AbsPathToCrd returns the absolute path to directory in which crds are stored (currently the same directory as this file)
// Used for tests to find the crd files if needed
func AbsPathToCrd(crdFile string) string {
return filepath.Join(directory, crdFile)
}

This file was deleted.

3 changes: 2 additions & 1 deletion test/kubernetes/e2e/features/services/httproute/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/solo-io/skv2/codegen/util"

"github.com/onsi/gomega/gstruct"
"github.com/solo-io/gloo/projects/gateway2/crds"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -17,7 +18,7 @@ import (
var (
routeWithServiceManifest = filepath.Join(util.MustGetThisDir(), "testdata", "route-with-service.yaml")
serviceManifest = filepath.Join(util.MustGetThisDir(), "testdata", "service-for-route.yaml")
tcpRouteCrdManifest = filepath.Join(util.MustGetThisDir(), "testdata", "tcproute-crd.yaml")
tcpRouteCrdManifest = filepath.Join(crds.AbsPathToCrd("tcproute-crd.yaml"))

// Proxy resource to be translated
glooProxyObjectMeta = metav1.ObjectMeta{
Expand Down
Loading