profile
viewpoint

mplzik/charts 0

Curated applications for Kubernetes

mplzik/github-pr-resource 0

Github pull request resource for Concourse

mplzik/prmonitor 0

A Chrome extension that notifies you when you receive a pull request on GitHub

mplzik/rawdns 0

a direct, raw DNS interface to the Docker API

mplzik/Rocket 0

A web framework for Rust.

mplzik/sbt-protoc 0

SBT plugin for generating code from Protocol Buffer using protoc

delete branch grafana/jsonnet-libs

delete branch : mplzik/silence-link-quotes

delete time in a day

push eventgrafana/jsonnet-libs

Milan Plzik

commit sha 08c17d3b535d7e40b82de41e58ae5ff430e4e20d

Percent-encode the double-quotes in silence link. The double-quote character is not a valid part of URL (see RFC 3986) and thus shall be percent-encoded. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

Milan Plžík

commit sha b9cc0f3529833096c043084c04bc7b3562a134c4

Merge pull request #263 from grafana/mplzik/silence-link-quotes Percent-encode the double-quotes in silence link.

view details

push time in a day

PR merged grafana/jsonnet-libs

Percent-encode the double-quotes in silence link.

The double-quote character is not a valid part of URL (see RFC 3986) and thus shall be percent-encoded.

+2 -2

0 comment

1 changed file

mplzik

pr closed time in a day

push eventgrafana/jsonnet-libs

Milan Plzik

commit sha 08c17d3b535d7e40b82de41e58ae5ff430e4e20d

Percent-encode the double-quotes in silence link. The double-quote character is not a valid part of URL (see RFC 3986) and thus shall be percent-encoded. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in a day

PR opened grafana/jsonnet-libs

Percent-encode the double-quotes in silence link.

The double-quote character is not a valid part of URL (see RFC 3986) and↲ thus shall be percent-encoded.↲

+2 -2

0 comment

1 changed file

pr created time in a day

create barnchgrafana/jsonnet-libs

branch : mplzik/silence-link-quotes

created branch time in a day

issue commentgrafana/tanka

tk eval: Requires `spec.json` even though it is not needed

Note that this is different mode of operation for tanka -- so far it's been used only for k8s deployments and all the subcommands were tailored to that. I think the straightforward way for fixing this would make tk basically a jsonnet interpreter with benefits (native functions compatible with tanka).

gotjosh

comment created time in a day

pull request commentgrafana/jsonnet-libs

resolve lint issues in kausal.libsonnet and prometheus-ksonnet

... having LGTM'd the image used in CircleCI (.circleci/Dockerfile) probably needs updating.

malcolmholmes

comment created time in 12 days

issue commentgrafana/tanka

Prioritize CRD's in diff

This has been implemented for apply in https://github.com/grafana/tanka/pull/244 and https://github.com/grafana/tanka/pull/259; working this out for diff is still pending.

sh0rez

comment created time in a month

pull request commentgrafana/tanka

Implement sorting by NS and test object sorting.

@sh0rez changes implemented; PTAL.

mplzik

comment created time in a month

push eventgrafana/tanka

Milan Plzik

commit sha 3063656c4ee687e8f039c9f501b827963c69e18f

Implement review comments. - Refactored `mkobj` to look nicer. - Added a testcase that tests prioritizing Kind -> Namespace -> Name, in that order. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in a month

Pull request review commentgrafana/tanka

Implement sorting by NS and test object sorting.

 func TestExtract(t *testing.T) { 		}) 	} }++func mkobj(kind string, name string, ns string) map[string]interface{} {+	if ns == "" {

Will implement tomorrow.

mplzik

comment created time in a month

Pull request review commentgrafana/tanka

Implement sorting by NS and test object sorting.

 func TestExtract(t *testing.T) { 		}) 	} }++func mkobj(kind string, name string, ns string) map[string]interface{} {+	if ns == "" {+		return map[string]interface{}{+			"kind":       kind,+			"apiVersion": "apiversion",+			"metadata": map[string]interface{}{+				"name": name,+			},+		}+	}++	return map[string]interface{}{+		"kind":       kind,+		"apiVersion": "apiversion",+		"metadata": map[string]interface{}{+			"name":      name,+			"namespace": ns,+		},+	}+}++func TestReconcileSorting(t *testing.T) {

Good point, will implement tomorrow.

mplzik

comment created time in a month

Pull request review commentgrafana/tanka

Implement sorting by NS and test object sorting.

 func Reconcile(raw map[string]interface{}, spec v1alpha1.Spec, targets []*regexp 			return out[i].Kind() < out[j].Kind() 		} +		// If namespaces differ, sort by the namespace.+		if out[i].Metadata().Namespace() != out[j].Metadata().Namespace() {

IIUC empty string is not a valid namespace; and is also returned by the Namespace() function if namespace is not set. For the purposes of sorting, this defines an order over namespaces if they are not equal, so we should be fine here.

mplzik

comment created time in a month

issue commentgrafana/tanka

Test output object ordering from the reconcile phase.

The tests have been implemented in https://github.com/grafana/tanka/pull/259 .

mplzik

comment created time in a month

push eventgrafana/tanka

Milan Plzik

commit sha 3a18c9dd22abc807fec8a42ae5c10348639a46bf

Implement sorting by NS and test object sorting. - the original sort code in Reconcile() didn't take into account the case where two objects of the same kind and name might reside in different namespace, allowing the sort being non-deterministic at times. - testing of the sort code is now implemented. There might be some refactor pending, since `kubernetes_test.go` also contains code testing `Reconcile()`, but this is outside the scope of this PR. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in a month

PR opened grafana/tanka

Implement sorting by NS and test object sorting.
  • the original sort code in Reconcile() didn't take into account the case where two objects of the same kind and name might reside in different namespace, allowing the sort being non-deterministic at times.

  • testing of the sort code is now implemented.

There might be some refactor pending, since kubernetes_test.go also contains code testing Reconcile(), but this is outside the scope of this PR.

+102 -0

0 comment

2 changed files

pr created time in a month

create barnchgrafana/tanka

branch : mplzik/test-object-sorting

created branch time in a month

pull request commentSergioBenitez/Rocket

Implement UriDisplay and FromUriParam for Segments.

Note: This uses unwrap() in FromUriParams implementation for PathBuf source; unfortunately I don't know how to deal with this (except for dropping this particular implementation)

mplzik

comment created time in 2 months

PR opened SergioBenitez/Rocket

Implement UriDisplay and FromUriParam for Segments.

Segments were missing an implementation of UriDisplay and FromUriParam, making it impossible to use uri! in cases where a route handler had a `Segments argument.

Signed-off-by: Milan Plzik milan.plzik@gmail.com

+43 -3

0 comment

2 changed files

pr created time in 2 months

create barnchmplzik/Rocket

branch : mplzik/segments-reverse-uri

created branch time in 2 months

fork mplzik/Rocket

A web framework for Rust.

https://rocket.rs

fork in 2 months

issue commentgrafana/tanka

Apply CRDs in advance of any CRD-dependant resources.

Resource re-ordering has been implemented; but there's still some work on the diffing part to make diffs behave correctly; that's the reason why I left this issue open for now.

mplzik

comment created time in 2 months

Pull request review commentgrafana/tanka

Sort kubernetes objects before applying.

 import ( 	"os" 	"strings" -	funk "github.com/thoas/go-funk"- 	"github.com/grafana/tanka/pkg/kubernetes/manifest" ) +// Order in which install different kinds of Kubernetes objects.+// Inspired by https://github.com/helm/helm/blob/8c84a0bc0376650bc3d7334eef0c46356c22fa36/pkg/releaseutil/kind_sorter.go+var kindOrder = []string{

Gone :)

mplzik

comment created time in 2 months

Pull request review commentgrafana/tanka

Sort kubernetes objects before applying.

 import ( 	"os" 	"strings" -	funk "github.com/thoas/go-funk"- 	"github.com/grafana/tanka/pkg/kubernetes/manifest" ) +// Order in which install different kinds of Kubernetes objects.+// Inspired by https://github.com/helm/helm/blob/8c84a0bc0376650bc3d7334eef0c46356c22fa36/pkg/releaseutil/kind_sorter.go+var kindOrder = []string{+	"Namespace",+	"NetworkPolicy",+	"ResourceQuota",+	"LimitRange",+	"PodSecurityPolicy",+	"PodDisruptionBudget",+	"ServiceAccount",+	"Secret",+	"ConfigMap",+	"StorageClass",+	"PersistentVolume",+	"PersistentVolumeClaim",+	"CustomResourceDefinition",+	"ClusterRole",+	"ClusterRoleList",+	"ClusterRoleBinding",+	"ClusterRoleBindingList",+	"Role",+	"RoleList",+	"RoleBinding",+	"RoleBindingList",+	"Service",+	"DaemonSet",+	"Pod",+	"ReplicationController",+	"ReplicaSet",+	"Deployment",+	"HorizontalPodAutoscaler",+	"StatefulSet",+	"Job",+	"CronJob",+	"Ingress",+	"APIService",+}+ // Apply applies the given yaml to the cluster func (k Kubectl) Apply(data manifest.List, opts ApplyOpts) error {

Done.

mplzik

comment created time in 2 months

push eventgrafana/tanka

Milan Plzik

commit sha 84eea1c6fca8854011270aaf241b3065a322fd73

Fix review comments. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in 2 months

Pull request review commentgrafana/tanka

Sort kubernetes objects before applying.

 func Reconcile(raw map[string]interface{}, spec v1alpha1.Spec, targets []*regexp  	// Stable output order 	sort.SliceStable(out, func(i int, j int) bool {

I had a quick look at the current tests and it seems to be more appropriate to be implemented after https://github.com/grafana/tanka/issues/220 is fixed. I've added https://github.com/grafana/tanka/issues/248 to not forget about this.

mplzik

comment created time in 2 months

issue openedgrafana/tanka

Test output object ordering from the reconcile phase.

I'd like to have some tests for this at some point:

- Namespaces and CRD's before their instances
- Kinds not in list alphabetically
- equal Kinds by name

[https://github.com/grafana/tanka/pull/244#discussion_r400344750]

created time in 2 months

IssuesEvent

issue commentgrafana/tanka

Implement acceptance tests.

Definitely not stale, just postponed until more important things get done.

mplzik

comment created time in 2 months

Pull request review commentgrafana/jsonnet-libs

Upgrade kubernetes-mixin

                     "subdir": ""                 }             },-            "version": "release-0.1"+            "version": "master"

nit: this sounds like a floating label that might change quite a lot -- is that ok?

Duologic

comment created time in 2 months

startedvimeo/pentagon

started time in 2 months

issue commentgrafana/tanka

Prioritize CRD's in diff

This will be addressed in a follow-up PR that will cover the rest of #227 . Splitting the original PR made it a bit easier to rewrite and review.

sh0rez

comment created time in 2 months

push eventgrafana/tanka

Milan Plzik

commit sha 488ef73efa9f0303a098bc44457a77d53b19bc6e

Move object sorting to the Reconcile phase. As suggested in https://github.com/grafana/tanka/pull/244#issuecomment-601657980 , `Reconcile()` might be a better place for sorting, since we're already doing sort-of (pun intended) similar thing there. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in 2 months

pull request commentgrafana/tanka

Sort Kubernetes object before installing them.

A first half of this PR (sorting objects) is separated to https://github.com/grafana/tanka/pull/244 .

mplzik

comment created time in 2 months

create barnchgrafana/tanka

branch : mplzik/sort-k8s-objects

created branch time in 2 months

PR opened grafana/tanka

Sort kubernetes objects before applying.

Instead of just applying namespces before everything else, let's sort all the objects. There's more inter-dependences between various kinds, e.g. CRDs need to be applied before the actual custom resources, StorageClasses before the PVCs, ... .

+56 -14

0 comment

1 changed file

pr created time in 2 months

issue commentgoogle/go-jsonnet

go-jsonnet's release packages can not be built using Bazel.

Note that putting information into README.md will not help to avoid the bad experience of broken build when using gazelle to generate the BUILD files.

mplzik

comment created time in 2 months

push eventgrafana/jsonnet-libs

Milan Plzik

commit sha ac41e772693e90970a567acbe46195c7862982ca

Import cert manager libraries. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

Milan Plzik

commit sha 5dc3afbab48f522e3f2eeb6850e36c67c8981072

Add README.md Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

Milan Plžík

commit sha d3c9f46e8f1ab665db6b31446fbe23e399c9f529

Merge pull request #220 from grafana/mplzik/cert-manager Import cert manager libraries.

view details

push time in 2 months

delete branch grafana/jsonnet-libs

delete branch : mplzik/cert-manager

delete time in 2 months

push eventgrafana/jsonnet-libs

Milan Plzik

commit sha e0d7ee9cb5c0e6f05853a4d2dff0ab8e3c5b1af0

Update jsonnet verstion to v0.15.0 Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

Milan Plžík

commit sha 4d058fc4fb13dc8441417ab3ff5992ab6defee37

Merge pull request #222 from grafana/mplzik/update-build-image Update jsonnet verstion to v0.15.0

view details

Milan Plzik

commit sha bd9c2568787dda025e03c1a6c6e4dd313a5c8fdd

Add jsonnetfmt to the docker image. The Dockerfile was originally just pulling a single jsonnet binary from jsonnet build. We're using jsonnetfmt for linting, let's include that one as well. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

Milan Plžík

commit sha 1022b3713fbab50f90c4ad0ee26a6634892f0cc8

Merge pull request #225 from grafana/mplzik/add-jsonnetfmt-to-build-image Add jsonnetfmt to the docker image.

view details

Milan Plzik

commit sha 6d8dd346bc892fbe90148e781127280a69f73144

Re-format files and switch to jsonnetfmt. This commit: - switches to Grafana's jsonnet image with jsonnet v0.15.0, - fixes lint script to fail if any of the linted files fails to check, - reformats files so that linting succeeds. This is a follow-up of https://github.com/grafana/jsonnet-libs/pull/222 . Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

Milan Plžík

commit sha 03da9ea0fc25e621d195fbb218a6bf8593152721

Merge pull request #221 from grafana/mplzik/fmt-and-switch-to-jsonnetfmt Re-format files and switch to jsonnetfmt.

view details

Milan Plzik

commit sha ac41e772693e90970a567acbe46195c7862982ca

Import cert manager libraries. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

Milan Plzik

commit sha 5dc3afbab48f522e3f2eeb6850e36c67c8981072

Add README.md Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in 2 months

issue closedbazelbuild/bazel-gazelle

fetch_repo doesn't handle git repositories with submodules

<!-- Please answer these questions before submitting your issue. Thanks! -->

What version of gazelle are you using?

0.20.0

What version of rules_go are you using?

0.22.1

What version of Bazel are you using?

2.1.0

Does this issue reproduce with the latest releases of all the above?

To my best knowledge, these are the latest versions, apart from bazel, which has had different issues when upgrading 2.2.0.

What operating system and processor architecture are you using?

Linux/amd64

What did you do?

Tried to use Bazel/rules_go/gazelle to build a (otherwise functional) golang project that uses github.com/google/go-jsonnet (which is a git repo using submodules). This was done by creating a Bazel workspace and trying to use gazelle to generate BUILD files and import the necessary repositories. After that, I tried to build the target using bazel build //...

See the attached archive with Bazel workspace. gazelle-bug.tar.gz

What did you expect to see?

A correctly compiled target.

What did you see instead?

Compilation error on go-jsonnet's side:

$ bazel build //...
ERROR: /home/whatever/.cache/bazel/_bazel_whatever/2746597193d878897e28c5186b213b4b/external/com_github_google_go_jsonnet/astgen/BUILD.bazel:3:1: no such package '@com_github_google_go_jsonnet//cpp-jsonnet/stdlib': BUILD file not found in directory 'cpp-jsonnet/stdlib' of external repository @com_github_google_go_jsonnet. Add a BUILD file to a directory to mark it as a package. and referenced by '@com_github_google_go_jsonnet//astgen:dumpstdlibast'
ERROR: Analysis of target '//:go_default_library' failed; build aborted: no such package '@com_github_google_go_jsonnet//cpp-jsonnet/stdlib': BUILD file not found in directory 'cpp-jsonnet/stdlib' of external repository @com_github_google_go_jsonnet. Add a BUILD file to a directory to mark it as a package.
INFO: Elapsed time: 3.191s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (10 packages loaded, 49 targets configured)

closed time in 2 months

mplzik

issue commentbazelbuild/bazel-gazelle

fetch_repo doesn't handle git repositories with submodules

Indeed, this seems to work; thanks a lot! :) In the meanwhile, Since the release archives don't contain the cpp-jsonnet/stdlib as well, it probably makes sense to report this as a bug to the go-jsonnet maintainers.

mplzik

comment created time in 2 months

issue openedgoogle/go-jsonnet

go-jsonnet's release packages can not be built using Bazel.

go-jsonnet's release packages don't contain cpp-jsonnet/stdlib, but does contain a BUILD file referring to this directory.

This breaks building this repository using go_repository module from rules_go (and also, makes gazelle's autogenerated configuration unusable). There's a workaround proposed by gazelle maintainers (https://github.com/bazelbuild/bazel-gazelle/issues/732#issuecomment-600882662), but this requires manual configuration.

created time in 2 months

issue openedbazelbuild/bazel-gazelle

fetch_repo doesn't handle git repositories with submodules

<!-- Please answer these questions before submitting your issue. Thanks! -->

What version of gazelle are you using?

0.20.0

What version of rules_go are you using?

0.22.1

What version of Bazel are you using?

2.1.0

Does this issue reproduce with the latest releases of all the above?

To my best knowledge, these are the latest versions, apart from bazel, which has had different issues when upgrading 2.2.0.

What operating system and processor architecture are you using?

Linux/amd64

What did you do?

Tried to use Bazel/rules_go/gazelle to build a (otherwise functional) golang project that uses github.com/google/go-jsonnet (which is a git repo using submodules). This was done by creating a Bazel workspace and trying to use gazelle to generate BUILD files and import the necessary repositories. After that, I tried to build the target using bazel build //...

See the attached archive with Bazel workspace. gazelle-bug.tar.gz

What did you expect to see?

A correctly compiled target.

What did you see instead?

Compilation error on go-jsonnet's side:

$ bazel build //...
ERROR: /home/whatever/.cache/bazel/_bazel_whatever/2746597193d878897e28c5186b213b4b/external/com_github_google_go_jsonnet/astgen/BUILD.bazel:3:1: no such package '@com_github_google_go_jsonnet//cpp-jsonnet/stdlib': BUILD file not found in directory 'cpp-jsonnet/stdlib' of external repository @com_github_google_go_jsonnet. Add a BUILD file to a directory to mark it as a package. and referenced by '@com_github_google_go_jsonnet//astgen:dumpstdlibast'
ERROR: Analysis of target '//:go_default_library' failed; build aborted: no such package '@com_github_google_go_jsonnet//cpp-jsonnet/stdlib': BUILD file not found in directory 'cpp-jsonnet/stdlib' of external repository @com_github_google_go_jsonnet. Add a BUILD file to a directory to mark it as a package.
INFO: Elapsed time: 3.191s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (10 packages loaded, 49 targets configured)

created time in 2 months

delete branch grafana/jsonnet-libs

delete branch : mplzik/fmt-and-switch-to-jsonnetfmt

delete time in 2 months

push eventgrafana/jsonnet-libs

Milan Plzik

commit sha 6d8dd346bc892fbe90148e781127280a69f73144

Re-format files and switch to jsonnetfmt. This commit: - switches to Grafana's jsonnet image with jsonnet v0.15.0, - fixes lint script to fail if any of the linted files fails to check, - reformats files so that linting succeeds. This is a follow-up of https://github.com/grafana/jsonnet-libs/pull/222 . Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

Milan Plžík

commit sha 03da9ea0fc25e621d195fbb218a6bf8593152721

Merge pull request #221 from grafana/mplzik/fmt-and-switch-to-jsonnetfmt Re-format files and switch to jsonnetfmt.

view details

push time in 2 months

PR merged grafana/jsonnet-libs

Reviewers
Re-format files and switch to jsonnetfmt.

Since v0.13.0, jsonnet fmt was separated into a jsonnetfmt library. Also, reformat files, since some of them are triggering linter errors.

Fixes https://github.com/grafana/jsonnet-libs/issues/224

+22 -19

2 comments

6 changed files

mplzik

pr closed time in 2 months

issue closedgrafana/jsonnet-libs

Linting in grafana/jsonnet-libs is broken

Linting in grafana/jsonnet-libs was broken for a long time due to a bug in evaluating exit codes when doing the lint. TL;DR, make lint fails with a non-zero error code only if the last checked jsonnet file check failed. Similar issue seems to have been already fixed in deployment_tools repo.

Moreover, the linting docker image uses an image from kausal, despite of jsonnet-libs/build/Makefile referring to a grafana-hosted image.

closed time in 2 months

mplzik

push eventgrafana/jsonnet-libs

Milan Plzik

commit sha 6d8dd346bc892fbe90148e781127280a69f73144

Re-format files and switch to jsonnetfmt. This commit: - switches to Grafana's jsonnet image with jsonnet v0.15.0, - fixes lint script to fail if any of the linted files fails to check, - reformats files so that linting succeeds. This is a follow-up of https://github.com/grafana/jsonnet-libs/pull/222 . Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in 2 months

delete branch grafana/jsonnet-libs

delete branch : mplzik/add-jsonnetfmt-to-build-image

delete time in 2 months

push eventgrafana/jsonnet-libs

Milan Plzik

commit sha bd9c2568787dda025e03c1a6c6e4dd313a5c8fdd

Add jsonnetfmt to the docker image. The Dockerfile was originally just pulling a single jsonnet binary from jsonnet build. We're using jsonnetfmt for linting, let's include that one as well. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

Milan Plžík

commit sha 1022b3713fbab50f90c4ad0ee26a6634892f0cc8

Merge pull request #225 from grafana/mplzik/add-jsonnetfmt-to-build-image Add jsonnetfmt to the docker image.

view details

push time in 2 months

PR merged grafana/jsonnet-libs

Add jsonnetfmt to the docker image.

The Dockerfile was originally just pulling a single jsonnet binary from jsonnet build. We're using jsonnetfmt for linting, let's include that one as well.

+1 -0

0 comment

1 changed file

mplzik

pr closed time in 2 months

PR opened grafana/jsonnet-libs

Add jsonnetfmt to the docker image.

The Dockerfile was originally just pulling a single jsonnet binary from jsonnet build. We're using jsonnetfmt for linting, let's include that one as well.

+1 -0

0 comment

1 changed file

pr created time in 2 months

create barnchgrafana/jsonnet-libs

branch : mplzik/add-jsonnetfmt-to-build-image

created branch time in 2 months

pull request commentgrafana/jsonnet-libs

Re-format files and switch to jsonnetfmt.

@DanCech this was done in https://github.com/grafana/jsonnet-libs/pull/222 ; I waited for a green light there to continue working on this :-)

mplzik

comment created time in 2 months

push eventgrafana/jsonnet-libs

Milan Plzik

commit sha e50d00a81372854721f33ac244ca72587a525db2

Re-format files and switch to jsonnetfmt. This commit: - switches to Grafana's jsonnet image with jsonnet v0.15.0, - fixes lint script to fail if any of the linted files fails to check, - reformats files so that linting succeeds. This is a follow-up of https://github.com/grafana/jsonnet-libs/pull/222 . Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in 2 months

IssuesEvent

push eventgrafana/jsonnet-libs

Milan Plzik

commit sha ab49f591f34e9aec531427d565910ff8f70b75be

Re-format files and switch to jsonnetfmt. This commit: - switches to Grafana's jsonnet image with jsonnet v0.15.0, - fixes lint script to fail if any of the linted files fails to check, - reformats files so that linting succeeds. This is a follow-up of https://github.com/grafana/jsonnet-libs/pull/222 . Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in 2 months

push eventgrafana/jsonnet-libs

Milan Plzik

commit sha 41409b14fb506843bccd67ec609f65a1723a1344

Re-format files and switch to jsonnetfmt. This commit: - switches to Grafana's jsonnet image with jsonnet v0.15.0, - fixes lint script to fail if any of the linted files fails to check, - reformats files so that linting succeeds. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in 2 months

push eventgrafana/jsonnet-libs

Milan Plzik

commit sha e0d7ee9cb5c0e6f05853a4d2dff0ab8e3c5b1af0

Update jsonnet verstion to v0.15.0 Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

Milan Plžík

commit sha 4d058fc4fb13dc8441417ab3ff5992ab6defee37

Merge pull request #222 from grafana/mplzik/update-build-image Update jsonnet verstion to v0.15.0

view details

push time in 2 months

delete branch grafana/jsonnet-libs

delete branch : mplzik/update-build-image

delete time in 2 months

PR merged grafana/jsonnet-libs

Reviewers
Update jsonnet verstion to v0.15.0

This is a first PR en route to fix https://github.com/grafana/jsonnet-libs/issues/224 . This image is not yet used anywhere, but a follow-up PR will switch circleci to use this image instead of kausal one.

+1 -1

0 comment

1 changed file

mplzik

pr closed time in 2 months

issue closedgrafana/jsonnet-libs

Linting in grafana/jsonnet-libs is broken

Linting in grafana/jsonnet-libs was broken for a long time due to a bug in evaluating exit codes when doing the lint. TL;DR, make lint fails with a non-zero error code only if the last checked jsonnet file check failed. Similar issue seems to have been already fixed in deployment_tools repo.

Moreover, the linting docker image uses an image from kausal, despite of jsonnet-libs/build/Makefile referring to a grafana-hosted image.

closed time in 2 months

mplzik

issue openedgrafana/jsonnet-libs

Linting in grafana/jsonnet-libs is broken

Linting in grafana/jsonnet-libs was broken for a long time due to a bug in evaluating exit codes when doing the lint. TL;DR, make lint fails with a non-zero error code only if the last checked jsonnet file check failed. Similar issue seems to have been already fixed in deployment_tools repo.

Moreover, the linting docker image uses an image from kausal, despite of jsonnet-libs/build/Makefile referring to a grafana-hosted image.

created time in 2 months

pull request commentgrafana/tanka

Sort Kubernetes object before installing them.

@sh0rez will have to PR ready (hopefully) tomorrow; thanks for the rewrite; the code that's been merged is much tidier than the code in this PR.

mplzik

comment created time in 2 months

create barnchgrafana/jsonnet-libs

branch : mplzik/update-build-image

created branch time in 2 months

PR opened grafana/jsonnet-libs

Re-format files and switch to jsonnetfmt.

Since v0.13.0, jsonnet fmt was separated into a jsonnetfmt library. Also, reformat files, since some of them are triggering linter errors.

+11 -11

0 comment

5 changed files

pr created time in 2 months

create barnchgrafana/jsonnet-libs

branch : mplzik/fmt-and-switch-to-jsonnetfmt

created branch time in 2 months

push eventgrafana/jsonnet-libs

Milan Plzik

commit sha 1a4e62584052216b16635b9fe893527982100bb2

Add README.md Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in 2 months

create barnchgrafana/jsonnet-libs

branch : mplzik/cert-manager

created branch time in 2 months

PR opened grafana/jsonnet-libs

Import cert manager libraries.
+6575 -0

0 comment

28 changed files

pr created time in 2 months

push eventgrafana/tanka

Milan Plžík

commit sha 6546515e4eba2d2914d857705c055cb18949246b

feat(cli): override kubectl path with env-var (#221) Up to now, Tanka was using hard-coded string as a `kubectl` path, making it hard to do any other tool without playing tricks with $PATH. This commit allows to use TANKA_KUBECTL_PATH env variable to override the path to `kubectl` used in Tanka's code.

view details

sh0rez

commit sha 13217bb41ce0ad29d7a0f6270496aaae1471a512

fix(docs): -t deployment example (#229) It made absolutely no sense that `-t 'deployment/.*'` would result in `ClusterRole` ....

view details

sh0rez

commit sha bf343675e149521cc217b0c2109681856d24cea4

fix(kubernetes): ignore diff errs on apply (#231) If diff fails, it doesn't mean apply couldn't suceed anyways, so it is wrong to abort in such a case. Changes that behavior so that the diff error is printed, but still continued to applying.

view details

sh0rez

commit sha f1ed20324a7ba1f522f869c11e6f7807111e513e

fix: full less in docker image (#232) Busybox less does not support `--RAW-CONTROL-CHARS`; `tk show` and `tk diff` fail in an unmodified alpine image.

view details

Milan Plzik

commit sha 65bff6ecbf9b7e98f22667416e5bbab274ceb90c

Sort Kubernetes object before installing them. There are certain interdependencies between Kubernetes objects that need to be taken care of, e.g. a Namespace must be created before any object using that namespace, or a CustomResourceDefinition needs to exist before any manifest that is of the kind defined by CRDs. The list is heavily inspired by Helm's kind_sorter.go at: https://github.com/helm/helm/blob/8c84a0bc0376650bc3d7334eef0c46356c22fa36/pkg/releaseutil/kind_sorter.go Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

Milan Plzik

commit sha 2dac9e0390c8ac3bf62f7f7f30ff5a23c63a5eb5

Remove the `filterNamespace` function. This has been superseded by object sorting. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

Milan Plzik

commit sha e189354fcb8de5ec402d8d25ddcd99c6ca808740

Implement filtering out of unknown object kinds from diffs. This commit adds support for fetching the list of supported resources from Kubernetes cluster and filtering out any unsupported kinds from the manifests sent for server-side diffs. This code is by no means complete, but should be able to handle most of the real-world cases. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

Milan Plzik

commit sha 99f272f567a8758472179ab5a36560fc821186a0

Add tests for separateUnsupportedResources. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in 3 months

push eventgrafana/tanka

Milan Plzik

commit sha 1cc1f57a162acad86668b34c39619d7f35ab9b20

Implement filtering out of unknown object kinds from diffs. This commit adds support for fetching the list of supported resources from Kubernetes cluster and filtering out any unsupported kinds from the manifests sent for server-side diffs. This code is by no means complete, but should be able to handle most of the real-world cases. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in 3 months

issue commentgrafana/tanka

Apply CRDs in advance of any CRD-dependant resources.

@steeling diffing indeed fails. We're currently trying to figure out a reasonable way to work around this issue, but unfortunately it's more complex than other similar code (e.g. filtering out the non-existent namespaces, which is already implemented in Tanka). One of the goals of this PR is to make Tanka work with more complex deployments, including cert-manager (which is also what we are trying to make work with this PR).

W.r.t. --validate=false, as @sh0rez already said, this is a supported option in Tanka. Note that the need for this flag is caused by cert-manager using Kubernetes 1.15 features -- see https://github.com/jetstack/cert-manager/issues/2441 for more information. There's not too much that can be done from Tanka's side.

mplzik

comment created time in 3 months

pull request commentgrafana/tanka

Sort Kubernetes object before installing them.

Note: this needs more work than just sorting -- doing dry run with CRDs on Kubernetes server fails:

error: cert-manager.io/v1alpha2, Kind=ClusterIssuer doesn't support dry-run
exit status 1

Thus, at least in for CRDs, a special handling for diff is necessary as well.

mplzik

comment created time in 3 months

Pull request review commentgrafana/tanka

Sort Kubernetes object before installing them.

 package client  import ( 	"os"+	"sort" 	"strings"  	"github.com/grafana/tanka/pkg/kubernetes/manifest" 	funk "github.com/thoas/go-funk" ) +// Order in which install different kinds of Kubernetes objects.+// Inspired by https://github.com/helm/helm/blob/8c84a0bc0376650bc3d7334eef0c46356c22fa36/pkg/releaseutil/kind_sorter.go+var kindOrder = []string{+	"Namespace",+	"NetworkPolicy",+	"ResourceQuota",+	"LimitRange",+	"PodSecurityPolicy",+	"PodDisruptionBudget",+	"ServiceAccount",+	"Secret",+	"ConfigMap",+	"StorageClass",+	"PersistentVolume",+	"PersistentVolumeClaim",+	"CustomResourceDefinition",+	"ClusterRole",+	"ClusterRoleList",+	"ClusterRoleBinding",+	"ClusterRoleBindingList",+	"Role",+	"RoleList",+	"RoleBinding",+	"RoleBindingList",+	"Service",+	"DaemonSet",+	"Pod",+	"ReplicationController",+	"ReplicaSet",+	"Deployment",+	"HorizontalPodAutoscaler",+	"StatefulSet",+	"Job",+	"CronJob",+	"Ingress",+	"APIService",+}+ // Apply applies the given yaml to the cluster func (k Kubectl) Apply(data manifest.List, opts ApplyOpts) error {-	// create namespaces first to succeed first try-	ns := filterNamespace(data)

Good point, I have missed that one. Done.

mplzik

comment created time in 3 months

push eventgrafana/tanka

Milan Plzik

commit sha 4bf6f150d6259f3a5f60d8ce3a53eefa11ed7793

Remove the `filterNamespace` function. This has been superseded by object sorting. Signed-off-by: Milan Plzik <milan.plzik@grafana.com>

view details

push time in 3 months

issue commentgrafana/tanka

Apply CRDs in advance of any CRD-dependant resources.

W.r.t. object orders. I guess that in most cases, Kubernetes will eventually (as in "might fail few times, but will succeed in the end) handle things correctly; there are only few cases of a real breakage. The PR I sent does some extra work to ensure some sane rules (e.g. PodSecurityPolicy objects get applied before anything that creates pods, and so are ConfigMaps and Secrets). If that's pre-mature, I'll be happy to trim the list just to the cases we know are causing trouble.

mplzik

comment created time in 3 months

issue commentgrafana/tanka

Apply CRDs in advance of any CRD-dependant resources.

Since the implementation wasn't that difficult, I implemented a draft PR for this: https://github.com/grafana/tanka/pull/227

mplzik

comment created time in 3 months

PR opened grafana/tanka

Sort Kubernetes object before installing them.

There are certain interdependencies between Kubernetes objects that need to be taken care of, e.g. a Namespace must be created before any object using that namespace, or a CustomResourceDefinition needs to exist before any manifest that is of the kind defined by CRDs.

The list is heavily inspired by Helm's kind_sorter.go at:

https://github.com/helm/helm/blob/8c84a0bc0376650bc3d7334eef0c46356c22fa36/pkg/releaseutil/kind_sorter.go

+57 -6

0 comment

1 changed file

pr created time in 3 months

create barnchgrafana/tanka

branch : mplzik/sort-before-applying

created branch time in 3 months

issue openedgrafana/tanka

Apply CRDs in advance of any other resources.

Currently, Custom Resource Definitions (CRDs) are not being given any kind of special treatment, which can easily result in CRD-defined resources being applied before the actual CRD is present in the cluster, making kubectl fail.

Tanka already implements special handling for namespaces, which get applied before anything else; a similar approach might work for CRDs as well.

created time in 3 months

issue commentgrafana/tanka

server err: cannot convert int64 to string

So, a quick googling found gave a suggestion -- a configmap entry that's rendered as a number, although configmaps accepts string values as keys: https://medium.com/@ismailyenigul/kubernetes-configmap-and-cannot-convert-int64-to-string-error-ebf48fa1cd28 . Might be worth looking at the generated configmaps.

mplzik

comment created time in 3 months

more