-
Notifications
You must be signed in to change notification settings - Fork 226
Conversation
Adds --config flag in rm command to accept VM removal using the same config file that was used to create the VM. VM name or UID is required when passing a config file. Adds tests to verify the changes.
} | ||
|
||
// Use vm args to find the VMs to be removed. | ||
if len(vmMatches) < 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.
I see. You removed minimumNArgs(1) above because you added a check here.
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.
Yes, that's right. When a config file is provided, a vm argument is not necessary.
ro := &rmOptions{RmFlags: rf} | ||
|
||
// If config file is provided, use it to find the VM to be removed. | ||
if len(rf.ConfigFile) != 0 { |
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.
if it's provided, you mean if len(rf.ConfigFile) > 0
?
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's right, I was checking if config file path isn't empty. In the lines of https://github.com/weaveworks/ignite/blob/v0.6.3/cmd/ignite/run/create.go#L73
Could have compared with ""
🙂
Should I still change 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.
np.
"github.com/weaveworks/ignite/pkg/util" | ||
) | ||
|
||
func TestNewRmOptions(t *testing.T) { |
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.
This test LGTM
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.
Thanks 🙂
Thank you @darkowlzz for this PR. |
@darkowlzz @stealthybox |
In the last meeting, we discussed about the CI failures due to dependency update check. We talked about removing the dependency update check. I'm okay with merging this and removing the check separately. |
LGTM then :-) |
Adds
--config
flag in rm command to accept VM removal using the sameconfig file that was used to create the VM. VM name or UID is required
when passing a config file.
Adds tests to verify the changes.