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

Add CMD command to Kubefile #1964

Merged
merged 1 commit into from
Jan 15, 2023
Merged

Conversation

Stevent-fei
Copy link
Collaborator

Describe what this PR does / why we need it

Temporary use of the CMD command.
ex:

Kubefile:
FROM docker.io/sealerio/kubernetes:v1.22.15
CMD kubectl get ns
CMD echo "AAAAAAA"
CMDS ["kubectl get node","kubectl get po -A"]

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

@github-actions github-actions bot added the ImageBuilding related to all staff with image building label Jan 10, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2023

Codecov Report

Base: 17.47% // Head: 17.45% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (3db1446) compared to base (b55f5b5).
Patch coverage: 11.76% of modified lines in pull request are covered.

❗ Current head 3db1446 differs from pull request most recent head 3ba8c2b. Consider uploading reports for the commit 3ba8c2b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1964      +/-   ##
==========================================
- Coverage   17.47%   17.45%   -0.02%     
==========================================
  Files         103      103              
  Lines        9169     9187      +18     
==========================================
+ Hits         1602     1604       +2     
- Misses       7355     7370      +15     
- Partials      212      213       +1     
Impacted Files Coverage Δ
build/kubefile/parser/kubefile.go 50.87% <6.25%> (-4.97%) ⬇️
build/kubefile/parser/parse.go 55.32% <100.00%> (+0.22%) ⬆️

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -74,6 +74,8 @@ func NewBuildCmd() *cobra.Command {
Args: cobra.MaximumNArgs(1),
Example: exampleNewBuildCmd,
RunE: func(cmd *cobra.Command, args []string) error {
logrus.Warn("CMD is about to be deprecated.")
Copy link
Member

Choose a reason for hiding this comment

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

add this warning message at instruction process stage

@@ -22,6 +22,7 @@ const (
App = "app"
Launch = "launch"
Cmds = "cmds"
Cmd = "cmd"
Copy link
Member

Choose a reason for hiding this comment

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

we could add description to cmd

default:
return fmt.Errorf("failed to recognize cmd: %s", cmd)
}
}

func (kp *KubefileParser) processCmd(node *Node, result *KubefileResult) error {
Copy link
Member

Choose a reason for hiding this comment

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

here may could be simple, or could we just use processCmds?

cmdCnt++
}

if cmdCnt >= 1 && launchCnt == 1 {
Copy link
Member

Choose a reason for hiding this comment

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

could we do parameter judgment in command.Cmd case

Copy link
Collaborator

@starnop starnop left a comment

Choose a reason for hiding this comment

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

LGTM

@starnop starnop merged commit 03c9e37 into sealerio:main Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ImageBuilding related to all staff with image building
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants