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
Add volumes to images #1465
Add volumes to images #1465
Conversation
Signed-off-by: Javier López Barba <javier@okteto.com>
Codecov Report
@@ Coverage Diff @@
## master #1465 +/- ##
==========================================
- Coverage 36.19% 36.00% -0.20%
==========================================
Files 80 80
Lines 7689 7744 +55
==========================================
+ Hits 2783 2788 +5
- Misses 4551 4601 +50
Partials 355 355
Continue to review full report at Codecov.
|
pkg/cmd/stack/translate.go
Outdated
|
||
if !building && forceBuild { | ||
log.Warning("Ignoring '--build' argument. There are not 'build' primitives in your stack") | ||
func addVolumeMountsToSvcs(ctx context.Context, s *model.Stack, buildKitHost string, isOktetoCluster, forceBuild, noCache bool) (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func addVolumeMountsToSvcs(ctx context.Context, s *model.Stack, buildKitHost string, isOktetoCluster, forceBuild, noCache bool) (bool, error) { | |
func addVolumeMountsToBuiltImage(ctx context.Context, s *model.Stack, buildKitHost string, isOktetoCluster, forceBuild, noCache bool) (bool, error) { |
if len(svc.VolumeMounts) != 0 { | ||
if !hasAddedAnyVolumeMounts { | ||
hasAddedAnyVolumeMounts = true | ||
log.Information("Running your build in %s...", buildKitHost) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check that hasBuiltSomething
is false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That checks if a previous service has created any mount volume on other image, so it only gets into it the first time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeap, but if hasBuiltSomething
is true, this has been already printed, not?
the idea is to show the logs only on the first image been built
} | ||
svc.Build = svcBuild | ||
if isOktetoCluster && !strings.HasPrefix(svc.Image, "okteto.dev") { | ||
tag := strings.Replace(svc.Image, ":", "-", 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's always create a new image tag for this, for example:
okteto.dev/{stack_name}-{service_name}:okteto-with-volume-mounts
pkg/cmd/stack/translate.go
Outdated
tag := strings.Replace(svc.Image, ":", "-", 1) | ||
svc.Image = fmt.Sprintf("okteto.dev/%s:okteto", tag) | ||
} | ||
log.Information("Building image for service '%s'...", name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.Information("Building image for service '%s'...", name) | |
log.Information("Building image for service '%s' to include host volumes...", name) |
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba <javier@okteto.com>
Signed-off-by: Javier López Barba javier@okteto.com
Fixes #1439
Proposed changes