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

Add v1alpha3 Config #982

Merged
merged 3 commits into from
Sep 13, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
45 changes: 0 additions & 45 deletions examples/kaniko/pod.yaml

This file was deleted.

45 changes: 31 additions & 14 deletions integration/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,22 +221,39 @@ func setupNamespace(t *testing.T) (*v1.Namespace, func()) {
}
}
func TestFix(t *testing.T) {
ns, deleteNs := setupNamespace(t)
defer deleteNs()

fixCmd := exec.Command("skaffold", "fix", "-f", "skaffold.yaml")
fixCmd.Dir = "testdata/old-config"
out, err := util.RunCmdOut(fixCmd)
if err != nil {
t.Fatalf("testing error: %v", err)
tests := []struct {
name string
directory string
}{
{
name: "test v1alpha1 to v1alpha2 fix",
directory: "testdata/v1alpha1",
},
{
name: "test v1alpha2 to v1alpha3 kaniko fix",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we won't need kaniko here I think

directory: "testdata/v1alpha2",
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
ns, deleteNs := setupNamespace(t)
defer deleteNs()

runCmd := exec.Command("skaffold", "run", "--namespace", ns.Name, "-f", "-")
runCmd.Dir = "testdata/old-config"
runCmd.Stdin = bytes.NewReader(out)
err = util.RunCmd(runCmd)
if err != nil {
t.Fatalf("testing error: %v", err)
fixCmd := exec.Command("skaffold", "fix", "-f", "skaffold.yaml")
fixCmd.Dir = test.directory
out, err := util.RunCmdOut(fixCmd)
if err != nil {
t.Fatalf("testing error: %v", err)
}

runCmd := exec.Command("skaffold", "run", "--namespace", ns.Name, "-f", "-")
runCmd.Dir = test.directory
runCmd.Stdin = bytes.NewReader(out)
err = util.RunCmd(runCmd)
if err != nil {
t.Fatalf("testing error: %v", err)
}
})
}
}

Expand Down
6 changes: 6 additions & 0 deletions integration/testdata/v1alpha2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM gcr.io/google-appengine/golang

WORKDIR /go/src/github.com/GoogleCloudPlatform/skaffold
CMD ["./app"]
COPY main.go .
RUN go build -o app main.go
8 changes: 8 additions & 0 deletions integration/testdata/v1alpha2/k8s-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Pod
metadata:
name: getting-started-kaniko
spec:
containers:
- name: getting-started
image: gcr.io/k8s-skaffold/skaffold-example
13 changes: 13 additions & 0 deletions integration/testdata/v1alpha2/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main

import (
"fmt"
"time"
)

func main() {
for {
fmt.Println("Hello world!")
time.Sleep(time.Second * 1)
}
}
13 changes: 13 additions & 0 deletions integration/testdata/v1alpha2/skaffold.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: skaffold/v1alpha2
kind: Config
build:
artifacts:
- imageName: gcr.io/k8s-skaffold/skaffold-example
kaniko:
gcsBucket: skaffold-kaniko
pullSecretName: e2esecret
namespace: default
deploy:
kubectl:
manifests:
- k8s-*