-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,076 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
changelog: | ||
- type: NON_USER_FACING | ||
issueLink: https://github.com/solo-io/solo-projects/issues/6303 | ||
resolvesIssue: false | ||
description: >- | ||
Migrate test utilities from kube2e to facilitate test migration. | ||
skipCI-docs-build:true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package fsutils | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
// ToTempFile takes a string to write to a temp file. It returns the filename and an error. | ||
func ToTempFile(content string) (string, error) { | ||
f, err := os.CreateTemp("", "") | ||
if err != nil { | ||
return "", err | ||
} | ||
defer f.Close() | ||
|
||
n, err := f.WriteString(content) | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
if n != len(content) { | ||
return "", fmt.Errorf("expected to write %d bytes, actually wrote %d", len(content), n) | ||
} | ||
return f.Name(), nil | ||
} | ||
|
||
// IsDirectory checks the provided path is a directory by first checking something exists at that path | ||
// and then checking that it is a directory. | ||
func IsDirectory(dir string) bool { | ||
stat, err := os.Stat(dir) | ||
if err != nil { | ||
return false | ||
} | ||
return stat.IsDir() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: http-echo | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: http-echo | ||
namespace: http-echo | ||
spec: | ||
selector: | ||
app.kubernetes.io/name: http-echo | ||
ports: | ||
- protocol: TCP | ||
port: 3000 | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: http-echo | ||
namespace: http-echo | ||
labels: | ||
app.kubernetes.io/name: http-echo | ||
spec: | ||
containers: | ||
- name: http-echo | ||
image: kennship/http-echo@sha256:144322e8e96be2be6675dcf6e3ee15697c5d052d14d240e8914871a2a83990af | ||
ports: | ||
- containerPort: 3000 | ||
resources: | ||
requests: | ||
cpu: "100m" | ||
limits: | ||
cpu: "200m" |
Oops, something went wrong.