-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding pagination for installation list result using skip and limit option #2136
Adding pagination for installation list result using skip and limit option #2136
Conversation
I accidentally tried to use a fallthrough, which go doesn't support. I have fixed GetBuilder and added a unit test to validate that it is creating a build driver for all cases. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Replace / with - in branch names, so that release/v1 resolves to https://release-v1.porter.sh Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Fix branch deploys of website
Fix GetBuilder
* Use distroless base image Use a distroless base image for our porter docker images. This has less of an attack surface because it only ships the essentials to run porter, not the extra stuff that usually comes with a linux distribution. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com> * Apply suggestions from code review Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com> Co-authored-by: Nathaniel "Church" Hatfield <church13halo@gmail.com> * Move agent's run.sh into Go Since the nonroot distroless image doesn't have a shell, we can't use run.sh to copy the porter config files into PORTER_HOME at container start. I have implemented that in Go (sorry it's a lot vs what good ole cp did for us under the hood). One trick is that when /porter-config is mounted into the container by k8s, it uses symlinks like this: /porter-config ..data/porter.config porter.config -> ..data/porter.config So it's not a straightforward as you'd think at first glance. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com> * Apply suggestions from code review Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com> Co-authored-by: Vaughn Dice <vaughn.dice@fermyon.com> Co-authored-by: Nathaniel "Church" Hatfield <church13halo@gmail.com> Co-authored-by: Vaughn Dice <vaughn.dice@fermyon.com>
* Fix Pushing Bundles that have a relocationMap (getporter#1815) * chore: add avinashupadhya99 to Contributors.md * docs: remove accidental packr word from contribution guide * Improve error message when cnab-to-oci fixes up a bundle * docs: fix command in contrib tutorial * docs: update parameters doc with allowable types (getporter#1792) Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Log to a file in ~/.porter/logs/CORRELLATION_ID.json and in colored human readable output to stderr. When stderr is not a TTY, color is omitted (which is what we need for piping to a file or running on headless CI servers). Tracing has been enabled using open-telemetry and can be configured with the standard OTEL environment variables. https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#specify-protocol This is just a stub of the final tracing and log switch over, that lays down a framework for converting the rest and instrumenting more commands. For now we start a trace for the command executed. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
This binds the --driver flag for porter install|invoke|upgrade|uninstall to the PORTER_RUNTIME_DRIVER environment variable used by the operator. I had already done this for PORTER_BUILD_DRIVER, but missed adding similar configuration bindings for runtime. So in the config file, the user can set rutime-driver and build-driver. The environment variables are named: PORTER_RUNTIME_DRIVER and PORTER_BUILD_DRIVER. The flag though on any command is just --driver for simplicity, e.g. porter install --driver kubernetes. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Makes it easier for people to know which version of the docs they are on (v0.38 or v1.0.0) and switch between the two. Long term, a better strategy for versioning the docs site would be great but this is a small change that we can do right now. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Link to the stable docs from v1 site
* sync go mod Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com> * Allow mixins to ignore a failed command Add the HasErrorHandling interface to the shared pkg/exec/builder package used by all the mixins. When implemented, a mixin can examine a failed command and optionaly handle it. The exec mixin now supports ignoring failed commands, which demonstrates how to use builder.IgnoreErrorHandler struct to use the same error handling behavior. Closes getporter#592 Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
The mage/mixins package contains common magefile targets that all mixins use: build, test, publish, etc. This minimizes the amount of custom logic in our magefiles and should make it easier to manage the magefile in all the mixins going forward. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Signed-off-by: Mahendra Bishnoi <mahendrabishnoi2@gmail.com>
Signed-off-by: Mahendra Bishnoi <mahendrabishnoi2@gmail.com>
…t-registry Change default registry to localhost:5000
Use the system porter that was installed by the EnsurePorter target. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Fix setting --driver with env variables
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Allow someone to just publish binaries or also publish a mixin feed. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
…ot exist (getporter#1828) * Porter triggers autobuild when detecting that invocation image does not exist Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com> * 1. Change function name from IsInvocationImagExists to IsImageCached along with some explanation comment. 2. Use invocationImage directly as an input to list images 3. Wrap error from Docker SDK and remove error wrap on stamp.go 4. Fix wording to "local image cache" from "host registry" Signed-off-by: joshuabezaleel <joshua.bezaleel@gmail.com>
Use structured logs and export traces
The integration tests accidentally were passing nil for the context after I added context.Context as a parameter to some Porter commands in getporter#1831. This passes in context.Background to fix the nil pointer exceptions that was causing. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Print out where we are publishing and explain what to do if you use different repository names. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Pass context from integration tests
…tions Add package for mixins magefile targets
First check if we have a local copy of porter and use that to generate a mixin feed. Otherwise assume that porter is installed in the GOPATH. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Use porter from the bin or the PATH
This PR adds missing double quotes for Telemetry struct tag so it can be properly set if present. Signed-off-by: Yingrong Zhao <yingrong.zhao@gmail.com>
When we are converting a porter.yaml to a bundle.json we need the porter config file so that we can check if the upcoming dependencies2 feature flag is enabled and conditionally build out a different bundle. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
* Update hashicorp plugin page with temp fork I've updated the Hashicorp plugins documentation page and am instructing people to install our temporary fork until the upstream repo is compatible with Porter v1. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com> * Update docs/content/plugins/hashicorp.md Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com> Co-authored-by: Vaughn Dice <vaughn.dice@fermyon.com> Co-authored-by: Vaughn Dice <vaughn.dice@fermyon.com>
Stop logging directly to stdout(!) and instead log with the current span so that it is traced. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
When the plugin configuration can't be marshaled to json, do not print the plugin config in the error message as it could contain sensitive data. I couldn't figure out how to test this since really we are just handling the error from json.Marshal but there isn't really a way for bad data to get to that point in Porter. We'd error out much earlier just reading the config file. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
I found a few spots I missed when removing docker from the build-driver options. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Fix performance for porter list
In a few places, I must have converted from fmt.Println to log.Debugf and forgot to use placeholders. This fixes the log lines so that they print properly instead of like this: using plugin pulling%!(EXTRA string=mongo:4.0-xenial) running a mongo server in a container on port%!(EXTRA string=27018) waiting for the mongo service to be ready Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Add registry.ListTags
Cleanup build-driver config setting
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Refactor the bundle adapter
Fix log messages from mongodb-docker
Sync release/v1 with main
When I was adding tests for the FindInstallations function, I realized that I'd made a mistake earlier when defining the FindOptions. It had erroneously included Group (which is only for Aggregate). In addition, our wrapper around FindOptions wasn't exposing the Select field. I've also updated it to use bson.D/M for consistency with the other options and ensure we are always passing types that will work with our gRPC conversion logic that specifically handles bson.D. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
…gs-exp-flag Remove structured logs exp flag
When I was adding tests for the FindInstallations function, I realized that I'd made a mistake earlier when defining the FindOptions. It had erroneously included Group (which is only for Aggregate). In addition, our wrapper around FindOptions wasn't exposing the Select field. I've also updated it to use bson.D/M for consistency with the other options and ensure we are always passing types that will work with our gRPC conversion logic that specifically handles bson.D. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
* change dependency schema in porter Signed-off-by: Yingrong Zhao <yingrong.zhao@gmail.com> * fix testdata Signed-off-by: Yingrong Zhao <yingrong.zhao@gmail.com>
* Fix race condition in plugin logs routine When we run a plugin, we start a go routine that captures logs from the plugin and forwards them to our traceLogger. I've found that there is a race condition where: 1. We close the plugin 2. The plugin emits a message saying that its closing 3. We cancel the context for the log go routine but ctx.Done doesn't immediately trigger on the go routine. 4. Instead the plugin connections's close function returns before the routine is stopped. 5. Porter moves on and closes our logger. 6. The log go routine then tries to forward the message to the logger which is now closed. I've added a wait group that ensures that the log go routine finishes before the plugin connection returns from Close. This ensures that all resources managed by the plugin connection are cleaned up before Close returns. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com> * Move when we add to the wait group Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
I am sorry I think I made a new branch from the wrong branch/commit, I'll close this one and made another one 😔 |
Just realized I think it's because the target branch is |
Just a heads up that if the problem was that when you made the PR you accidentally picked "main" instead of "release/v1", you can change that by clicking the edit button by the title of your PR and then you can change the target branch. |
@carolynvs My bad, yesterday I thought the edit button was only able to change the title of the particular PR that's why what I did was made another PR for this branch. So sorry for the inconvenience .. |
It doesn't inconvenience me at all! I just wanted you to know so that you can fix it next time. 👍 |
@carolynvs will always be grateful for you and others being really eaccommodating, Carolyn. thank you so much! Looking forward to the review 😄 |
What does this change
User that use the Porter CLI can use
--skip
and--limit
flag for paginating their list output.What issue does it fix
Closes #2051
Notes for the reviewer
Checklist
Reviewer Checklist