mirror of
https://github.com/1Password/onepassword-operator.git
synced 2025-10-24 00:10:46 +00:00
Upgrade Operator SDK to v1.34.1 and update dependencies (#185)
This does the following updates: * Upgrade to Operator SDK v1.34.1. This fixes building multi-arch images from Makefile. Check this MR from operator-framework for details. * Update Go dependencies. This addresses Dependabot alert ["Golang protojson.Unmarshal function infinite loop when unmarshaling certain forms of invalid JSON"](https://github.com/1Password/onepassword-operator/security/dependabot/13). * Update versions of the GitHub Actions used in the pipelines. * Update Kubernetes related tools (such as controller-tools version, and operator-sdk for ci pipelines) By updating dependencies, the pipelines no longer fail due to a panic error when running `make test`.
This commit is contained in:
23
vendor/sigs.k8s.io/controller-runtime/pkg/envtest/crd.go
generated
vendored
23
vendor/sigs.k8s.io/controller-runtime/pkg/envtest/crd.go
generated
vendored
@@ -38,7 +38,7 @@ import (
|
||||
"k8s.io/client-go/kubernetes/scheme"
|
||||
"k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/util/retry"
|
||||
"k8s.io/utils/pointer"
|
||||
"k8s.io/utils/ptr"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
@@ -364,19 +364,26 @@ func modifyConversionWebhooks(crds []*apiextensionsv1.CustomResourceDefinition,
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
url := pointer.String(fmt.Sprintf("https://%s/convert", hostPort))
|
||||
url := ptr.To(fmt.Sprintf("https://%s/convert", hostPort))
|
||||
|
||||
for i := range crds {
|
||||
// Continue if we're preserving unknown fields.
|
||||
if crds[i].Spec.PreserveUnknownFields {
|
||||
continue
|
||||
}
|
||||
// Continue if the GroupKind isn't registered as being convertible.
|
||||
if _, ok := convertibles[schema.GroupKind{
|
||||
Group: crds[i].Spec.Group,
|
||||
Kind: crds[i].Spec.Names.Kind,
|
||||
}]; !ok {
|
||||
continue
|
||||
if !webhookOptions.IgnoreSchemeConvertible {
|
||||
// Continue if the GroupKind isn't registered as being convertible,
|
||||
// and remove any existing conversion webhooks if they exist.
|
||||
// This is to prevent the CRD from being rejected by the apiserver, usually
|
||||
// manifests that are generated by controller-gen will have a conversion
|
||||
// webhook set, but we don't want to enable it if the type isn't registered.
|
||||
if _, ok := convertibles[schema.GroupKind{
|
||||
Group: crds[i].Spec.Group,
|
||||
Kind: crds[i].Spec.Names.Kind,
|
||||
}]; !ok {
|
||||
crds[i].Spec.Conversion = nil
|
||||
continue
|
||||
}
|
||||
}
|
||||
if crds[i].Spec.Conversion == nil {
|
||||
crds[i].Spec.Conversion = &apiextensionsv1.CustomResourceConversion{
|
||||
|
||||
10
vendor/sigs.k8s.io/controller-runtime/pkg/envtest/webhook.go
generated
vendored
10
vendor/sigs.k8s.io/controller-runtime/pkg/envtest/webhook.go
generated
vendored
@@ -49,6 +49,11 @@ type WebhookInstallOptions struct {
|
||||
// ValidatingWebhooks is a list of ValidatingWebhookConfigurations to install
|
||||
ValidatingWebhooks []*admissionv1.ValidatingWebhookConfiguration
|
||||
|
||||
// IgnoreSchemeConvertible, will modify any CRD conversion webhook to use the local serving host and port,
|
||||
// bypassing the need to have the types registered in the Scheme. This is useful for testing CRD conversion webhooks
|
||||
// with unregistered or unstructured types.
|
||||
IgnoreSchemeConvertible bool
|
||||
|
||||
// IgnoreErrorIfPathMissing will ignore an error if a DirectoryPath does not exist when set to true
|
||||
IgnoreErrorIfPathMissing bool
|
||||
|
||||
@@ -184,7 +189,8 @@ func defaultWebhookOptions(o *WebhookInstallOptions) {
|
||||
func WaitForWebhooks(config *rest.Config,
|
||||
mutatingWebhooks []*admissionv1.MutatingWebhookConfiguration,
|
||||
validatingWebhooks []*admissionv1.ValidatingWebhookConfiguration,
|
||||
options WebhookInstallOptions) error {
|
||||
options WebhookInstallOptions,
|
||||
) error {
|
||||
waitingFor := map[schema.GroupVersionKind]*sets.Set[string]{}
|
||||
|
||||
for _, hook := range mutatingWebhooks {
|
||||
@@ -242,7 +248,7 @@ func (p *webhookPoller) poll(ctx context.Context) (done bool, err error) {
|
||||
continue
|
||||
}
|
||||
for _, name := range names.UnsortedList() {
|
||||
var obj = &unstructured.Unstructured{}
|
||||
obj := &unstructured.Unstructured{}
|
||||
obj.SetGroupVersionKind(gvk)
|
||||
err := c.Get(context.Background(), client.ObjectKey{
|
||||
Namespace: "",
|
||||
|
||||
Reference in New Issue
Block a user