Simplify skaffold init code#3406
Conversation
Codecov Report
|
There was a problem hiding this comment.
One issue with these changes is that it will generate a bit more verbose skaffold.yaml than necessary based on our current defaults - however there is no tests ensuring this behavior yet, and it is not the end of the world. But still a bit of a regression in UX in my opinion:
diff --git a/examples/microservices/skaffold.yaml b/examples/microservices/skaffold.yaml
index f4e408246..4bd5ba5b3 100644
--- a/examples/microservices/skaffold.yaml
+++ b/examples/microservices/skaffold.yaml
@@ -1,18 +1,22 @@
-apiVersion: skaffold/v1
+apiVersion: skaffold/v2alpha1
kind: Config
+metadata:
+ name: microservices
build:
artifacts:
- - image: gcr.io/k8s-skaffold/leeroy-web
- context: ./leeroy-web/
- - image: gcr.io/k8s-skaffold/leeroy-app
- context: ./leeroy-app/
+ - image: gcr.io/k8s-skaffold/leeroy-app
+ context: leeroy-app
+ docker:
+ dockerfile: Dockerfile
+ - image: gcr.io/k8s-skaffold/leeroy-web
+ context: leeroy-web
+ docker:
+ dockerfile: Dockerfile
+ tagPolicy:
+ gitCommit: {}
+ local: {}
...vs the current version:
diff --git a/examples/microservices/skaffold.yaml b/examples/microservices/skaffold.yaml
index f4e408246..b79fcbb74 100644
--- a/examples/microservices/skaffold.yaml
+++ b/examples/microservices/skaffold.yaml
@@ -1,18 +1,15 @@
-apiVersion: skaffold/v1
+apiVersion: skaffold/v2alpha1
kind: Config
+metadata:
+ name: microservices
build:
artifacts:
- - image: gcr.io/k8s-skaffold/leeroy-web
- context: ./leeroy-web/
- - image: gcr.io/k8s-skaffold/leeroy-app
- context: ./leeroy-app/
+ - image: gcr.io/k8s-skaffold/leeroy-app
+ context: leeroy-app
+ - image: gcr.io/k8s-skaffold/leeroy-web
+ context: leeroy-web|
Good catch @balopat! It used to be that only a few defaults were explicit. Anyways, I think it’s best to add a non regression test and make sure we produce the same yaml as before. Wdyt? |
12e7904 to
b0cff0d
Compare
|
I changed a few things to make sure we produce the same yaml as before. |
b0cff0d to
37a8bee
Compare
balopat
left a comment
There was a problem hiding this comment.
Nice! Good to go! Thank you for the improvements, I believe this is a much better UX to keep the yaml minimal!
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
37a8bee to
86ceefb
Compare
Each commit is a simplification. I didn't merge them to ease the review.
Also fixes #3405