Update nginx base image in one place (#8400)

* update files to use one base image file

Signed-off-by: James Strong <strong.james.e@gmail.com>

* add chart test as well

Signed-off-by: James Strong <strong.james.e@gmail.com>

* update e2e-test image building

Signed-off-by: James Strong <strong.james.e@gmail.com>

* update e2e base image arg

Signed-off-by: James Strong <strong.james.e@gmail.com>

* add current e2e so test run

Signed-off-by: James Strong <strong.james.e@gmail.com>

* working on fixing build

* getting dev-env and make release to work

* test

* i think buildx is working on mac

* updates

* why docker for mac and linux cli differ

* fix target arch

* fix target arch

* fix loag issue

* fix issue

* update the chroot docker file

* fix docker base build

* mac is the issue

* env not getting to the e2e deployment.go file

* fix pull issue

* fix pull issue

* move test scripts into test folder

* clean up ci

* updates for PR

* remove unnesscary var
This commit is contained in:
James Strong 2022-07-08 12:27:47 -04:00 committed by GitHub
parent 8baac4214a
commit e1a16f6e74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 138 additions and 70 deletions

View file

@ -18,6 +18,8 @@ package framework
import (
"context"
"errors"
"os"
"time"
"github.com/onsi/ginkgo"
@ -37,13 +39,11 @@ const SlowEchoService = "slow-echo"
// HTTPBinService name of the deployment for the httpbin app
const HTTPBinService = "httpbin"
// NginxBaseImage use for testing
const NginxBaseImage = "registry.k8s.io/ingress-nginx/nginx:0ff500c23f34e939305de709cb6d47da34b66611@sha256:15f91034a03550dfab6ec50a7be4abbb683d087e234ad7fef5adedef54e46a5a"
type deploymentOptions struct {
namespace string
name string
replicas int
image string
}
// WithDeploymentNamespace allows configuring the deployment's namespace
@ -67,7 +67,7 @@ func WithDeploymentReplicas(r int) func(*deploymentOptions) {
}
}
// NewEchoDeployment creates a new single replica deployment of the echoserver image in a particular namespace
// NewEchoDeployment creates a new single replica deployment of the echo server image in a particular namespace
func (f *Framework) NewEchoDeployment(opts ...func(*deploymentOptions)) {
options := &deploymentOptions{
namespace: f.Namespace,
@ -150,6 +150,16 @@ http {
f.NGINXWithConfigDeployment(SlowEchoService, cfg)
}
func (f *Framework) GetNginxBaseImage() string {
nginxBaseImage := os.Getenv("NGINX_BASE_IMAGE")
if nginxBaseImage == "" {
assert.NotEmpty(ginkgo.GinkgoT(), errors.New("NGINX_BASE_IMAGE not defined"), "NGINX_BASE_IMAGE not defined")
}
return nginxBaseImage
}
// NGINXDeployment creates a new simple NGINX Deployment using NGINX base image
// and passing the desired configuration
func (f *Framework) NGINXDeployment(name string, cfg string, waitendpoint bool) {
@ -166,7 +176,7 @@ func (f *Framework) NGINXDeployment(name string, cfg string, waitendpoint bool)
}, metav1.CreateOptions{})
assert.Nil(ginkgo.GinkgoT(), err, "creating configmap")
deployment := newDeployment(name, f.Namespace, NginxBaseImage, 80, 1,
deployment := newDeployment(name, f.Namespace, f.GetNginxBaseImage(), 80, 1,
nil,
[]corev1.VolumeMount{
{