Skip to content

Commit

Permalink
build(deps): Bump k8s.io/api from v0.20.5 to v0.22.1 (#894)
Browse files Browse the repository at this point in the history
build(deps): Bump k8s.io/apimachinery from v0.20.5 to v0.22.1
build(deps): Bump k8s.io/client-go from v0.20.5 to v0.22.1
build(deps): Bump k8s.io/code-generator from v0.20.5 to v0.22.1
build(deps): Bump k8s.io/klog/v2 from v2.8.0 to v2.9.0

build(deps): Bump sigs.k8s.io/controller-runtime from v0.8.3 to v0.9.7
build(deps): Bump sigs.k8s.io/controller-tools from v0.5.0 v0.6.2

build(deps): Bump istio.io/api from v1.9.2 to v1.11.2
build(deps): Bump istio.io/client-go from v1.9.2 to v1.11.2

build(deps): Bump github.com/prometheus/client_golang from v1.10.0 to v1.11.0
build(deps): Bump github.com/operator-framework/operator-lib from v0.4.0 to v0.7.0
build(deps): Bump go.uber.org/zap from v1.16.0 to v1.19.0
build(deps): Bump google.golang.org/grpc from v1.36.1 to v1.38.0

build(deps): Bump github.com/spf13/afero from v1.5.1 to v1.6.0
build(deps): Bump github.com/spf13/cobra from v1.1.3 to v1.2.1
build(deps): Bump github.com/spf13/viper from v1.7.1 to v1.8.1

build(deps): Bump github.com/onsi/ginkgo from v1.16.1 to v1.16.4
build(deps): Bump github.com/onsi/gomega from v1.11.0 to v1.15.0

fixes #776
fixes #881
fixes #880
fixes #879
fixes #878
  • Loading branch information
aslakknutsen authored Sep 10, 2021
1 parent 7482d03 commit 024dbac
Show file tree
Hide file tree
Showing 6 changed files with 407 additions and 420 deletions.
32 changes: 22 additions & 10 deletions config/crd/bases/maistra.io_sessions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
name: sessions.maistra.io
spec:
Expand Down Expand Up @@ -42,10 +42,14 @@ spec:
description: Session controls the creation of the specialized hidden routes.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
Expand All @@ -63,15 +67,19 @@ spec:
description: Additional arguments to the given strategy
type: object
name:
description: Deployment or DeploymentConfig name, could optionally contain [Kind/]Name to be specific
description: Deployment or DeploymentConfig name, could optionally
contain [Kind/]Name to be specific
type: string
strategy:
description: How this deployment should be handled, e.g. telepresence or prepared-image
description: How this deployment should be handled, e.g. telepresence
or prepared-image
type: string
type: object
type: array
route:
description: How to route the given Session. A header based route using x-workspace-route with the Session name as value will be used if not provided.
description: How to route the given Session. A header based route
using x-workspace-route with the Session name as value will be used
if not provided.
properties:
name:
description: Name of the key, e.g. http header
Expand All @@ -92,7 +100,8 @@ spec:
type: string
type: array
_routeExp:
description: RouteExpression represents the Route object as single string expression
description: RouteExpression represents the Route object as single
string expression
type: string
_strategies:
items:
Expand All @@ -101,10 +110,12 @@ spec:
conditions:
description: The combined log of changes across all refs
items:
description: Condition describes a step of manipulating resources within a session.
description: Condition describes a step of manipulating resources
within a session.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time this action was applied
description: LastTransitionTime is the last time this action
was applied
format: date-time
type: string
message:
Expand All @@ -127,7 +138,8 @@ spec:
description: Status indicates success.
type: string
target:
description: Result contains the resource involved if different from Target, e.g. Create
description: Result contains the resource involved if different
from Target, e.g. Create
properties:
kind:
type: string
Expand Down
39 changes: 11 additions & 28 deletions controllers/session/session_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/maistra/istio-workspace/api/maistra/v1alpha1"
"github.com/maistra/istio-workspace/controllers/session"
"github.com/maistra/istio-workspace/pkg/model"
"github.com/maistra/istio-workspace/test/testclient"
)

