Skip to content

Commit

Permalink
Rename tools_autoupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
vapopov committed Aug 22, 2024
1 parent 0e45c8f commit e24daff
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion api/client/webclient/webclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ type PingResponse struct {
// ToolsVersion defines the version of {tsh, tctl} for client auto-upgrade.
ToolsVersion string `json:"tools_version"`
// ToolsAutoupdate enables client autoupdate feature.
ToolsAutoupdate bool `json:"tools_auto_update"`
ToolsAutoupdate bool `json:"tools_autoupdate"`
// ClusterName contains the name of the Teleport cluster.
ClusterName string `json:"cluster_name"`

Expand Down
64 changes: 32 additions & 32 deletions api/gen/proto/go/teleport/autoupdate/v1/autoupdate.pb.go

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

4 changes: 2 additions & 2 deletions api/proto/teleport/autoupdate/v1/autoupdate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ message AutoupdateConfig {

// AutoupdateConfigSpec encodes the parameters of the autoupdate config object.
message AutoupdateConfigSpec {
// ToolsAutoUpdate encodes the feature flag to enable/disable tools autoupdates.
bool tools_auto_update = 1;
// ToolsAutoupdate encodes the feature flag to enable/disable tools autoupdates.
bool tools_autoupdate = 1;
}

// AutoupdateVersion is a resource singleton with version required for
Expand Down
2 changes: 1 addition & 1 deletion lib/web/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ func (h *Handler) find(w http.ResponseWriter, r *http.Request, p httprouter.Para
if !trace.IsNotFound(err) && err != nil {
return nil, trace.Wrap(err)
} else if !trace.IsNotFound(err) {
response.ToolsAutoupdate = autoupdateConfig.GetSpec().GetToolsAutoUpdate()
response.ToolsAutoupdate = autoupdateConfig.GetSpec().GetToolsAutoupdate()
}

autoupdateVersion, err := h.GetAccessPoint().GetAutoupdateVersion(r.Context())
Expand Down
4 changes: 2 additions & 2 deletions tool/tctl/common/autoupdate_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ func (c *AutoupdateCommand) Upsert(ctx context.Context, client *authclient.Clien
return trace.Wrap(err)
}
isEnabled := c.toolsAutoupdate == "on"
if isEnabled != config.Spec.ToolsAutoUpdate {
config.Spec.ToolsAutoUpdate = isEnabled
if isEnabled != config.Spec.ToolsAutoupdate {
config.Spec.ToolsAutoupdate = isEnabled
if _, err := serviceClient.UpsertAutoupdateConfig(ctx, &autoupdate.UpsertAutoupdateConfigRequest{
Config: config,
}); err != nil {
Expand Down

0 comments on commit e24daff

Please sign in to comment.