Repository navigation
feat(crd): define Namespace spec and validation #25
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9ca6e1b
feat(crd): define Namespace spec and validation
tomba7 01a7021
test(e2e): replace patched manifests with static fixtures
tomba7 624b767
refactor(crd): rename Namespace ProjectID field to Project
tomba7 7ab78a1
feat(crd): add shared Cloud resource types
tomba7 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 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 |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| .idea | ||
| *.swp | ||
| *.swo | ||
| *~ | ||
|
|
||
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
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,4 @@ | ||
| // Package common contains API types shared by the Temporal Cloud resource | ||
| // CRDs. | ||
| // +k8s:deepcopy-gen=package | ||
| package common |
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,10 @@ | ||
| package common | ||
|
|
||
| // LifecycleSpec configures lifecycle settings for a Temporal Cloud resource. | ||
| // Maps to Temporal Cloud proto `LifecycleSpec`. | ||
| type LifecycleSpec struct { | ||
| // EnableDeleteProtection prevents the resource from being deleted. | ||
| // Maps to Temporal Cloud proto `LifecycleSpec.enable_delete_protection`. | ||
| // +optional | ||
| EnableDeleteProtection bool `json:"enableDeleteProtection,omitempty"` | ||
| } |
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,72 @@ | ||
| package common | ||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| // ResourceStatus describes the state of a Temporal Cloud resource as reported | ||
| // by Temporal Cloud. Not every resource type reports every field. Fields that | ||
| // a resource type does not report are left unset. | ||
| // | ||
| // Ref: https://github.com/temporalio/cloud-api/blob/main/temporal/api/cloud/resource/v1/message.proto | ||
| type ResourceStatus struct { | ||
| // ID is the identifier Temporal Cloud uses for the resource. Not set for | ||
| // resources that Temporal Cloud identifies by name. | ||
| // Maps to Temporal Cloud proto `id`, or `Namespace.namespace` for | ||
| // Namespaces. | ||
| // +optional | ||
| ID string `json:"id,omitempty"` | ||
| // ResourceVersion is the version of the resource in Temporal Cloud. It is | ||
| // sent with each update and delete request. | ||
| // Maps to Temporal Cloud proto `resource_version`. | ||
| // +optional | ||
| ResourceVersion string `json:"resourceVersion,omitempty"` | ||
| // State is the state of the resource in Temporal Cloud. | ||
| // Maps to Temporal Cloud proto `state`. | ||
| // +optional | ||
| State ResourceState `json:"state,omitempty"` | ||
| // AsyncOperationID is the ID of the most recent asynchronous operation | ||
| // started on the resource. | ||
| // Maps to Temporal Cloud proto `async_operation_id`. | ||
| // +optional | ||
| AsyncOperationID string `json:"asyncOperationID,omitempty"` | ||
| // CreatedTime is when the resource was created in Temporal Cloud. | ||
| // Maps to Temporal Cloud proto `created_time`. | ||
| // +optional | ||
| CreatedTime *metav1.Time `json:"createdTime,omitempty"` | ||
| // LastModifiedTime is when the resource was last modified in Temporal | ||
| // Cloud. | ||
| // Maps to Temporal Cloud proto `last_modified_time`. | ||
| // +optional | ||
| LastModifiedTime *metav1.Time `json:"lastModifiedTime,omitempty"` | ||
| } | ||
|
|
||
| // ResourceState is the state of a resource in Temporal Cloud. | ||
| // Maps to Temporal Cloud proto `ResourceState`. | ||
| // +kubebuilder:validation:Enum=Activating;ActivationFailed;Active;Updating;UpdateFailed;Deleting;DeleteFailed;Deleted;Suspended;Expired | ||
| type ResourceState string | ||
|
|
||
| const ( | ||
| // ResourceStateActivating means the resource is being activated. | ||
| ResourceStateActivating ResourceState = "Activating" | ||
| // ResourceStateActivationFailed means the resource failed to activate. | ||
| ResourceStateActivationFailed ResourceState = "ActivationFailed" | ||
| // ResourceStateActive means the resource is active and ready to use. | ||
| ResourceStateActive ResourceState = "Active" | ||
| // ResourceStateUpdating means the resource is being updated. | ||
| ResourceStateUpdating ResourceState = "Updating" | ||
| // ResourceStateUpdateFailed means the resource failed to update. | ||
| ResourceStateUpdateFailed ResourceState = "UpdateFailed" | ||
| // ResourceStateDeleting means the resource is being deleted. | ||
| ResourceStateDeleting ResourceState = "Deleting" | ||
| // ResourceStateDeleteFailed means the resource failed to delete. | ||
| ResourceStateDeleteFailed ResourceState = "DeleteFailed" | ||
| // ResourceStateDeleted means the resource has been deleted. | ||
| ResourceStateDeleted ResourceState = "Deleted" | ||
| // ResourceStateSuspended means the resource is suspended and not | ||
| // available for use. | ||
| ResourceStateSuspended ResourceState = "Suspended" | ||
| // ResourceStateExpired means the resource has expired and is no longer | ||
| // available for use. | ||
| ResourceStateExpired ResourceState = "Expired" | ||
| ) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.