id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
131,600 | weaveworks/flux | update/automated.go | workloadMap | func (a *Automated) workloadMap() map[flux.ResourceID][]Change {
set := map[flux.ResourceID][]Change{}
for _, change := range a.Changes {
set[change.WorkloadID] = append(set[change.WorkloadID], change)
}
return set
} | go | func (a *Automated) workloadMap() map[flux.ResourceID][]Change {
set := map[flux.ResourceID][]Change{}
for _, change := range a.Changes {
set[change.WorkloadID] = append(set[change.WorkloadID], change)
}
return set
} | [
"func",
"(",
"a",
"*",
"Automated",
")",
"workloadMap",
"(",
")",
"map",
"[",
"flux",
".",
"ResourceID",
"]",
"[",
"]",
"Change",
"{",
"set",
":=",
"map",
"[",
"flux",
".",
"ResourceID",
"]",
"[",
"]",
"Change",
"{",
"}",
"\n",
"for",
"_",
",",
... | // workloadMap transposes the changes so they can be looked up by ID | [
"workloadMap",
"transposes",
"the",
"changes",
"so",
"they",
"can",
"be",
"looked",
"up",
"by",
"ID"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/update/automated.go#L141-L147 |
131,601 | weaveworks/flux | integrations/client/clientset/versioned/typed/flux.weave.works/v1beta1/fake/fake_helmrelease.go | Get | func (c *FakeHelmReleases) Get(name string, options v1.GetOptions) (result *v1beta1.HelmRelease, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(helmreleasesResource, c.ns, name), &v1beta1.HelmRelease{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.HelmRelease), err
} | go | func (c *FakeHelmReleases) Get(name string, options v1.GetOptions) (result *v1beta1.HelmRelease, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(helmreleasesResource, c.ns, name), &v1beta1.HelmRelease{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.HelmRelease), err
} | [
"func",
"(",
"c",
"*",
"FakeHelmReleases",
")",
"Get",
"(",
"name",
"string",
",",
"options",
"v1",
".",
"GetOptions",
")",
"(",
"result",
"*",
"v1beta1",
".",
"HelmRelease",
",",
"err",
"error",
")",
"{",
"obj",
",",
"err",
":=",
"c",
".",
"Fake",
... | // Get takes name of the helmRelease, and returns the corresponding helmRelease object, and an error if there is any. | [
"Get",
"takes",
"name",
"of",
"the",
"helmRelease",
"and",
"returns",
"the",
"corresponding",
"helmRelease",
"object",
"and",
"an",
"error",
"if",
"there",
"is",
"any",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/client/clientset/versioned/typed/flux.weave.works/v1beta1/fake/fake_helmrelease.go#L42-L50 |
131,602 | weaveworks/flux | integrations/client/clientset/versioned/typed/flux.weave.works/v1beta1/fake/fake_helmrelease.go | List | func (c *FakeHelmReleases) List(opts v1.ListOptions) (result *v1beta1.HelmReleaseList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(helmreleasesResource, helmreleasesKind, c.ns, opts), &v1beta1.HelmReleaseList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions... | go | func (c *FakeHelmReleases) List(opts v1.ListOptions) (result *v1beta1.HelmReleaseList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(helmreleasesResource, helmreleasesKind, c.ns, opts), &v1beta1.HelmReleaseList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions... | [
"func",
"(",
"c",
"*",
"FakeHelmReleases",
")",
"List",
"(",
"opts",
"v1",
".",
"ListOptions",
")",
"(",
"result",
"*",
"v1beta1",
".",
"HelmReleaseList",
",",
"err",
"error",
")",
"{",
"obj",
",",
"err",
":=",
"c",
".",
"Fake",
".",
"Invokes",
"(",
... | // List takes label and field selectors, and returns the list of HelmReleases that match those selectors. | [
"List",
"takes",
"label",
"and",
"field",
"selectors",
"and",
"returns",
"the",
"list",
"of",
"HelmReleases",
"that",
"match",
"those",
"selectors",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/client/clientset/versioned/typed/flux.weave.works/v1beta1/fake/fake_helmrelease.go#L53-L72 |
131,603 | weaveworks/flux | integrations/client/clientset/versioned/typed/flux.weave.works/v1beta1/fake/fake_helmrelease.go | Watch | func (c *FakeHelmReleases) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(helmreleasesResource, c.ns, opts))
} | go | func (c *FakeHelmReleases) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(helmreleasesResource, c.ns, opts))
} | [
"func",
"(",
"c",
"*",
"FakeHelmReleases",
")",
"Watch",
"(",
"opts",
"v1",
".",
"ListOptions",
")",
"(",
"watch",
".",
"Interface",
",",
"error",
")",
"{",
"return",
"c",
".",
"Fake",
".",
"InvokesWatch",
"(",
"testing",
".",
"NewWatchAction",
"(",
"h... | // Watch returns a watch.Interface that watches the requested helmReleases. | [
"Watch",
"returns",
"a",
"watch",
".",
"Interface",
"that",
"watches",
"the",
"requested",
"helmReleases",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/client/clientset/versioned/typed/flux.weave.works/v1beta1/fake/fake_helmrelease.go#L75-L79 |
131,604 | weaveworks/flux | integrations/client/clientset/versioned/typed/flux.weave.works/v1beta1/fake/fake_helmrelease.go | Delete | func (c *FakeHelmReleases) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(helmreleasesResource, c.ns, name), &v1beta1.HelmRelease{})
return err
} | go | func (c *FakeHelmReleases) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(helmreleasesResource, c.ns, name), &v1beta1.HelmRelease{})
return err
} | [
"func",
"(",
"c",
"*",
"FakeHelmReleases",
")",
"Delete",
"(",
"name",
"string",
",",
"options",
"*",
"v1",
".",
"DeleteOptions",
")",
"error",
"{",
"_",
",",
"err",
":=",
"c",
".",
"Fake",
".",
"Invokes",
"(",
"testing",
".",
"NewDeleteAction",
"(",
... | // Delete takes name of the helmRelease and deletes it. Returns an error if one occurs. | [
"Delete",
"takes",
"name",
"of",
"the",
"helmRelease",
"and",
"deletes",
"it",
".",
"Returns",
"an",
"error",
"if",
"one",
"occurs",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/client/clientset/versioned/typed/flux.weave.works/v1beta1/fake/fake_helmrelease.go#L116-L121 |
131,605 | weaveworks/flux | integrations/client/clientset/versioned/typed/flux.weave.works/v1beta1/fake/fake_helmrelease.go | Patch | func (c *FakeHelmReleases) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.HelmRelease, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(helmreleasesResource, c.ns, name, pt, data, subresources...), &v1beta1.HelmRelease{})
if obj == nil {
ret... | go | func (c *FakeHelmReleases) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.HelmRelease, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(helmreleasesResource, c.ns, name, pt, data, subresources...), &v1beta1.HelmRelease{})
if obj == nil {
ret... | [
"func",
"(",
"c",
"*",
"FakeHelmReleases",
")",
"Patch",
"(",
"name",
"string",
",",
"pt",
"types",
".",
"PatchType",
",",
"data",
"[",
"]",
"byte",
",",
"subresources",
"...",
"string",
")",
"(",
"result",
"*",
"v1beta1",
".",
"HelmRelease",
",",
"err... | // Patch applies the patch and returns the patched helmRelease. | [
"Patch",
"applies",
"the",
"patch",
"and",
"returns",
"the",
"patched",
"helmRelease",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/client/clientset/versioned/typed/flux.weave.works/v1beta1/fake/fake_helmrelease.go#L132-L140 |
131,606 | weaveworks/flux | integrations/client/informers/externalversions/flux.weave.works/v1beta1/interface.go | HelmReleases | func (v *version) HelmReleases() HelmReleaseInformer {
return &helmReleaseInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
} | go | func (v *version) HelmReleases() HelmReleaseInformer {
return &helmReleaseInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
} | [
"func",
"(",
"v",
"*",
"version",
")",
"HelmReleases",
"(",
")",
"HelmReleaseInformer",
"{",
"return",
"&",
"helmReleaseInformer",
"{",
"factory",
":",
"v",
".",
"factory",
",",
"namespace",
":",
"v",
".",
"namespace",
",",
"tweakListOptions",
":",
"v",
".... | // HelmReleases returns a HelmReleaseInformer. | [
"HelmReleases",
"returns",
"a",
"HelmReleaseInformer",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/client/informers/externalversions/flux.weave.works/v1beta1/interface.go#L43-L45 |
131,607 | weaveworks/flux | registry/cache/registry.go | GetImage | func (c *Cache) GetImage(id image.Ref) (image.Info, error) {
key := NewManifestKey(id.CanonicalRef())
val, _, err := c.Reader.GetKey(key)
if err != nil {
return image.Info{}, err
}
var img registry.ImageEntry
err = json.Unmarshal(val, &img)
if err != nil {
return image.Info{}, err
}
if img.ExcludedReason ... | go | func (c *Cache) GetImage(id image.Ref) (image.Info, error) {
key := NewManifestKey(id.CanonicalRef())
val, _, err := c.Reader.GetKey(key)
if err != nil {
return image.Info{}, err
}
var img registry.ImageEntry
err = json.Unmarshal(val, &img)
if err != nil {
return image.Info{}, err
}
if img.ExcludedReason ... | [
"func",
"(",
"c",
"*",
"Cache",
")",
"GetImage",
"(",
"id",
"image",
".",
"Ref",
")",
"(",
"image",
".",
"Info",
",",
"error",
")",
"{",
"key",
":=",
"NewManifestKey",
"(",
"id",
".",
"CanonicalRef",
"(",
")",
")",
"\n\n",
"val",
",",
"_",
",",
... | // GetImage gets the manifest of a specific image ref, from its
// registry. | [
"GetImage",
"gets",
"the",
"manifest",
"of",
"a",
"specific",
"image",
"ref",
"from",
"its",
"registry",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/cache/registry.go#L61-L77 |
131,608 | weaveworks/flux | http/client/client.go | PostWithBody | func (c *Client) PostWithBody(ctx context.Context, route string, body interface{}, queryParams ...string) error {
return c.methodWithResp(ctx, "POST", nil, route, body, queryParams...)
} | go | func (c *Client) PostWithBody(ctx context.Context, route string, body interface{}, queryParams ...string) error {
return c.methodWithResp(ctx, "POST", nil, route, body, queryParams...)
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"PostWithBody",
"(",
"ctx",
"context",
".",
"Context",
",",
"route",
"string",
",",
"body",
"interface",
"{",
"}",
",",
"queryParams",
"...",
"string",
")",
"error",
"{",
"return",
"c",
".",
"methodWithResp",
"(",
... | // PostWithBody is a more complex post request, which includes a json-ified body.
// If body is not nil, it is encoded to json before sending | [
"PostWithBody",
"is",
"a",
"more",
"complex",
"post",
"request",
"which",
"includes",
"a",
"json",
"-",
"ified",
"body",
".",
"If",
"body",
"is",
"not",
"nil",
"it",
"is",
"encoded",
"to",
"json",
"before",
"sending"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/http/client/client.go#L127-L129 |
131,609 | weaveworks/flux | http/client/client.go | methodWithResp | func (c *Client) methodWithResp(ctx context.Context, method string, dest interface{}, route string, body interface{}, queryParams ...string) error {
u, err := transport.MakeURL(c.endpoint, c.router, route, queryParams...)
if err != nil {
return errors.Wrap(err, "constructing URL")
}
var bodyBytes []byte
if body... | go | func (c *Client) methodWithResp(ctx context.Context, method string, dest interface{}, route string, body interface{}, queryParams ...string) error {
u, err := transport.MakeURL(c.endpoint, c.router, route, queryParams...)
if err != nil {
return errors.Wrap(err, "constructing URL")
}
var bodyBytes []byte
if body... | [
"func",
"(",
"c",
"*",
"Client",
")",
"methodWithResp",
"(",
"ctx",
"context",
".",
"Context",
",",
"method",
"string",
",",
"dest",
"interface",
"{",
"}",
",",
"route",
"string",
",",
"body",
"interface",
"{",
"}",
",",
"queryParams",
"...",
"string",
... | // methodWithResp is the full enchilada, it handles body and query-param
// encoding, as well as decoding the response into the provided destination.
// Note, the response will only be decoded into the dest if the len is > 0. | [
"methodWithResp",
"is",
"the",
"full",
"enchilada",
"it",
"handles",
"body",
"and",
"query",
"-",
"param",
"encoding",
"as",
"well",
"as",
"decoding",
"the",
"response",
"into",
"the",
"provided",
"destination",
".",
"Note",
"the",
"response",
"will",
"only",
... | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/http/client/client.go#L138-L179 |
131,610 | weaveworks/flux | http/client/client.go | Get | func (c *Client) Get(ctx context.Context, dest interface{}, route string, queryParams ...string) error {
u, err := transport.MakeURL(c.endpoint, c.router, route, queryParams...)
if err != nil {
return errors.Wrap(err, "constructing URL")
}
req, err := http.NewRequest("GET", u.String(), nil)
if err != nil {
re... | go | func (c *Client) Get(ctx context.Context, dest interface{}, route string, queryParams ...string) error {
u, err := transport.MakeURL(c.endpoint, c.router, route, queryParams...)
if err != nil {
return errors.Wrap(err, "constructing URL")
}
req, err := http.NewRequest("GET", u.String(), nil)
if err != nil {
re... | [
"func",
"(",
"c",
"*",
"Client",
")",
"Get",
"(",
"ctx",
"context",
".",
"Context",
",",
"dest",
"interface",
"{",
"}",
",",
"route",
"string",
",",
"queryParams",
"...",
"string",
")",
"error",
"{",
"u",
",",
"err",
":=",
"transport",
".",
"MakeURL"... | // get executes a get request against the Flux server. it unmarshals the response into dest. | [
"get",
"executes",
"a",
"get",
"request",
"against",
"the",
"Flux",
"server",
".",
"it",
"unmarshals",
"the",
"response",
"into",
"dest",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/http/client/client.go#L182-L207 |
131,611 | weaveworks/flux | cluster/kubernetes/resource/fluxhelmrelease.go | interpret | func interpret(values interface{}) (image.Ref, ImageSetter, bool) {
switch m := values.(type) {
case map[string]interface{}:
return interpretAsContainer(stringMap(m))
case map[interface{}]interface{}:
return interpretAsContainer(anyMap(m))
}
return image.Ref{}, nil, false
} | go | func interpret(values interface{}) (image.Ref, ImageSetter, bool) {
switch m := values.(type) {
case map[string]interface{}:
return interpretAsContainer(stringMap(m))
case map[interface{}]interface{}:
return interpretAsContainer(anyMap(m))
}
return image.Ref{}, nil, false
} | [
"func",
"interpret",
"(",
"values",
"interface",
"{",
"}",
")",
"(",
"image",
".",
"Ref",
",",
"ImageSetter",
",",
"bool",
")",
"{",
"switch",
"m",
":=",
"values",
".",
"(",
"type",
")",
"{",
"case",
"map",
"[",
"string",
"]",
"interface",
"{",
"}"... | // interpret gets a value which may contain a description of an image. | [
"interpret",
"gets",
"a",
"value",
"which",
"may",
"contain",
"a",
"description",
"of",
"an",
"image",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cluster/kubernetes/resource/fluxhelmrelease.go#L97-L105 |
131,612 | weaveworks/flux | cluster/kubernetes/resource/fluxhelmrelease.go | interpretAsContainer | func interpretAsContainer(m mapper) (image.Ref, ImageSetter, bool) {
imageValue, ok := m.get("image")
if !ok {
return image.Ref{}, nil, false
}
switch img := imageValue.(type) {
case string:
// ```
// container:
// image: 'repo/image:tag'
// ```
imageRef, err := image.ParseRef(img)
if err == nil {
... | go | func interpretAsContainer(m mapper) (image.Ref, ImageSetter, bool) {
imageValue, ok := m.get("image")
if !ok {
return image.Ref{}, nil, false
}
switch img := imageValue.(type) {
case string:
// ```
// container:
// image: 'repo/image:tag'
// ```
imageRef, err := image.ParseRef(img)
if err == nil {
... | [
"func",
"interpretAsContainer",
"(",
"m",
"mapper",
")",
"(",
"image",
".",
"Ref",
",",
"ImageSetter",
",",
"bool",
")",
"{",
"imageValue",
",",
"ok",
":=",
"m",
".",
"get",
"(",
"\"",
"\"",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"image",
".",
... | // interpretAsContainer takes a `mapper` value that may _contain_ an
// image, and attempts to interpret it. | [
"interpretAsContainer",
"takes",
"a",
"mapper",
"value",
"that",
"may",
"_contain_",
"an",
"image",
"and",
"attempts",
"to",
"interpret",
"it",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cluster/kubernetes/resource/fluxhelmrelease.go#L109-L147 |
131,613 | weaveworks/flux | cluster/kubernetes/resource/fluxhelmrelease.go | interpretAsImage | func interpretAsImage(m mapper) (image.Ref, ImageSetter, bool) {
var imgRepo, imgTag interface{}
var ok bool
if imgRepo, ok = m.get("repository"); !ok {
return image.Ref{}, nil, false
}
if imgTag, ok = m.get("tag"); !ok {
return image.Ref{}, nil, false
}
if imgStr, ok := imgRepo.(string); ok {
if tagStr,... | go | func interpretAsImage(m mapper) (image.Ref, ImageSetter, bool) {
var imgRepo, imgTag interface{}
var ok bool
if imgRepo, ok = m.get("repository"); !ok {
return image.Ref{}, nil, false
}
if imgTag, ok = m.get("tag"); !ok {
return image.Ref{}, nil, false
}
if imgStr, ok := imgRepo.(string); ok {
if tagStr,... | [
"func",
"interpretAsImage",
"(",
"m",
"mapper",
")",
"(",
"image",
".",
"Ref",
",",
"ImageSetter",
",",
"bool",
")",
"{",
"var",
"imgRepo",
",",
"imgTag",
"interface",
"{",
"}",
"\n",
"var",
"ok",
"bool",
"\n",
"if",
"imgRepo",
",",
"ok",
"=",
"m",
... | // interpretAsImage takes a `mapper` value that may represent an
// image, and attempts to interpret it. | [
"interpretAsImage",
"takes",
"a",
"mapper",
"value",
"that",
"may",
"represent",
"an",
"image",
"and",
"attempts",
"to",
"interpret",
"it",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cluster/kubernetes/resource/fluxhelmrelease.go#L151-L178 |
131,614 | weaveworks/flux | cluster/kubernetes/resource/fluxhelmrelease.go | Containers | func (fhr FluxHelmRelease) Containers() []resource.Container {
var containers []resource.Container
// If there's an error in interpreting, return what we have.
_ = FindFluxHelmReleaseContainers(fhr.Spec.Values, func(container string, image image.Ref, _ ImageSetter) error {
containers = append(containers, resource.... | go | func (fhr FluxHelmRelease) Containers() []resource.Container {
var containers []resource.Container
// If there's an error in interpreting, return what we have.
_ = FindFluxHelmReleaseContainers(fhr.Spec.Values, func(container string, image image.Ref, _ ImageSetter) error {
containers = append(containers, resource.... | [
"func",
"(",
"fhr",
"FluxHelmRelease",
")",
"Containers",
"(",
")",
"[",
"]",
"resource",
".",
"Container",
"{",
"var",
"containers",
"[",
"]",
"resource",
".",
"Container",
"\n",
"// If there's an error in interpreting, return what we have.",
"_",
"=",
"FindFluxHel... | // Containers returns the containers that are defined in the
// FluxHelmRelease. | [
"Containers",
"returns",
"the",
"containers",
"that",
"are",
"defined",
"in",
"the",
"FluxHelmRelease",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cluster/kubernetes/resource/fluxhelmrelease.go#L182-L193 |
131,615 | weaveworks/flux | cluster/kubernetes/resource/fluxhelmrelease.go | SetContainerImage | func (fhr FluxHelmRelease) SetContainerImage(container string, ref image.Ref) error {
found := false
if err := FindFluxHelmReleaseContainers(fhr.Spec.Values, func(name string, image image.Ref, setter ImageSetter) error {
if container == name {
setter(ref)
found = true
}
return nil
}); err != nil {
retu... | go | func (fhr FluxHelmRelease) SetContainerImage(container string, ref image.Ref) error {
found := false
if err := FindFluxHelmReleaseContainers(fhr.Spec.Values, func(name string, image image.Ref, setter ImageSetter) error {
if container == name {
setter(ref)
found = true
}
return nil
}); err != nil {
retu... | [
"func",
"(",
"fhr",
"FluxHelmRelease",
")",
"SetContainerImage",
"(",
"container",
"string",
",",
"ref",
"image",
".",
"Ref",
")",
"error",
"{",
"found",
":=",
"false",
"\n",
"if",
"err",
":=",
"FindFluxHelmReleaseContainers",
"(",
"fhr",
".",
"Spec",
".",
... | // SetContainerImage mutates this resource by setting the `image`
// field of `values`, or a subvalue therein, per one of the
// interpretations in `FindFluxHelmReleaseContainers` above. NB we can
// get away with a value-typed receiver because we set a map entry. | [
"SetContainerImage",
"mutates",
"this",
"resource",
"by",
"setting",
"the",
"image",
"field",
"of",
"values",
"or",
"a",
"subvalue",
"therein",
"per",
"one",
"of",
"the",
"interpretations",
"in",
"FindFluxHelmReleaseContainers",
"above",
".",
"NB",
"we",
"can",
... | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cluster/kubernetes/resource/fluxhelmrelease.go#L199-L214 |
131,616 | weaveworks/flux | integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go | DeepCopy | func (in *ChartFileSelector) DeepCopy() *ChartFileSelector {
if in == nil {
return nil
}
out := new(ChartFileSelector)
in.DeepCopyInto(out)
return out
} | go | func (in *ChartFileSelector) DeepCopy() *ChartFileSelector {
if in == nil {
return nil
}
out := new(ChartFileSelector)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"ChartFileSelector",
")",
"DeepCopy",
"(",
")",
"*",
"ChartFileSelector",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"ChartFileSelector",
")",
"\n",
"in",
".",
"DeepCopyInto",
"... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChartFileSelector. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"ChartFileSelector",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go#L40-L47 |
131,617 | weaveworks/flux | integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go | DeepCopy | func (in *ChartSource) DeepCopy() *ChartSource {
if in == nil {
return nil
}
out := new(ChartSource)
in.DeepCopyInto(out)
return out
} | go | func (in *ChartSource) DeepCopy() *ChartSource {
if in == nil {
return nil
}
out := new(ChartSource)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"ChartSource",
")",
"DeepCopy",
"(",
")",
"*",
"ChartSource",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"ChartSource",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")"... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChartSource. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"ChartSource",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go#L66-L73 |
131,618 | weaveworks/flux | integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go | DeepCopy | func (in *ExternalSourceSelector) DeepCopy() *ExternalSourceSelector {
if in == nil {
return nil
}
out := new(ExternalSourceSelector)
in.DeepCopyInto(out)
return out
} | go | func (in *ExternalSourceSelector) DeepCopy() *ExternalSourceSelector {
if in == nil {
return nil
}
out := new(ExternalSourceSelector)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"ExternalSourceSelector",
")",
"DeepCopy",
"(",
")",
"*",
"ExternalSourceSelector",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"ExternalSourceSelector",
")",
"\n",
"in",
".",
"Dee... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalSourceSelector. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"ExternalSourceSelector",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go#L87-L94 |
131,619 | weaveworks/flux | integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go | DeepCopy | func (in *GitChartSource) DeepCopy() *GitChartSource {
if in == nil {
return nil
}
out := new(GitChartSource)
in.DeepCopyInto(out)
return out
} | go | func (in *GitChartSource) DeepCopy() *GitChartSource {
if in == nil {
return nil
}
out := new(GitChartSource)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"GitChartSource",
")",
"DeepCopy",
"(",
")",
"*",
"GitChartSource",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"GitChartSource",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"ou... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitChartSource. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"GitChartSource",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go#L103-L110 |
131,620 | weaveworks/flux | integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go | DeepCopy | func (in *HelmRelease) DeepCopy() *HelmRelease {
if in == nil {
return nil
}
out := new(HelmRelease)
in.DeepCopyInto(out)
return out
} | go | func (in *HelmRelease) DeepCopy() *HelmRelease {
if in == nil {
return nil
}
out := new(HelmRelease)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"HelmRelease",
")",
"DeepCopy",
"(",
")",
"*",
"HelmRelease",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"HelmRelease",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
"out",
")"... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmRelease. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"HelmRelease",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go#L123-L130 |
131,621 | weaveworks/flux | integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go | DeepCopy | func (in *HelmReleaseCondition) DeepCopy() *HelmReleaseCondition {
if in == nil {
return nil
}
out := new(HelmReleaseCondition)
in.DeepCopyInto(out)
return out
} | go | func (in *HelmReleaseCondition) DeepCopy() *HelmReleaseCondition {
if in == nil {
return nil
}
out := new(HelmReleaseCondition)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"HelmReleaseCondition",
")",
"DeepCopy",
"(",
")",
"*",
"HelmReleaseCondition",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"HelmReleaseCondition",
")",
"\n",
"in",
".",
"DeepCopyI... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseCondition. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"HelmReleaseCondition",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go#L148-L155 |
131,622 | weaveworks/flux | integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go | DeepCopy | func (in *HelmReleaseList) DeepCopy() *HelmReleaseList {
if in == nil {
return nil
}
out := new(HelmReleaseList)
in.DeepCopyInto(out)
return out
} | go | func (in *HelmReleaseList) DeepCopy() *HelmReleaseList {
if in == nil {
return nil
}
out := new(HelmReleaseList)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"HelmReleaseList",
")",
"DeepCopy",
"(",
")",
"*",
"HelmReleaseList",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"HelmReleaseList",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseList. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"HelmReleaseList",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go#L173-L180 |
131,623 | weaveworks/flux | integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go | DeepCopy | func (in *HelmReleaseSpec) DeepCopy() *HelmReleaseSpec {
if in == nil {
return nil
}
out := new(HelmReleaseSpec)
in.DeepCopyInto(out)
return out
} | go | func (in *HelmReleaseSpec) DeepCopy() *HelmReleaseSpec {
if in == nil {
return nil
}
out := new(HelmReleaseSpec)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"HelmReleaseSpec",
")",
"DeepCopy",
"(",
")",
"*",
"HelmReleaseSpec",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"HelmReleaseSpec",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseSpec. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"HelmReleaseSpec",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go#L216-L223 |
131,624 | weaveworks/flux | integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go | DeepCopy | func (in *HelmReleaseStatus) DeepCopy() *HelmReleaseStatus {
if in == nil {
return nil
}
out := new(HelmReleaseStatus)
in.DeepCopyInto(out)
return out
} | go | func (in *HelmReleaseStatus) DeepCopy() *HelmReleaseStatus {
if in == nil {
return nil
}
out := new(HelmReleaseStatus)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"HelmReleaseStatus",
")",
"DeepCopy",
"(",
")",
"*",
"HelmReleaseStatus",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"HelmReleaseStatus",
")",
"\n",
"in",
".",
"DeepCopyInto",
"... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseStatus. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"HelmReleaseStatus",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go#L239-L246 |
131,625 | weaveworks/flux | integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go | DeepCopy | func (in *RepoChartSource) DeepCopy() *RepoChartSource {
if in == nil {
return nil
}
out := new(RepoChartSource)
in.DeepCopyInto(out)
return out
} | go | func (in *RepoChartSource) DeepCopy() *RepoChartSource {
if in == nil {
return nil
}
out := new(RepoChartSource)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"RepoChartSource",
")",
"DeepCopy",
"(",
")",
"*",
"RepoChartSource",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"RepoChartSource",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepoChartSource. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"RepoChartSource",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go#L260-L267 |
131,626 | weaveworks/flux | integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go | DeepCopy | func (in *ValuesFromSource) DeepCopy() *ValuesFromSource {
if in == nil {
return nil
}
out := new(ValuesFromSource)
in.DeepCopyInto(out)
return out
} | go | func (in *ValuesFromSource) DeepCopy() *ValuesFromSource {
if in == nil {
return nil
}
out := new(ValuesFromSource)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"ValuesFromSource",
")",
"DeepCopy",
"(",
")",
"*",
"ValuesFromSource",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"ValuesFromSource",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValuesFromSource. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"ValuesFromSource",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/flux.weave.works/v1beta1/zz_generated.deepcopy.go#L296-L303 |
131,627 | weaveworks/flux | integrations/client/clientset/versioned/typed/flux.weave.works/v1beta1/helmrelease.go | newHelmReleases | func newHelmReleases(c *FluxV1beta1Client, namespace string) *helmReleases {
return &helmReleases{
client: c.RESTClient(),
ns: namespace,
}
} | go | func newHelmReleases(c *FluxV1beta1Client, namespace string) *helmReleases {
return &helmReleases{
client: c.RESTClient(),
ns: namespace,
}
} | [
"func",
"newHelmReleases",
"(",
"c",
"*",
"FluxV1beta1Client",
",",
"namespace",
"string",
")",
"*",
"helmReleases",
"{",
"return",
"&",
"helmReleases",
"{",
"client",
":",
"c",
".",
"RESTClient",
"(",
")",
",",
"ns",
":",
"namespace",
",",
"}",
"\n",
"}... | // newHelmReleases returns a HelmReleases | [
"newHelmReleases",
"returns",
"a",
"HelmReleases"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/client/clientset/versioned/typed/flux.weave.works/v1beta1/helmrelease.go#L59-L64 |
131,628 | weaveworks/flux | http/websocket/server.go | Upgrade | func Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (Websocket, error) {
wsConn, err := upgrader.Upgrade(w, r, responseHeader)
if err != nil {
return nil, err
}
return Ping(wsConn), nil
} | go | func Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (Websocket, error) {
wsConn, err := upgrader.Upgrade(w, r, responseHeader)
if err != nil {
return nil, err
}
return Ping(wsConn), nil
} | [
"func",
"Upgrade",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
",",
"responseHeader",
"http",
".",
"Header",
")",
"(",
"Websocket",
",",
"error",
")",
"{",
"wsConn",
",",
"err",
":=",
"upgrader",
".",
"Upgrade",
"(",... | // Upgrade upgrades the HTTP server connection to the WebSocket protocol. | [
"Upgrade",
"upgrades",
"the",
"HTTP",
"server",
"connection",
"to",
"the",
"WebSocket",
"protocol",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/http/websocket/server.go#L14-L20 |
131,629 | weaveworks/flux | registry/cache/repocachemanager.go | fetchRepository | func (c *repoCacheManager) fetchRepository() (ImageRepository, error) {
var result ImageRepository
repoKey := NewRepositoryKey(c.repoID.CanonicalName())
bytes, _, err := c.cacheClient.GetKey(repoKey)
if err != nil {
return ImageRepository{}, err
}
if err = json.Unmarshal(bytes, &result); err != nil {
return I... | go | func (c *repoCacheManager) fetchRepository() (ImageRepository, error) {
var result ImageRepository
repoKey := NewRepositoryKey(c.repoID.CanonicalName())
bytes, _, err := c.cacheClient.GetKey(repoKey)
if err != nil {
return ImageRepository{}, err
}
if err = json.Unmarshal(bytes, &result); err != nil {
return I... | [
"func",
"(",
"c",
"*",
"repoCacheManager",
")",
"fetchRepository",
"(",
")",
"(",
"ImageRepository",
",",
"error",
")",
"{",
"var",
"result",
"ImageRepository",
"\n",
"repoKey",
":=",
"NewRepositoryKey",
"(",
"c",
".",
"repoID",
".",
"CanonicalName",
"(",
")... | // fetchRepository fetches the repository from the cache | [
"fetchRepository",
"fetches",
"the",
"repository",
"from",
"the",
"cache"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/cache/repocachemanager.go#L59-L70 |
131,630 | weaveworks/flux | registry/cache/repocachemanager.go | getTags | func (c *repoCacheManager) getTags(ctx context.Context) ([]string, error) {
ctx, cancel := context.WithTimeout(ctx, c.clientTimeout)
defer cancel()
tags, err := c.client.Tags(ctx)
if ctx.Err() == context.DeadlineExceeded {
return nil, c.clientTimeoutError()
}
return tags, err
} | go | func (c *repoCacheManager) getTags(ctx context.Context) ([]string, error) {
ctx, cancel := context.WithTimeout(ctx, c.clientTimeout)
defer cancel()
tags, err := c.client.Tags(ctx)
if ctx.Err() == context.DeadlineExceeded {
return nil, c.clientTimeoutError()
}
return tags, err
} | [
"func",
"(",
"c",
"*",
"repoCacheManager",
")",
"getTags",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithTimeout",
"(",
"ctx",
",",
"c",
".",
"clientTimeo... | // getTags gets the tags from the repository | [
"getTags",
"gets",
"the",
"tags",
"from",
"the",
"repository"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/cache/repocachemanager.go#L73-L81 |
131,631 | weaveworks/flux | registry/cache/repocachemanager.go | storeRepository | func (c *repoCacheManager) storeRepository(repo ImageRepository) error {
repoKey := NewRepositoryKey(c.repoID.CanonicalName())
bytes, err := json.Marshal(repo)
if err != nil {
return err
}
return c.cacheClient.SetKey(repoKey, c.now.Add(repoRefresh), bytes)
} | go | func (c *repoCacheManager) storeRepository(repo ImageRepository) error {
repoKey := NewRepositoryKey(c.repoID.CanonicalName())
bytes, err := json.Marshal(repo)
if err != nil {
return err
}
return c.cacheClient.SetKey(repoKey, c.now.Add(repoRefresh), bytes)
} | [
"func",
"(",
"c",
"*",
"repoCacheManager",
")",
"storeRepository",
"(",
"repo",
"ImageRepository",
")",
"error",
"{",
"repoKey",
":=",
"NewRepositoryKey",
"(",
"c",
".",
"repoID",
".",
"CanonicalName",
"(",
")",
")",
"\n",
"bytes",
",",
"err",
":=",
"json"... | // storeRepository stores the repository from the cache | [
"storeRepository",
"stores",
"the",
"repository",
"from",
"the",
"cache"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/cache/repocachemanager.go#L84-L91 |
131,632 | weaveworks/flux | registry/cache/repocachemanager.go | fetchImages | func (c *repoCacheManager) fetchImages(tags []string) (fetchImagesResult, error) {
images := map[string]image.Info{}
// Create a list of images that need updating
var toUpdate []imageToUpdate
// Counters for reporting what happened
var missing, refresh int
for _, tag := range tags {
if tag == "" {
return f... | go | func (c *repoCacheManager) fetchImages(tags []string) (fetchImagesResult, error) {
images := map[string]image.Info{}
// Create a list of images that need updating
var toUpdate []imageToUpdate
// Counters for reporting what happened
var missing, refresh int
for _, tag := range tags {
if tag == "" {
return f... | [
"func",
"(",
"c",
"*",
"repoCacheManager",
")",
"fetchImages",
"(",
"tags",
"[",
"]",
"string",
")",
"(",
"fetchImagesResult",
",",
"error",
")",
"{",
"images",
":=",
"map",
"[",
"string",
"]",
"image",
".",
"Info",
"{",
"}",
"\n\n",
"// Create a list of... | // fetchImages attemps to fetch the images with the provided tags from the cache.
// It returns the images found, those which require updating and details about
// why they need to be updated. | [
"fetchImages",
"attemps",
"to",
"fetch",
"the",
"images",
"with",
"the",
"provided",
"tags",
"from",
"the",
"cache",
".",
"It",
"returns",
"the",
"images",
"found",
"those",
"which",
"require",
"updating",
"and",
"details",
"about",
"why",
"they",
"need",
"t... | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/cache/repocachemanager.go#L105-L173 |
131,633 | weaveworks/flux | registry/cache/repocachemanager.go | updateImages | func (c *repoCacheManager) updateImages(ctx context.Context, images []imageToUpdate) (map[string]image.Info, int, int) {
// The upper bound for concurrent fetches against a single host is
// w.Burst, so limit the number of fetching goroutines to that.
fetchers := make(chan struct{}, c.burst)
awaitFetchers := &sync.... | go | func (c *repoCacheManager) updateImages(ctx context.Context, images []imageToUpdate) (map[string]image.Info, int, int) {
// The upper bound for concurrent fetches against a single host is
// w.Burst, so limit the number of fetching goroutines to that.
fetchers := make(chan struct{}, c.burst)
awaitFetchers := &sync.... | [
"func",
"(",
"c",
"*",
"repoCacheManager",
")",
"updateImages",
"(",
"ctx",
"context",
".",
"Context",
",",
"images",
"[",
"]",
"imageToUpdate",
")",
"(",
"map",
"[",
"string",
"]",
"image",
".",
"Info",
",",
"int",
",",
"int",
")",
"{",
"// The upper ... | // updateImages, refreshes the cache entries for the images passed. It may not succeed for all images.
// It returns the values stored in cache, the number of images it succeeded for and the number
// of images whose manifest wasn't found in the registry. | [
"updateImages",
"refreshes",
"the",
"cache",
"entries",
"for",
"the",
"images",
"passed",
".",
"It",
"may",
"not",
"succeed",
"for",
"all",
"images",
".",
"It",
"returns",
"the",
"values",
"stored",
"in",
"cache",
"the",
"number",
"of",
"images",
"it",
"su... | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/cache/repocachemanager.go#L178-L240 |
131,634 | weaveworks/flux | integrations/helm/http/daemon/server.go | ListenAndServe | func ListenAndServe(listenAddr string, apiServer api.Server, logger log.Logger, stopCh <-chan struct{}) {
mux := http.DefaultServeMux
// setup metrics and health endpoints
mux.Handle("/metrics", promhttp.Handler())
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.Statu... | go | func ListenAndServe(listenAddr string, apiServer api.Server, logger log.Logger, stopCh <-chan struct{}) {
mux := http.DefaultServeMux
// setup metrics and health endpoints
mux.Handle("/metrics", promhttp.Handler())
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.Statu... | [
"func",
"ListenAndServe",
"(",
"listenAddr",
"string",
",",
"apiServer",
"api",
".",
"Server",
",",
"logger",
"log",
".",
"Logger",
",",
"stopCh",
"<-",
"chan",
"struct",
"{",
"}",
")",
"{",
"mux",
":=",
"http",
".",
"DefaultServeMux",
"\n\n",
"// setup me... | // ListenAndServe starts a HTTP server instrumented with Prometheus metrics,
// health and API endpoints on the specified address. | [
"ListenAndServe",
"starts",
"a",
"HTTP",
"server",
"instrumented",
"with",
"Prometheus",
"metrics",
"health",
"and",
"API",
"endpoints",
"on",
"the",
"specified",
"address",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/helm/http/daemon/server.go#L19-L60 |
131,635 | weaveworks/flux | integrations/helm/http/daemon/server.go | NewHandler | func NewHandler(s api.Server, r *mux.Router) http.Handler {
handle := &APIServer{server: s}
r.Get(transport.SyncGit).HandlerFunc(handle.SyncGit)
return r
} | go | func NewHandler(s api.Server, r *mux.Router) http.Handler {
handle := &APIServer{server: s}
r.Get(transport.SyncGit).HandlerFunc(handle.SyncGit)
return r
} | [
"func",
"NewHandler",
"(",
"s",
"api",
".",
"Server",
",",
"r",
"*",
"mux",
".",
"Router",
")",
"http",
".",
"Handler",
"{",
"handle",
":=",
"&",
"APIServer",
"{",
"server",
":",
"s",
"}",
"\n",
"r",
".",
"Get",
"(",
"transport",
".",
"SyncGit",
... | // NewHandler registers handlers on the given router. | [
"NewHandler",
"registers",
"handlers",
"on",
"the",
"given",
"router",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/helm/http/daemon/server.go#L63-L67 |
131,636 | weaveworks/flux | integrations/apis/helm.integrations.flux.weave.works/v1alpha2/types.go | DeepCopyInto | func (in *FluxHelmValues) DeepCopyInto(out *FluxHelmValues) {
if in == nil {
return
}
b, err := yaml.Marshal(in.Values)
if err != nil {
return
}
var values chartutil.Values
err = yaml.Unmarshal(b, &values)
if err != nil {
return
}
out.Values = values
} | go | func (in *FluxHelmValues) DeepCopyInto(out *FluxHelmValues) {
if in == nil {
return
}
b, err := yaml.Marshal(in.Values)
if err != nil {
return
}
var values chartutil.Values
err = yaml.Unmarshal(b, &values)
if err != nil {
return
}
out.Values = values
} | [
"func",
"(",
"in",
"*",
"FluxHelmValues",
")",
"DeepCopyInto",
"(",
"out",
"*",
"FluxHelmValues",
")",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n\n",
"b",
",",
"err",
":=",
"yaml",
".",
"Marshal",
"(",
"in",
".",
"Values",
")",
"\n... | // DeepCopyInto implements deepcopy-gen method for use in generated code | [
"DeepCopyInto",
"implements",
"deepcopy",
"-",
"gen",
"method",
"for",
"use",
"in",
"generated",
"code"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/helm.integrations.flux.weave.works/v1alpha2/types.go#L43-L58 |
131,637 | weaveworks/flux | http/websocket/ping.go | Ping | func Ping(c *websocket.Conn) Websocket {
p := &pingingWebsocket{conn: c}
p.conn.SetPongHandler(p.pong)
p.conn.SetReadDeadline(time.Now().Add(pongWait))
p.pinger = time.AfterFunc(pingPeriod, p.ping)
return p
} | go | func Ping(c *websocket.Conn) Websocket {
p := &pingingWebsocket{conn: c}
p.conn.SetPongHandler(p.pong)
p.conn.SetReadDeadline(time.Now().Add(pongWait))
p.pinger = time.AfterFunc(pingPeriod, p.ping)
return p
} | [
"func",
"Ping",
"(",
"c",
"*",
"websocket",
".",
"Conn",
")",
"Websocket",
"{",
"p",
":=",
"&",
"pingingWebsocket",
"{",
"conn",
":",
"c",
"}",
"\n",
"p",
".",
"conn",
".",
"SetPongHandler",
"(",
"p",
".",
"pong",
")",
"\n",
"p",
".",
"conn",
"."... | // Ping adds a periodic ping to a websocket connection. | [
"Ping",
"adds",
"a",
"periodic",
"ping",
"to",
"a",
"websocket",
"connection",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/http/websocket/ping.go#L37-L43 |
131,638 | weaveworks/flux | registry/client.go | MarshalJSON | func (entry ImageEntry) MarshalJSON() ([]byte, error) {
// We can only do it this way because it's explicitly an either-or
// -- I don't know of a way to inline all the fields when one of
// the things you're inlining defines its own MarshalJSON.
if entry.ExcludedReason != "" {
return json.Marshal(entry.Excluded)... | go | func (entry ImageEntry) MarshalJSON() ([]byte, error) {
// We can only do it this way because it's explicitly an either-or
// -- I don't know of a way to inline all the fields when one of
// the things you're inlining defines its own MarshalJSON.
if entry.ExcludedReason != "" {
return json.Marshal(entry.Excluded)... | [
"func",
"(",
"entry",
"ImageEntry",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"// We can only do it this way because it's explicitly an either-or",
"// -- I don't know of a way to inline all the fields when one of",
"// the things you're inlinin... | // MarshalJSON does custom JSON marshalling for ImageEntry values. We
// need this because the struct embeds the image.Info type, which has
// its own custom marshaling, which would get used otherwise. | [
"MarshalJSON",
"does",
"custom",
"JSON",
"marshalling",
"for",
"ImageEntry",
"values",
".",
"We",
"need",
"this",
"because",
"the",
"struct",
"embeds",
"the",
"image",
".",
"Info",
"type",
"which",
"has",
"its",
"own",
"custom",
"marshaling",
"which",
"would",... | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/client.go#L37-L45 |
131,639 | weaveworks/flux | registry/client.go | UnmarshalJSON | func (entry *ImageEntry) UnmarshalJSON(bytes []byte) error {
if err := json.Unmarshal(bytes, &entry.Info); err != nil {
return err
}
if err := json.Unmarshal(bytes, &entry.Excluded); err != nil {
return err
}
return nil
} | go | func (entry *ImageEntry) UnmarshalJSON(bytes []byte) error {
if err := json.Unmarshal(bytes, &entry.Info); err != nil {
return err
}
if err := json.Unmarshal(bytes, &entry.Excluded); err != nil {
return err
}
return nil
} | [
"func",
"(",
"entry",
"*",
"ImageEntry",
")",
"UnmarshalJSON",
"(",
"bytes",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"err",
":=",
"json",
".",
"Unmarshal",
"(",
"bytes",
",",
"&",
"entry",
".",
"Info",
")",
";",
"err",
"!=",
"nil",
"{",
"return"... | // UnmarshalJSON does custom JSON unmarshalling for ImageEntry values. | [
"UnmarshalJSON",
"does",
"custom",
"JSON",
"unmarshalling",
"for",
"ImageEntry",
"values",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/client.go#L48-L56 |
131,640 | weaveworks/flux | registry/client.go | Tags | func (a *Remote) Tags(ctx context.Context) ([]string, error) {
repository, err := client.NewRepository(named{a.repo}, a.base, a.transport)
if err != nil {
return nil, err
}
return repository.Tags(ctx).All(ctx)
} | go | func (a *Remote) Tags(ctx context.Context) ([]string, error) {
repository, err := client.NewRepository(named{a.repo}, a.base, a.transport)
if err != nil {
return nil, err
}
return repository.Tags(ctx).All(ctx)
} | [
"func",
"(",
"a",
"*",
"Remote",
")",
"Tags",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"repository",
",",
"err",
":=",
"client",
".",
"NewRepository",
"(",
"named",
"{",
"a",
".",
"repo",
"}",
"... | // Return the tags for this repository. | [
"Return",
"the",
"tags",
"for",
"this",
"repository",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/client.go#L95-L101 |
131,641 | weaveworks/flux | integrations/helm/chartsync/deps.go | updateDependencies | func updateDependencies(chartDir, helmhome string) error {
var hasLockFile bool
// sanity check: does the chart directory exist
if chartDir == "" {
return errors.New("empty path to chart supplied")
}
chartInfo, err := os.Stat(chartDir)
switch {
case os.IsNotExist(err):
return fmt.Errorf("chart path %s does ... | go | func updateDependencies(chartDir, helmhome string) error {
var hasLockFile bool
// sanity check: does the chart directory exist
if chartDir == "" {
return errors.New("empty path to chart supplied")
}
chartInfo, err := os.Stat(chartDir)
switch {
case os.IsNotExist(err):
return fmt.Errorf("chart path %s does ... | [
"func",
"updateDependencies",
"(",
"chartDir",
",",
"helmhome",
"string",
")",
"error",
"{",
"var",
"hasLockFile",
"bool",
"\n\n",
"// sanity check: does the chart directory exist",
"if",
"chartDir",
"==",
"\"",
"\"",
"{",
"return",
"errors",
".",
"New",
"(",
"\""... | // helmHome is optional; if it's "", it's left to default | [
"helmHome",
"is",
"optional",
";",
"if",
"it",
"s",
"it",
"s",
"left",
"to",
"default"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/helm/chartsync/deps.go#L12-L72 |
131,642 | weaveworks/flux | integrations/helm/release/release.go | New | func New(logger log.Logger, helmClient *k8shelm.Client) *Release {
r := &Release{
logger: logger,
HelmClient: helmClient,
}
return r
} | go | func New(logger log.Logger, helmClient *k8shelm.Client) *Release {
r := &Release{
logger: logger,
HelmClient: helmClient,
}
return r
} | [
"func",
"New",
"(",
"logger",
"log",
".",
"Logger",
",",
"helmClient",
"*",
"k8shelm",
".",
"Client",
")",
"*",
"Release",
"{",
"r",
":=",
"&",
"Release",
"{",
"logger",
":",
"logger",
",",
"HelmClient",
":",
"helmClient",
",",
"}",
"\n",
"return",
"... | // New creates a new Release instance. | [
"New",
"creates",
"a",
"new",
"Release",
"instance",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/helm/release/release.go#L63-L69 |
131,643 | weaveworks/flux | integrations/helm/release/release.go | GetUpgradableRelease | func (r *Release) GetUpgradableRelease(name string) (*hapi_release.Release, error) {
rls, err := r.HelmClient.ReleaseContent(name)
if err != nil {
if strings.Contains(err.Error(), "not found") {
return nil, nil
}
return nil, err
}
release := rls.GetRelease()
status := release.GetInfo().GetStatus()
swit... | go | func (r *Release) GetUpgradableRelease(name string) (*hapi_release.Release, error) {
rls, err := r.HelmClient.ReleaseContent(name)
if err != nil {
if strings.Contains(err.Error(), "not found") {
return nil, nil
}
return nil, err
}
release := rls.GetRelease()
status := release.GetInfo().GetStatus()
swit... | [
"func",
"(",
"r",
"*",
"Release",
")",
"GetUpgradableRelease",
"(",
"name",
"string",
")",
"(",
"*",
"hapi_release",
".",
"Release",
",",
"error",
")",
"{",
"rls",
",",
"err",
":=",
"r",
".",
"HelmClient",
".",
"ReleaseContent",
"(",
"name",
")",
"\n",... | // GetUpgradableRelease returns a release if the current state of it
// allows an upgrade, a descriptive error if it is not allowed, or
// nil if the release does not exist. | [
"GetUpgradableRelease",
"returns",
"a",
"release",
"if",
"the",
"current",
"state",
"of",
"it",
"allows",
"an",
"upgrade",
"a",
"descriptive",
"error",
"if",
"it",
"is",
"not",
"allowed",
"or",
"nil",
"if",
"the",
"release",
"does",
"not",
"exist",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/helm/release/release.go#L89-L113 |
131,644 | weaveworks/flux | integrations/helm/release/release.go | Delete | func (r *Release) Delete(name string) error {
ok, err := r.canDelete(name)
if !ok {
if err != nil {
return err
}
return nil
}
_, err = r.HelmClient.DeleteRelease(name, k8shelm.DeletePurge(true))
if err != nil {
r.logger.Log("error", fmt.Sprintf("Release deletion error: %#v", err))
return err
}
r.lo... | go | func (r *Release) Delete(name string) error {
ok, err := r.canDelete(name)
if !ok {
if err != nil {
return err
}
return nil
}
_, err = r.HelmClient.DeleteRelease(name, k8shelm.DeletePurge(true))
if err != nil {
r.logger.Log("error", fmt.Sprintf("Release deletion error: %#v", err))
return err
}
r.lo... | [
"func",
"(",
"r",
"*",
"Release",
")",
"Delete",
"(",
"name",
"string",
")",
"error",
"{",
"ok",
",",
"err",
":=",
"r",
".",
"canDelete",
"(",
"name",
")",
"\n",
"if",
"!",
"ok",
"{",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
... | // Delete purges a Chart release | [
"Delete",
"purges",
"a",
"Chart",
"release"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/helm/release/release.go#L252-L268 |
131,645 | weaveworks/flux | integrations/helm/release/release.go | fhrResourceID | func fhrResourceID(fhr flux_v1beta1.HelmRelease) flux.ResourceID {
return flux.MakeResourceID(fhr.Namespace, "HelmRelease", fhr.Name)
} | go | func fhrResourceID(fhr flux_v1beta1.HelmRelease) flux.ResourceID {
return flux.MakeResourceID(fhr.Namespace, "HelmRelease", fhr.Name)
} | [
"func",
"fhrResourceID",
"(",
"fhr",
"flux_v1beta1",
".",
"HelmRelease",
")",
"flux",
".",
"ResourceID",
"{",
"return",
"flux",
".",
"MakeResourceID",
"(",
"fhr",
".",
"Namespace",
",",
"\"",
"\"",
",",
"fhr",
".",
"Name",
")",
"\n",
"}"
] | // fhrResourceID constructs a flux.ResourceID for a HelmRelease resource. | [
"fhrResourceID",
"constructs",
"a",
"flux",
".",
"ResourceID",
"for",
"a",
"HelmRelease",
"resource",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/helm/release/release.go#L292-L294 |
131,646 | weaveworks/flux | integrations/helm/release/release.go | readLocalChartFile | func readLocalChartFile(filePath string) ([]byte, error) {
f, err := ioutil.ReadFile(filePath)
if err != nil {
return []byte{}, err
}
return f, nil
} | go | func readLocalChartFile(filePath string) ([]byte, error) {
f, err := ioutil.ReadFile(filePath)
if err != nil {
return []byte{}, err
}
return f, nil
} | [
"func",
"readLocalChartFile",
"(",
"filePath",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"f",
",",
"err",
":=",
"ioutil",
".",
"ReadFile",
"(",
"filePath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"[",
"]",
"byte",
"{... | // readLocalChartFile attempts to read a file from the chart path. | [
"readLocalChartFile",
"attempts",
"to",
"read",
"a",
"file",
"from",
"the",
"chart",
"path",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/helm/release/release.go#L456-L463 |
131,647 | weaveworks/flux | integrations/helm/release/release.go | releaseManifestToUnstructured | func releaseManifestToUnstructured(manifest string, logger log.Logger) []unstructured.Unstructured {
manifests := helmutil.SplitManifests(manifest)
var objs []unstructured.Unstructured
for _, manifest := range manifests {
bytes, err := yaml.YAMLToJSON([]byte(manifest))
if err != nil {
logger.Log("err", err)
... | go | func releaseManifestToUnstructured(manifest string, logger log.Logger) []unstructured.Unstructured {
manifests := helmutil.SplitManifests(manifest)
var objs []unstructured.Unstructured
for _, manifest := range manifests {
bytes, err := yaml.YAMLToJSON([]byte(manifest))
if err != nil {
logger.Log("err", err)
... | [
"func",
"releaseManifestToUnstructured",
"(",
"manifest",
"string",
",",
"logger",
"log",
".",
"Logger",
")",
"[",
"]",
"unstructured",
".",
"Unstructured",
"{",
"manifests",
":=",
"helmutil",
".",
"SplitManifests",
"(",
"manifest",
")",
"\n",
"var",
"objs",
"... | // releaseManifestToUnstructured turns a string containing YAML
// manifests into an array of Unstructured objects. | [
"releaseManifestToUnstructured",
"turns",
"a",
"string",
"containing",
"YAML",
"manifests",
"into",
"an",
"array",
"of",
"Unstructured",
"objects",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/helm/release/release.go#L467-L498 |
131,648 | weaveworks/flux | http/websocket/websocket.go | IsExpectedWSCloseError | func IsExpectedWSCloseError(err error) bool {
return err == io.EOF || err == io.ErrClosedPipe || websocket.IsCloseError(err,
websocket.CloseNormalClosure,
websocket.CloseGoingAway,
websocket.CloseNoStatusReceived,
websocket.CloseAbnormalClosure,
)
} | go | func IsExpectedWSCloseError(err error) bool {
return err == io.EOF || err == io.ErrClosedPipe || websocket.IsCloseError(err,
websocket.CloseNormalClosure,
websocket.CloseGoingAway,
websocket.CloseNoStatusReceived,
websocket.CloseAbnormalClosure,
)
} | [
"func",
"IsExpectedWSCloseError",
"(",
"err",
"error",
")",
"bool",
"{",
"return",
"err",
"==",
"io",
".",
"EOF",
"||",
"err",
"==",
"io",
".",
"ErrClosedPipe",
"||",
"websocket",
".",
"IsCloseError",
"(",
"err",
",",
"websocket",
".",
"CloseNormalClosure",
... | // IsExpectedWSCloseError returns boolean indicating whether the error is a
// clean disconnection. | [
"IsExpectedWSCloseError",
"returns",
"boolean",
"indicating",
"whether",
"the",
"error",
"is",
"a",
"clean",
"disconnection",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/http/websocket/websocket.go#L20-L27 |
131,649 | weaveworks/flux | integrations/apis/flux.weave.works/v1beta1/types.go | ResourceID | func (fhr HelmRelease) ResourceID() flux.ResourceID {
return flux.MakeResourceID(fhr.Namespace, "HelmRelease", fhr.Name)
} | go | func (fhr HelmRelease) ResourceID() flux.ResourceID {
return flux.MakeResourceID(fhr.Namespace, "HelmRelease", fhr.Name)
} | [
"func",
"(",
"fhr",
"HelmRelease",
")",
"ResourceID",
"(",
")",
"flux",
".",
"ResourceID",
"{",
"return",
"flux",
".",
"MakeResourceID",
"(",
"fhr",
".",
"Namespace",
",",
"\"",
"\"",
",",
"fhr",
".",
"Name",
")",
"\n",
"}"
] | // ResourceID returns an ID made from the identifying parts of the
// resource, as a convenience for Flux, which uses them
// everywhere. | [
"ResourceID",
"returns",
"an",
"ID",
"made",
"from",
"the",
"identifying",
"parts",
"of",
"the",
"resource",
"as",
"a",
"convenience",
"for",
"Flux",
"which",
"uses",
"them",
"everywhere",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/flux.weave.works/v1beta1/types.go#L29-L31 |
131,650 | weaveworks/flux | integrations/apis/flux.weave.works/v1beta1/types.go | CleanRepoURL | func (s RepoChartSource) CleanRepoURL() string {
cleanURL := strings.TrimRight(s.RepoURL, "/")
return cleanURL + "/"
} | go | func (s RepoChartSource) CleanRepoURL() string {
cleanURL := strings.TrimRight(s.RepoURL, "/")
return cleanURL + "/"
} | [
"func",
"(",
"s",
"RepoChartSource",
")",
"CleanRepoURL",
"(",
")",
"string",
"{",
"cleanURL",
":=",
"strings",
".",
"TrimRight",
"(",
"s",
".",
"RepoURL",
",",
"\"",
"\"",
")",
"\n",
"return",
"cleanURL",
"+",
"\"",
"\"",
"\n",
"}"
] | // CleanRepoURL returns the RepoURL but ensures it ends with a trailing slash | [
"CleanRepoURL",
"returns",
"the",
"RepoURL",
"but",
"ensures",
"it",
"ends",
"with",
"a",
"trailing",
"slash"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/flux.weave.works/v1beta1/types.go#L101-L104 |
131,651 | weaveworks/flux | cmd/fluxctl/await.go | await | func await(ctx context.Context, stdout, stderr io.Writer, client api.Server, jobID job.ID, apply bool, verbosity int) error {
result, err := awaitJob(ctx, client, jobID)
if err != nil {
if err == ErrTimeout {
fmt.Fprintln(stderr, `
We timed out waiting for the result of the operation. This does not
necessarily m... | go | func await(ctx context.Context, stdout, stderr io.Writer, client api.Server, jobID job.ID, apply bool, verbosity int) error {
result, err := awaitJob(ctx, client, jobID)
if err != nil {
if err == ErrTimeout {
fmt.Fprintln(stderr, `
We timed out waiting for the result of the operation. This does not
necessarily m... | [
"func",
"await",
"(",
"ctx",
"context",
".",
"Context",
",",
"stdout",
",",
"stderr",
"io",
".",
"Writer",
",",
"client",
"api",
".",
"Server",
",",
"jobID",
"job",
".",
"ID",
",",
"apply",
"bool",
",",
"verbosity",
"int",
")",
"error",
"{",
"result"... | // await polls for a job to complete, then for the resulting commit to
// be applied | [
"await",
"polls",
"for",
"a",
"job",
"to",
"complete",
"then",
"for",
"the",
"resulting",
"commit",
"to",
"be",
"applied"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cmd/fluxctl/await.go#L19-L61 |
131,652 | weaveworks/flux | cmd/fluxctl/await.go | awaitJob | func awaitJob(ctx context.Context, client api.Server, jobID job.ID) (job.Result, error) {
var result job.Result
err := backoff(100*time.Millisecond, 2, 50, 1*time.Minute, func() (bool, error) {
j, err := client.JobStatus(ctx, jobID)
if err != nil {
return false, err
}
switch j.StatusString {
case job.Sta... | go | func awaitJob(ctx context.Context, client api.Server, jobID job.ID) (job.Result, error) {
var result job.Result
err := backoff(100*time.Millisecond, 2, 50, 1*time.Minute, func() (bool, error) {
j, err := client.JobStatus(ctx, jobID)
if err != nil {
return false, err
}
switch j.StatusString {
case job.Sta... | [
"func",
"awaitJob",
"(",
"ctx",
"context",
".",
"Context",
",",
"client",
"api",
".",
"Server",
",",
"jobID",
"job",
".",
"ID",
")",
"(",
"job",
".",
"Result",
",",
"error",
")",
"{",
"var",
"result",
"job",
".",
"Result",
"\n",
"err",
":=",
"backo... | // await polls for a job to have been completed, with exponential backoff. | [
"await",
"polls",
"for",
"a",
"job",
"to",
"have",
"been",
"completed",
"with",
"exponential",
"backoff",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cmd/fluxctl/await.go#L64-L85 |
131,653 | weaveworks/flux | cmd/fluxctl/await.go | awaitSync | func awaitSync(ctx context.Context, client api.Server, revision string) error {
return backoff(1*time.Second, 2, 10, 1*time.Minute, func() (bool, error) {
refs, err := client.SyncStatus(ctx, revision)
return err == nil && len(refs) == 0, err
})
} | go | func awaitSync(ctx context.Context, client api.Server, revision string) error {
return backoff(1*time.Second, 2, 10, 1*time.Minute, func() (bool, error) {
refs, err := client.SyncStatus(ctx, revision)
return err == nil && len(refs) == 0, err
})
} | [
"func",
"awaitSync",
"(",
"ctx",
"context",
".",
"Context",
",",
"client",
"api",
".",
"Server",
",",
"revision",
"string",
")",
"error",
"{",
"return",
"backoff",
"(",
"1",
"*",
"time",
".",
"Second",
",",
"2",
",",
"10",
",",
"1",
"*",
"time",
".... | // await polls for a commit to have been applied, with exponential backoff. | [
"await",
"polls",
"for",
"a",
"commit",
"to",
"have",
"been",
"applied",
"with",
"exponential",
"backoff",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cmd/fluxctl/await.go#L88-L93 |
131,654 | weaveworks/flux | registry/credentials.go | Hosts | func (cs Credentials) Hosts() []string {
hosts := []string{}
for host := range cs.m {
hosts = append(hosts, host)
}
return hosts
} | go | func (cs Credentials) Hosts() []string {
hosts := []string{}
for host := range cs.m {
hosts = append(hosts, host)
}
return hosts
} | [
"func",
"(",
"cs",
"Credentials",
")",
"Hosts",
"(",
")",
"[",
"]",
"string",
"{",
"hosts",
":=",
"[",
"]",
"string",
"{",
"}",
"\n",
"for",
"host",
":=",
"range",
"cs",
".",
"m",
"{",
"hosts",
"=",
"append",
"(",
"hosts",
",",
"host",
")",
"\n... | // Hosts returns all of the hosts available in these credentials. | [
"Hosts",
"returns",
"all",
"of",
"the",
"hosts",
"available",
"in",
"these",
"credentials",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/credentials.go#L158-L164 |
131,655 | weaveworks/flux | update/release_containers.go | CalculateRelease | func (s ReleaseContainersSpec) CalculateRelease(rc ReleaseContext, logger log.Logger) ([]*WorkloadUpdate, Result, error) {
results := Result{}
prefilter, postfilter := s.filters()
all, err := rc.SelectWorkloads(results, prefilter, postfilter)
if err != nil {
return nil, results, err
}
updates := s.workloadUpdat... | go | func (s ReleaseContainersSpec) CalculateRelease(rc ReleaseContext, logger log.Logger) ([]*WorkloadUpdate, Result, error) {
results := Result{}
prefilter, postfilter := s.filters()
all, err := rc.SelectWorkloads(results, prefilter, postfilter)
if err != nil {
return nil, results, err
}
updates := s.workloadUpdat... | [
"func",
"(",
"s",
"ReleaseContainersSpec",
")",
"CalculateRelease",
"(",
"rc",
"ReleaseContext",
",",
"logger",
"log",
".",
"Logger",
")",
"(",
"[",
"]",
"*",
"WorkloadUpdate",
",",
"Result",
",",
"error",
")",
"{",
"results",
":=",
"Result",
"{",
"}",
"... | // CalculateRelease computes required controller updates to satisfy this specification.
// It returns an error if any spec calculation fails unless `SkipMismatches` is true. | [
"CalculateRelease",
"computes",
"required",
"controller",
"updates",
"to",
"satisfy",
"this",
"specification",
".",
"It",
"returns",
"an",
"error",
"if",
"any",
"spec",
"calculation",
"fails",
"unless",
"SkipMismatches",
"is",
"true",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/update/release_containers.go#L28-L37 |
131,656 | weaveworks/flux | cmd/fluxctl/save_cmd.go | filterObject | func filterObject(object saveObject) {
delete(object.Metadata.Annotations, "deployment.kubernetes.io/revision")
delete(object.Metadata.Annotations, "kubectl.kubernetes.io/last-applied-configuration")
delete(object.Metadata.Annotations, "kubernetes.io/change-cause")
deleteNested(object.Spec, "template", "metadata", ... | go | func filterObject(object saveObject) {
delete(object.Metadata.Annotations, "deployment.kubernetes.io/revision")
delete(object.Metadata.Annotations, "kubectl.kubernetes.io/last-applied-configuration")
delete(object.Metadata.Annotations, "kubernetes.io/change-cause")
deleteNested(object.Spec, "template", "metadata", ... | [
"func",
"filterObject",
"(",
"object",
"saveObject",
")",
"{",
"delete",
"(",
"object",
".",
"Metadata",
".",
"Annotations",
",",
"\"",
"\"",
")",
"\n",
"delete",
"(",
"object",
".",
"Metadata",
".",
"Annotations",
",",
"\"",
"\"",
")",
"\n",
"delete",
... | // Remove any data that should not be version controlled | [
"Remove",
"any",
"data",
"that",
"should",
"not",
"be",
"version",
"controlled"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cmd/fluxctl/save_cmd.go#L101-L107 |
131,657 | weaveworks/flux | cmd/fluxctl/save_cmd.go | deleteNested | func deleteNested(m map[interface{}]interface{}, keys ...string) {
switch len(keys) {
case 0:
return
case 1:
delete(m, keys[0])
default:
if v, ok := m[keys[0]].(map[interface{}]interface{}); ok {
deleteNested(v, keys[1:]...)
}
}
} | go | func deleteNested(m map[interface{}]interface{}, keys ...string) {
switch len(keys) {
case 0:
return
case 1:
delete(m, keys[0])
default:
if v, ok := m[keys[0]].(map[interface{}]interface{}); ok {
deleteNested(v, keys[1:]...)
}
}
} | [
"func",
"deleteNested",
"(",
"m",
"map",
"[",
"interface",
"{",
"}",
"]",
"interface",
"{",
"}",
",",
"keys",
"...",
"string",
")",
"{",
"switch",
"len",
"(",
"keys",
")",
"{",
"case",
"0",
":",
"return",
"\n",
"case",
"1",
":",
"delete",
"(",
"m... | // Recurse through nested maps to remove a key | [
"Recurse",
"through",
"nested",
"maps",
"to",
"remove",
"a",
"key"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cmd/fluxctl/save_cmd.go#L110-L121 |
131,658 | weaveworks/flux | cmd/fluxctl/save_cmd.go | deleteEmptyMapValues | func deleteEmptyMapValues(i interface{}) bool {
switch i := i.(type) {
case map[interface{}]interface{}:
if len(i) == 0 {
return true
} else {
for k, v := range i {
if deleteEmptyMapValues(v) {
delete(i, k)
}
}
}
case []interface{}:
if len(i) == 0 {
return true
} else {
for _, e... | go | func deleteEmptyMapValues(i interface{}) bool {
switch i := i.(type) {
case map[interface{}]interface{}:
if len(i) == 0 {
return true
} else {
for k, v := range i {
if deleteEmptyMapValues(v) {
delete(i, k)
}
}
}
case []interface{}:
if len(i) == 0 {
return true
} else {
for _, e... | [
"func",
"deleteEmptyMapValues",
"(",
"i",
"interface",
"{",
"}",
")",
"bool",
"{",
"switch",
"i",
":=",
"i",
".",
"(",
"type",
")",
"{",
"case",
"map",
"[",
"interface",
"{",
"}",
"]",
"interface",
"{",
"}",
":",
"if",
"len",
"(",
"i",
")",
"==",... | // Recursively delete map keys with empty values | [
"Recursively",
"delete",
"map",
"keys",
"with",
"empty",
"values"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cmd/fluxctl/save_cmd.go#L124-L148 |
131,659 | weaveworks/flux | cmd/fluxctl/save_cmd.go | saveYAML | func saveYAML(stdout io.Writer, object saveObject, out string) error {
buf, err := yaml.Marshal(object)
if err != nil {
return errors.Wrap(err, "marshalling yaml")
}
// to stdout
if out == "-" {
fmt.Fprintln(stdout, "---")
fmt.Fprint(stdout, string(buf))
return nil
}
// to a directory
path, err := out... | go | func saveYAML(stdout io.Writer, object saveObject, out string) error {
buf, err := yaml.Marshal(object)
if err != nil {
return errors.Wrap(err, "marshalling yaml")
}
// to stdout
if out == "-" {
fmt.Fprintln(stdout, "---")
fmt.Fprint(stdout, string(buf))
return nil
}
// to a directory
path, err := out... | [
"func",
"saveYAML",
"(",
"stdout",
"io",
".",
"Writer",
",",
"object",
"saveObject",
",",
"out",
"string",
")",
"error",
"{",
"buf",
",",
"err",
":=",
"yaml",
".",
"Marshal",
"(",
"object",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"errors"... | // Save YAML to directory structure | [
"Save",
"YAML",
"to",
"directory",
"structure"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cmd/fluxctl/save_cmd.go#L170-L203 |
131,660 | weaveworks/flux | integrations/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go | NewFluxHelmReleaseInformer | func NewFluxHelmReleaseInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredFluxHelmReleaseInformer(client, namespace, resyncPeriod, indexers, nil)
} | go | func NewFluxHelmReleaseInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredFluxHelmReleaseInformer(client, namespace, resyncPeriod, indexers, nil)
} | [
"func",
"NewFluxHelmReleaseInformer",
"(",
"client",
"versioned",
".",
"Interface",
",",
"namespace",
"string",
",",
"resyncPeriod",
"time",
".",
"Duration",
",",
"indexers",
"cache",
".",
"Indexers",
")",
"cache",
".",
"SharedIndexInformer",
"{",
"return",
"NewFi... | // NewFluxHelmReleaseInformer constructs a new informer for FluxHelmRelease type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server. | [
"NewFluxHelmReleaseInformer",
"constructs",
"a",
"new",
"informer",
"for",
"FluxHelmRelease",
"type",
".",
"Always",
"prefer",
"using",
"an",
"informer",
"factory",
"to",
"get",
"a",
"shared",
"informer",
"instead",
"of",
"getting",
"an",
"independent",
"one",
"."... | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go#L50-L52 |
131,661 | weaveworks/flux | integrations/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go | NewFilteredFluxHelmReleaseInformer | func NewFilteredFluxHelmReleaseInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOpti... | go | func NewFilteredFluxHelmReleaseInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOpti... | [
"func",
"NewFilteredFluxHelmReleaseInformer",
"(",
"client",
"versioned",
".",
"Interface",
",",
"namespace",
"string",
",",
"resyncPeriod",
"time",
".",
"Duration",
",",
"indexers",
"cache",
".",
"Indexers",
",",
"tweakListOptions",
"internalinterfaces",
".",
"TweakL... | // NewFilteredFluxHelmReleaseInformer constructs a new informer for FluxHelmRelease type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server. | [
"NewFilteredFluxHelmReleaseInformer",
"constructs",
"a",
"new",
"informer",
"for",
"FluxHelmRelease",
"type",
".",
"Always",
"prefer",
"using",
"an",
"informer",
"factory",
"to",
"get",
"a",
"shared",
"informer",
"instead",
"of",
"getting",
"an",
"independent",
"one... | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go#L57-L77 |
131,662 | weaveworks/flux | integrations/apis/helm.integrations.flux.weave.works/v1alpha2/zz_generated.deepcopy.go | DeepCopy | func (in *FluxHelmRelease) DeepCopy() *FluxHelmRelease {
if in == nil {
return nil
}
out := new(FluxHelmRelease)
in.DeepCopyInto(out)
return out
} | go | func (in *FluxHelmRelease) DeepCopy() *FluxHelmRelease {
if in == nil {
return nil
}
out := new(FluxHelmRelease)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"FluxHelmRelease",
")",
"DeepCopy",
"(",
")",
"*",
"FluxHelmRelease",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"FluxHelmRelease",
")",
"\n",
"in",
".",
"DeepCopyInto",
"(",
... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FluxHelmRelease. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"FluxHelmRelease",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/helm.integrations.flux.weave.works/v1alpha2/zz_generated.deepcopy.go#L39-L46 |
131,663 | weaveworks/flux | integrations/apis/helm.integrations.flux.weave.works/v1alpha2/zz_generated.deepcopy.go | DeepCopy | func (in *FluxHelmReleaseList) DeepCopy() *FluxHelmReleaseList {
if in == nil {
return nil
}
out := new(FluxHelmReleaseList)
in.DeepCopyInto(out)
return out
} | go | func (in *FluxHelmReleaseList) DeepCopy() *FluxHelmReleaseList {
if in == nil {
return nil
}
out := new(FluxHelmReleaseList)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"FluxHelmReleaseList",
")",
"DeepCopy",
"(",
")",
"*",
"FluxHelmReleaseList",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"FluxHelmReleaseList",
")",
"\n",
"in",
".",
"DeepCopyInto... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FluxHelmReleaseList. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"FluxHelmReleaseList",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/helm.integrations.flux.weave.works/v1alpha2/zz_generated.deepcopy.go#L72-L79 |
131,664 | weaveworks/flux | integrations/apis/helm.integrations.flux.weave.works/v1alpha2/zz_generated.deepcopy.go | DeepCopy | func (in *FluxHelmReleaseSpec) DeepCopy() *FluxHelmReleaseSpec {
if in == nil {
return nil
}
out := new(FluxHelmReleaseSpec)
in.DeepCopyInto(out)
return out
} | go | func (in *FluxHelmReleaseSpec) DeepCopy() *FluxHelmReleaseSpec {
if in == nil {
return nil
}
out := new(FluxHelmReleaseSpec)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"FluxHelmReleaseSpec",
")",
"DeepCopy",
"(",
")",
"*",
"FluxHelmReleaseSpec",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"FluxHelmReleaseSpec",
")",
"\n",
"in",
".",
"DeepCopyInto... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FluxHelmReleaseSpec. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"FluxHelmReleaseSpec",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/helm.integrations.flux.weave.works/v1alpha2/zz_generated.deepcopy.go#L102-L109 |
131,665 | weaveworks/flux | integrations/apis/helm.integrations.flux.weave.works/v1alpha2/zz_generated.deepcopy.go | DeepCopy | func (in *FluxHelmReleaseStatus) DeepCopy() *FluxHelmReleaseStatus {
if in == nil {
return nil
}
out := new(FluxHelmReleaseStatus)
in.DeepCopyInto(out)
return out
} | go | func (in *FluxHelmReleaseStatus) DeepCopy() *FluxHelmReleaseStatus {
if in == nil {
return nil
}
out := new(FluxHelmReleaseStatus)
in.DeepCopyInto(out)
return out
} | [
"func",
"(",
"in",
"*",
"FluxHelmReleaseStatus",
")",
"DeepCopy",
"(",
")",
"*",
"FluxHelmReleaseStatus",
"{",
"if",
"in",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"out",
":=",
"new",
"(",
"FluxHelmReleaseStatus",
")",
"\n",
"in",
".",
"DeepCo... | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FluxHelmReleaseStatus. | [
"DeepCopy",
"is",
"an",
"autogenerated",
"deepcopy",
"function",
"copying",
"the",
"receiver",
"creating",
"a",
"new",
"FluxHelmReleaseStatus",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/apis/helm.integrations.flux.weave.works/v1alpha2/zz_generated.deepcopy.go#L118-L125 |
131,666 | weaveworks/flux | cluster/kubernetes/sync.go | ResourceID | func (r *kuberesource) ResourceID() flux.ResourceID {
ns, kind, name := r.obj.GetNamespace(), r.obj.GetKind(), r.obj.GetName()
if !r.namespaced {
ns = kresource.ClusterScope
}
return flux.MakeResourceID(ns, kind, name)
} | go | func (r *kuberesource) ResourceID() flux.ResourceID {
ns, kind, name := r.obj.GetNamespace(), r.obj.GetKind(), r.obj.GetName()
if !r.namespaced {
ns = kresource.ClusterScope
}
return flux.MakeResourceID(ns, kind, name)
} | [
"func",
"(",
"r",
"*",
"kuberesource",
")",
"ResourceID",
"(",
")",
"flux",
".",
"ResourceID",
"{",
"ns",
",",
"kind",
",",
"name",
":=",
"r",
".",
"obj",
".",
"GetNamespace",
"(",
")",
",",
"r",
".",
"obj",
".",
"GetKind",
"(",
")",
",",
"r",
... | // ResourceID returns the ResourceID for this resource loaded from the
// cluster. | [
"ResourceID",
"returns",
"the",
"ResourceID",
"for",
"this",
"resource",
"loaded",
"from",
"the",
"cluster",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cluster/kubernetes/sync.go#L164-L170 |
131,667 | weaveworks/flux | registry/cache/warming.go | Loop | func (w *Warmer) Loop(logger log.Logger, stop <-chan struct{}, wg *sync.WaitGroup, imagesToFetchFunc func() registry.ImageCreds) {
defer wg.Done()
refresh := time.Tick(askForNewImagesInterval)
imageCreds := imagesToFetchFunc()
backlog := imageCredsToBacklog(imageCreds)
// We have some fine control over how long ... | go | func (w *Warmer) Loop(logger log.Logger, stop <-chan struct{}, wg *sync.WaitGroup, imagesToFetchFunc func() registry.ImageCreds) {
defer wg.Done()
refresh := time.Tick(askForNewImagesInterval)
imageCreds := imagesToFetchFunc()
backlog := imageCredsToBacklog(imageCreds)
// We have some fine control over how long ... | [
"func",
"(",
"w",
"*",
"Warmer",
")",
"Loop",
"(",
"logger",
"log",
".",
"Logger",
",",
"stop",
"<-",
"chan",
"struct",
"{",
"}",
",",
"wg",
"*",
"sync",
".",
"WaitGroup",
",",
"imagesToFetchFunc",
"func",
"(",
")",
"registry",
".",
"ImageCreds",
")"... | // Loop continuously gets the images to populate the cache with,
// and populate the cache with them. | [
"Loop",
"continuously",
"gets",
"the",
"images",
"to",
"populate",
"the",
"cache",
"with",
"and",
"populate",
"the",
"cache",
"with",
"them",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/cache/warming.go#L79-L137 |
131,668 | weaveworks/flux | registry/cache/warming.go | NewStringSet | func NewStringSet(ss []string) StringSet {
res := StringSet{}
for _, s := range ss {
res[s] = struct{}{}
}
return res
} | go | func NewStringSet(ss []string) StringSet {
res := StringSet{}
for _, s := range ss {
res[s] = struct{}{}
}
return res
} | [
"func",
"NewStringSet",
"(",
"ss",
"[",
"]",
"string",
")",
"StringSet",
"{",
"res",
":=",
"StringSet",
"{",
"}",
"\n",
"for",
"_",
",",
"s",
":=",
"range",
"ss",
"{",
"res",
"[",
"s",
"]",
"=",
"struct",
"{",
"}",
"{",
"}",
"\n",
"}",
"\n",
... | // NewStringSet returns a StringSet containing exactly the strings
// given as arguments. | [
"NewStringSet",
"returns",
"a",
"StringSet",
"containing",
"exactly",
"the",
"strings",
"given",
"as",
"arguments",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/cache/warming.go#L251-L257 |
131,669 | weaveworks/flux | integrations/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/interface.go | FluxHelmReleases | func (v *version) FluxHelmReleases() FluxHelmReleaseInformer {
return &fluxHelmReleaseInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
} | go | func (v *version) FluxHelmReleases() FluxHelmReleaseInformer {
return &fluxHelmReleaseInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
} | [
"func",
"(",
"v",
"*",
"version",
")",
"FluxHelmReleases",
"(",
")",
"FluxHelmReleaseInformer",
"{",
"return",
"&",
"fluxHelmReleaseInformer",
"{",
"factory",
":",
"v",
".",
"factory",
",",
"namespace",
":",
"v",
".",
"namespace",
",",
"tweakListOptions",
":",... | // FluxHelmReleases returns a FluxHelmReleaseInformer. | [
"FluxHelmReleases",
"returns",
"a",
"FluxHelmReleaseInformer",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/client/informers/externalversions/helm.integrations.flux.weave.works/v1alpha2/interface.go#L43-L45 |
131,670 | weaveworks/flux | http/daemon/upstream.go | Close | func (a *Upstream) Close() error {
close(a.quit)
if a.ws == nil {
return nil
}
return a.ws.Close()
} | go | func (a *Upstream) Close() error {
close(a.quit)
if a.ws == nil {
return nil
}
return a.ws.Close()
} | [
"func",
"(",
"a",
"*",
"Upstream",
")",
"Close",
"(",
")",
"error",
"{",
"close",
"(",
"a",
".",
"quit",
")",
"\n",
"if",
"a",
".",
"ws",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"a",
".",
"ws",
".",
"Close",
"(",
")",
... | // Close closes the connection to the service | [
"Close",
"closes",
"the",
"connection",
"to",
"the",
"service"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/http/daemon/upstream.go#L182-L188 |
131,671 | weaveworks/flux | remote/rpc/clientV6.go | remoteApplicationError | func remoteApplicationError(err error) error {
return &fluxerr.Error{
Type: fluxerr.User,
Err: err,
Help: `Error from daemon
The daemon (fluxd, running in your cluster) reported this error when
attempting to fulfil your request:
` + err.Error() + `
`,
}
} | go | func remoteApplicationError(err error) error {
return &fluxerr.Error{
Type: fluxerr.User,
Err: err,
Help: `Error from daemon
The daemon (fluxd, running in your cluster) reported this error when
attempting to fulfil your request:
` + err.Error() + `
`,
}
} | [
"func",
"remoteApplicationError",
"(",
"err",
"error",
")",
"error",
"{",
"return",
"&",
"fluxerr",
".",
"Error",
"{",
"Type",
":",
"fluxerr",
".",
"User",
",",
"Err",
":",
"err",
",",
"Help",
":",
"`Error from daemon\n\nThe daemon (fluxd, running in your cluster)... | // We don't get proper application error structs back from v6, but we
// do know that anything that's not considered a fatal error can be
// translated into an application error. | [
"We",
"don",
"t",
"get",
"proper",
"application",
"error",
"structs",
"back",
"from",
"v6",
"but",
"we",
"do",
"know",
"that",
"anything",
"that",
"s",
"not",
"considered",
"a",
"fatal",
"error",
"can",
"be",
"translated",
"into",
"an",
"application",
"err... | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/remote/rpc/clientV6.go#L33-L45 |
131,672 | weaveworks/flux | remote/rpc/clientV6.go | NewClientV6 | func NewClientV6(conn io.ReadWriteCloser) *RPCClientV6 {
return &RPCClientV6{&baseClient{}, jsonrpc.NewClient(conn)}
} | go | func NewClientV6(conn io.ReadWriteCloser) *RPCClientV6 {
return &RPCClientV6{&baseClient{}, jsonrpc.NewClient(conn)}
} | [
"func",
"NewClientV6",
"(",
"conn",
"io",
".",
"ReadWriteCloser",
")",
"*",
"RPCClientV6",
"{",
"return",
"&",
"RPCClientV6",
"{",
"&",
"baseClient",
"{",
"}",
",",
"jsonrpc",
".",
"NewClient",
"(",
"conn",
")",
"}",
"\n",
"}"
] | // NewClient creates a new rpc-backed implementation of the server. | [
"NewClient",
"creates",
"a",
"new",
"rpc",
"-",
"backed",
"implementation",
"of",
"the",
"server",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/remote/rpc/clientV6.go#L52-L54 |
131,673 | weaveworks/flux | remote/rpc/clientV6.go | Version | func (p *RPCClientV6) Version(ctx context.Context) (string, error) {
var version string
err := p.client.Call("RPCServer.Version", struct{}{}, &version)
if _, ok := err.(rpc.ServerError); !ok && err != nil {
return "", remote.FatalError{err}
} else if err != nil && err.Error() == "rpc: can't find method RPCServer.... | go | func (p *RPCClientV6) Version(ctx context.Context) (string, error) {
var version string
err := p.client.Call("RPCServer.Version", struct{}{}, &version)
if _, ok := err.(rpc.ServerError); !ok && err != nil {
return "", remote.FatalError{err}
} else if err != nil && err.Error() == "rpc: can't find method RPCServer.... | [
"func",
"(",
"p",
"*",
"RPCClientV6",
")",
"Version",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"string",
",",
"error",
")",
"{",
"var",
"version",
"string",
"\n",
"err",
":=",
"p",
".",
"client",
".",
"Call",
"(",
"\"",
"\"",
",",
"struct",... | // Version is used to check the version of the remote server. | [
"Version",
"is",
"used",
"to",
"check",
"the",
"version",
"of",
"the",
"remote",
"server",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/remote/rpc/clientV6.go#L66-L77 |
131,674 | weaveworks/flux | job/job.go | nextOrNil | func (q *Queue) nextOrNil() *Job {
q.waitingLock.Lock()
defer q.waitingLock.Unlock()
if len(q.waiting) > 0 {
return q.waiting[0]
}
return nil
} | go | func (q *Queue) nextOrNil() *Job {
q.waitingLock.Lock()
defer q.waitingLock.Unlock()
if len(q.waiting) > 0 {
return q.waiting[0]
}
return nil
} | [
"func",
"(",
"q",
"*",
"Queue",
")",
"nextOrNil",
"(",
")",
"*",
"Job",
"{",
"q",
".",
"waitingLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"q",
".",
"waitingLock",
".",
"Unlock",
"(",
")",
"\n",
"if",
"len",
"(",
"q",
".",
"waiting",
")",
">",... | // nextOrNil returns the head of the queue, or nil if
// the queue is empty. | [
"nextOrNil",
"returns",
"the",
"head",
"of",
"the",
"queue",
"or",
"nil",
"if",
"the",
"queue",
"is",
"empty",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/job/job.go#L150-L157 |
131,675 | weaveworks/flux | update/images.go | GetRepositoryMetadata | func (r ImageRepos) GetRepositoryMetadata(repo image.Name) image.RepositoryMetadata {
if metadata, ok := r.imageRepos[repo.CanonicalName()]; ok {
// copy tags
tagsCopy := make([]string, len(metadata.Tags))
copy(tagsCopy, metadata.Tags)
// copy images
imagesCopy := make(map[string]image.Info, len(metadata.Ima... | go | func (r ImageRepos) GetRepositoryMetadata(repo image.Name) image.RepositoryMetadata {
if metadata, ok := r.imageRepos[repo.CanonicalName()]; ok {
// copy tags
tagsCopy := make([]string, len(metadata.Tags))
copy(tagsCopy, metadata.Tags)
// copy images
imagesCopy := make(map[string]image.Info, len(metadata.Ima... | [
"func",
"(",
"r",
"ImageRepos",
")",
"GetRepositoryMetadata",
"(",
"repo",
"image",
".",
"Name",
")",
"image",
".",
"RepositoryMetadata",
"{",
"if",
"metadata",
",",
"ok",
":=",
"r",
".",
"imageRepos",
"[",
"repo",
".",
"CanonicalName",
"(",
")",
"]",
";... | // GetRepositoryMetadata returns the metadata for all the images in the
// named image repository. | [
"GetRepositoryMetadata",
"returns",
"the",
"metadata",
"for",
"all",
"the",
"images",
"in",
"the",
"named",
"image",
"repository",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/update/images.go#L26-L44 |
131,676 | weaveworks/flux | update/images.go | FilterImages | func FilterImages(images []image.Info, pattern policy.Pattern) []image.Info {
return filterImages(images, pattern)
} | go | func FilterImages(images []image.Info, pattern policy.Pattern) []image.Info {
return filterImages(images, pattern)
} | [
"func",
"FilterImages",
"(",
"images",
"[",
"]",
"image",
".",
"Info",
",",
"pattern",
"policy",
".",
"Pattern",
")",
"[",
"]",
"image",
".",
"Info",
"{",
"return",
"filterImages",
"(",
"images",
",",
"pattern",
")",
"\n",
"}"
] | // FilterImages returns only the images that match the pattern, in a new list. | [
"FilterImages",
"returns",
"only",
"the",
"images",
"that",
"match",
"the",
"pattern",
"in",
"a",
"new",
"list",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/update/images.go#L50-L52 |
131,677 | weaveworks/flux | update/images.go | SortImages | func SortImages(images []image.Info, pattern policy.Pattern) SortedImageInfos {
return sortImages(images, pattern)
} | go | func SortImages(images []image.Info, pattern policy.Pattern) SortedImageInfos {
return sortImages(images, pattern)
} | [
"func",
"SortImages",
"(",
"images",
"[",
"]",
"image",
".",
"Info",
",",
"pattern",
"policy",
".",
"Pattern",
")",
"SortedImageInfos",
"{",
"return",
"sortImages",
"(",
"images",
",",
"pattern",
")",
"\n",
"}"
] | // SortImages orders the images according to the pattern order in a new list. | [
"SortImages",
"orders",
"the",
"images",
"according",
"to",
"the",
"pattern",
"order",
"in",
"a",
"new",
"list",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/update/images.go#L55-L57 |
131,678 | weaveworks/flux | update/images.go | fetchUpdatableImageRepos | func fetchUpdatableImageRepos(registry registry.Registry, updateable []*WorkloadUpdate, logger log.Logger) (ImageRepos, error) {
return FetchImageRepos(registry, workloadContainers(updateable), logger)
} | go | func fetchUpdatableImageRepos(registry registry.Registry, updateable []*WorkloadUpdate, logger log.Logger) (ImageRepos, error) {
return FetchImageRepos(registry, workloadContainers(updateable), logger)
} | [
"func",
"fetchUpdatableImageRepos",
"(",
"registry",
"registry",
".",
"Registry",
",",
"updateable",
"[",
"]",
"*",
"WorkloadUpdate",
",",
"logger",
"log",
".",
"Logger",
")",
"(",
"ImageRepos",
",",
"error",
")",
"{",
"return",
"FetchImageRepos",
"(",
"regist... | // fetchUpdatableImageRepos is a convenient shim to
// `FetchImageRepos`. | [
"fetchUpdatableImageRepos",
"is",
"a",
"convenient",
"shim",
"to",
"FetchImageRepos",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/update/images.go#L141-L143 |
131,679 | weaveworks/flux | update/images.go | FetchImageRepos | func FetchImageRepos(reg registry.Registry, cs containers, logger log.Logger) (ImageRepos, error) {
imageRepos := imageReposMap{}
for i := 0; i < cs.Len(); i++ {
for _, container := range cs.Containers(i) {
imageRepos[container.Image.CanonicalName()] = image.RepositoryMetadata{}
}
}
for repo := range imageRe... | go | func FetchImageRepos(reg registry.Registry, cs containers, logger log.Logger) (ImageRepos, error) {
imageRepos := imageReposMap{}
for i := 0; i < cs.Len(); i++ {
for _, container := range cs.Containers(i) {
imageRepos[container.Image.CanonicalName()] = image.RepositoryMetadata{}
}
}
for repo := range imageRe... | [
"func",
"FetchImageRepos",
"(",
"reg",
"registry",
".",
"Registry",
",",
"cs",
"containers",
",",
"logger",
"log",
".",
"Logger",
")",
"(",
"ImageRepos",
",",
"error",
")",
"{",
"imageRepos",
":=",
"imageReposMap",
"{",
"}",
"\n",
"for",
"i",
":=",
"0",
... | // FetchImageRepos finds all the known image metadata for
// containers in the controllers given. | [
"FetchImageRepos",
"finds",
"all",
"the",
"known",
"image",
"metadata",
"for",
"containers",
"in",
"the",
"controllers",
"given",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/update/images.go#L147-L166 |
131,680 | weaveworks/flux | update/images.go | exactImageRepos | func exactImageRepos(reg registry.Registry, images []image.Ref) (ImageRepos, error) {
m := imageReposMap{}
for _, id := range images {
// We must check that the exact images requested actually exist. Otherwise we risk pushing invalid images to git.
exist, err := imageExists(reg, id)
if err != nil {
return Im... | go | func exactImageRepos(reg registry.Registry, images []image.Ref) (ImageRepos, error) {
m := imageReposMap{}
for _, id := range images {
// We must check that the exact images requested actually exist. Otherwise we risk pushing invalid images to git.
exist, err := imageExists(reg, id)
if err != nil {
return Im... | [
"func",
"exactImageRepos",
"(",
"reg",
"registry",
".",
"Registry",
",",
"images",
"[",
"]",
"image",
".",
"Ref",
")",
"(",
"ImageRepos",
",",
"error",
")",
"{",
"m",
":=",
"imageReposMap",
"{",
"}",
"\n",
"for",
"_",
",",
"id",
":=",
"range",
"image... | // Create a map of image repos to images. It will check that each image exists. | [
"Create",
"a",
"map",
"of",
"image",
"repos",
"to",
"images",
".",
"It",
"will",
"check",
"that",
"each",
"image",
"exists",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/update/images.go#L169-L188 |
131,681 | weaveworks/flux | git/working.go | ManifestDirs | func (c *Checkout) ManifestDirs() []string {
if len(c.config.Paths) == 0 {
return []string{c.dir}
}
paths := make([]string, len(c.config.Paths), len(c.config.Paths))
for i, p := range c.config.Paths {
paths[i] = filepath.Join(c.dir, p)
}
return paths
} | go | func (c *Checkout) ManifestDirs() []string {
if len(c.config.Paths) == 0 {
return []string{c.dir}
}
paths := make([]string, len(c.config.Paths), len(c.config.Paths))
for i, p := range c.config.Paths {
paths[i] = filepath.Join(c.dir, p)
}
return paths
} | [
"func",
"(",
"c",
"*",
"Checkout",
")",
"ManifestDirs",
"(",
")",
"[",
"]",
"string",
"{",
"if",
"len",
"(",
"c",
".",
"config",
".",
"Paths",
")",
"==",
"0",
"{",
"return",
"[",
"]",
"string",
"{",
"c",
".",
"dir",
"}",
"\n",
"}",
"\n\n",
"p... | // ManifestDirs returns the paths to the manifests files. It ensures
// that at least one path is returned, so that it can be used with
// `Manifest.LoadManifests`. | [
"ManifestDirs",
"returns",
"the",
"paths",
"to",
"the",
"manifests",
"files",
".",
"It",
"ensures",
"that",
"at",
"least",
"one",
"path",
"is",
"returned",
"so",
"that",
"it",
"can",
"be",
"used",
"with",
"Manifest",
".",
"LoadManifests",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/git/working.go#L115-L125 |
131,682 | weaveworks/flux | git/working.go | CommitAndPush | func (c *Checkout) CommitAndPush(ctx context.Context, commitAction CommitAction, note interface{}) error {
if !check(ctx, c.dir, c.config.Paths) {
return ErrNoChanges
}
commitAction.Message += c.config.SkipMessage
if commitAction.SigningKey == "" {
commitAction.SigningKey = c.config.SigningKey
}
if err := c... | go | func (c *Checkout) CommitAndPush(ctx context.Context, commitAction CommitAction, note interface{}) error {
if !check(ctx, c.dir, c.config.Paths) {
return ErrNoChanges
}
commitAction.Message += c.config.SkipMessage
if commitAction.SigningKey == "" {
commitAction.SigningKey = c.config.SigningKey
}
if err := c... | [
"func",
"(",
"c",
"*",
"Checkout",
")",
"CommitAndPush",
"(",
"ctx",
"context",
".",
"Context",
",",
"commitAction",
"CommitAction",
",",
"note",
"interface",
"{",
"}",
")",
"error",
"{",
"if",
"!",
"check",
"(",
"ctx",
",",
"c",
".",
"dir",
",",
"c"... | // CommitAndPush commits changes made in this checkout, along with any
// extra data as a note, and pushes the commit and note to the remote repo. | [
"CommitAndPush",
"commits",
"changes",
"made",
"in",
"this",
"checkout",
"along",
"with",
"any",
"extra",
"data",
"as",
"a",
"note",
"and",
"pushes",
"the",
"commit",
"and",
"note",
"to",
"the",
"remote",
"repo",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/git/working.go#L129-L165 |
131,683 | weaveworks/flux | git/working.go | GetNote | func (c *Checkout) GetNote(ctx context.Context, rev string, note interface{}) (bool, error) {
return getNote(ctx, c.dir, c.realNotesRef, rev, note)
} | go | func (c *Checkout) GetNote(ctx context.Context, rev string, note interface{}) (bool, error) {
return getNote(ctx, c.dir, c.realNotesRef, rev, note)
} | [
"func",
"(",
"c",
"*",
"Checkout",
")",
"GetNote",
"(",
"ctx",
"context",
".",
"Context",
",",
"rev",
"string",
",",
"note",
"interface",
"{",
"}",
")",
"(",
"bool",
",",
"error",
")",
"{",
"return",
"getNote",
"(",
"ctx",
",",
"c",
".",
"dir",
"... | // GetNote gets a note for the revision specified, or nil if there is no such note. | [
"GetNote",
"gets",
"a",
"note",
"for",
"the",
"revision",
"specified",
"or",
"nil",
"if",
"there",
"is",
"no",
"such",
"note",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/git/working.go#L168-L170 |
131,684 | weaveworks/flux | git/working.go | ChangedFiles | func (c *Checkout) ChangedFiles(ctx context.Context, ref string) ([]string, error) {
list, err := changed(ctx, c.dir, ref, c.config.Paths)
if err == nil {
for i, file := range list {
list[i] = filepath.Join(c.dir, file)
}
}
return list, err
} | go | func (c *Checkout) ChangedFiles(ctx context.Context, ref string) ([]string, error) {
list, err := changed(ctx, c.dir, ref, c.config.Paths)
if err == nil {
for i, file := range list {
list[i] = filepath.Join(c.dir, file)
}
}
return list, err
} | [
"func",
"(",
"c",
"*",
"Checkout",
")",
"ChangedFiles",
"(",
"ctx",
"context",
".",
"Context",
",",
"ref",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"list",
",",
"err",
":=",
"changed",
"(",
"ctx",
",",
"c",
".",
"dir",
",",... | // ChangedFiles does a git diff listing changed files | [
"ChangedFiles",
"does",
"a",
"git",
"diff",
"listing",
"changed",
"files"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/git/working.go#L192-L200 |
131,685 | weaveworks/flux | cluster/kubernetes/kubeyaml.go | Image | func (k KubeYAML) Image(in []byte, ns, kind, name, container, image string) ([]byte, error) {
args := []string{"image", "--namespace", ns, "--kind", kind, "--name", name}
args = append(args, "--container", container, "--image", image)
return execKubeyaml(in, args)
} | go | func (k KubeYAML) Image(in []byte, ns, kind, name, container, image string) ([]byte, error) {
args := []string{"image", "--namespace", ns, "--kind", kind, "--name", name}
args = append(args, "--container", container, "--image", image)
return execKubeyaml(in, args)
} | [
"func",
"(",
"k",
"KubeYAML",
")",
"Image",
"(",
"in",
"[",
"]",
"byte",
",",
"ns",
",",
"kind",
",",
"name",
",",
"container",
",",
"image",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"args",
":=",
"[",
"]",
"string",
"{",
... | // Image calls the kubeyaml subcommand `image` with the arguments given. | [
"Image",
"calls",
"the",
"kubeyaml",
"subcommand",
"image",
"with",
"the",
"arguments",
"given",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cluster/kubernetes/kubeyaml.go#L16-L20 |
131,686 | weaveworks/flux | cluster/kubernetes/kubeyaml.go | Annotate | func (k KubeYAML) Annotate(in []byte, ns, kind, name string, policies ...string) ([]byte, error) {
args := []string{"annotate", "--namespace", ns, "--kind", kind, "--name", name}
args = append(args, policies...)
return execKubeyaml(in, args)
} | go | func (k KubeYAML) Annotate(in []byte, ns, kind, name string, policies ...string) ([]byte, error) {
args := []string{"annotate", "--namespace", ns, "--kind", kind, "--name", name}
args = append(args, policies...)
return execKubeyaml(in, args)
} | [
"func",
"(",
"k",
"KubeYAML",
")",
"Annotate",
"(",
"in",
"[",
"]",
"byte",
",",
"ns",
",",
"kind",
",",
"name",
"string",
",",
"policies",
"...",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"args",
":=",
"[",
"]",
"string",
"... | // Annotate calls the kubeyaml subcommand `annotate` with the arguments as given. | [
"Annotate",
"calls",
"the",
"kubeyaml",
"subcommand",
"annotate",
"with",
"the",
"arguments",
"as",
"given",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cluster/kubernetes/kubeyaml.go#L23-L27 |
131,687 | weaveworks/flux | registry/client_factory.go | Succeed | func (f *RemoteClientFactory) Succeed(repo image.CanonicalName) {
f.Limiters.Recover(repo.Domain)
} | go | func (f *RemoteClientFactory) Succeed(repo image.CanonicalName) {
f.Limiters.Recover(repo.Domain)
} | [
"func",
"(",
"f",
"*",
"RemoteClientFactory",
")",
"Succeed",
"(",
"repo",
"image",
".",
"CanonicalName",
")",
"{",
"f",
".",
"Limiters",
".",
"Recover",
"(",
"repo",
".",
"Domain",
")",
"\n",
"}"
] | // Succeed exists merely so that the user of the ClientFactory can
// bump rate limits up if a repo's metadata has successfully been
// fetched. | [
"Succeed",
"exists",
"merely",
"so",
"that",
"the",
"user",
"of",
"the",
"ClientFactory",
"can",
"bump",
"rate",
"limits",
"up",
"if",
"a",
"repo",
"s",
"metadata",
"has",
"successfully",
"been",
"fetched",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/client_factory.go#L162-L164 |
131,688 | weaveworks/flux | cluster/kubernetes/cached_disco.go | MakeCachedDiscovery | func MakeCachedDiscovery(d discovery.DiscoveryInterface, c crd.Interface, shutdown <-chan struct{}) discovery.CachedDiscoveryInterface {
result, _, _ := makeCachedDiscovery(d, c, shutdown, makeInvalidatingHandler)
return result
} | go | func MakeCachedDiscovery(d discovery.DiscoveryInterface, c crd.Interface, shutdown <-chan struct{}) discovery.CachedDiscoveryInterface {
result, _, _ := makeCachedDiscovery(d, c, shutdown, makeInvalidatingHandler)
return result
} | [
"func",
"MakeCachedDiscovery",
"(",
"d",
"discovery",
".",
"DiscoveryInterface",
",",
"c",
"crd",
".",
"Interface",
",",
"shutdown",
"<-",
"chan",
"struct",
"{",
"}",
")",
"discovery",
".",
"CachedDiscoveryInterface",
"{",
"result",
",",
"_",
",",
"_",
":=",... | // MakeCachedDiscovery constructs a CachedDicoveryInterface that will
// be invalidated whenever the set of CRDs change. The idea is that
// the only avenue of a change to the API resources in a running
// system is CRDs being added, updated or deleted. | [
"MakeCachedDiscovery",
"constructs",
"a",
"CachedDicoveryInterface",
"that",
"will",
"be",
"invalidated",
"whenever",
"the",
"set",
"of",
"CRDs",
"change",
".",
"The",
"idea",
"is",
"that",
"the",
"only",
"avenue",
"of",
"a",
"change",
"to",
"the",
"API",
"res... | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/cluster/kubernetes/cached_disco.go#L62-L65 |
131,689 | weaveworks/flux | sync/sync.go | Sync | func Sync(setName string, repoResources map[string]resource.Resource, clus Syncer) error {
set := makeSet(setName, repoResources)
if err := clus.Sync(set); err != nil {
return err
}
return nil
} | go | func Sync(setName string, repoResources map[string]resource.Resource, clus Syncer) error {
set := makeSet(setName, repoResources)
if err := clus.Sync(set); err != nil {
return err
}
return nil
} | [
"func",
"Sync",
"(",
"setName",
"string",
",",
"repoResources",
"map",
"[",
"string",
"]",
"resource",
".",
"Resource",
",",
"clus",
"Syncer",
")",
"error",
"{",
"set",
":=",
"makeSet",
"(",
"setName",
",",
"repoResources",
")",
"\n",
"if",
"err",
":=",
... | // Sync synchronises the cluster to the files under a directory. | [
"Sync",
"synchronises",
"the",
"cluster",
"to",
"the",
"files",
"under",
"a",
"directory",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/sync/sync.go#L14-L20 |
131,690 | weaveworks/flux | integrations/helm/http/transport.go | NewRouter | func NewRouter() *mux.Router {
r := mux.NewRouter()
r.NewRoute().Name(SyncGit).Methods("POST").Path("/v1/sync-git")
return r
} | go | func NewRouter() *mux.Router {
r := mux.NewRouter()
r.NewRoute().Name(SyncGit).Methods("POST").Path("/v1/sync-git")
return r
} | [
"func",
"NewRouter",
"(",
")",
"*",
"mux",
".",
"Router",
"{",
"r",
":=",
"mux",
".",
"NewRouter",
"(",
")",
"\n",
"r",
".",
"NewRoute",
"(",
")",
".",
"Name",
"(",
"SyncGit",
")",
".",
"Methods",
"(",
"\"",
"\"",
")",
".",
"Path",
"(",
"\"",
... | // NewRouter creates a new routeri nstance, registers all API routes
// and returns it. | [
"NewRouter",
"creates",
"a",
"new",
"routeri",
"nstance",
"registers",
"all",
"API",
"routes",
"and",
"returns",
"it",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/helm/http/transport.go#L9-L13 |
131,691 | weaveworks/flux | http/daemon/server.go | NewRouter | func NewRouter() *mux.Router {
r := transport.NewAPIRouter()
// All old versions are deprecated in the daemon. Use an up to
// date client!
transport.DeprecateVersions(r, "v1", "v2", "v3", "v4", "v5")
// We assume every request that doesn't match a route is a client
// calling an old or hitherto unsupported API.... | go | func NewRouter() *mux.Router {
r := transport.NewAPIRouter()
// All old versions are deprecated in the daemon. Use an up to
// date client!
transport.DeprecateVersions(r, "v1", "v2", "v3", "v4", "v5")
// We assume every request that doesn't match a route is a client
// calling an old or hitherto unsupported API.... | [
"func",
"NewRouter",
"(",
")",
"*",
"mux",
".",
"Router",
"{",
"r",
":=",
"transport",
".",
"NewAPIRouter",
"(",
")",
"\n\n",
"// All old versions are deprecated in the daemon. Use an up to",
"// date client!",
"transport",
".",
"DeprecateVersions",
"(",
"r",
",",
"... | // An API server for the daemon | [
"An",
"API",
"server",
"for",
"the",
"daemon"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/http/daemon/server.go#L34-L47 |
131,692 | weaveworks/flux | integrations/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go | newFluxHelmReleases | func newFluxHelmReleases(c *HelmV1alpha2Client, namespace string) *fluxHelmReleases {
return &fluxHelmReleases{
client: c.RESTClient(),
ns: namespace,
}
} | go | func newFluxHelmReleases(c *HelmV1alpha2Client, namespace string) *fluxHelmReleases {
return &fluxHelmReleases{
client: c.RESTClient(),
ns: namespace,
}
} | [
"func",
"newFluxHelmReleases",
"(",
"c",
"*",
"HelmV1alpha2Client",
",",
"namespace",
"string",
")",
"*",
"fluxHelmReleases",
"{",
"return",
"&",
"fluxHelmReleases",
"{",
"client",
":",
"c",
".",
"RESTClient",
"(",
")",
",",
"ns",
":",
"namespace",
",",
"}",... | // newFluxHelmReleases returns a FluxHelmReleases | [
"newFluxHelmReleases",
"returns",
"a",
"FluxHelmReleases"
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2/fluxhelmrelease.go#L58-L63 |
131,693 | weaveworks/flux | integrations/helm/chartsync/download.go | makeChartPath | func makeChartPath(base string, source *flux_v1beta1.RepoChartSource) string {
// We don't need to obscure the location of the charts in the
// filesystem; but we do need a stable, filesystem-friendly path
// to them that is based on the URL.
repoPath := filepath.Join(base, base64.URLEncoding.EncodeToString([]byte(... | go | func makeChartPath(base string, source *flux_v1beta1.RepoChartSource) string {
// We don't need to obscure the location of the charts in the
// filesystem; but we do need a stable, filesystem-friendly path
// to them that is based on the URL.
repoPath := filepath.Join(base, base64.URLEncoding.EncodeToString([]byte(... | [
"func",
"makeChartPath",
"(",
"base",
"string",
",",
"source",
"*",
"flux_v1beta1",
".",
"RepoChartSource",
")",
"string",
"{",
"// We don't need to obscure the location of the charts in the",
"// filesystem; but we do need a stable, filesystem-friendly path",
"// to them that is bas... | // makeChartPath gives the expected filesystem location for a chart,
// without testing whether the file exists or not. | [
"makeChartPath",
"gives",
"the",
"expected",
"filesystem",
"location",
"for",
"a",
"chart",
"without",
"testing",
"whether",
"the",
"file",
"exists",
"or",
"not",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/helm/chartsync/download.go#L23-L33 |
131,694 | weaveworks/flux | integrations/helm/chartsync/download.go | ensureChartFetched | func ensureChartFetched(base string, source *flux_v1beta1.RepoChartSource) (string, error) {
chartPath := makeChartPath(base, source)
stat, err := os.Stat(chartPath)
switch {
case os.IsNotExist(err):
return chartPath, downloadChart(chartPath, source)
case err != nil:
return chartPath, err
case stat.IsDir():
... | go | func ensureChartFetched(base string, source *flux_v1beta1.RepoChartSource) (string, error) {
chartPath := makeChartPath(base, source)
stat, err := os.Stat(chartPath)
switch {
case os.IsNotExist(err):
return chartPath, downloadChart(chartPath, source)
case err != nil:
return chartPath, err
case stat.IsDir():
... | [
"func",
"ensureChartFetched",
"(",
"base",
"string",
",",
"source",
"*",
"flux_v1beta1",
".",
"RepoChartSource",
")",
"(",
"string",
",",
"error",
")",
"{",
"chartPath",
":=",
"makeChartPath",
"(",
"base",
",",
"source",
")",
"\n",
"stat",
",",
"err",
":="... | // ensureChartFetched returns the path to a downloaded chart, fetching
// it first if necessary. It always returns the expected path to the
// chart, and either an error or nil. | [
"ensureChartFetched",
"returns",
"the",
"path",
"to",
"a",
"downloaded",
"chart",
"fetching",
"it",
"first",
"if",
"necessary",
".",
"It",
"always",
"returns",
"the",
"expected",
"path",
"to",
"the",
"chart",
"and",
"either",
"an",
"error",
"or",
"nil",
"."
... | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/helm/chartsync/download.go#L38-L50 |
131,695 | weaveworks/flux | integrations/helm/chartsync/download.go | downloadChart | func downloadChart(destFile string, source *flux_v1beta1.RepoChartSource) error {
// Helm's support libs are designed to be driven by the
// command-line client, so there are some inevitable CLI-isms,
// like getting values from flags and the environment. None of
// these things are directly relevant here, _except_... | go | func downloadChart(destFile string, source *flux_v1beta1.RepoChartSource) error {
// Helm's support libs are designed to be driven by the
// command-line client, so there are some inevitable CLI-isms,
// like getting values from flags and the environment. None of
// these things are directly relevant here, _except_... | [
"func",
"downloadChart",
"(",
"destFile",
"string",
",",
"source",
"*",
"flux_v1beta1",
".",
"RepoChartSource",
")",
"error",
"{",
"// Helm's support libs are designed to be driven by the",
"// command-line client, so there are some inevitable CLI-isms,",
"// like getting values from... | // downloadChart attempts to fetch a chart tarball, given the name,
// version and repo URL in `source`, and the path to write the file
// to in `destFile`. | [
"downloadChart",
"attempts",
"to",
"fetch",
"a",
"chart",
"tarball",
"given",
"the",
"name",
"version",
"and",
"repo",
"URL",
"in",
"source",
"and",
"the",
"path",
"to",
"write",
"the",
"file",
"to",
"in",
"destFile",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/integrations/helm/chartsync/download.go#L55-L129 |
131,696 | weaveworks/flux | registry/cache/memcached/memcached.go | NewFixedServerMemcacheClient | func NewFixedServerMemcacheClient(config MemcacheConfig, addresses ...string) *MemcacheClient {
var servers memcache.ServerList
servers.SetServers(addresses...)
client := memcache.NewFromSelector(&servers)
client.Timeout = config.Timeout
newClient := &MemcacheClient{
client: client,
serverList: &servers,
... | go | func NewFixedServerMemcacheClient(config MemcacheConfig, addresses ...string) *MemcacheClient {
var servers memcache.ServerList
servers.SetServers(addresses...)
client := memcache.NewFromSelector(&servers)
client.Timeout = config.Timeout
newClient := &MemcacheClient{
client: client,
serverList: &servers,
... | [
"func",
"NewFixedServerMemcacheClient",
"(",
"config",
"MemcacheConfig",
",",
"addresses",
"...",
"string",
")",
"*",
"MemcacheClient",
"{",
"var",
"servers",
"memcache",
".",
"ServerList",
"\n",
"servers",
".",
"SetServers",
"(",
"addresses",
"...",
")",
"\n",
... | // Does not use DNS, accepts static list of servers. | [
"Does",
"not",
"use",
"DNS",
"accepts",
"static",
"list",
"of",
"servers",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/cache/memcached/memcached.go#L83-L102 |
131,697 | weaveworks/flux | registry/cache/memcached/memcached.go | GetKey | func (c *MemcacheClient) GetKey(k cache.Keyer) ([]byte, time.Time, error) {
cacheItem, err := c.client.Get(k.Key())
if err != nil {
if err == memcache.ErrCacheMiss {
// Don't log on cache miss
return []byte{}, time.Time{}, cache.ErrNotCached
} else {
c.logger.Log("err", errors.Wrap(err, "Fetching tag fro... | go | func (c *MemcacheClient) GetKey(k cache.Keyer) ([]byte, time.Time, error) {
cacheItem, err := c.client.Get(k.Key())
if err != nil {
if err == memcache.ErrCacheMiss {
// Don't log on cache miss
return []byte{}, time.Time{}, cache.ErrNotCached
} else {
c.logger.Log("err", errors.Wrap(err, "Fetching tag fro... | [
"func",
"(",
"c",
"*",
"MemcacheClient",
")",
"GetKey",
"(",
"k",
"cache",
".",
"Keyer",
")",
"(",
"[",
"]",
"byte",
",",
"time",
".",
"Time",
",",
"error",
")",
"{",
"cacheItem",
",",
"err",
":=",
"c",
".",
"client",
".",
"Get",
"(",
"k",
".",... | // GetKey gets the value and its refresh deadline from the cache. | [
"GetKey",
"gets",
"the",
"value",
"and",
"its",
"refresh",
"deadline",
"from",
"the",
"cache",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/cache/memcached/memcached.go#L105-L118 |
131,698 | weaveworks/flux | registry/cache/memcached/memcached.go | SetKey | func (c *MemcacheClient) SetKey(k cache.Keyer, refreshDeadline time.Time, v []byte) error {
expiry := refreshDeadline.Sub(time.Now()) * 2
if expiry < MinExpiry {
expiry = MinExpiry
}
deadlineBytes := make([]byte, 4, 4)
binary.BigEndian.PutUint32(deadlineBytes, uint32(refreshDeadline.Unix()))
if err := c.client... | go | func (c *MemcacheClient) SetKey(k cache.Keyer, refreshDeadline time.Time, v []byte) error {
expiry := refreshDeadline.Sub(time.Now()) * 2
if expiry < MinExpiry {
expiry = MinExpiry
}
deadlineBytes := make([]byte, 4, 4)
binary.BigEndian.PutUint32(deadlineBytes, uint32(refreshDeadline.Unix()))
if err := c.client... | [
"func",
"(",
"c",
"*",
"MemcacheClient",
")",
"SetKey",
"(",
"k",
"cache",
".",
"Keyer",
",",
"refreshDeadline",
"time",
".",
"Time",
",",
"v",
"[",
"]",
"byte",
")",
"error",
"{",
"expiry",
":=",
"refreshDeadline",
".",
"Sub",
"(",
"time",
".",
"Now... | // SetKey sets the value and its refresh deadline at a key. NB the key
// expiry is set _longer_ than the deadline, to give us a grace period
// in which to refresh the value. | [
"SetKey",
"sets",
"the",
"value",
"and",
"its",
"refresh",
"deadline",
"at",
"a",
"key",
".",
"NB",
"the",
"key",
"expiry",
"is",
"set",
"_longer_",
"than",
"the",
"deadline",
"to",
"give",
"us",
"a",
"grace",
"period",
"in",
"which",
"to",
"refresh",
... | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/cache/memcached/memcached.go#L123-L140 |
131,699 | weaveworks/flux | registry/cache/memcached/memcached.go | updateFromSRVRecords | func (c *MemcacheClient) updateFromSRVRecords() error {
_, addrs, err := net.LookupSRV(c.service, "tcp", c.hostname)
if err != nil {
return err
}
var servers []string
for _, srv := range addrs {
servers = append(servers, fmt.Sprintf("%s:%d", srv.Target, srv.Port))
}
// ServerList deterministically maps keys ... | go | func (c *MemcacheClient) updateFromSRVRecords() error {
_, addrs, err := net.LookupSRV(c.service, "tcp", c.hostname)
if err != nil {
return err
}
var servers []string
for _, srv := range addrs {
servers = append(servers, fmt.Sprintf("%s:%d", srv.Target, srv.Port))
}
// ServerList deterministically maps keys ... | [
"func",
"(",
"c",
"*",
"MemcacheClient",
")",
"updateFromSRVRecords",
"(",
")",
"error",
"{",
"_",
",",
"addrs",
",",
"err",
":=",
"net",
".",
"LookupSRV",
"(",
"c",
".",
"service",
",",
"\"",
"\"",
",",
"c",
".",
"hostname",
")",
"\n",
"if",
"err"... | // updateMemcacheServers sets a memcache server list from SRV records. SRV
// priority & weight are ignored. | [
"updateMemcacheServers",
"sets",
"a",
"memcache",
"server",
"list",
"from",
"SRV",
"records",
".",
"SRV",
"priority",
"&",
"weight",
"are",
"ignored",
"."
] | 6e1702275f5fae61a4d2c796215612450e73da62 | https://github.com/weaveworks/flux/blob/6e1702275f5fae61a4d2c796215612450e73da62/registry/cache/memcached/memcached.go#L166-L180 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.