Skip to content

Commit

Permalink
move tests to gh actions (kubernetes#9461)
Browse files Browse the repository at this point in the history
  • Loading branch information
rikatz authored and jaehnri committed Jan 2, 2023
1 parent 2295dab commit 4d5303f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ test: ## Run go unit tests.
COMMIT_SHA=$(COMMIT_SHA) \
REPO_INFO=$(REPO_INFO) \
TAG=$(TAG) \
GOFLAGS="-buildvcs=false" \
test/test.sh

.PHONY: lua-test
Expand Down
3 changes: 2 additions & 1 deletion internal/ingress/annotations/authreq/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ func ValidHeader(header string) bool {
// ValidCacheDuration checks if the provided string is a valid cache duration
// spec: [code ...] [time ...];
// with: code is an http status code
// time must match the time regex and may appear multiple times, e.g. `1h 30m`
//
// time must match the time regex and may appear multiple times, e.g. `1h 30m`
func ValidCacheDuration(duration string) bool {
elements := strings.Split(duration, " ")
seenDuration := false
Expand Down
11 changes: 6 additions & 5 deletions internal/ingress/controller/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ type Template struct {
bp *BufferPool
}

//NewTemplate returns a new Template instance or an
//error if the specified template file contains errors
// NewTemplate returns a new Template instance or an
// error if the specified template file contains errors
func NewTemplate(file string) (*Template, error) {
data, err := os.ReadFile(file)
if err != nil {
Expand Down Expand Up @@ -287,9 +287,10 @@ var (
// escapeLiteralDollar will replace the $ character with ${literal_dollar}
// which is made to work via the following configuration in the http section of
// the template:
// geo $literal_dollar {
// default "$";
// }
//
// geo $literal_dollar {
// default "$";
// }
func escapeLiteralDollar(input interface{}) string {
inputStr, ok := input.(string)
if !ok {
Expand Down
3 changes: 2 additions & 1 deletion internal/ingress/resolver/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ func (m Mock) GetSecret(string) (*apiv1.Secret, error) {

// GetAuthCertificate resolves a given secret name into an SSL certificate.
// The secret must contain 3 keys named:
// ca.crt: contains the certificate chain used for authentication
//
// ca.crt: contains the certificate chain used for authentication
func (m Mock) GetAuthCertificate(string) (*AuthSSLCert, error) {
return nil, nil
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/util/runtime/cpu_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import (
// NumCPU returns the number of logical CPUs usable by the current process.
// If CPU cgroups limits are configured, use cfs_quota_us / cfs_period_us
// as formula
// https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt
//
// https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt
func NumCPU() int {
cpus := runtime.NumCPU()

Expand Down
1 change: 0 additions & 1 deletion rootfs/chroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ for dir in "${writeDirs[@]}"; do
chown -R www-data.www-data ${dir};
done


mkdir -p /chroot/lib /chroot/proc /chroot/usr /chroot/bin /chroot/dev /chroot/run
cp /etc/passwd /etc/group /chroot/etc/
cp -a /usr/* /chroot/usr/
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/framework/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func CreateIngressClass(namespace string, c kubernetes.Interface) (string, error
return ic.Name, nil
}

//deleteIngressClass deletes an IngressClass and its related ClusterRole* objects
// deleteIngressClass deletes an IngressClass and its related ClusterRole* objects
func deleteIngressClass(c kubernetes.Interface, ingressclass string) error {
var err error
grace := int64(0)
Expand All @@ -215,7 +215,7 @@ func deleteIngressClass(c kubernetes.Interface, ingressclass string) error {
return nil
}

//GetIngressClassName returns the default IngressClassName given a namespace
// GetIngressClassName returns the default IngressClassName given a namespace
func GetIngressClassName(namespace string) *string {
icname := fmt.Sprintf("ic-%s", namespace)
return &icname
Expand Down

0 comments on commit 4d5303f

Please sign in to comment.