Skip to content
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

Build: Update plugin installation in custom Dockerfile #68310

Merged
merged 1 commit into from
May 11, 2023

Conversation

hoptical
Copy link
Contributor

What is this feature?

There is a for loop in the plugin installation layer in the custom Dockerfile. The problem is that if the installation of any plugin except the last one faces an error (e.g., Network error and etc.), the layer will continue to run and the image is built successfully, and the user may not be aware of the missing plugins in the image.

This PR adds the set -e command to the layer to exit the layer with a non-zero code in case of any failure in the loop and prevent the image from building successfully.

Why do we need this feature?

Users should be certain about the successful installation of all plugins, especially for the CI/CD pipelines.

Who is this feature for?

Anyone who uses the custom Dockerfile for pre-installed plugins.

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

Add `set -e` command to the custom Dockerfile to prevent missing plugins in installation.
@hoptical hoptical requested a review from DanCech as a code owner May 11, 2023 13:17
@grafanabot grafanabot added type/build-packaging pr/external This PR is from external contributor labels May 11, 2023
Copy link
Collaborator

@DanCech DanCech left a comment

Choose a reason for hiding this comment

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

I think this is a sensible approach, and agree that failing to build is a better approach than producing an image that is missing a specified plugin.

@DanCech DanCech added add to changelog no-backport Skip backport of PR labels May 11, 2023
@DanCech DanCech modified the milestone: 10.0.0 May 11, 2023
@DanCech DanCech merged commit df4f569 into grafana:main May 11, 2023
15 checks passed
@hoptical hoptical deleted the update-custom-dockerfile branch May 11, 2023 20:49
ryantxu pushed a commit that referenced this pull request May 16, 2023
Update custom dockerfile

Add `set -e` command to the custom Dockerfile to prevent missing plugins in installation.
@zerok zerok modified the milestones: 10.0.0, 10.0.0-preview, 10.1.x May 31, 2023
@ricky-undeadcoders ricky-undeadcoders modified the milestones: 10.1.x, 10.1.0 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog no-backport Skip backport of PR pr/external This PR is from external contributor type/build-packaging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants