Skip to content

Commit

Permalink
Merge branch 'master' into Azure#1112#DelUserAzureSQLUser
Browse files Browse the repository at this point in the history
  • Loading branch information
buhongw7583c authored Jun 6, 2020
2 parents eb24059 + d0294e1 commit 5c3e145
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
9 changes: 8 additions & 1 deletion config/samples/azure_v1alpha1_rediscacheaction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,11 @@ spec:
resourceGroup: resourcegroup-azure-operators
cacheName: rediscache-sample-1
# possible values are 'rollallkeys', 'rollprimarykey', 'rollsecondarykey', 'rebootallnodes', 'rebootprimarynode', 'rebootsecondarynode'
actionName: rollallkeys
actionName: rollallkeys

# (Optional) use the fields below to specify which keyvault to update for 'roll*' actions
#keyVaultToStoreSecrets: keyvaultsample123
#secretName: default-rediscache-sample-1

# (Optional) use the field below to specify which shard to effect for 'reboot*' actions
#shardID: 12345678
40 changes: 40 additions & 0 deletions controllers/rediscache_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"time"

azurev1alpha1 "github.com/Azure/azure-service-operator/api/v1alpha1"
"github.com/Azure/azure-service-operator/pkg/errhelp"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -59,3 +60,42 @@ func TestRedisCacheControllerHappyPath(t *testing.T) {
// delete rc
EnsureDelete(ctx, t, tc, redisCacheInstance)
}
func TestRedisCacheControllerNoResourceGroup(t *testing.T) {
t.Parallel()
defer PanicRecover(t)
ctx := context.Background()

var rgLocation string
var rgName string
var redisCacheName string

rgName = GenerateTestResourceNameWithRandom("rcfwr-rg", 10)
rgLocation = tc.resourceGroupLocation
redisCacheName = GenerateTestResourceNameWithRandom("rediscache", 10)

// Create the RedisCache object and expect the Reconcile to be created
redisCacheInstance := &azurev1alpha1.RedisCache{
ObjectMeta: metav1.ObjectMeta{
Name: redisCacheName,
Namespace: "default",
},
Spec: azurev1alpha1.RedisCacheSpec{
Location: rgLocation,
ResourceGroupName: rgName,
Properties: azurev1alpha1.RedisCacheProperties{
Sku: azurev1alpha1.RedisCacheSku{
Name: "Basic",
Family: "C",
Capacity: 0,
},
EnableNonSslPort: true,
},
},
}

// create rc
EnsureInstanceWithResult(ctx, t, tc, redisCacheInstance, errhelp.ResourceGroupNotFoundErrorCode, false)

// delete rc
EnsureDelete(ctx, t, tc, redisCacheInstance)
}

0 comments on commit 5c3e145

Please sign in to comment.