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

Update available version of DocumentDB #3967

Merged
merged 38 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ab101f7
Add new version of DatabaseAccount to config
theunrepentantgeek Apr 17, 2024
3880463
Update API code
theunrepentantgeek Apr 17, 2024
83b7214
Update samples
theunrepentantgeek Apr 17, 2024
0da1048
Update configuration
theunrepentantgeek Apr 19, 2024
174c5f8
Update generated files
theunrepentantgeek Apr 19, 2024
875bbae
Add samples
theunrepentantgeek Apr 19, 2024
791f995
Update documentation
theunrepentantgeek Apr 19, 2024
594f7ac
Update generated files
theunrepentantgeek Apr 19, 2024
5603541
Update documentation
theunrepentantgeek Apr 19, 2024
66348fe
Update samples
theunrepentantgeek Apr 19, 2024
32820f6
Record new sample
theunrepentantgeek Apr 22, 2024
70579ca
Rename old sample recording
theunrepentantgeek Apr 22, 2024
fbc9dd7
Add samples to docs
theunrepentantgeek Apr 22, 2024
43e1421
fixup! Update generated files
theunrepentantgeek Apr 22, 2024
bc5e615
Rename test files
theunrepentantgeek Apr 22, 2024
b20ddb9
Add coded test for MongoDB
theunrepentantgeek Apr 22, 2024
5dcc563
Add coded test for SQL databases
theunrepentantgeek Apr 23, 2024
3ba33b6
Add walkthrough
theunrepentantgeek Apr 23, 2024
008267d
Update recording
theunrepentantgeek Apr 23, 2024
64d706f
Add missing resource
theunrepentantgeek Apr 24, 2024
891120b
Accommodate slow deletion of DatabaseAccount
theunrepentantgeek Apr 29, 2024
7b93380
Fix test failures
theunrepentantgeek May 2, 2024
5fdbe5f
Address PR feedback
theunrepentantgeek May 2, 2024
eb435b4
Update recording
theunrepentantgeek May 2, 2024
d78ed0b
Defaults for SQL Role Assignments
theunrepentantgeek May 2, 2024
52b828a
Update test recording
theunrepentantgeek May 3, 2024
584059f
Add new recording
theunrepentantgeek May 3, 2024
627b624
Update test recording
theunrepentantgeek May 6, 2024
4c17fb6
Update recording
theunrepentantgeek May 7, 2024
fc7ec1e
Remove readonly property
theunrepentantgeek May 7, 2024
dd218de
Update version
theunrepentantgeek May 7, 2024
edfdcea
Update recording to new resilient format
theunrepentantgeek May 7, 2024
79868a5
Update docs
theunrepentantgeek May 7, 2024
dfebe9a
Update recording
theunrepentantgeek May 7, 2024
8512004
Merge branch 'main' into feature/update-documentdb
theunrepentantgeek May 7, 2024
568d800
Move walkthrough
theunrepentantgeek May 7, 2024
5602d3a
Update docs
theunrepentantgeek May 7, 2024
9fb3b59
Update recording
theunrepentantgeek May 8, 2024
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
1 change: 1 addition & 0 deletions docs/hugo/content/contributing/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ description: "How to contribute new resources to Azure Service Operator v2"

* [Developer Setup]( {{< relref "developer-setup" >}} ).
* [Adding a new code-generator resource]( {{< relref "add-a-new-code-generated-resource" >}} ).
* [Example walkthrough of adding a new resource version]( {{< relref "upgrade-resource-version" >}}).
* [Generator code overview]( {{< relref "generator-overview" >}} ).
* [Running a development version of ASO]( {{< relref "running-a-development-version" >}} ).
* [Testing]( {{< relref "testing" >}} ).
Expand Down
682 changes: 682 additions & 0 deletions docs/hugo/content/contributing/upgrade-resource-version/_index.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 39 additions & 19 deletions docs/hugo/content/reference/_index.md

Large diffs are not rendered by default.

50 changes: 35 additions & 15 deletions docs/hugo/content/reference/documentdb/_index.md

Large diffs are not rendered by default.

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

Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/conversion"

documentdb "github.com/Azure/azure-service-operator/v2/api/documentdb/v1api20210515/storage"
documentdb "github.com/Azure/azure-service-operator/v2/api/documentdb/v1api20231115/storage"
"github.com/Azure/azure-service-operator/v2/internal/genericarmclient"
. "github.com/Azure/azure-service-operator/v2/internal/logging"
"github.com/Azure/azure-service-operator/v2/internal/resolver"
"github.com/Azure/azure-service-operator/v2/internal/util/to"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime/core"
Expand Down Expand Up @@ -163,3 +164,44 @@ func isCapacityError(err *genericarmclient.CloudError) bool {

return err.Code() == "ServiceUnavailable" && strings.Contains(err.Message(), "currently experiencing high demand")
}

var _ extensions.PreReconciliationChecker = &DatabaseAccountExtension{}

// PreReconcileCheck does a pre-reconcile check to see if the resource is in a state that can be reconciled.
// ARM resources should implement this to avoid reconciliation attempts that cannot possibly succeed.
// Returns ProceedWithReconcile if the reconciliation should go ahead.
// Returns BlockReconcile and a human-readable reason if the reconciliation should be skipped.
// ctx is the current operation context.
// obj is the resource about to be reconciled. The resource's State will be freshly updated.
// kubeClient allows access to the cluster for any required queries.
// armClient allows access to ARM for any required queries.
// log is the logger for the current operation.
// next is the next (nested) implementation to call.
func (ext *DatabaseAccountExtension) PreReconcileCheck(
ctx context.Context,
obj genruntime.MetaObject,
owner genruntime.MetaObject,
resourceResolver *resolver.Resolver,
armClient *genericarmclient.GenericClient,
log logr.Logger,
next extensions.PreReconcileCheckFunc,
) (extensions.PreReconcileCheckResult, error) {
// This has to be the current hub storage version of the account.
// It will need to be updated if the hub storage version changes.
account, ok := obj.(*documentdb.DatabaseAccount)
if !ok {
return extensions.PreReconcileCheckResult{}, errors.Errorf("cannot run on unknown resource type %T, expected *documentdb.DatabaseAccount", obj)
}

// Type assert that we are the hub type. This will fail to compile if
// the hub type has been changed but this extension has not
var _ conversion.Hub = account

// If the account is already deleting, we have to wait for that to finish
// before trying anything else
if account.Status.ProvisioningState != nil && strings.EqualFold(*account.Status.ProvisioningState, "Deleting") {
return extensions.BlockReconcile("reconcile blocked while account is at status deleting"), nil
}

return next(ctx, obj, owner, resourceResolver, armClient, log)
}

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

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

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

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

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

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

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

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

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

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

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

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

Loading
Loading