Skip to content

Commit f695654

Browse files
authored
Add frameworks apis to scheme (#1470)
* Add frameworks apis to scheme I recently ran `make vendor` on gatekeeper master and noticed that a number of files from frameworks/constraint were being deleted. Why? It runs out that a recent PR (#1445) removed a dependency on frameworks/constraint/pkg/apis and `make vendor` was pruning the unused code from the vendor/ directory. As the API types declared in frameworks/constraint are part of the API used in g8r, I thought it appropriate to add them to the scheme. This fixes the problem with make vendor. Signed-off-by: juliankatz <[email protected]> * Add frameworks apis to scheme I recently ran `make vendor` on gatekeeper master and noticed that a number of files from frameworks/constraint were being deleted. Why? It runs out that a recent PR (#1445) removed a dependency on frameworks/constraint/pkg/apis and `make vendor` was pruning the unused code from the vendor/ directory. Further, while we might expect the AddToScheme calls to be used when we setup the scheme in main.go, it turns out that we were making essentially duplicate versions of the AddToScheme files in g8r. I've replaced these with a single file that calls all the AddToScheme functions in frameworks/constraint. Signed-off-by: juliankatz <[email protected]>
1 parent 07e2fd0 commit f695654

File tree

3 files changed

+2
-28
lines changed

3 files changed

+2
-28
lines changed

apis/addtoscheme_constrainttemplate_v1alpha1.go renamed to apis/addtoscheme_constrainttemplate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ limitations under the License.
1616
package apis
1717

1818
import (
19-
"github.com/open-policy-agent/frameworks/constraint/pkg/apis/templates/v1alpha1"
19+
frameworksapis "github.com/open-policy-agent/frameworks/constraint/pkg/apis"
2020
)
2121

2222
func init() {
2323
// Register the types with the Scheme so the components can map objects to GroupVersionKinds and back
24-
AddToSchemes = append(AddToSchemes, v1alpha1.AddToScheme)
24+
AddToSchemes = append(AddToSchemes, frameworksapis.AddToScheme)
2525
}

apis/addtoscheme_constrainttemplate_v1beta1.go

Lines changed: 0 additions & 25 deletions
This file was deleted.

go.sum

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
308308
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
309309
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
310310
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
311-
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
312311
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
313312
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
314313
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=

0 commit comments

Comments
 (0)