Skip to content
This repository was archived by the owner on Nov 19, 2020. It is now read-only.

Commit b6e4a43

Browse files
committed
fix API errors README example
1 parent 72a6e54 commit b6e4a43

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func createConfigMap(client *k8s.Client, name string, values map[string]string)
262262
Data: values,
263263
}
264264

265-
_, err := client.CoreV1().CreateConfigMap(context.TODO(), cm)
265+
err := client.Create(context.TODO(), cm)
266266

267267
// If an HTTP error was returned by the API server, it will be of type
268268
// *k8s.APIError. This can be used to inspect the status code.

examples/api-errors.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ func createConfigMap(client *k8s.Client, name string, values map[string]string)
2525
}
2626

2727
err := client.Create(context.Background(), cm)
28-
if err == nil {
29-
return err
30-
}
3128

3229
// If an HTTP error was returned by the API server, it will be of type
3330
// *k8s.APIError. This can be used to inspect the status code.

0 commit comments

Comments
 (0)