Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/yaml/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func GenYamlCustom(cmd *cobra.Command, w io.Writer) error {
cliDoc.Kubernetes = true
}
if _, ok := curr.Annotations["swarm"]; ok && !cliDoc.Swarm {
cliDoc.Kubernetes = true
cliDoc.Swarm = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Something still looks weird here.

It shouldn't need to check !cliDoc.Swarm because if it's true, setting it to true again doesn't hurt. Is this just an unnecessary statement that can be removed?

I guess all the checks above are the same, so maybe it was just copied?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, was looking at that as well, but didn't want to change without going through the whole logic. I can look at it for a follow-up 👍

}
}

Expand Down Expand Up @@ -208,7 +208,7 @@ func genFlagResult(flags *pflag.FlagSet) []cmdOption {
opt.Kubernetes = true
}
if _, ok := flag.Annotations["swarm"]; ok {
opt.Kubernetes = true
opt.Swarm = true
}

result = append(result, opt)
Expand Down