This repository was archived by the owner on Nov 19, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -80,8 +80,27 @@ type Client struct {
80
80
// The URL of the API server.
81
81
Endpoint string
82
82
83
- // Default namespaces for objects that don't supply a namespace in
84
- // their object metadata.
83
+ // Namespace is the name fo the default reconciled from the client's config.
84
+ // It is set when constructing a client using NewClient(), and defaults to
85
+ // the value "default".
86
+ //
87
+ // This value should be used to access the client's default namespace. For
88
+ // example, to create a configmap in the default namespace, use client.Namespace
89
+ // when to fill the ObjectMeta:
90
+ //
91
+ // client, err := k8s.NewClient(config)
92
+ // if err != nil {
93
+ // // handle error
94
+ // }
95
+ // cm := v1.ConfigMap{
96
+ // Metadata: &metav1.ObjectMeta{
97
+ // Name: &k8s.String("my-configmap"),
98
+ // Namespace: &client.Namespace,
99
+ // },
100
+ // Data: map[string]string{"foo": "bar", "spam": "eggs"},
101
+ // }
102
+ // err := client.Create(ctx, cm)
103
+ //
85
104
Namespace string
86
105
87
106
// SetHeaders provides a hook for modifying the HTTP headers of all requests.
You can’t perform that action at this time.
0 commit comments