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

Configurable container images for cert-csi #53

Merged
merged 5 commits into from
Dec 4, 2023

Conversation

rishabhatdell
Copy link
Contributor

@rishabhatdell rishabhatdell commented Dec 1, 2023

Description

This PR allows cert-csi to use custom images for creating containers by passing an image config YAML file as an argument. The YAML file should have linux(test) and postgres images name with their corresponding image URL. For example:

images:
  - test: "docker.io/centos:centos7"
    postgres: "docker.io/bitnami/postgresql:11.8.0-debian-10-r72"

To use this feature, run cert-csi with the option --image-config /path/to/config.yaml along with any other arguments.

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
dell/csm#1059

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have maintained backward compatibility

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Built binary and executed unit tests
    image

  • Executed the cert-csi to verify whether the provided image was utilized in the container build process
    287244359-8c8bdbe3-6996-4bcc-93bd-c99e8daea067

@atye
Copy link
Contributor

atye commented Dec 1, 2023

Will there be a csm-docs update describing how to use this?

@@ -835,6 +842,12 @@ func (cts *CapacityTrackingSuite) Run(ctx context.Context, storageClass string,
if sc.HasError() {
return delFunc, sc.GetError()
}

if cts.Image == "" {
log.Info("Using default image")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we enhance this log by stating that 'docker.io/centos:latest' is the default image?

@@ -841,10 +1004,22 @@ func getBlockSnapCommand(globalFlags []cli.Flag) cli.Command {
snapClass := c.String("volumeSnapshotClass")
size := c.String("size")
accessMode := c.String("access-mode")
imageConfigPath := c.String("image-config")
var testImage string
Copy link
Contributor

Choose a reason for hiding this comment

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

@rishabhatdell , what are your thoughts on incorporating a generic/common function to eliminate code duplication? It seems we've duplicated the same logic across multiple sections, checking for the same conditions in each suite.

@rishabhatdell
Copy link
Contributor Author

Will there be a csm-docs update describing how to use this?

here is the PR: dell/csm-docs#928

Copy link
Contributor

@gallacher gallacher left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@AkshaySainiDell AkshaySainiDell left a comment

Choose a reason for hiding this comment

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

LGTM

@suryagupta4 suryagupta4 merged commit 934c398 into main Dec 4, 2023
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants