Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,20 @@ format:
go fmt ./...
.PHONY: format

imports:
which goimports || go install -mod=mod golang.org/x/tools/cmd/goimports@latest
go list ./... | sed "s|^github.com/openshift/cluster-version-operator/||" | xargs goimports -w -local "k8s.io,github.com/openshift"
go list ./... | sed "s|^github.com/openshift/cluster-version-operator/||" | xargs goimports -w -local "github.com/openshift/cluster-version-operator"
.PHONY: imports

verify: verify-yaml verify-update
.PHONY: verify

verify-yaml:
hack/verify-yaml.sh
.PHONY: verify-yaml

verify-update: update
verify-update: imports update
git diff --exit-code HEAD
.PHONY: verify-update

Expand Down
1 change: 1 addition & 0 deletions cmd/cluster-version-operator/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"

"github.com/spf13/cobra"

"k8s.io/klog/v2"

"github.com/openshift/cluster-version-operator/pkg/payload"
Expand Down
1 change: 1 addition & 0 deletions cmd/cluster-version-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"flag"

"github.com/spf13/cobra"

"k8s.io/klog/v2"
)

Expand Down
1 change: 1 addition & 0 deletions cmd/cluster-version-operator/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"os"

"github.com/spf13/cobra"

"k8s.io/klog/v2"

"github.com/openshift/cluster-version-operator/pkg/payload"
Expand Down
1 change: 1 addition & 0 deletions cmd/cluster-version-operator/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"

"github.com/spf13/cobra"

"k8s.io/klog/v2"

"github.com/openshift/cluster-version-operator/pkg/start"
Expand Down
3 changes: 2 additions & 1 deletion cmd/cluster-version-operator/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package main
import (
"fmt"

"github.com/openshift/cluster-version-operator/pkg/version"
"github.com/spf13/cobra"

"github.com/openshift/cluster-version-operator/pkg/version"
)

var (
Expand Down
1 change: 1 addition & 0 deletions hack/cluster-version-util/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"flag"

"github.com/spf13/cobra"

"k8s.io/klog/v2"
)

Expand Down
1 change: 1 addition & 0 deletions hack/cluster-version-util/task_graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/spf13/cobra"

"k8s.io/apimachinery/pkg/util/sets"

"github.com/openshift/cluster-version-operator/pkg/payload"
Expand Down
1 change: 1 addition & 0 deletions lib/capability/capability_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"

"github.com/google/go-cmp/cmp"

"k8s.io/apimachinery/pkg/util/sets"

configv1 "github.com/openshift/api/config/v1"
Expand Down
4 changes: 3 additions & 1 deletion lib/resourceapply/admissionregistration.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import (
"context"

"github.com/google/go-cmp/cmp"
"github.com/openshift/cluster-version-operator/lib/resourcemerge"

admissionregv1 "k8s.io/api/admissionregistration/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
admissionregclientv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1"
"k8s.io/klog/v2"
"k8s.io/utils/ptr"

"github.com/openshift/cluster-version-operator/lib/resourcemerge"
)

