Skip to content

Commit 7728ed0

Browse files
committed
Merge remote-tracking branch 'origin/master' into HEAD
2 parents 010ec5a + e52a22a commit 7728ed0

File tree

82 files changed

+4705
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+4705
-104
lines changed

DEVELOPMENT.md

+52
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,58 @@ For more details behind the logic of config changes see [the Skaffold config man
103103

104104
We build the API directly through gRPC, which gets translated into REST API through a reverse proxy gateway library. If you make changes to the [proto/skaffold.proto](https://github.com/GoogleContainerTools/skaffold/blob/master/proto/skaffold.proto) file you can run `./hack/generate-proto.sh` to generate the equivalent Go code.
105105

106+
## Adding actionable error messages to code.
107+
Skaffold has a built-in framework to provide actionable error messages for user to help bootstrap skaffold errors.
108+
109+
Also, [v1.19.0](https://github.com/GoogleContainerTools/skaffold/releases/tag/v1.19.0) onwards, skaffold is collecting failure error codes to help the team get more insights into common failure scenarios.
110+
111+
To take advantage of this framework, contributors can simply use the [`ErrDef`](https://github.com/GoogleContainerTools/skaffold/blob/master/pkg/skaffold/errors/err_def.go#L32) struct to throw meaningful actionable error messages and
112+
improve user experience.
113+
114+
e.g In this example [PR](https://github.com/GoogleContainerTools/skaffold/pull/5273),
115+
1. The contributor created 3 distinct error codes in [skaffold.proto](https://github.com/GoogleContainerTools/skaffold/pull/5088/files#diff-3883fe4549a47ae73a7a3a0afc00896b197d5ba8570906ba423769cf5a93a26f)
116+
```
117+
// Docker build error when listing containers.
118+
INIT_DOCKER_NETWORK_LISTING_CONTAINERS = 122;
119+
// Docker build error indicating an invalid container name (or id).
120+
INIT_DOCKER_NETWORK_INVALID_CONTAINER_NAME = 123;
121+
// Docker build error indicating the container referenced does not exists in the docker context used.
122+
INIT_DOCKER_NETWORK_CONTAINER_DOES_NOT_EXIST = 124
123+
```
124+
The `INIT` in this case stands for skaffold `INIT` phase which includes, parsing of skaffold config and creating a skaffold runner.
125+
The other valid phases are `BUILD`, `DEPLOY`, `STATUSCHECK`. Complete list [here](https://skaffold.dev/docs/references/api/grpc/#statuscode)
126+
2. Run `hack/generate_proto.sh`. These will generate go code and structs for the newly added proto fields.
127+
```shell script
128+
git status
129+
modified: docs/content/en/api/skaffold.swagger.json
130+
modified: docs/content/en/docs/references/api/grpc.md
131+
modified: proto/skaffold.pb.go
132+
modified: proto/skaffold.proto
133+
```
134+
3. The contributor then used these error codes when creating an error in their [proposed code change](https://github.com/GoogleContainerTools/skaffold/pull/5088/files#diff-3fc5246574bf7367a232c6d682b22a4e22795d52eb1c81fe2c27ff052939d507R220).
135+
They used the constructor `sErrors.NewError` in [pkg/skaffold/errors](https://github.com/GoogleContainerTools/skaffold/blob/54466ff6983e9fcf977d6e549119b4c1c4dc9e2b/pkg/skaffold/errors/err_def.go#L57) to inantiate an object of struct `ErrDef`.
136+
`ErrDef` implements the golang `error` interface.
137+
```
138+
err := sErrors.NewError(fmt.Errorf(errMsg),
139+
proto.ActionableErr{
140+
Message: errMsg,
141+
ErrCode: proto.StatusCode_INIT_DOCKER_NETWORK_INVALID_CONTAINER_NAME,
142+
Suggestions: []*proto.Suggestion{
143+
{
144+
SuggestionCode: proto.SuggestionCode_FIX_DOCKER_NETWORK_CONTAINER_NAME,
145+
Action: "Please fix the docker network container name and try again",
146+
},
147+
},
148+
}))
149+
```
150+
151+
With above two changes, skaffold will now show a meaning full error message when this error condition is met.
152+
```shell script
153+
skaffold dev
154+
invalid skaffold config: container 'does-not-exits' not found, required by image 'skaffold-example' for docker network stack sharing.
155+
Please fix the docker network container name and try again.
156+
```
157+
106158
## Building skaffold
107159

108160
To build with your local changes you have two options:

docs/config.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ weight = 1
8282
copyright = "Skaffold Authors"
8383
privacy_policy = "https://policies.google.com/privacy"
8484
github_repo = "https://github.com/GoogleContainerTools/skaffold"
85-
skaffold_version = "skaffold/v2beta11"
85+
skaffold_version = "skaffold/v2beta12"
8686

8787
# Google Custom Search Engine ID. Remove or comment out to disable search.
8888
# gcs_engine_id = "013756393218025596041:3nojel67sum"

docs/content/en/api/skaffold.swagger.json

+1-1
Large diffs are not rendered by default.

docs/content/en/docs/install/_index.md

+36-4
Original file line numberDiff line numberDiff line change
@@ -19,46 +19,78 @@ Your use of this software is subject to the [Google Privacy Policy](https://poli
1919

2020
{{% tabs %}}
2121
{{% tab "LINUX" %}}
22-
The latest **stable** binary can be found here:
22+
The latest **stable** binaries can be found here:
2323

2424
https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
25+
https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-arm64
2526

26-
Simply download it and add it to your `PATH`. Or, copy+paste this command in your terminal:
27+
Simply download the appropriate binary and add it to your `PATH`. Or, copy+paste one of the following commands in your terminal:
2728

2829
```bash
30+
# For Linux AMD64
2931
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && \
3032
sudo install skaffold /usr/local/bin/
3133
```
3234

35+
```bash
36+
# For Linux ARM64
37+
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-arm && \
38+
sudo install skaffold /usr/local/bin/
39+
```
40+
3341
We also release a **bleeding edge** build, built from the latest commit:
3442

3543
https://storage.googleapis.com/skaffold/builds/latest/skaffold-linux-amd64
44+
https://storage.googleapis.com/skaffold/builds/latest/skaffold-linux-arm64
3645

3746
```bash
47+
# For Linux on AMD64
3848
curl -Lo skaffold https://storage.googleapis.com/skaffold/builds/latest/skaffold-linux-amd64 && \
3949
sudo install skaffold /usr/local/bin/
4050
```
4151

52+
```bash
53+
# For Linux on ARM64
54+
curl -Lo skaffold https://storage.googleapis.com/skaffold/builds/latest/skaffold-linux-arm64 && \
55+
sudo install skaffold /usr/local/bin/
56+
```
57+
4258
{{% /tab %}}
4359

4460
{{% tab "MACOS" %}}
4561

46-
The latest **stable** binary can be found here:
62+
The latest **stable** binaries can be found here:
4763

4864
https://storage.googleapis.com/skaffold/releases/latest/skaffold-darwin-amd64
65+
https://storage.googleapis.com/skaffold/releases/latest/skaffold-darwin-arm64
66+
67+
Simply download the appropriate binary and add it to your `PATH`. Or, copy+paste one of the following commands in your terminal:
4968

50-
Simply download it and add it to your `PATH`. Or, copy+paste this command in your terminal:
69+
```bash
70+
# For macOS on AMD64
71+
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-darwin-amd64 && \
72+
sudo install skaffold /usr/local/bin/
73+
```
5174

5275
```bash
76+
# For macOS on ARM64
5377
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-darwin-amd64 && \
5478
sudo install skaffold /usr/local/bin/
5579
```
5680

5781
We also release a **bleeding edge** build, built from the latest commit:
5882

5983
https://storage.googleapis.com/skaffold/builds/latest/skaffold-darwin-amd64
84+
https://storage.googleapis.com/skaffold/builds/latest/skaffold-darwin-arm64
85+
86+
```bash
87+
# For macOS on AMD64
88+
curl -Lo skaffold https://storage.googleapis.com/skaffold/builds/latest/skaffold-darwin-amd64 && \
89+
sudo install skaffold /usr/local/bin/
90+
```
6091

6192
```bash
93+
# For macOS on ARM64
6294
curl -Lo skaffold https://storage.googleapis.com/skaffold/builds/latest/skaffold-darwin-amd64 && \
6395
sudo install skaffold /usr/local/bin/
6496
```

docs/content/en/docs/references/api/grpc.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -845,12 +845,12 @@ Enum indicating deploy tools used
845845
<a name="proto.StatusCode"></a>
846846

847847
### StatusCode
848-
Enum for Status codes
848+
Enum for Status codes<br>
849849
These error codes are prepended by Phase Name e.g.
850-
BUILD, TEST, DEPLOY, STATUSCHECK, DEVINIT
851-
For Success Error codes, use range 200 to 250.
852-
For Unknown error codes, use range 500 to 600.
853-
For Cancelled Error code, use range 800 to 850.
850+
INIT, BUILD, TEST, DEPLOY, STATUSCHECK, DEVINIT<br>
851+
For Success Error codes, use range 200 to 250.<br>
852+
For Unknown error codes, use range 500 to 600.<br>
853+
For Cancelled Error code, use range 800 to 850.<br>
854854

855855
| Name | Number | Description |
856856
| ---- |:------:| ----------- |

docs/content/en/docs/references/cli/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ Options:
723723
-f, --filename='skaffold.yaml': Path or URL to the Skaffold config file
724724
-m, --module=[]: Filter Skaffold configs to only the provided named modules
725725
--overwrite=false: Overwrite original config with fixed config
726-
--version='skaffold/v2beta11': Target schema version to upgrade to
726+
--version='skaffold/v2beta12': Target schema version to upgrade to
727727
728728
Usage:
729729
skaffold fix [options]

0 commit comments

Comments
 (0)