|
| 1 | +/* |
| 2 | +Copyright 2023. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package v1beta1 |
| 18 | + |
| 19 | +import ( |
| 20 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 21 | +) |
| 22 | + |
| 23 | +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! |
| 24 | +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. |
| 25 | + |
| 26 | +// GlobalRepositorySpec defines the desired state of GlobalRepository |
| 27 | +type GlobalRepositorySpec struct { |
| 28 | + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster |
| 29 | + // Important: Run "make" to regenerate code after modifying this file |
| 30 | + |
| 31 | + // GitHub Org |
| 32 | + Organization string `json:"organization"` |
| 33 | + // A short description of the repository that will show up on GitHub |
| 34 | + Description *string `json:"description,omitempty"` |
| 35 | + // A URL with more information about the repository |
| 36 | + Homepage *string `json:"homepage,omitempty"` |
| 37 | + // A list of topics to set on the repository - can alternatively set like this: [github, probot, new-topic, another-topic, topic-12] |
| 38 | + Topics []string `json:"topics,omitempty"` |
| 39 | + // Either `true` to make the repository private, or `false` to make it public. |
| 40 | + Private *bool `json:"private,omitempty"` |
| 41 | + // Either `true` to enable issues for this repository, `false` to disable them. |
| 42 | + HasIssues *bool `json:"hasIssues,omitempty"` |
| 43 | + // Either `true` to enable pages for this repository, `false` to disable them. |
| 44 | + HasPages *bool `json:"hasPages,omitempty"` |
| 45 | + // Either `true` to enable projects for this repository, or `false` to disable them. |
| 46 | + HasProjects *bool `json:"hasProjects,omitempty"` |
| 47 | + // Either `true` to enable the wiki for this repository, `false` to disable it. |
| 48 | + HasWiki *bool `json:"hasWiki,omitempty"` |
| 49 | + // The default branch for this repository. |
| 50 | + DefaultBranch *string `json:"defaultBranch,omitempty"` |
| 51 | + // Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. |
| 52 | + AllowSquashMerge *bool `json:"allowSquashMerge,omitempty"` |
| 53 | + // Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. |
| 54 | + AllowMergeCommit *bool `json:"allowMergeCommit,omitempty"` |
| 55 | + // Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. |
| 56 | + AllowRebaseMerge *bool `json:"allowRebaseMerge,omitempty"` |
| 57 | + // Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. |
| 58 | + AllowAutoMerge *bool `json:"allowAutoMerge,omitempty"` |
| 59 | + // Either `true` to allow automatically deleting head branches, when pull requests are merged, or `false` to prevent automatic deletion. |
| 60 | + DeleteBranchOnMerge *bool `json:"deleteBranchOnMerge,omitempty"` |
| 61 | + // Either `true` if its a template repo, false if its not |
| 62 | + IsTemplate *bool `json:"isTemplate,omitempty"` |
| 63 | + // Can be one of: PR_TITLE, COMMIT_OR_PR_TITLE |
| 64 | + SquashMergeCommitTitle *string `json:"squashMergeCommitTitle,omitempty"` |
| 65 | + // Can be one of: PR_BODY, COMMIT_MESSAGES, BLANK |
| 66 | + SquashMergeCommitMessage *string `json:"squashMergeCommitMessage,omitempty"` |
| 67 | + // Can be one of: PR_TITLE, MERGE_MESSAGE |
| 68 | + MergeCommitTitle *string `json:"mergeCommitTitle,omitempty"` |
| 69 | + // Can be one of: PR_BODY, PR_TITLE, BLANK |
| 70 | + MergeCommitMessage *string `json:"mergeCommitMessage,omitempty"` |
| 71 | + |
| 72 | + RepositoryCollaborators *RepositoryCollaborators `json:"repositoryCollaborators,omitempty"` |
| 73 | +} |
| 74 | + |
| 75 | +// GlobalRepositoryStatus defines the observed state of GlobalRepository |
| 76 | +type GlobalRepositoryStatus struct { |
| 77 | + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster |
| 78 | + // Important: Run "make" to regenerate code after modifying this file |
| 79 | +} |
| 80 | + |
| 81 | +//+kubebuilder:object:root=true |
| 82 | +//+kubebuilder:subresource:status |
| 83 | + |
| 84 | +// GlobalRepository is the Schema for the globalrepositories API |
| 85 | +type GlobalRepository struct { |
| 86 | + metav1.TypeMeta `json:",inline"` |
| 87 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 88 | + |
| 89 | + Spec GlobalRepositorySpec `json:"spec,omitempty"` |
| 90 | + Status GlobalRepositoryStatus `json:"status,omitempty"` |
| 91 | +} |
| 92 | + |
| 93 | +//+kubebuilder:object:root=true |
| 94 | + |
| 95 | +// GlobalRepositoryList contains a list of GlobalRepository |
| 96 | +type GlobalRepositoryList struct { |
| 97 | + metav1.TypeMeta `json:",inline"` |
| 98 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 99 | + Items []GlobalRepository `json:"items"` |
| 100 | +} |
| 101 | + |
| 102 | +func init() { |
| 103 | + SchemeBuilder.Register(&GlobalRepository{}, &GlobalRepositoryList{}) |
| 104 | +} |
0 commit comments