Skip to content

Commit

Permalink
fix: allow config "v1" (#5803)
Browse files Browse the repository at this point in the history
  • Loading branch information
r2k1 authored Feb 11, 2025
1 parent 694dc12 commit 9f4e118
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion aks-node-controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Here is an example of how to retrieve node bootstrapping parameters and use the

```go
config := &aksnodeconfigv1.Configuration{
Version: "v0",
Version: "v1",
// fill in the rest of the fields
}
customData, err := nodeconfigutils.CustomData(config)
Expand Down
8 changes: 7 additions & 1 deletion aks-node-controller/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,16 @@ func (a *App) Provision(ctx context.Context, flags ProvisionFlags) error {
if err != nil {
return fmt.Errorf("unmarshal provision config: %w", err)
}
if config.Version != "v0" {
// TODO: "v0" were a mistake. We are not going to have different logic maintaining both v0 and v1
// Disallow "v0" after some time (allow some time to update consumers)
if config.Version != "v0" && config.Version != "v1" {
return fmt.Errorf("unsupported version: %s", config.Version)
}

if config.Version == "v0" {
slog.Error("v0 version is deprecated, please use v1 instead")
}

cmd, err := parser.BuildCSECmd(ctx, config)
if err != nil {
return fmt.Errorf("build CSE command: %w", err)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "v0",
"version": "v1",
"bootstrapping_config": {
"bootstrapping_auth_method": "BOOTSTRAPPING_AUTH_METHOD_BOOTSTRAP_TOKEN"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "v0",
"version": "v1",
"bootstrapping_config": {
"bootstrapping_auth_method": "BOOTSTRAPPING_AUTH_METHOD_BOOTSTRAP_TOKEN"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "v0",
"version": "v1",
"bootstrapping_config": {
"bootstrapping_auth_method": "BOOTSTRAPPING_AUTH_METHOD_BOOTSTRAP_TOKEN"
},
Expand Down

0 comments on commit 9f4e118

Please sign in to comment.