@@ -65,8 +65,12 @@ import (
65
65
)
66
66
67
67
// {{.kind.String}}ClusterLister can list {{.kind.Plural}} across all workspaces, or scope down to a {{.kind.String}}Lister for one workspace.
68
+ // All objects returned here must be treated as read-only.
68
69
type {{.kind.String}}ClusterLister interface {
70
+ // List lists all {{.kind.Plural}} in the indexer.
71
+ // Objects returned here must be treated as read-only.
69
72
List(selector labels.Selector) (ret []*{{.group.PackageAlias}}.{{.kind.String}}, err error)
73
+ // Cluster returns a lister that can list and get {{.kind.Plural}} in one workspace.
70
74
{{if not .useUpstreamInterfaces -}}
71
75
Cluster(cluster logicalcluster.Name) {{.kind.String}}Lister
72
76
{{else -}}
@@ -101,11 +105,22 @@ func (s *{{.kind.String | lowerFirst}}ClusterLister) Cluster(cluster logicalclus
101
105
}
102
106
103
107
{{if not .useUpstreamInterfaces -}}
108
+ {{ if not .kind.IsNamespaced -}}
109
+ // {{.kind.String}}Lister can list all {{.kind.Plural}}, or get one in particular.
110
+ {{else -}}
111
+ // {{.kind.String}}Lister can list {{.kind.Plural}} across all namespaces, or scope down to a {{.kind.String}}NamespaceLister for one namespace.
112
+ {{end -}}
113
+ // All objects returned here must be treated as read-only.
104
114
type {{.kind.String}}Lister interface {
115
+ // List lists all {{.kind.Plural}} in the workspace.
116
+ // Objects returned here must be treated as read-only.
105
117
List(selector labels.Selector) (ret []*{{.group.PackageAlias}}.{{.kind.String}}, err error)
106
118
{{ if not .kind.IsNamespaced -}}
119
+ // Get retrieves the {{.kind.String}} from the indexer for a given workspace and name.
120
+ // Objects returned here must be treated as read-only.
107
121
Get(name string) (*{{.group.PackageAlias}}.{{.kind.String}}, error)
108
122
{{else -}}
123
+ // {{.kind.Plural}} returns a lister that can list and get {{.kind.Plural}} in one workspace and namespace.
109
124
{{.kind.Plural}}(namespace string) {{.kind.String}}NamespaceLister
110
125
{{end -}}
111
126
}
@@ -153,8 +168,14 @@ func (s *{{.kind.String | lowerFirst}}Lister) {{.kind.Plural}}(namespace string)
153
168
}
154
169
155
170
{{if not .useUpstreamInterfaces -}}
171
+ // {{.kind.String | lowerFirst}}NamespaceLister helps list and get {{.kind.Plural}}.
172
+ // All objects returned here must be treated as read-only.
156
173
type {{.kind.String}}NamespaceLister interface {
174
+ // List lists all {{.kind.Plural}} in the workspace and namespace.
175
+ // Objects returned here must be treated as read-only.
157
176
List(selector labels.Selector) (ret []*{{.group.PackageAlias}}.{{.kind.String}}, err error)
177
+ // Get retrieves the {{.kind.String}} from the indexer for a given workspace, namespace and name.
178
+ // Objects returned here must be treated as read-only.
158
179
Get(name string) (*{{.group.PackageAlias}}.{{.kind.String}}, error)
159
180
}
160
181
{{end -}}
0 commit comments