Skip to content

Commit

Permalink
test: Upgrade to argosay:v2 (argoproj#3001)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed May 11, 2020
1 parent e08fdb1 commit 4593d9a
Show file tree
Hide file tree
Showing 31 changed files with 315 additions and 99 deletions.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ endif
@mkdir -p ui/dist
touch ui/dist/node_modules.marker

ui/dist/app/index.html: ui/dist/node_modules.marker ui/src
ui/dist/app/index.html: ui/dist/node_modules.marker $(UI_FILES)
# Build UI
@mkdir -p ui/dist/app
ifeq ($(CI),false)
Expand Down Expand Up @@ -344,9 +344,21 @@ endif
pull-build-images:
./hack/pull-build-images.sh

.PHONY: argosay
argosay: test/e2e/images/argosay/v2/argosay
cd test/e2e/images/argosay/v2 && docker build . -t argoproj/argosay:v2
ifeq ($(K3D),true)
k3d import-images argoproj/argosay:v2
endif
docker push argoproj/argosay:v2

test/e2e/images/argosay/v2/argosay: $(shell find test/e2e/images/argosay/v2/main -type f)
cd test/e2e/images/argosay/v2 && GOOS=linux CGO_ENABLED=0 go build -ldflags '-w -s' -o argosay ./main

.PHONY: test-images
test-images:
docker pull argoproj/argosay:v1
docker pull argoproj/argosay:v2
docker pull python:alpine3.6

.PHONY: stop
Expand Down
26 changes: 13 additions & 13 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ type PersistConfig struct {
// in days
ArchiveTTL TTL `json:"archiveTTL,omitempty"`
ClusterName string `json:"clusterName,omitempty"`
ConnectionPool *ConnectionPool `json:"connectionPool"`
ConnectionPool *ConnectionPool `json:"connectionPool,omitempty"`
PostgreSQL *PostgreSQLConfig `json:"postgresql,omitempty"`
MySQL *MySQLConfig `json:"mysql,omitempty"`
}
Expand All @@ -148,16 +148,16 @@ func (c PersistConfig) GetClusterName() string {
}

type ConnectionPool struct {
MaxIdleConns int `json:"maxIdleConns"`
MaxOpenConns int `json:"maxOpenConns"`
MaxIdleConns int `json:"maxIdleConns,omitempty"`
MaxOpenConns int `json:"maxOpenConns,omitempty"`
}
type PostgreSQLConfig struct {
Host string `json:"host"`
Port string `json:"port"`
Database string `json:"database"`
TableName string `json:"tableName"`
UsernameSecret apiv1.SecretKeySelector `json:"userNameSecret"`
PasswordSecret apiv1.SecretKeySelector `json:"passwordSecret"`
TableName string `json:"tableName,omitempty"`
UsernameSecret apiv1.SecretKeySelector `json:"userNameSecret,omitempty"`
PasswordSecret apiv1.SecretKeySelector `json:"passwordSecret,omitempty"`
SSL bool `json:"ssl,omitempty"`
SSLMode string `json:"sslMode,omitempty"`
}
Expand All @@ -166,10 +166,10 @@ type MySQLConfig struct {
Host string `json:"host"`
Port string `json:"port"`
Database string `json:"database"`
TableName string `json:"tableName"`
Options map[string]string `json:"options"`
UsernameSecret apiv1.SecretKeySelector `json:"userNameSecret"`
PasswordSecret apiv1.SecretKeySelector `json:"passwordSecret"`
TableName string `json:"tableName,omitempty"`
Options map[string]string `json:"options,omitempty"`
UsernameSecret apiv1.SecretKeySelector `json:"userNameSecret,omitempty"`
PasswordSecret apiv1.SecretKeySelector `json:"passwordSecret,omitempty"`
}

// S3ArtifactRepository defines the controller configuration for an S3 artifact repository
Expand Down Expand Up @@ -220,9 +220,9 @@ type HDFSArtifactRepository struct {

// PrometheusConfig defines a config for a metrics server
type PrometheusConfig struct {
Enabled bool `json:"enabled,omitempty"`
DisableLegacy bool `json:"disableLegacy"`
MetricsTTL TTL `json:"metricsTTL"`
Enabled bool `json:"enabled"`
DisableLegacy bool `json:"disableLegacy,omitempty"`
MetricsTTL TTL `json:"metricsTTL,omitempty"`
Path string `json:"path,omitempty"`
Port string `json:"port,omitempty"`
}
2 changes: 0 additions & 2 deletions docs/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -3002,8 +3002,6 @@ MetricLabel is a single label for a prometheus metric

- [`custom-metrics.yaml`](../examples/custom-metrics.yaml)

- [`forever.yaml`](../examples/forever.yaml)

- [`pod-metadata.yaml`](../examples/pod-metadata.yaml)

- [`resource-delete-with-flags.yaml`](../examples/resource-delete-with-flags.yaml)
Expand Down
2 changes: 0 additions & 2 deletions examples/forever.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: forever
labels:
argo-e2e: true
spec:
entrypoint: main
templates:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ spec:
- --executor-image
- argoproj/argoexec:latest
nodeSelector:
kubernetes.io/os: linux
kubernetes.io/os: linux
30 changes: 15 additions & 15 deletions test/e2e/argo_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (s *ArgoServerSuite) TestPermission() {
{
"name": "run-workflow",
"container": {
"image": "argoproj/argosay:v1",
"image": "argoproj/argosay:v2",
"command": ["sh"],
"args": ["-c", "sleep 1"]
}
Expand Down Expand Up @@ -268,7 +268,7 @@ func (s *ArgoServerSuite) TestPermission() {
{
"name": "run-workflow",
"container": {
"image": "argoproj/argosay:v1",
"image": "argoproj/argosay:v2",
"imagePullPolicy": "IfNotPresent",
"command": ["sh"],
"args": ["-c", "sleep 1"]
Expand Down Expand Up @@ -391,7 +391,7 @@ func (s *ArgoServerSuite) TestLintWorkflow() {
{
"name": "run-workflow",
"container": {
"image": "argoproj/argosay:v1",
"image": "argoproj/argosay:v2",
"imagePullPolicy": "IfNotPresent"
}
}
Expand Down Expand Up @@ -422,7 +422,7 @@ func (s *ArgoServerSuite) TestCreateWorkflowDryRun() {
{
"name": "run-workflow",
"container": {
"image": "argoproj/argosay:v1",
"image": "argoproj/argosay:v2",
"imagePullPolicy": "IfNotPresent"
}
}
Expand Down Expand Up @@ -456,7 +456,7 @@ func (s *ArgoServerSuite) TestWorkflowService() {
{
"name": "run-workflow",
"container": {
"image": "argoproj/argosay:v1",
"image": "argoproj/argosay:v2",
"imagePullPolicy": "IfNotPresent",
"command": ["sh"],
"args": ["-c", "sleep 10"]
Expand Down Expand Up @@ -612,7 +612,7 @@ func (s *ArgoServerSuite) TestCronWorkflowService() {
{
"name": "whalesay",
"container": {
"image": "argoproj/argosay:v1",
"image": "argoproj/argosay:v2",
"imagePullPolicy": "IfNotPresent"
}
}
Expand Down Expand Up @@ -650,7 +650,7 @@ spec:
templates:
- name: whalesay
container:
image: argoproj/argosay:v1
image: argoproj/argosay:v2
imagePullPolicy: IfNotPresent
command: ["sh", -c]
args: ["echo hello"]
Expand Down Expand Up @@ -702,7 +702,7 @@ spec:
{
"name": "whalesay",
"container": {
"image": "argoproj/argosay:v1",
"image": "argoproj/argosay:v2",
"imagePullPolicy": "IfNotPresent"
}
}
Expand Down Expand Up @@ -865,7 +865,7 @@ spec:
templates:
- name: run-archie
container:
image: argoproj/argosay:v1
image: argoproj/argosay:v2
command: [cowsay, ":) Hello Argo!"]
imagePullPolicy: IfNotPresent`).
When().
Expand All @@ -887,7 +887,7 @@ spec:
templates:
- name: run-betty
container:
image: argoproj/argosay:v1
image: argoproj/argosay:v2
command: [cowsay, ":) Hello Argo!"]
imagePullPolicy: IfNotPresent`).
When().
Expand Down Expand Up @@ -1015,7 +1015,7 @@ func (s *ArgoServerSuite) TestWorkflowTemplateService() {
"name": "run-workflow",
"container": {
"name": "",
"image": "argoproj/argosay:v1",
"image": "argoproj/argosay:v2",
"imagePullPolicy": "IfNotPresent"
}
}
Expand Down Expand Up @@ -1044,7 +1044,7 @@ func (s *ArgoServerSuite) TestWorkflowTemplateService() {
"name": "run-workflow",
"container": {
"name": "",
"image": "argoproj/argosay:v1",
"image": "argoproj/argosay:v2",
"imagePullPolicy": "IfNotPresent"
}
}
Expand Down Expand Up @@ -1148,7 +1148,7 @@ func (s *ArgoServerSuite) TestSubmitWorkflowFromResource() {
"name": "run-workflow",
"container": {
"name": "",
"image": "argoproj/argosay:v1",
"image": "argoproj/argosay:v2",
"imagePullPolicy": "IfNotPresent"
}
}
Expand Down Expand Up @@ -1190,7 +1190,7 @@ func (s *ArgoServerSuite) TestSubmitWorkflowFromResource() {
{
"name": "whalesay",
"container": {
"image": "argoproj/argosay:v1",
"image": "argoproj/argosay:v2",
"imagePullPolicy": "IfNotPresent"
}
}
Expand Down Expand Up @@ -1231,7 +1231,7 @@ func (s *ArgoServerSuite) TestSubmitWorkflowFromResource() {
"name": "run-workflow",
"container": {
"name": "",
"image": "argoproj/argosay:v1",
"image": "argoproj/argosay:v2",
"imagePullPolicy": "IfNotPresent"
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/expectedfailures/failed-step-event.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ spec:
templates:
- name: exit
container:
image: argoproj/argosay:v1
command: [sh, -c, exit 1]
image: argoproj/argosay:v2
args: [exit, 1]
1 change: 1 addition & 0 deletions test/e2e/fixtures/given.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func (g *Given) checkImages(templates []wfv1.Template) {
imageWhitelist := map[string]bool{
"argoexec:" + imageTag: true,
"argoproj/argosay:v1": true,
"argoproj/argosay:v2": true,
"python:alpine3.6": true,
}
for _, t := range templates {
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/functional/stop-terminate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ spec:
parameters:
- name: message
container:
image: argoproj/argosay:v1
command: [sleep, "10"]
image: argoproj/argosay:v2
args: [sleep, "10s"]

- name: exit
container:
image: argoproj/argosay:v1
command: [echo, "one exit"]
image: argoproj/argosay:v2
args: [echo, "one exit"]
2 changes: 1 addition & 1 deletion test/e2e/functional/success-event.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ spec:
templates:
- name: exit
container:
image: argoproj/argosay:v1
image: argoproj/argosay:v2
25 changes: 10 additions & 15 deletions test/e2e/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ spec:
- name: whalesay
container:
image: argoproj/argosay:v1
image: argoproj/argosay:v2
imagePullPolicy: IfNotPresent
- name: whalesplosion
container:
image: argoproj/argosay:v1
image: argoproj/argosay:v2
imagePullPolicy: IfNotPresent
command: ["sh", "-c", "sleep 5 ; exit 1"]
`).
Expand Down Expand Up @@ -124,12 +124,12 @@ spec:
- name: whalesay
container:
imagePullPolicy: IfNotPresent
image: argoproj/argosay:v1
image: argoproj/argosay:v2
- name: whalesplosion
container:
imagePullPolicy: IfNotPresent
image: argoproj/argosay:v1
image: argoproj/argosay:v2
command: ["sh", "-c", "sleep 10; exit 1"]
`).
When().
Expand Down Expand Up @@ -262,9 +262,8 @@ spec:
- name: cowsay
resubmitPendingPods: true
container:
image: argoproj/argosay:v1
command: [sh, -c]
args: ["cowsay a"]
image: argoproj/argosay:v2
args: ["echo", "a"]
resources:
limits:
memory: 128M
Expand Down Expand Up @@ -314,9 +313,8 @@ spec:
retryStrategy:
limit: 1
container:
image: argoproj/argosay:v1
command: [sh, -c]
args: ["cowsay a"]
image: argoproj/argosay:v2
args: ["echo", "a"]
resources:
limits:
memory: 128M
Expand Down Expand Up @@ -470,11 +468,8 @@ spec:
- name: generate
container:
image: argoproj/argosay:v1
command: [sh, -c]
args: ["
echo 'my-output-parameter' > /tmp/my-output-parameter.txt
"]
image: argoproj/argosay:v2
args: [echo, my-output-parameter, /tmp/my-output-parameter.txt]
outputs:
parameters:
- name: out-parameter
Expand Down
17 changes: 17 additions & 0 deletions test/e2e/images/argosay/v1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:14.04

RUN apt-get update && \
apt-get install -y apt-utils ca-certificates apt-transport-https cowsay --no-install-recommends && \
apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
/usr/share/man \
/usr/share/doc \
/usr/share/doc-base

# "cowsay" installs to /usr/games
ENV PATH $PATH:/usr/games

CMD ["cowsay"]
1 change: 1 addition & 0 deletions test/e2e/images/argosay/v2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/argosay
5 changes: 5 additions & 0 deletions test/e2e/images/argosay/v2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM scratch

ADD argosay /

ENTRYPOINT ["/argosay"]
Loading

0 comments on commit 4593d9a

Please sign in to comment.