forked from Azure/ARO-RP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
365413c
commit 6924ad8
Showing
5 changed files
with
110 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package cluster | ||
|
||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the Apache License 2.0. | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/Azure/ARO-RP/pkg/validate/dynamic" | ||
) | ||
|
||
/*************************************************************** | ||
Monitor the Cluster Service Prinicpal required Permissions | ||
****************************************************************/ | ||
|
||
func (mon *Monitor) emitValidatePermissions(ctx context.Context) error { | ||
subnets := []dynamic.Subnet{{ | ||
ID: mon.oc.Properties.MasterProfile.SubnetID, | ||
Path: "properties.masterProfile.subnetId", | ||
}} | ||
|
||
err := mon.validator.ValidateVnet(ctx, mon.oc.Location, subnets, mon.oc.Properties.NetworkProfile.PodCIDR, | ||
mon.oc.Properties.NetworkProfile.ServiceCIDR) | ||
if err != nil { | ||
mon.emitGauge("cluster.validate.permissions", 1, map[string]string{ | ||
"ValidateVnetPermissions": "Required permissions missing", | ||
}) | ||
} | ||
|
||
err = mon.validator.ValidateSubnets(ctx, mon.oc, subnets) | ||
if err != nil { | ||
mon.emitGauge("cluster.validate.permissions", 1, map[string]string{ | ||
"ValidateSubnet": "Required permissions Missing", | ||
}) | ||
} | ||
|
||
err = mon.validator.ValidateDiskEncryptionSets(ctx, mon.oc) | ||
if err != nil { | ||
mon.emitGauge("cluster.validate.permissions", 1, map[string]string{ | ||
"ValidateDiskEncryptionSet": "Required permissions Missing", | ||
}) | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package cluster | ||
|
||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the Apache License 2.0. | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestEmitValidatePermissions(t *testing.T) { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters