From d5230b94a3b88d3a5caa0f0e0a5f8fb9652c366b Mon Sep 17 00:00:00 2001 From: Erik Godding Boye Date: Thu, 10 Oct 2024 22:51:17 +0200 Subject: [PATCH 1/3] chore: bump Go requirements to 1.23 --- go.mod | 2 +- .../applyconfiguration/internal/internal.go | 43 ------------------- internal/client/applyconfiguration/utils.go | 41 ------------------ 3 files changed, 1 insertion(+), 85 deletions(-) diff --git a/go.mod b/go.mod index 9217aa2f..bfd4abe2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/statnett/image-scanner-operator -go 1.22.0 +go 1.23.0 require ( github.com/distribution/reference v0.6.0 diff --git a/internal/client/applyconfiguration/internal/internal.go b/internal/client/applyconfiguration/internal/internal.go index 47f29e51..8a377a46 100644 --- a/internal/client/applyconfiguration/internal/internal.go +++ b/internal/client/applyconfiguration/internal/internal.go @@ -1,46 +1,3 @@ // Code generated by applyconfiguration-gen. DO NOT EDIT. package internal - -import ( - "fmt" - "sync" - - typed "sigs.k8s.io/structured-merge-diff/v4/typed" -) - -func Parser() *typed.Parser { - parserOnce.Do(func() { - var err error - parser, err = typed.NewParser(schemaYAML) - if err != nil { - panic(fmt.Sprintf("Failed to parse schema: %v", err)) - } - }) - return parser -} - -var parserOnce sync.Once -var parser *typed.Parser -var schemaYAML = typed.YAMLObject(`types: -- name: __untyped_atomic_ - scalar: untyped - list: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic - map: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic -- name: __untyped_deduced_ - scalar: untyped - list: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic - map: - elementType: - namedType: __untyped_deduced_ - elementRelationship: separable -`) diff --git a/internal/client/applyconfiguration/utils.go b/internal/client/applyconfiguration/utils.go index 8366417a..ef650382 100644 --- a/internal/client/applyconfiguration/utils.go +++ b/internal/client/applyconfiguration/utils.go @@ -1,44 +1,3 @@ // Code generated by applyconfiguration-gen. DO NOT EDIT. package applyconfiguration - -import ( - v1alpha1 "github.com/statnett/image-scanner-operator/api/stas/v1alpha1" - internal "github.com/statnett/image-scanner-operator/internal/client/applyconfiguration/internal" - stasv1alpha1 "github.com/statnett/image-scanner-operator/internal/client/applyconfiguration/stas/v1alpha1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - testing "k8s.io/client-go/testing" -) - -// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no -// apply configuration type exists for the given GroupVersionKind. -func ForKind(kind schema.GroupVersionKind) interface{} { - switch kind { - // Group=stas.statnett.no, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithKind("ContainerImageScan"): - return &stasv1alpha1.ContainerImageScanApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ContainerImageScanSpec"): - return &stasv1alpha1.ContainerImageScanSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ContainerImageScanStatus"): - return &stasv1alpha1.ContainerImageScanStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Image"): - return &stasv1alpha1.ImageApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ImageScanSpec"): - return &stasv1alpha1.ImageScanSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ScanConfig"): - return &stasv1alpha1.ScanConfigApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Vulnerability"): - return &stasv1alpha1.VulnerabilityApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VulnerabilitySummary"): - return &stasv1alpha1.VulnerabilitySummaryApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Workload"): - return &stasv1alpha1.WorkloadApplyConfiguration{} - - } - return nil -} - -func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter { - return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()} -} From 4f8c1d7f1723c270aabd3b358af67b405e9bfa77 Mon Sep 17 00:00:00 2001 From: Erik Godding Boye Date: Thu, 10 Oct 2024 22:57:10 +0200 Subject: [PATCH 2/3] bump go even more --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index bfd4abe2..09f76d5b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/statnett/image-scanner-operator -go 1.23.0 +go 1.23.2 require ( github.com/distribution/reference v0.6.0 From f750b068291c03424a410a1787a769c01fd27887 Mon Sep 17 00:00:00 2001 From: mikaelol <104485047+mikaelol@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:20:22 +0000 Subject: [PATCH 3/3] chore: run 'make generate-all' --- .../applyconfiguration/internal/internal.go | 43 +++++++++++++++++++ internal/client/applyconfiguration/utils.go | 41 ++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/internal/client/applyconfiguration/internal/internal.go b/internal/client/applyconfiguration/internal/internal.go index 8a377a46..47f29e51 100644 --- a/internal/client/applyconfiguration/internal/internal.go +++ b/internal/client/applyconfiguration/internal/internal.go @@ -1,3 +1,46 @@ // Code generated by applyconfiguration-gen. DO NOT EDIT. package internal + +import ( + "fmt" + "sync" + + typed "sigs.k8s.io/structured-merge-diff/v4/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/internal/client/applyconfiguration/utils.go b/internal/client/applyconfiguration/utils.go index ef650382..8366417a 100644 --- a/internal/client/applyconfiguration/utils.go +++ b/internal/client/applyconfiguration/utils.go @@ -1,3 +1,44 @@ // Code generated by applyconfiguration-gen. DO NOT EDIT. package applyconfiguration + +import ( + v1alpha1 "github.com/statnett/image-scanner-operator/api/stas/v1alpha1" + internal "github.com/statnett/image-scanner-operator/internal/client/applyconfiguration/internal" + stasv1alpha1 "github.com/statnett/image-scanner-operator/internal/client/applyconfiguration/stas/v1alpha1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + testing "k8s.io/client-go/testing" +) + +// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no +// apply configuration type exists for the given GroupVersionKind. +func ForKind(kind schema.GroupVersionKind) interface{} { + switch kind { + // Group=stas.statnett.no, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithKind("ContainerImageScan"): + return &stasv1alpha1.ContainerImageScanApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ContainerImageScanSpec"): + return &stasv1alpha1.ContainerImageScanSpecApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ContainerImageScanStatus"): + return &stasv1alpha1.ContainerImageScanStatusApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Image"): + return &stasv1alpha1.ImageApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ImageScanSpec"): + return &stasv1alpha1.ImageScanSpecApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ScanConfig"): + return &stasv1alpha1.ScanConfigApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Vulnerability"): + return &stasv1alpha1.VulnerabilityApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("VulnerabilitySummary"): + return &stasv1alpha1.VulnerabilitySummaryApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Workload"): + return &stasv1alpha1.WorkloadApplyConfiguration{} + + } + return nil +} + +func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter { + return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()} +}