var kind, name = "X", "details"
Expand All @@ -30,16 +31,8 @@ var _ = Describe("Basic session manipulation", func() {
c client.Client
locator *trackedLocator
mutator *trackedMutator
get *testclient.Getters
)
GetSession := func(c *client.Client) func(namespace, name string) v1alpha1.Session {
return func(namespace, name string) v1alpha1.Session {
s := v1alpha1.Session{}
err := (*c).Get(context.Background(), types.NamespacedName{Namespace: namespace, Name: name}, &s)
Expect(err).ToNot(HaveOccurred())

return s
}
}(&c)
JustBeforeEach(func() {
locator = &trackedLocator{Action: notFoundTestLocator}
mutator = &trackedMutator{Action: noOpModifier}
Expand All @@ -61,6 +54,7 @@ var _ = Describe("Basic session manipulation", func() {
}
c = fake.NewClientBuilder().WithScheme(schema).WithRuntimeObjects(objects...).Build()
controller = session.NewStandaloneReconciler(c, manipulators)
get = testclient.New(c)
})

Context("session creation", func() {
Expand Down Expand Up @@ -96,7 +90,7 @@ var _ = Describe("Basic session manipulation", func() {
Expect(err).ToNot(HaveOccurred())
Expect(res.Requeue).To(BeFalse())

modified := GetSession("test", "test-session")
modified := get.Session("test", "test-session")
Expect(modified.ObjectMeta.Finalizers).To(HaveLen(1))
})

Expand All @@ -118,7 +112,7 @@ var _ = Describe("Basic session manipulation", func() {
Expect(err).ToNot(HaveOccurred())
Expect(res.Requeue).To(BeFalse())

modified := GetSession("test", "test-session")
modified := get.Session("test", "test-session")
Expect(modified.Status).ToNot(BeNil())
Expect(modified.Status.Conditions).To(HaveLen(1))
Expect(modified.Status.Conditions[0].Source.Name).To(Equal("test"))
Expand All @@ -128,7 +122,7 @@ var _ = Describe("Basic session manipulation", func() {
Expect(err).ToNot(HaveOccurred())
Expect(res.Requeue).To(BeFalse())

modified := GetSession("test", "test-session")
modified := get.Session("test", "test-session")
fmt.Println(modified.Status.Route)
Expect(modified.Status.Route).ToNot(BeNil())
Expect(modified.Status.Route.Type).To(Equal(session.RouteStrategyHeader))
Expand Down Expand Up @@ -181,7 +175,7 @@ var _ = Describe("Basic session manipulation", func() {
Expect(err).ToNot(HaveOccurred())
Expect(res.Requeue).To(BeFalse())

modified := GetSession("test", "test-session")
modified := get.Session("test", "test-session")
Expect(modified.Status).ToNot(BeNil())
Expect(modified.Status.Conditions).To(HaveLen(2))

Expand Down Expand Up @@ -240,7 +234,7 @@ var _ = Describe("Basic session manipulation", func() {
Expect(err).ToNot(HaveOccurred())
Expect(res.Requeue).To(BeFalse())

modified := GetSession("test", "test-session")
modified := get.Session("test", "test-session")
Expect(modified.Status).ToNot(BeNil())
Expect(modified.Status.Conditions).To(HaveLen(0))
})
Expand Down Expand Up @@ -286,25 +280,14 @@ var _ = Describe("Basic session manipulation", func() {
Expect(mutator.Refs[0].Remove).To(BeTrue())
})

It("should remove status when session removed", func() {
locator.Action = foundTestLocator
mutator.Action = reportSuccess()
res, err := controller.Reconcile(context.Background(), req)
Expect(err).ToNot(HaveOccurred())
Expect(res.Requeue).To(BeFalse())

modified := GetSession("test", "test-session")
Expect(modified.Status).ToNot(BeNil())
Expect(modified.Status.Conditions).To(HaveLen(0))
})

It("should remove finalizer", func() {
res, err := controller.Reconcile(context.Background(), req)
Expect(err).ToNot(HaveOccurred())
Expect(res.Requeue).To(BeFalse())

modified := GetSession("test", "test-session")
Expect(modified.ObjectMeta.Finalizers).To(HaveLen(0))
// Then - object should have been finalized/deleted if no finalizers present
_, err = get.SessionWithError("test", "test-session")
Expect(err).To(HaveOccurred())
})
})
})
Expand Down
51 changes: 21 additions & 30 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.15

require (
emperror.dev/errors v0.8.0
github.com/evanphx/json-patch v4.9.0+incompatible
github.com/evanphx/json-patch v4.11.0+incompatible
github.com/fsnotify/fsnotify v1.4.9
github.com/go-bindata/go-bindata/v3 v3.1.3
github.com/go-cmd/cmd v1.3.0
Expand All @@ -15,42 +15,33 @@ require (
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/joho/godotenv v1.3.0
github.com/kisielk/errcheck v1.6.0
github.com/magiconair/properties v1.8.4 // indirect
github.com/mikefarah/yq/v4 v4.7.1
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/onsi/ginkgo v1.16.1
github.com/onsi/gomega v1.11.0
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.15.0
github.com/openshift/api v0.0.0-20200527184302-a843dc3262a0
github.com/operator-framework/operator-lib v0.4.0
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/prometheus/client_golang v1.10.0
github.com/operator-framework/operator-lib v0.7.0
github.com/prometheus/client_golang v1.11.0
github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94 // v1.0.2
github.com/schollz/progressbar/v3 v3.8.2
github.com/spf13/afero v1.5.1
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/cobra v1.1.3
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/afero v1.6.0
github.com/spf13/cobra v1.2.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
github.com/spf13/viper v1.8.1
go.uber.org/goleak v1.1.10
go.uber.org/zap v1.16.0
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
golang.org/x/tools v0.1.0
google.golang.org/grpc v1.36.1
go.uber.org/zap v1.19.0
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023
golang.org/x/tools v0.1.5
google.golang.org/grpc v1.38.0
google.golang.org/protobuf v1.26.0
gopkg.in/h2non/gock.v1 v1.0.16
gopkg.in/ini.v1 v1.62.0 // indirect
honnef.co/go/tools v0.0.1-2020.1.4 // indirect
istio.io/api v0.0.0-20210318170531-e6e017e575c5
istio.io/client-go v1.9.2
k8s.io/api v0.20.5
k8s.io/apimachinery v0.20.5
k8s.io/client-go v0.20.5
k8s.io/code-generator v0.20.5
k8s.io/klog/v2 v2.8.0
sigs.k8s.io/controller-runtime v0.8.3
sigs.k8s.io/controller-tools v0.5.0
istio.io/api v0.0.0-20210809175348-eff556fb5d8a
istio.io/client-go v1.11.2
k8s.io/api v0.22.1
k8s.io/apimachinery v0.22.1
k8s.io/client-go v0.22.1
k8s.io/code-generator v0.22.1
k8s.io/klog/v2 v2.9.0
sigs.k8s.io/controller-runtime v0.9.7
sigs.k8s.io/controller-tools v0.6.2
sigs.k8s.io/yaml v1.2.0
)
Loading

0 comments on commit 024dbac

Please sign in to comment.