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

Use NodeAuthorizer config options instead of soely hard-codes #7211

Merged
merged 2 commits into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions nodeup/pkg/model/node_authorizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ func (b *NodeAuthorizationBuilder) Build(c *fi.ModelBuilderContext) error {
man.Set("Service", "ExecStartPre", "/bin/bash -c 'while [ ! -f "+clientCert+" ]; do sleep 5; done; sleep 5'")

interval := 10 * time.Second
if na.Interval != nil {
interval = na.Interval.Duration
}
timeout := 5 * time.Minute
if na.Timeout != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Ah - you're right - it looks like we simply weren't using it! Thanks for fixing!

timeout = na.Timeout.Duration
}

// @node: using a string array just to make it easier to read
dockerCmd := []string{
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ type NodeAuthorizerSpec struct {
NodeURL string `json:"nodeURL,omitempty"`
// Port is the port the service is running on the master
Port int `json:"port,omitempty"`
// Interval the time between retires for authorization request
Copy link
Member

Choose a reason for hiding this comment

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

Nit: typo - retries

Interval *metav1.Duration `json:"interval,omitempty"`
// Timeout the max time for authorization request
Timeout *metav1.Duration `json:"timeout,omitempty"`
// TokenTTL is the max ttl for an issued token
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ type NodeAuthorizerSpec struct {
NodeURL string `json:"nodeURL,omitempty"`
// Port is the port the service is running on the master
Port int `json:"port,omitempty"`
// Interval the time between retires for authorization request
Copy link
Member

Choose a reason for hiding this comment

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

copy-paste of retires typo

Interval *metav1.Duration `json:"interval,omitempty"`
// Timeout the max time for authorization request
Timeout *metav1.Duration `json:"timeout,omitempty"`
// TokenTTL is the max ttl for an issued token
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ type NodeAuthorizerSpec struct {
NodeURL string `json:"nodeURL,omitempty"`
// Port is the port the service is running on the master
Port int `json:"port,omitempty"`
// Interval the time between retires for authorization request
Copy link
Member

Choose a reason for hiding this comment

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

nit: retires

Interval *metav1.Duration `json:"interval,omitempty"`
// Timeout the max time for authorization request
Timeout *metav1.Duration `json:"timeout,omitempty"`
// TokenTTL is the max ttl for an issued token
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.