Skip to content
Draft
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
4,763 changes: 2,388 additions & 2,375 deletions staging/operator-lifecycle-manager/pkg/controller/operators/catalog/operator.go

Large diffs are not rendered by default.

4,092 changes: 2,103 additions & 1,989 deletions staging/operator-lifecycle-manager/pkg/controller/operators/catalog/operator_test.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: stable.example.com/v2
kind: CronTab
metadata:
name: my-crontab
spec:
cronSpec: "* * * * *"
image: ""
replicas: 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: stable.example.com/v1
kind: CronTab
metadata:
name: my-crontab-v1
spec:
cronSpec: "* * * * *"
image: ""
replicas: 9
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: stable.example.com/v2
kind: CronTab
metadata:
name: my-crontab-v2
spec:
cronSpec: "* * * * *"
image: ""
replicas: 9
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Adapated from: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: crontabs.stable.example.com
spec:
group: stable.example.com
versions:
- name: v1
served: false
storage: false
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
cronSpec:
type: string
pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
image:
type: string
replicas:
type: integer
minimum: 100
maximum: 200
- name: v2
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
cronSpec:
type: string
pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
image:
type: string
replicas:
type: integer
minimum: 1
maximum: 10
scope: Namespaced
names:
plural: crontabs
singular: crontab
kind: CronTab
shortNames:
- ct
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Adapated from: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: crontabs.stable.example.com
spec:
group: stable.example.com
versions:
- name: v1
served: true
storage: false
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
cronSpec:
type: string
pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
image:
type: string
replicas:
type: integer
minimum: 1
maximum: 10
- name: v2
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
cronSpec:
type: string
pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
image:
type: string
replicas:
type: integer
minimum: 1
maximum: 10
scope: Namespaced
names:
plural: crontabs
singular: crontab
kind: CronTab
shortNames:
- ct
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Adapated from: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: crontabs.stable.example.com
spec:
group: stable.example.com
versions:
- name: v1
served: false
storage: false
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
cronSpec:
type: string
pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
image:
type: string
replicas:
type: integer
minimum: 100
maximum: 200
- name: v2
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
cronSpec:
type: string
pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
image:
type: string
replicas:
type: integer
minimum: 1
maximum: 9
scope: Namespaced
names:
plural: crontabs
singular: crontab
kind: CronTab
shortNames:
- ct
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Adapated from: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: crontabs.stable.example.com
spec:
group: stable.example.com
versions:
- name: v1
served: true
storage: false
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
cronSpec:
type: string
pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
image:
type: string
replicas:
type: integer
minimum: 1
maximum: 10
- name: v2
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
cronSpec:
type: string
pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
image:
type: string
replicas:
type: integer
minimum: 1
maximum: 9
scope: Namespaced
names:
plural: crontabs
singular: crontab
kind: CronTab
shortNames:
- ct
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: cluster.com/v1alpha1
kind: testcrd
metadata:
name: my-cr-1
spec:
scalar: 100
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: testcrd.cluster.com
spec:
conversion:
strategy: None
group: cluster.com
names:
kind: testcrd
listKind: testcrdList
plural: testcrds
singular: testcrd
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
properties:
spec:
description: Spec of a test object.
properties:
scalar:
description: Scalar value that should have a min and max.
type: integer
type: object
type: object
served: true
storage: true

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: testcrd.cluster.com
spec:
conversion:
strategy: None
group: cluster.com
names:
kind: testcrd
listKind: testcrdList
plural: testcrds
singular: testcrd
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
properties:
spec:
description: Spec of a test object.
properties:
scalar:
description: Scalar value that should have a min and max.
maximum: 50
minimum: 2
type: integer
type: object
type: object
served: true
storage: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: cluster.com/v2
kind: testcrd
metadata:
name: my-cr-1
spec:
scalar: 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: cluster.com/v1alpha1
kind: testcrd
metadata:
name: my-cr-1
spec:
scalar: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: testcrd.cluster.com
spec:
conversion:
strategy: None
group: cluster.com
names:
kind: testcrd
listKind: testcrdList
plural: testcrds
singular: testcrd
scope: Namespaced
validation:
openAPIV3Schema:
properties:
spec:
description: Spec of a test object.
properties:
scalar:
description: Scalar value that should have a min and max.
maximum: 50
minimum: 1
type: integer
type: object
type: object
version: v1alpha1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: testcrd.cluster.com
spec:
conversion:
strategy: None
group: cluster.com
names:
kind: testcrd
listKind: testcrdList
plural: testcrds
singular: testcrd
scope: Namespaced
validation:
openAPIV3Schema:
properties:
spec:
description: Spec of a test object.
properties:
scalar:
description: Scalar value that should have a min and max.
maximum: 50
minimum: 3
type: integer
type: object
type: object
version: v1alpha1
Loading