Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dependencies to align with Build v0.12.0 #168

Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ jobs:
fail-fast: false
matrix:
kubernetes:
- v1.23.13
# Kubernetes version must match a built KinD node image.
# See release notes in https://github.com/kubernetes-sigs/kind/releases for supported
# node image versions.
- v1.24.15
max-parallel: 2
runs-on: ubuntu-latest
steps:
Expand All @@ -74,7 +77,7 @@ jobs:
- name: Create KinD cluster
uses: helm/kind-action@v1
with:
version: v0.17.0
version: v0.20.0
node_image: kindest/node:${{ matrix.kubernetes }}
cluster_name: kind
config: test/kind/config.yaml
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ endif
# Image URL to use all building/pushing image targets
IMG ?= $(IMAGE_TAG_BASE):$(TAG)
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.23
ENVTEST_K8S_VERSION = 1.26

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down
4 changes: 2 additions & 2 deletions bundle/manifests/operator.shipwright.io_shipwrightbuilds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ spec:
description: "Condition contains details for one aspect of the current
state of this API Resource. --- This struct is intended for direct
use as an array at the field path .status.conditions. For example,
type FooStatus struct{ // Represents the observations of a foo's
current state. // Known .status.conditions.type are: \"Available\",
\n type FooStatus struct{ // Represents the observations of a
foo's current state. // Known .status.conditions.type are: \"Available\",
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
// +listType=map // +listMapKey=type Conditions []metav1.Condition
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ spec:
- email: [email protected]
name: The Shipwright Contributors
maturity: alpha
minKubeVersion: 1.23.13
minKubeVersion: 1.24.0
provider:
name: The Shipwright Contributors
url: https://shipwright.io
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/operator.shipwright.io_shipwrightbuilds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ spec:
description: "Condition contains details for one aspect of the current
state of this API Resource. --- This struct is intended for direct
use as an array at the field path .status.conditions. For example,
type FooStatus struct{ // Represents the observations of a foo's
current state. // Known .status.conditions.type are: \"Available\",
\n type FooStatus struct{ // Represents the observations of a
foo's current state. // Known .status.conditions.type are: \"Available\",
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
// +listType=map // +listMapKey=type Conditions []metav1.Condition
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ spec:
- email: [email protected]
name: The Shipwright Contributors
maturity: alpha
minKubeVersion: 1.23.13
minKubeVersion: 1.24.0
provider:
name: The Shipwright Contributors
url: https://shipwright.io
Expand Down
27 changes: 15 additions & 12 deletions controllers/default_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package controllers

import (
g "github.com/onsi/ginkgo"
"context"

g "github.com/onsi/ginkgo/v2"
o "github.com/onsi/gomega"
"github.com/shipwright-io/operator/pkg/common"

appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
Expand All @@ -14,11 +16,12 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

"github.com/shipwright-io/operator/api/v1alpha1"
"github.com/shipwright-io/operator/pkg/common"
"github.com/shipwright-io/operator/test"
)

// createNamespace creates the namespace informed.
func createNamespace(name string) {
func createNamespace(ctx context.Context, name string) {
ns := &corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: name}}
err := k8sClient.Get(ctx, types.NamespacedName{Name: ns.Name}, ns)
if errors.IsNotFound(err) {
Expand Down Expand Up @@ -60,9 +63,9 @@ var _ = g.Describe("Reconcile default ShipwrightBuild installation", func() {
}

truePtr := true
g.BeforeEach(func() {
g.BeforeEach(func(ctx g.SpecContext) {
// setting up the namespaces, where Shipwright Controller will be deployed
createNamespace(namespace)
createNamespace(ctx, namespace)

g.By("does tekton taskrun crd exist")
err := k8sClient.Get(ctx, types.NamespacedName{Name: "taskruns.tekton.dev"}, &crdv1.CustomResourceDefinition{})
Expand Down Expand Up @@ -144,7 +147,7 @@ var _ = g.Describe("Reconcile default ShipwrightBuild installation", func() {
test.EventuallyContainFinalizer(ctx, k8sClient, build, FinalizerAnnotation)
})

g.AfterEach(func() {
g.AfterEach(func(ctx g.SpecContext) {
g.By("deleting the ShipwrightBuild instance")
namespacedName := types.NamespacedName{Namespace: namespace, Name: build.Name}
err := k8sClient.Get(ctx, namespacedName, build)
Expand All @@ -170,7 +173,7 @@ var _ = g.Describe("Reconcile default ShipwrightBuild installation", func() {

g.When("a ShipwrightBuild object is created", func() {

g.It("creates RBAC for the Shipwright build controller", func() {
g.It("creates RBAC for the Shipwright build controller", func(ctx g.SpecContext) {
expectedClusterRole := baseClusterRole.DeepCopy()
test.EventuallyExists(ctx, k8sClient, expectedClusterRole)

Expand All @@ -181,12 +184,12 @@ var _ = g.Describe("Reconcile default ShipwrightBuild installation", func() {
test.EventuallyExists(ctx, k8sClient, expectedServiceAccount)
})

g.It("creates a deployment for the Shipwright build controller", func() {
g.It("creates a deployment for the Shipwright build controller", func(ctx g.SpecContext) {
expectedDeployment := baseDeployment.DeepCopy()
test.EventuallyExists(ctx, k8sClient, expectedDeployment)
})

g.It("creates custom resource definitions for the Shipwright build APIs", func() {
g.It("creates custom resource definitions for the Shipwright build APIs", func(ctx g.SpecContext) {
test.CRDEventuallyExists(ctx, k8sClient, "builds.shipwright.io")
test.CRDEventuallyExists(ctx, k8sClient, "buildruns.shipwright.io")
test.CRDEventuallyExists(ctx, k8sClient, "buildstrategies.shipwright.io")
Expand All @@ -196,7 +199,7 @@ var _ = g.Describe("Reconcile default ShipwrightBuild installation", func() {

g.When("a ShipwrightBuild object is deleted", func() {

g.It("deletes the RBAC for the Shipwright build controller", func() {
g.It("deletes the RBAC for the Shipwright build controller", func(ctx g.SpecContext) {
expectedClusterRole := baseClusterRole.DeepCopy()
expectedClusterRoleBinding := baseClusterRoleBinding.DeepCopy()
expectedServiceAccount := baseServiceAccount.DeepCopy()
Expand All @@ -216,7 +219,7 @@ var _ = g.Describe("Reconcile default ShipwrightBuild installation", func() {
test.EventuallyRemoved(ctx, k8sClient, expectedServiceAccount)
})

g.It("deletes the deployment for the Shipwright build controller", func() {
g.It("deletes the deployment for the Shipwright build controller", func(ctx g.SpecContext) {
expectedDeployment := baseDeployment.DeepCopy()
// Setup - ensure the objects we want exist
test.EventuallyExists(ctx, k8sClient, expectedDeployment)
Expand All @@ -230,7 +233,7 @@ var _ = g.Describe("Reconcile default ShipwrightBuild installation", func() {
})

// TODO: Do not delete the CRDs! This is something only a cluster admin should do.
g.It("deletes the custom resource definitions for the Shipwright build APIs", func() {
g.It("deletes the custom resource definitions for the Shipwright build APIs", func(ctx g.SpecContext) {
test.CRDEventuallyExists(ctx, k8sClient, "builds.shipwright.io")
test.CRDEventuallyExists(ctx, k8sClient, "buildruns.shipwright.io")
test.CRDEventuallyExists(ctx, k8sClient, "buildstrategies.shipwright.io")
Expand Down
21 changes: 9 additions & 12 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,20 @@ import (
"testing"
"time"

tektonoperatorv1alpha1client "github.com/tektoncd/operator/pkg/client/clientset/versioned/typed/operator/v1alpha1"
crdclientv1 "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1"

. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
crdclientv1 "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1"
"k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

tektonoperatorv1alpha1client "github.com/tektoncd/operator/pkg/client/clientset/versioned/typed/operator/v1alpha1"

operatorv1alpha1 "github.com/shipwright-io/operator/api/v1alpha1"
// +kubebuilder:scaffold:imports
)
Expand All @@ -45,16 +44,12 @@ func TestAPIs(t *testing.T) {
RegisterFailHandler(Fail)
SetDefaultEventuallyTimeout(restTimeout)
SetDefaultEventuallyPollingInterval(restRetry)
RunSpecsWithDefaultAndCustomReporters(t,
"Controller Suite",
[]Reporter{printer.NewlineReporter{}})
RunSpecs(t, "Controller Suite")
}

var _ = BeforeSuite(func() {
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))

ctx, cancel = context.WithCancel(context.TODO())

By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
Expand Down Expand Up @@ -91,15 +86,17 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())

go func() {
// The controller needs its own context to run in a separate goroutine
// This needs to be lifecycled independently of the context that ginkgo/v2 passes in
ctx, cancel = context.WithCancel(context.Background())
err := mgr.Start(ctx)
Expect(err).NotTo(HaveOccurred())
}()

k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
Expect(err).NotTo(HaveOccurred())
Expect(k8sClient).NotTo(BeNil())

}, 60)
})

var _ = AfterSuite(func() {
cancel()
Expand Down
114 changes: 60 additions & 54 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,102 +3,108 @@ module github.com/shipwright-io/operator
go 1.20

require (
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
github.com/go-logr/logr v1.2.4
github.com/manifestival/controller-runtime-client v0.4.0
github.com/manifestival/manifestival v0.7.2
github.com/onsi/ginkgo v1.16.5
github.com/onsi/ginkgo/v2 v2.12.0
github.com/onsi/gomega v1.28.0
github.com/tektoncd/operator v0.60.0
k8s.io/api v0.23.5
k8s.io/apiextensions-apiserver v0.23.4
k8s.io/apimachinery v0.23.5
k8s.io/client-go v0.23.5
sigs.k8s.io/controller-runtime v0.11.0
github.com/tektoncd/operator v0.67.0
k8s.io/api v0.26.4
k8s.io/apiextensions-apiserver v0.26.4
k8s.io/apimachinery v0.26.4
// go mod tidy forces this to v1.5.2
k8s.io/client-go v1.5.2
sigs.k8s.io/controller-runtime v0.14.6
)

require (
cloud.google.com/go/compute v1.19.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d // indirect
contrib.go.opencensus.io/exporter/prometheus v0.4.0 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.24 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blendle/zapdriver v1.3.1 // indirect
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/emicklei/go-restful/v3 v3.10.2 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-kit/log v0.1.0 // indirect
github.com/go-logfmt/logfmt v0.5.0 // indirect
github.com/go-logr/zapr v1.2.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/zapr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.3.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/imdario/mergo v0.3.14 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kelseyhightower/envconfig v1.4.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/openshift-pipelines/pipelines-as-code v0.19.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.11.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/prometheus/statsd_exporter v0.21.0 // indirect
github.com/prometheus/client_golang v1.15.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/statsd_exporter v0.23.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tektoncd/pipeline v0.47.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.9.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.12.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/api v0.114.0 // indirect
google.golang.org/api v0.119.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.56.3 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/component-base v0.23.4 // indirect
k8s.io/klog/v2 v2.60.1-0.20220317184644-43cc75f9ae89 // indirect
k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf // indirect
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
knative.dev/pkg v0.0.0-20220329144915-0a1ec2e0d46c // indirect
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
k8s.io/component-base v0.26.4 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a // indirect
k8s.io/utils v0.0.0-20230313181309-38a27ef9d749 // indirect
knative.dev/pkg v0.0.0-20230320014357-4c84b1b51ee8 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

// github.com/manifestival/controller-runtime-client v0.4.0 depends on
// github.com/manifestival/manifestival v0.6.0, which in turn depends on
// k8s.io/client-go v0.15.7. This is not compatible with v0.20.2 and leads to transitive
// dependency hell. Pinning k8s.io/client-go to the version shared by controller-runtime and
// the latest version of manifestival
replace k8s.io/client-go => k8s.io/client-go v0.23.5
// Go modules at times does not effectively resolve transitive dependencies that share
// k8s.io/* packages. These should be kept internally consistent with a "common" k8s version - this
// is more of an art than a science, and can change with successive dependency updates.
//
// Each replace here should provide a comment explaining why it is warranted, and its necessity
// should be tested with successive dependency updates.

// k8s.io/client-go has a "latest" semantic version of v1.5.2, which predates the project
// go module version standardization (v0.y.z, with y and z representing the k8s 1.y.z minor/patch
// versions). `go mod tidy` will often overwrite the desired client-go version to v1.5.2, so we
// pin the version here.
replace k8s.io/client-go => k8s.io/client-go v0.26.4
Loading
Loading