func ApplyValidatingWebhookConfigurationv1(ctx context.Context, client admissionregclientv1.ValidatingWebhookConfigurationsGetter, required *admissionregv1.ValidatingWebhookConfiguration, reconciling bool) (*admissionregv1.ValidatingWebhookConfiguration, bool, error) {
Expand Down
4 changes: 3 additions & 1 deletion lib/resourceapply/apiext.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import (
"context"

"github.com/google/go-cmp/cmp"
"github.com/openshift/cluster-version-operator/lib/resourcemerge"

apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
apiextclientv1 "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
"k8s.io/utils/ptr"

"github.com/openshift/cluster-version-operator/lib/resourcemerge"
)

func ApplyCustomResourceDefinitionv1(ctx context.Context, client apiextclientv1.CustomResourceDefinitionsGetter, required *apiextv1.CustomResourceDefinition, reconciling bool) (*apiextv1.CustomResourceDefinition, bool, error) {
Expand Down
4 changes: 3 additions & 1 deletion lib/resourceapply/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import (
"context"

"github.com/google/go-cmp/cmp"
"github.com/openshift/cluster-version-operator/lib/resourcemerge"

appsv1 "k8s.io/api/apps/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
appsclientv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
"k8s.io/klog/v2"
"k8s.io/utils/ptr"

"github.com/openshift/cluster-version-operator/lib/resourcemerge"
)

// ApplyDeploymentv1 applies the required deployment to the cluster.
Expand Down
4 changes: 3 additions & 1 deletion lib/resourceapply/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import (
"context"

"github.com/google/go-cmp/cmp"
"github.com/openshift/cluster-version-operator/lib/resourcemerge"

batchv1 "k8s.io/api/batch/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
batchclientv1 "k8s.io/client-go/kubernetes/typed/batch/v1"
"k8s.io/klog/v2"
"k8s.io/utils/ptr"

"github.com/openshift/cluster-version-operator/lib/resourcemerge"
)

// ApplyJobv1 applies the required Job to the cluster.
Expand Down
1 change: 1 addition & 0 deletions lib/resourceapply/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"

"github.com/google/go-cmp/cmp"

"k8s.io/klog/v2"

corev1 "k8s.io/api/core/v1"
Expand Down
4 changes: 3 additions & 1 deletion lib/resourceapply/cv.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import (
"context"

"github.com/google/go-cmp/cmp"

configv1 "github.com/openshift/api/config/v1"
configclientv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1"
configlistersv1 "github.com/openshift/client-go/config/listers/config/v1"
"github.com/openshift/cluster-version-operator/lib/resourcemerge"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
"k8s.io/utils/ptr"

"github.com/openshift/cluster-version-operator/lib/resourcemerge"
)

func ApplyClusterVersionFromCache(ctx context.Context, lister configlistersv1.ClusterVersionLister, client configclientv1.ClusterVersionsGetter, required *configv1.ClusterVersion) (*configv1.ClusterVersion, bool, error) {
Expand Down
4 changes: 3 additions & 1 deletion lib/resourceapply/imagestream.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import (
"context"

"github.com/google/go-cmp/cmp"

imagev1 "github.com/openshift/api/image/v1"
imageclientv1 "github.com/openshift/client-go/image/clientset/versioned/typed/image/v1"
"github.com/openshift/cluster-version-operator/lib/resourcemerge"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
"k8s.io/utils/ptr"

"github.com/openshift/cluster-version-operator/lib/resourcemerge"
)

func ApplyImageStreamv1(ctx context.Context, client imageclientv1.ImageStreamsGetter, required *imagev1.ImageStream, reconciling bool) (*imagev1.ImageStream, bool, error) {
Expand Down
2 changes: 2 additions & 0 deletions lib/resourceapply/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import (
"context"

"github.com/google/go-cmp/cmp"

"k8s.io/klog/v2"

operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
operatorsclientv1 "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned/typed/operators/v1"

apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
Expand Down
4 changes: 3 additions & 1 deletion lib/resourceapply/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import (
"context"

"github.com/google/go-cmp/cmp"
"github.com/openshift/cluster-version-operator/lib/resourcemerge"

rbacv1 "k8s.io/api/rbac/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
rbacclientv1 "k8s.io/client-go/kubernetes/typed/rbac/v1"
"k8s.io/klog/v2"
"k8s.io/utils/ptr"

"github.com/openshift/cluster-version-operator/lib/resourcemerge"
)

// ApplyClusterRoleBindingv1 applies the required clusterrolebinding to the cluster.
Expand Down
4 changes: 3 additions & 1 deletion lib/resourceapply/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import (
"context"

"github.com/google/go-cmp/cmp"

securityv1 "github.com/openshift/api/security/v1"
securityclientv1 "github.com/openshift/client-go/security/clientset/versioned/typed/security/v1"
"github.com/openshift/cluster-version-operator/lib/resourcemerge"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"

"github.com/openshift/cluster-version-operator/lib/resourcemerge"
)

// ApplySecurityContextConstraintsv1 applies the required SecurityContextConstraints to the cluster.
Expand Down
1 change: 1 addition & 0 deletions lib/resourcebuilder/podspec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"

"github.com/google/go-cmp/cmp"

corev1 "k8s.io/api/core/v1"
)

Expand Down
12 changes: 7 additions & 5 deletions lib/resourcebuilder/resourcebuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ import (
"context"
"fmt"

operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
operatorsclientv1 "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned/typed/operators/v1"

imagev1 "github.com/openshift/api/image/v1"
securityv1 "github.com/openshift/api/security/v1"
configclientv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config/v1"
imageclientv1 "github.com/openshift/client-go/image/clientset/versioned/typed/image/v1"
securityclientv1 "github.com/openshift/client-go/security/clientset/versioned/typed/security/v1"
"github.com/openshift/cluster-version-operator/lib/resourceapply"
"github.com/openshift/cluster-version-operator/lib/resourcedelete"
"github.com/openshift/cluster-version-operator/lib/resourceread"
"github.com/openshift/library-go/pkg/manifest"
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
operatorsclientv1 "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned/typed/operators/v1"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
Expand All @@ -32,6 +30,10 @@ import (
rbacclientv1 "k8s.io/client-go/kubernetes/typed/rbac/v1"
"k8s.io/client-go/rest"
apiregistrationclientv1 "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1"

"github.com/openshift/cluster-version-operator/lib/resourceapply"
"github.com/openshift/cluster-version-operator/lib/resourcedelete"
"github.com/openshift/cluster-version-operator/lib/resourceread"
)

// builder manages single-manifest cluster reconciliation and monitoring.
Expand Down
1 change: 1 addition & 0 deletions lib/resourcedelete/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
operatorsclientv1 "github.com/operator-framework/operator-lifecycle-manager/pkg/api/client/clientset/versioned/typed/operators/v1"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down
1 change: 1 addition & 0 deletions lib/resourcemerge/admissionregistration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

"github.com/google/go-cmp/cmp"

admissionregv1 "k8s.io/api/admissionregistration/v1"
"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
1 change: 1 addition & 0 deletions lib/resourcemerge/apiext_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

"github.com/google/go-cmp/cmp"

apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"

"k8s.io/apimachinery/pkg/api/equality"
Expand Down
1 change: 1 addition & 0 deletions lib/resourcemerge/batch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"time"

"github.com/google/go-cmp/cmp"

batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
Expand Down
1 change: 1 addition & 0 deletions lib/resourcemerge/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

"github.com/google/go-cmp/cmp"

"k8s.io/apimachinery/pkg/util/intstr"

corev1 "k8s.io/api/core/v1"
Expand Down
1 change: 1 addition & 0 deletions lib/resourcemerge/imagestream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"time"

"github.com/google/go-cmp/cmp"

imagev1 "github.com/openshift/api/image/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/equality"
Expand Down
1 change: 1 addition & 0 deletions lib/resourcemerge/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package resourcemerge

import (
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"

"k8s.io/apimachinery/pkg/api/equality"
)

Expand Down
1 change: 1 addition & 0 deletions lib/resourcemerge/operators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"

"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
Expand Down
1 change: 1 addition & 0 deletions lib/resourcemerge/rbac_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

"github.com/google/go-cmp/cmp"

rbacv1 "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/api/equality"
"k8s.io/utils/ptr"
Expand Down
1 change: 1 addition & 0 deletions lib/resourcemerge/security_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

"github.com/google/go-cmp/cmp"

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
Expand Down
3 changes: 2 additions & 1 deletion lib/resourceread/resourceread.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
package resourceread

import (
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"

imagev1 "github.com/openshift/api/image/v1"
securityv1 "github.com/openshift/api/security/v1"
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
Expand Down
4 changes: 3 additions & 1 deletion pkg/cincinnati/cincinnati.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ import (

"github.com/blang/semver/v4"
"github.com/google/uuid"

configv1 "github.com/openshift/api/config/v1"
"github.com/openshift/cluster-version-operator/pkg/clusterconditions"
"k8s.io/klog/v2"

"github.com/openshift/cluster-version-operator/pkg/clusterconditions"
)

const (
Expand Down
1 change: 1 addition & 0 deletions pkg/cincinnati/cincinnati_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

"github.com/blang/semver/v4"
"github.com/google/uuid"

configv1 "github.com/openshift/api/config/v1"
_ "k8s.io/klog/v2" // integration tests set glog flags.
)
Expand Down
Loading