Skip to content

Commit

Permalink
Move the dynamic validator out of api/ (#3015)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkowl authored Jul 19, 2023
1 parent 220c6ff commit 4d57b4b
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pkg/api/openshiftcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ type MasterProfile struct {
type VMSize string

// VMSize constants
// add required resources in pkg/api/validate/dynamic/quota.go when adding a new VMSize
// add required resources in pkg/validate/dynamic/quota.go when adding a new VMSize
const (
VMSizeStandardD2sV3 VMSize = "Standard_D2s_v3"
VMSizeStandardD4sV3 VMSize = "Standard_D4s_v3"
Expand Down
12 changes: 0 additions & 12 deletions pkg/api/validate/dynamic/generate.go

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/cluster/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"context"

"github.com/Azure/ARO-RP/pkg/api"
"github.com/Azure/ARO-RP/pkg/api/validate"
"github.com/Azure/ARO-RP/pkg/validate"
)

func (m *manager) validateResources(ctx context.Context) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"github.com/sirupsen/logrus"
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/Azure/ARO-RP/pkg/api/validate/dynamic"
"github.com/Azure/ARO-RP/pkg/util/azureclient"
"github.com/Azure/ARO-RP/pkg/util/clusterauthorizer"
"github.com/Azure/ARO-RP/pkg/validate/dynamic"
)

type servicePrincipalChecker interface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
"github.com/golang/mock/gomock"
"github.com/sirupsen/logrus"

"github.com/Azure/ARO-RP/pkg/api/validate/dynamic"
"github.com/Azure/ARO-RP/pkg/util/azureclient"
"github.com/Azure/ARO-RP/pkg/util/clusterauthorizer"
mock_dynamic "github.com/Azure/ARO-RP/pkg/util/mocks/dynamic"
"github.com/Azure/ARO-RP/pkg/validate/dynamic"
utilerror "github.com/Azure/ARO-RP/test/util/error"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/util/mocks/dynamic/dynamic.go

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

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions pkg/validate/dynamic/generate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package dynamic

// Copyright (c) Microsoft Corporation.
// Licensed under the Apache License 2.0.

// XXX Using mockgen in source mode here to prevent mockgen from following
// type alias azcore.TokenCredential to an internal azcore subpackage.
// See https://github.com/golang/mock/issues/244

//go:generate rm -rf ../../../pkg/util/mocks/$GOPACKAGE
//go:generate go run ../../../vendor/github.com/golang/mock/mockgen -destination=../../../pkg/util/mocks/$GOPACKAGE/$GOPACKAGE.go -source=dynamic.go
//go:generate go run ../../../vendor/golang.org/x/tools/cmd/goimports -local=github.com/Azure/ARO-RP -e -w ../../../pkg/util/mocks/$GOPACKAGE/$GOPACKAGE.go
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"k8s.io/apimachinery/pkg/util/wait"

"github.com/Azure/ARO-RP/pkg/api"
"github.com/Azure/ARO-RP/pkg/api/validate/dynamic"
"github.com/Azure/ARO-RP/pkg/env"
"github.com/Azure/ARO-RP/pkg/util/azureclient/authz/remotepdp"
"github.com/Azure/ARO-RP/pkg/util/feature"
"github.com/Azure/ARO-RP/pkg/validate/dynamic"
)

// OpenShiftClusterDynamicValidator is the dynamic validator interface
Expand Down

0 comments on commit 4d57b4b

Please sign in to comment.