-
Notifications
You must be signed in to change notification settings - Fork 41
Claimed resources api #185
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
Closed
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
88fecd6
Add fields for claimed resources
lhaendler f0dee16
Add readable prompts for permission claims (#1)
nkkmpf 5f5a8cc
Update pkg/apis/kubebind/v1alpha1/apiservicebinding_types.go
lhaendler 3b991fb
Update pkg/apis/kubebind/v1alpha1/apiservicebinding_types.go
lhaendler 977be31
Remove redundant paragraph
lhaendler 0e45d82
apis: move permission claims to their own file
sttts fbb4984
apis: qualify permission claim types
sttts dc307ba
apis: an attempt on more precise permission claim docs
sttts b67ec95
codegen
sttts 31c7f3c
Update tests
sttts 1ab45c3
Address comments
sttts 81872fb
Small fixes
lhaendler 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,186 @@ | ||
| --- | ||
| apiVersion: apiextensions.k8s.io/v1 | ||
| kind: CustomResourceDefinition | ||
| metadata: | ||
| annotations: | ||
| controller-gen.kubebuilder.io/version: v0.10.0 | ||
| creationTimestamp: null | ||
| name: apiserviceexporttemplates.kube-bind.io | ||
| spec: | ||
| group: kube-bind.io | ||
| names: | ||
| categories: | ||
| - kube-bindings | ||
| kind: APIServiceExportTemplate | ||
| listKind: APIServiceExportTemplateList | ||
| plural: apiserviceexporttemplates | ||
| singular: apiserviceexporttemplate | ||
| scope: Namespaced | ||
| versions: | ||
| - additionalPrinterColumns: | ||
| - jsonPath: .status.conditions[?(@.type=="Established")].status | ||
| name: Established | ||
| priority: 5 | ||
| type: string | ||
| - jsonPath: .metadata.creationTimestamp | ||
| name: Age | ||
| type: date | ||
| name: v1alpha1 | ||
| schema: | ||
| openAPIV3Schema: | ||
| description: APIServiceExportTemplate specifies the resource to be exported. | ||
| It references the CRD to be exported along with additional resources that | ||
| are synchronized from and to the consumer cluster. | ||
| 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' | ||
| 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' | ||
| type: string | ||
| metadata: | ||
| type: object | ||
| spec: | ||
| description: spec specifies the resource. | ||
| properties: | ||
| APIServiceSelector: | ||
| properties: | ||
| group: | ||
| type: string | ||
| resource: | ||
| type: string | ||
| versions: | ||
| items: | ||
| type: string | ||
| type: array | ||
| type: object | ||
| permissionClaims: | ||
| items: | ||
| description: "PermissionClaim selects objects of a GVR that a service | ||
| provider may request and that a consumer may accept and allow | ||
| the service provider access to. \n TODO fix validation +kubebuilder:validation:XValidation:rule=\"!(self.create.donate | ||
| && self.adopt)\",message=\"donate and adopt are mutually exclusive\"" | ||
| properties: | ||
| adopt: | ||
| description: adopt set to true means that objects created by | ||
| the consumer are adopted by the provider. i.e. the provider | ||
| will become the owner. | ||
| type: boolean | ||
| create: | ||
| description: "only for owner Provider \n create determines whether | ||
| the kube-bind konnector will sync matching objects from the | ||
| provider side down to the consumer cluster." | ||
| properties: | ||
| donate: | ||
| description: donate set to true means that a newly created | ||
| object by the provider is immediately owned by the consumer. | ||
| If false, the object stays in ownership of the provider | ||
| type: boolean | ||
| type: object | ||
| global: | ||
| description: Global claims global resources for the given group/resource. | ||
| This is mutually exclusive with resourceSelector. | ||
| type: boolean | ||
| group: | ||
| default: "" | ||
| description: group is the name of an API group. For core groups | ||
| this is the empty string '""'. | ||
| pattern: ^(|[a-z0-9]([-a-z0-9]*[a-z0-9](\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)?)$ | ||
| type: string | ||
| onConflict: | ||
| description: onConflict determines how the conflicts between | ||
| objects on the consumer side will be resolved. | ||
| properties: | ||
| providerOverrides: | ||
| description: providerOverrides will make the provider override | ||
| any object that might already exist in the consumer cluster | ||
| if it has the same namespaced name as a resource created | ||
| by the provider, but is not the result of syncing. | ||
| type: boolean | ||
| recreateWhenConsumerSideDeleted: | ||
| description: recreateWhenConsumerSideDeleted set to true | ||
| means the provider will recreate the object in case the | ||
| object is missing on the consumer side. Even if the consumer | ||
| mistakenly or intentionally deletes the objet, the provider | ||
| will recreate it. If the field is set as false, the provider | ||
| will not recreate the object in case the object is deleted | ||
| on the RecreateWhenConsumerSideDeleted side. | ||
| type: boolean | ||
| type: object | ||
| required: | ||
| description: required indicates whether the APIServiceBinding | ||
| will work if this claim is not accepted. | ||
| type: boolean | ||
| resource: | ||
| description: 'resource is the name of the resource. Note: it | ||
| is worth noting that you can not ask for permissions for resource | ||
| provided by a CRD not provided by an service binding export.' | ||
| pattern: ^[a-z][-a-z0-9]*[a-z0-9]$ | ||
| type: string | ||
| selector: | ||
| description: selector selects which resources are affected by | ||
| this claim. | ||
| properties: | ||
| name: | ||
| description: name of an object within a claimed group/resource. | ||
| It matches the metadata.name field of the underlying object. | ||
| If name is unset, all objects in bound namespaces will | ||
| be claimed. | ||
| maxLength: 253 | ||
| minLength: 1 | ||
| pattern: ^([a-z0-9][-a-z0-9_.]*)?[a-z0-9]$ | ||
| type: string | ||
| owner: | ||
| enum: | ||
| - Provider | ||
| - Consumer | ||
| type: string | ||
| type: object | ||
| update: | ||
| description: update lists a number of claimed permissions for | ||
| the provider. "field" and "preserving" are mutually exclusive. | ||
| properties: | ||
| alwaysRecreate: | ||
| description: alwaysRecreate, when true will make the konnector | ||
| delete the old object and create a new one instead of | ||
| updating. Useful for immutable objects. | ||
| type: boolean | ||
| fields: | ||
| description: fields are the fields owned by the owner of | ||
| the claim. If the owner sets values of those fields, they | ||
| will be synced to the other participant. Mutually exclusive | ||
| with preservings. | ||
| items: | ||
| type: string | ||
| type: array | ||
| preservings: | ||
| description: Preservings are the fields that are preserved | ||
| by the konnector during synchronization. The owner is | ||
| not able to set those fields. If the owner changes the | ||
| value of these fields, their change will be overwritten. | ||
| items: | ||
| type: string | ||
| type: array | ||
| type: object | ||
| version: | ||
| type: string | ||
| required: | ||
| - resource | ||
| - version | ||
| type: object | ||
| type: array | ||
| type: object | ||
| status: | ||
| description: status contains reconciliation information for the resource. | ||
| type: object | ||
| required: | ||
| - spec | ||
| type: object | ||
| served: true | ||
| storage: true | ||
| subresources: | ||
| status: {} |
This file contains hidden or 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 hidden or 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 hidden or 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.
how is the flow? The cli (or some other means under the user identity) creates these acceptable claims and sets the accepted or rejected? What is the consequence of rejected (vs. not being listed)?
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.
rejected claims are not reconciled. Saving them as rejected could allow the user to accept them later on via cli.