This repository has been archived by the owner on Jun 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
SBO design direction with multiple services support #286
Closed
Closed
Changes from 27 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
7a96082
Improving .editorconfig file.
otaviof 38c9014
BackingServiceSelectors.
otaviof 3eb18cb
Refactoring SBR validation.
otaviof 3fcc2a7
Embed GroupVersionKind in BackingServiceSelector and other cleanups
isutton dedc3e3
Merge remote-tracking branch 'origin/master' into isutton/APPSVC-305
isutton 953d7d0
Refactor Reconciler and friends to simplify the code
isutton f5b5664
Add TypeMeta information in SBR mock
isutton 495ddfc
Mark yaml encoding to inline GroupVersionKind
isutton 5802800
Split Reconciiler into Reconciler and BindingManager
isutton c106db9
Add found bool return value
isutton 54edba9
Client is required
isutton 5384087
Move types and constant like vars to the top
isutton cd49930
Validate options in BuildBindingManager
isutton e838a17
Rename local variable
isutton c04eaa9
Reword field documentation
isutton 8ae4ff9
Organize imports
isutton e642982
Adjust APIs to handle multiple related CRs
isutton 7923e8a
Group CRD and CR into RelatedResources
isutton ca56e23
Reorder method definitions
isutton cbe927e
Rename BindingManager to ServiceBinder
isutton a280ee9
Return CR after adding it to known objects
isutton 7b11f10
Return unstructured Deployment
isutton cc3cb7a
Fix an issue where selector could be empty, leading to a nil element …
isutton 35a37e5
Change return type to expose actions collected by FakeDynamicClient
isutton 0344b4b
Convert v1.ConfigMap to Unstructured before adding it to test fixtures
isutton 296c544
Implement ServiceBinder bind tests
isutton bd1d3ed
Add support for multiple backing services
isutton dcc69cd
Fixes go mod invalid pseudo-version error
e75305c
Extracts RelatedResources type to its own file
bc35d12
Extract methods to their own files
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
232 changes: 232 additions & 0 deletions
232
deploy/crds/apps.openshift.io_servicebindingrequests_crd.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,232 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: servicebindingrequests.apps.openshift.io | ||
spec: | ||
group: apps.openshift.io | ||
names: | ||
kind: ServiceBindingRequest | ||
listKind: ServiceBindingRequestList | ||
plural: servicebindingrequests | ||
shortNames: | ||
- sbr | ||
- sbrs | ||
singular: servicebindingrequest | ||
scope: Namespaced | ||
subresources: | ||
status: {} | ||
validation: | ||
openAPIV3Schema: | ||
description: ServiceBindingRequest is the Schema for the servicebindings API | ||
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/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/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
description: ServiceBindingRequestSpec defines the desired state of ServiceBindingRequest | ||
properties: | ||
applicationSelector: | ||
description: ApplicationSelector is used to identify the application | ||
connecting to the backing service operator. | ||
properties: | ||
group: | ||
type: string | ||
matchLabels: | ||
additionalProperties: | ||
type: string | ||
type: object | ||
resource: | ||
type: string | ||
resourceRef: | ||
type: string | ||
version: | ||
type: string | ||
required: | ||
- matchLabels | ||
- resource | ||
- resourceRef | ||
- version | ||
type: object | ||
backingServiceSelector: | ||
description: BackingServiceSelector is used to identify the backing | ||
service operator. | ||
properties: | ||
group: | ||
type: string | ||
kind: | ||
type: string | ||
resourceRef: | ||
type: string | ||
version: | ||
type: string | ||
required: | ||
- group | ||
- kind | ||
- resourceRef | ||
- version | ||
type: object | ||
backingServiceSelectors: | ||
description: BackingServiceSelectors is an slice of BackingServiceSelector | ||
items: | ||
description: BackingServiceSelector defines the selector based on | ||
resource name, version, and resource kind | ||
properties: | ||
group: | ||
type: string | ||
kind: | ||
type: string | ||
resourceRef: | ||
type: string | ||
version: | ||
type: string | ||
required: | ||
- group | ||
- kind | ||
- resourceRef | ||
- version | ||
type: object | ||
type: array | ||
customEnvVar: | ||
description: Custom env variables | ||
items: | ||
description: EnvVar represents an environment variable present in | ||
a Container. | ||
properties: | ||
name: | ||
description: Name of the environment variable. Must be a C_IDENTIFIER. | ||
type: string | ||
value: | ||
description: 'Variable references $(VAR_NAME) are expanded using | ||
the previous defined environment variables in the container | ||
and any service environment variables. If a variable cannot | ||
be resolved, the reference in the input string will be unchanged. | ||
The $(VAR_NAME) syntax can be escaped with a double $$, ie: | ||
$$(VAR_NAME). Escaped references will never be expanded, regardless | ||
of whether the variable exists or not. Defaults to "".' | ||
type: string | ||
valueFrom: | ||
description: Source for the environment variable's value. Cannot | ||
be used if value is not empty. | ||
properties: | ||
configMapKeyRef: | ||
description: Selects a key of a ConfigMap. | ||
properties: | ||
key: | ||
description: The key to select. | ||
type: string | ||
name: | ||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | ||
TODO: Add other useful fields. apiVersion, kind, uid?' | ||
type: string | ||
optional: | ||
description: Specify whether the ConfigMap or its key | ||
must be defined | ||
type: boolean | ||
required: | ||
- key | ||
type: object | ||
fieldRef: | ||
description: 'Selects a field of the pod: supports metadata.name, | ||
metadata.namespace, metadata.labels, metadata.annotations, | ||
spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP.' | ||
properties: | ||
apiVersion: | ||
description: Version of the schema the FieldPath is written | ||
in terms of, defaults to "v1". | ||
type: string | ||
fieldPath: | ||
description: Path of the field to select in the specified | ||
API version. | ||
type: string | ||
required: | ||
- fieldPath | ||
type: object | ||
resourceFieldRef: | ||
description: 'Selects a resource of the container: only resources | ||
limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, | ||
requests.cpu, requests.memory and requests.ephemeral-storage) | ||
are currently supported.' | ||
properties: | ||
containerName: | ||
description: 'Container name: required for volumes, optional | ||
for env vars' | ||
type: string | ||
divisor: | ||
description: Specifies the output format of the exposed | ||
resources, defaults to "1" | ||
type: string | ||
resource: | ||
description: 'Required: resource to select' | ||
type: string | ||
required: | ||
- resource | ||
type: object | ||
secretKeyRef: | ||
description: Selects a key of a secret in the pod's namespace | ||
properties: | ||
key: | ||
description: The key of the secret to select from. Must | ||
be a valid secret key. | ||
type: string | ||
name: | ||
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | ||
TODO: Add other useful fields. apiVersion, kind, uid?' | ||
type: string | ||
optional: | ||
description: Specify whether the Secret or its key must | ||
be defined | ||
type: boolean | ||
required: | ||
- key | ||
type: object | ||
type: object | ||
required: | ||
- name | ||
type: object | ||
type: array | ||
detectBindingResources: | ||
description: DetectBindingResources is flag used to bind all non-bindable | ||
variables from different subresources owned by backing operator CR. | ||
type: boolean | ||
envVarPrefix: | ||
description: EnvVarPrefix is the prefix for environment variables | ||
type: string | ||
mountPathPrefix: | ||
description: MountPathPrefix is the prefix for volume mount | ||
type: string | ||
required: | ||
- applicationSelector | ||
- backingServiceSelector | ||
- backingServiceSelectors | ||
type: object | ||
status: | ||
description: ServiceBindingRequestStatus defines the observed state of ServiceBindingRequest | ||
properties: | ||
applicationObjects: | ||
description: ApplicationObjects contains all the application objects | ||
filtered by label | ||
items: | ||
type: string | ||
type: array | ||
bindingStatus: | ||
description: BindingStatus is the status of the service binding request. | ||
type: string | ||
secret: | ||
description: Secret is the name of the intermediate secret | ||
type: string | ||
type: object | ||
type: object | ||
version: v1alpha1 | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@isutton Could I assign https://issues.redhat.com/browse/APPSVC-324 to you
CC @baijum ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do this change in a separate PR merge it first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure if Igor is ok with it