-
Notifications
You must be signed in to change notification settings - Fork 9
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
Initial cmd state #3
Conversation
Signed-off-by: Sergey Shlyanin <sergey.shlyanin@xored.com>
Signed-off-by: Sergey Shlyanin <sergey.shlyanin@xored.com>
main.go
Outdated
ConnectTo url.URL `default:"unix:///var/lib/networkservicemesh/nsm.io.sock" desc:"url to connect to" split_words:"true"` | ||
MaxTokenLifetime time.Duration `default:"10m" desc:"maximum lifetime of tokens" split_words:"true"` | ||
ServiceNames []string `default:"istio-proxy-responder" desc:"Name of provided services" split_words:"true"` | ||
Payload string `default:"ETHERNET" desc:"Name of provided service payload" split_words:"true"` |
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.
Payload should always be IP for this NSE.
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.
Done. IP contants is used now in the registry client.
Payload string `default:"ETHERNET" desc:"Name of provided service payload" split_words:"true"` | ||
Labels map[string]string `default:"" desc:"Endpoint labels"` | ||
DNSConfigs dnstools.Decoder `default:"[]" desc:"DNSConfigs represents array of DNSConfig in json format. See at model definition: https://github.com/networkservicemesh/api/blob/main/pkg/api/networkservice/connectioncontext.pb.go#L426-L435" split_words:"true"` | ||
CidrPrefix []string `default:"169.254.0.0/16" desc:"List of CIDR Prefix to assign IPv4 and IPv6 addresses from" split_words:"true"` |
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.
https://github.com/networkservicemesh/api/blob/main/pkg/api/networkservice/connectioncontext.pb.go#L426-L435 will move as main moves, use an absolute reference to a tag or commit for this comment.
main.go
Outdated
DNSConfigs dnstools.Decoder `default:"[]" desc:"DNSConfigs represents array of DNSConfig in json format. See at model definition: https://github.com/networkservicemesh/api/blob/main/pkg/api/networkservice/connectioncontext.pb.go#L426-L435" split_words:"true"` | ||
CidrPrefix []string `default:"169.254.0.0/16" desc:"List of CIDR Prefix to assign IPv4 and IPv6 addresses from" split_words:"true"` | ||
IdleTimeout time.Duration `default:"0" desc:"timeout for automatic shutdown when there were no requests for specified time. Set 0 to disable auto-shutdown." split_words:"true"` | ||
RegisterService bool `default:"true" desc:"if true then registers network service on startup" split_words:"true"` |
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.
When would this be false?
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.
Done. Removed this option.
main.go
Outdated
CidrPrefix []string `default:"169.254.0.0/16" desc:"List of CIDR Prefix to assign IPv4 and IPv6 addresses from" split_words:"true"` | ||
IdleTimeout time.Duration `default:"0" desc:"timeout for automatic shutdown when there were no requests for specified time. Set 0 to disable auto-shutdown." split_words:"true"` | ||
RegisterService bool `default:"true" desc:"if true then registers network service on startup" split_words:"true"` | ||
PBRConfigPath string `default:"/etc/policy-based-routing/config.yaml" desc:"Path to policy based routing config file" split_words:"true"` |
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.
We aren't doing configurable PBR for this NSE.
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.
Done. Removed all PBR related functions and variables.
main.go
Outdated
log.FromContext(ctx).Infof("the phases include:") | ||
log.FromContext(ctx).Infof("1: get config from environment") | ||
log.FromContext(ctx).Infof("2: retrieve spiffe svid") | ||
log.FromContext(ctx).Infof("3: create icmp server ipam") |
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.
We should fix the text here as its not icmp server. I'd suggest just changing it to 'create ipam' (and below to 'create nse'
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.
@rejmond Could you resolve the comment?
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.
Done.
main.go
Outdated
} | ||
|
||
// newPolicyRoutesGetter - watches the config file and dynamically updates policy routes. | ||
func newPolicyRoutesGetter(ctx context.Context, configPath string) *policyRoutesGetter { |
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 whole function is probably unneeded in this NSE.
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.
Done.
main.go
Outdated
return p | ||
} | ||
|
||
func (p *policyRoutesGetter) Get() []*networkservice.PolicyRoute { |
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 whole function is probably unneeded in this NSE
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.
Done.
main.go
Outdated
return p.policyRoutes.Load().([]*networkservice.PolicyRoute) | ||
} | ||
|
||
type policyRoutesGetter struct { |
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 is probably unneeded in this NSE
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.
Done.
@edwarnicke Thank you for your comments, I will check everything. |
Signed-off-by: Sergey Shlyanin <sergey.shlyanin@xored.com>
Signed-off-by: Sergey Shlyanin <sergey.shlyanin@xored.com>
Signed-off-by: Sergey Shlyanin <sergey.shlyanin@xored.com>
Signed-off-by: Sergey Shlyanin <sergey.shlyanin@xored.com>
1be608c
to
ce964d6
Compare
Signed-off-by: Sergey Shlyanin <sergey.shlyanin@xored.com>
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.
@rejmond Please resolve @edwarnicke comment and this can be merged. Thanks.
Signed-off-by: Sergey Shlyanin <sergey.shlyanin@xored.com>
@edwarnicke Let us know if you still have any comments on this then we'll resolve them in separate PR. |
Signed-off-by: Sergey Shlyanin sergey.shlyanin@xored.com
Description
Clone
cmd-nse-icmp-responder
repository content and rename package tonse-istio-proxy
.