Skip to content

(fix): add labels for tooling to query containers - #218

Merged
tphoney merged 3 commits into
harness:masterfrom
kameshsampath:step-labels
Aug 1, 2022
Merged

(fix): add labels for tooling to query containers#218
tphoney merged 3 commits into
harness:masterfrom
kameshsampath:step-labels

Conversation

@kameshsampath

Copy link
Copy Markdown
Contributor

Add labels to help tools to query the containers

Comment thread drone/exec/exec.go Outdated
comp.Labels = make(map[string]string)
}
comp.Labels["io.drone.pipeline.dir"] = pwd
comp.Labels["io.drone.pipeline.FQN"] = fmt.Sprintf("%s~~%s", strings.ReplaceAll(pwd, "/", "-"), commy.Stage.Name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the label keys should be all lowercase, for consistency purposes

-comp.Labels["io.drone.pipeline.FQN"]
+comp.Labels["io.drone.desktop.fqn"]

It would also be helpful if you provided some details around the goals of the fqn attribute. Drone already adds the stage as a label [1]. I feel like we should be able to use these two labels as a composite key, as opposed to having to create a third label.

[1] https://github.com/drone/runner-go/blob/master/labels/labels.go#L39

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Yeah we can remove this attribute and use pipeline.dir and stage name combo to query them unquiely

Comment thread drone/exec/exec.go Outdated
if comp.Labels == nil {
comp.Labels = make(map[string]string)
}
comp.Labels["io.drone.pipeline.dir"] = pwd

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these labels meant for drone desktop? If yes, it might make sense to use io.drone.desktop so that we can associate the labels with the correct client and reduce ambiguity. For example, one might assume that dir represents the pipeline working directory, which would not be the case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah mostly for now its targetted for the tools and it make sense to rename it

@tphoney
tphoney merged commit dcb1602 into harness:master Aug 1, 2022
tphoney pushed a commit to tphoney/drone-cli that referenced this pull request Sep 6, 2023
* Add missing ctx values

* Add new ctx.build.debug option

* Build drone for mac with m1 chip

* Update go version to support m1 builds

* Update go version in drone.yml

* Update building

* run go mod tidy

* feat(cron): add rm command

Signed-off-by: Javier Palomo <javier.palomo@grafana.com>

* Add drone cron exec cmd (harness#180)

* fixes issue were cli required an additional parameter in order to communicate with vault when using drone-vault plugin.

* refactor env variable declaration to one statement

* improve Defect/permission template command (harness#191)

* Update the way namespace is sent to the drone server.
* update drone-go version
* bump drone-go library

* (DRON-113) use ghodss/yaml for yaml pretty print

* release prep v1.3.1

* (fix) re-enable format option for jsonnet command

* (maint) release prep for v1.3.2

* Fix `--stream` combined with `--format` for `jsonnet` (harness#195)

* Fix `--stream` combined with `--format` for `jsonnet`
If both are defined and jsonnet defines a list, it currently only generates one of the resources
Also added a test for it
* Minimize diffs by keeping all in one file

* (maint) release prep v1.3.3

* provide update and get info values for repo

* bump drone-go

* (fix) fix multi-docs/lists in starlark

* (maint) release-v1.4.0 prep

* Update go-jsonnet to version v0.17.0

* fixes issue where template info command wasn't working

* (dron-124) Add new command for build incomplete V2

* Update README.md

* update libaries with vulnerabilies

* release prep v1.5.0

* (feat) remove drone-yaml dependency. use docker compiler for lint

* rewrite of exec command, use docker runner code

* add community information

* (drone-372) use the modern docker runner for exec, upgrade deps

* (fix): add labels for tooling to query containers (harness#218)

* (fix): add labels for tooling to query containers

* fix: use .drone.yml as default pipeline file (harness#219)

use .drone.yml as default pipeline file if no pipeline file is passed

* (maint) v1.6.0 release prep

* (fix) add secret file to compiler in exec

* (maint) update containerd and docker/distrubution

* (maint) release prep 1.6.1 & go tidy (harness#223)

* fix lack of colors in drone exec output

* fix: use right parameter name for secrets-file (harness#226)

Update the param name to secret-file instead of secrets

* (maint) prep v1.6.2

* Add support for jpath in jsonnet (harness#224)

* Add support for jpath in jsonnet
Co-authored-by: TP Honey <tp@harness.io>

* (maint) v1.7.0 prep

* Remove output for resources (harness#225)

* Bump google.golang.org/grpc from 1.43.0 to 1.53.0

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.43.0 to 1.53.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.43.0...v1.53.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/docker/distribution

Bumps [github.com/docker/distribution](https://github.com/docker/distribution) from 2.8.1+incompatible to 2.8.2+incompatible.
- [Release notes](https://github.com/docker/distribution/releases)
- [Commits](distribution/distribution@v2.8.1...v2.8.2)

---
updated-dependencies:
- dependency-name: github.com/docker/distribution
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump github.com/containerd/containerd from 1.6.8 to 1.6.18

Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.6.8 to 1.6.18.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](containerd/containerd@v1.6.8...v1.6.18)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump golang.org/x/net from 0.0.0-20220630215102-69896b714898 to 0.7.0

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20220630215102-69896b714898 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: [CI-8942]: Add manifest push support (harness#235)

* fix: [CI-8942]: Add manifest push support

---------

Co-authored-by: TP Honey <tp@harness.io>

* (fix) setup dependencies in drone build

* (fix) add manifest file

* Update .drone.yml

* Update manifest.tmpl

* Update .drone.yml

* Update .drone.yml

* Update manifest.tmpl

* Update manifest.tmpl

* Update .drone.yml set platform for arm64

* [feat]: [CI-8942]: Add alpine support (harness#240)

* [feat]: [CI-8942]: Add alpine support

---------

Co-authored-by: TP Honey <tp@harness.io>

* fix arm (harness#241)

* switch to vm runner

* parallelize build and use native infra

---------

Signed-off-by: Javier Palomo <javier.palomo@grafana.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Timofei Kushnir <timophey@kushnir.msk.ru>
Co-authored-by: Eoin McAfee <83226740+eoinmcafee00@users.noreply.github.com>
Co-authored-by: Alik Khilazhev <alikhil@mail.ru>
Co-authored-by: Javier Palomo <javier.palomo@grafana.com>
Co-authored-by: Chris Raborg <craborg57@gmail.com>
Co-authored-by: Eoin McAfee <eoin.mcafee@harness.io>
Co-authored-by: Julien Duchesne <julienduchesne@live.com>
Co-authored-by: Harrison Katz <hkatz@squarespace.com>
Co-authored-by: Marko Gaćeša <marko.gacesa@harness.io>
Co-authored-by: Marie <chefantons@gmail.com>
Co-authored-by: Kamesh Sampath <kamesh.sampath@hotmail.com>
Co-authored-by: Dan Wilson <daniel.wilson@harness.io>
Co-authored-by: Brad Rydzewski <bradley.rydzewski@harness.io>
Co-authored-by: Sean Ryan <16017399+rhiaxion@users.noreply.github.com>
Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Soumyajit Das <soumyajit.das@harness.io>
Co-authored-by: dependabot-ci <no-reply@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants