This repository has been archived by the owner on Feb 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 886
stage0: add --expose flag on app level #3691
Open
trusch
wants to merge
4
commits into
rkt:master
Choose a base branch
from
trusch:feature/runtime-port-expose
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7a536e8
stage0: add --expose flag on app level
trusch 6947674
stage0: applied gofmt on --expose changes;
trusch b8b8747
stage0: --expose flag: check for null pointers before merging port li…
trusch 349f899
stage0: --expose flag: assume tcp by default;
trusch File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,6 +103,7 @@ func addAppFlags(cmd *cobra.Command) { | |
cmd.Flags().Var((*appWorkingDir)(&rktApps), "working-dir", "override the working directory of the preceding image") | ||
cmd.Flags().Var((*appReadOnlyRootFS)(&rktApps), "readonly-rootfs", "if set, the app's rootfs will be mounted read-only") | ||
cmd.Flags().Var((*appMount)(&rktApps), "mount", "mount point binding a volume to a path within an app") | ||
cmd.Flags().Var((*appExpose)(&rktApps), "expose", "expose ports of the application (example: '--expose=http,protocol=tcp,port=8080')") | ||
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. This new flag should be documented in |
||
cmd.Flags().Var((*appUser)(&rktApps), "user", "user override for the preceding image (example: '--user=user')") | ||
cmd.Flags().Var((*appGroup)(&rktApps), "group", "group override for the preceding image (example: '--group=group')") | ||
cmd.Flags().Var((*appSupplementaryGIDs)(&rktApps), "supplementary-gids", "supplementary group IDs override for the preceding image (examples: '--supplementary-gids=1024,2048'") | ||
|
@@ -335,7 +336,6 @@ func runRun(cmd *cobra.Command, args []string) (exit int) { | |
pcfg.EnvFromFile = flagEnvFromFile.Strings() | ||
pcfg.Apps = &rktApps | ||
} | ||
|
||
if globalFlags.Debug { | ||
stage0.InitDebug() | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,6 +188,24 @@ func MergeMounts(mounts []schema.Mount, appMounts []schema.Mount) []schema.Mount | |
return deduplicateMPs(ml) | ||
} | ||
|
||
// MergePorts merges two port lists | ||
func MergePorts(a, b []types.Port) []types.Port { | ||
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. I'm not sure how relevant this maybe in this context, but this is not a stable merge (i.e. it doesn't guarantee too keep the relative order). It may poses some issues when trying to answer questions like |
||
m := make(map[types.ACName]types.Port) | ||
for _, port := range a { | ||
m[port.Name] = port | ||
} | ||
for _, port := range b { | ||
m[port.Name] = port | ||
} | ||
res := make([]types.Port, len(m)) | ||
i := 0 | ||
for _, port := range m { | ||
res[i] = port | ||
i++ | ||
} | ||
return res | ||
} | ||
|
||
// generatePodManifest creates the pod manifest from the command line input. | ||
// It returns the pod manifest as []byte on success. | ||
// This is invoked if no pod manifest is specified at the command line. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I guess
query
here would be clearer asportname
.