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

Expose router feature dataConnectionCount with flag on link create co… #970

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mgoulish
Copy link
Contributor

…mmand

This allows user to control data connection count (number of parallel data links) on inter-router connections between skupper sites. -- using a flag on the link create command.

This is my first Skupper PR, somebody please let me know what I missed...

@mgoulish mgoulish requested review from nluaces and grs December 14, 2022 16:03
Copy link
Member

@grs grs left a comment

Choose a reason for hiding this comment

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

This looks mostly fine to me on the whole, apart from the minor issues. However in general I think we would not expect users to need to set this and we should try to set it to the optimal value (or if there are clear trade-offs we should document those clearly and perhaps offer options in terms of those tradeoffs)

@@ -17,6 +17,7 @@ type ConnectorCreateOptions struct {
SkupperNamespace string
Name string
Cost int32
Dcc int
Copy link
Member

Choose a reason for hiding this comment

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

Dcc is a bit opaque. Perhaps ConCount or something along those lines?

@@ -168,6 +168,7 @@ const (
TokenGeneratedBy string = BaseQualifier + "/generated-by"
SiteVersion string = BaseQualifier + "/site-version"
TokenCost string = BaseQualifier + "/cost"
TokenDcc string = BaseQualifier + "/dcc"
Copy link
Member

Choose a reason for hiding this comment

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

As above, particularly for the actual annotation key, which is user visible, lets have something a bit less cryptic.

@@ -34,6 +34,7 @@ func NewCmdLinkCreate(skupperClient SkupperLinkClient, flag string) *cobra.Comma
}
cmd.Flags().StringVarP(&connectorCreateOpts.Name, flag, "", "", "Provide a specific name for the link (used when deleting it)")
cmd.Flags().Int32VarP(&connectorCreateOpts.Cost, "cost", "", 1, "Specify a cost for this link.")
cmd.Flags().IntVarP(&connectorCreateOpts.Dcc, "dataConnectionCount", "", 1, "How many inter-router data connections")
Copy link
Member

Choose a reason for hiding this comment

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

Other multi word flags use hyphens rather than camel case, so this so follow that pattern for consistency. I think the default should be 0, and that should be treated as unset, in which case a default would be applied by some other part of the code.

@@ -38,6 +38,7 @@ connector {
name: {{.Name}}-connector
host: {{.Host}}
port: {{.Port}}
dataConnectionCount: {{.Dcc}}
Copy link
Member

Choose a reason for hiding this comment

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

We should only set this if it is non zero. That way we have a way to revert to the router default if desired.

role: {{.Role}}
cost: {{.Cost}}
cost: {{.Cost}} {{if .ConCount}}{{printf "\n dataConnectionCount:" }} {{.ConCount}}{{end}}
Copy link
Member

Choose a reason for hiding this comment

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

Noting the comment above, I don't think this is the right way to handle the issue. Use {{- if .ConCount}} ... {{- end}} as in QdRouterConfig() method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants