-
Notifications
You must be signed in to change notification settings - Fork 686
Optimize required unix file modes #7781
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
Changes from 1 commit
c15dcc8
48b467a
87427d9
09b9a02
bbbceec
14d9324
bee2e03
8fc53fc
783ea93
f03076b
3db1daf
927904c
45b429f
ab42aba
46b279e
dbdc6ae
2942736
7141452
bce8682
d80098d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1080,24 +1080,6 @@ private void PrepareContainers() | |
ctr.Annotate(CustomResource.OtelServiceInstanceIdAnnotation, containerObjectInstance.Suffix); | ||
SetInitialResourceState(container, ctr); | ||
|
||
if (container.TryGetContainerMounts(out var containerMounts)) | ||
{ | ||
ctr.Spec.VolumeMounts = []; | ||
|
||
foreach (var mount in containerMounts) | ||
{ | ||
var volumeSpec = new VolumeMount | ||
{ | ||
Source = mount.Source, | ||
Target = mount.Target, | ||
Type = mount.Type == ContainerMountType.BindMount ? VolumeMountType.Bind : VolumeMountType.Volume, | ||
IsReadOnly = mount.IsReadOnly | ||
}; | ||
|
||
ctr.Spec.VolumeMounts.Add(volumeSpec); | ||
} | ||
} | ||
|
||
ctr.Spec.Networks = new List<ContainerNetworkConnection> | ||
{ | ||
new ContainerNetworkConnection | ||
|
@@ -1206,6 +1188,8 @@ private async Task CreateContainerAsync(AppResource cr, ILogger resourceLogger, | |
spec.Ports = BuildContainerPorts(cr); | ||
} | ||
|
||
spec.VolumeMounts = BuildBindMounts(modelContainerResource); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea is to be able to add container mount annotations during the NB: In the case of MySql/PgSql the target ports are currently used, which are static. Resolution is done thought host name since it's docker to docker communication. This means that at least this part of the configuration in invariant across restarts. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI - @mitchdenny @karolz-ms @danegsta |
||
|
||
(spec.RunArgs, var failedToApplyRunArgs) = await BuildRunArgsAsync(resourceLogger, modelContainerResource, cancellationToken).ConfigureAwait(false); | ||
|
||
(var args, var failedToApplyArgs) = await BuildArgsAsync(resourceLogger, modelContainerResource, cancellationToken).ConfigureAwait(false); | ||
|
@@ -1646,4 +1630,27 @@ private static List<ContainerPortSpec> BuildContainerPorts(AppResource cr) | |
|
||
return ports; | ||
} | ||
|
||
private static List<VolumeMount> BuildBindMounts(IResource container) | ||
sebastienros marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
var volumeMounts = new List<VolumeMount>(); | ||
|
||
if (container.TryGetContainerMounts(out var containerMounts)) | ||
{ | ||
foreach (var mount in containerMounts) | ||
{ | ||
var volumeSpec = new VolumeMount | ||
{ | ||
Source = mount.Source, | ||
Target = mount.Target, | ||
Type = mount.Type == ContainerMountType.BindMount ? VolumeMountType.Bind : VolumeMountType.Volume, | ||
IsReadOnly = mount.IsReadOnly | ||
}; | ||
|
||
volumeMounts.Add(volumeSpec); | ||
} | ||
} | ||
|
||
return volumeMounts; | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.