-
Notifications
You must be signed in to change notification settings - Fork 362
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
support launch app via its name though clusterfile or cli #1917
support launch app via its name though clusterfile or cli #1917
Conversation
types/api/v2/cluster_types.go
Outdated
Hosts []Host `json:"hosts,omitempty"` | ||
SSH v1.SSH `json:"ssh,omitempty"` | ||
// APPNames This field allows user to specify the app name they want to run launch. | ||
APPNames []string `json:"appNames"` |
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.
add omitempty tag?
pkg/cluster-runtime/apps.go
Outdated
func GetImageDefaultLaunchCmds(extension v12.ImageExtension) []string { | ||
rawCmds := extension.Launch.Cmds | ||
appNames := extension.Launch.AppNames | ||
// if raw cmds exist in extension, return it. |
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.
In my opinion, the launch applications should take precedence over cmds, and we can even mark cmd deprecated in the future because the app can completely override cmd's capabilities
0911fec
to
19e13a3
Compare
cmd/sealer/cmd/cluster/run-app.go
Outdated
}, | ||
} | ||
|
||
appFlags = &types.APPFlags{} | ||
runAppCmd.Flags().StringSliceVar(&appFlags.LaunchCmds, "cmds", []string{}, "override default LaunchCmds of clusterimage") | ||
runAppCmd.Flags().StringSliceVar(&appFlags.Cmds, "cmds", []string{}, "override default LaunchCmds of clusterimage") | ||
runAppCmd.Flags().StringSliceVar(&appFlags.AppNames, "app-names", []string{}, "override default AppNames of clusterimage") |
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.
s/app-names/apps
19e13a3
to
f0abbe3
Compare
Codecov ReportBase: 21.52% // Head: 21.37% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1917 +/- ##
==========================================
- Coverage 21.52% 21.37% -0.16%
==========================================
Files 80 80
Lines 7415 7430 +15
==========================================
- Hits 1596 1588 -8
- Misses 5605 5629 +24
+ Partials 214 213 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
LGTM
f0abbe3
to
328fde4
Compare
@@ -230,7 +230,7 @@ func getApplicationType(sources []string) (string, []string, error) { | |||
|
|||
ish, helmErr := isHelm(sources...) |
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.
s/ish/isHelm
Describe what this PR does / why we need it
sealer store some basic information about the cluster image in the image's annotations, such as cluster image type, applications list and its launch commands in one field .
however, we cannot accurately find the application launch command based on its name and all launch commands generate from "APP" instruction is mixed with the "CMDS" instruction in "launch.cmds" filed .
Therefore, I recommend that we only save the relevant information of the application during the build stage and control the launch logic of the application image during the run stage.
Does this pull request fix one issue?
Describe how you did it
Describe how to verify it
Special notes for reviews