-
Notifications
You must be signed in to change notification settings - Fork 17
Gitea helm #174
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
Gitea helm #174
Changes from all commits
75e58f5
f15ff11
a656997
78ab84c
ce92d3d
831ac4b
e467412
081ee0c
59f5986
7adac2b
78b92b1
f9faf3c
7acf6b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| /* | ||
| Copyright 2022. | ||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| package v1alpha1 | ||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop these |
||
| // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
| // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
|
||
| // GiteaServerSpec defines the desired state of GiteaServer | ||
| type GiteaServerSpec struct { | ||
| // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
| // Important: Run "make" to regenerate code after modifying this file | ||
claudiol marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // Helm Chart URL. Default value: https://charts.validatedpatterns.io | ||
| // +operator-sdk:csv:customresourcedefinitions:type=spec,order=1 | ||
| HelmChartUrl string `json:"helmChartUrl,omitempty"` | ||
| // Namespace where helm chart will be deployed to. Default: gitea | ||
| // +operator-sdk:csv:customresourcedefinitions:type=spec,order=2 | ||
| Namespace string `json:"namespace,omitempty"` | ||
claudiol marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Helm Repo name. Default: helm-charts | ||
| // +operator-sdk:csv:customresourcedefinitions:type=spec,order=3 | ||
| RepoName string `json:"repoName,omitempty"` | ||
claudiol marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Chart Name that we will deploy. Default: gitea-chart | ||
| // +operator-sdk:csv:customresourcedefinitions:type=spec,order=4 | ||
| ChartName string `json:"chartName,omitempty"` | ||
claudiol marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Version for the chart. Default: 0.0.3 | ||
| // +operator-sdk:csv:customresourcedefinitions:type=spec,order=5 | ||
| Version string `json:"version,omitempty"` | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. HelmChartVersion?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also how is the version of gitea itself managed? Is this a parameter in the helm chart or is it tightly coupled with the helm chart version? Just asking to make sure we are aware and consciously choosing a path |
||
| // Release name used to deploy the chart. Default: gitea | ||
| // +operator-sdk:csv:customresourcedefinitions:type=spec,order=6 | ||
| ReleaseName string `json:"releaseName,omitempty"` | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This I would drop entirely as it is mostly a hidden implementation detail of helm |
||
| } | ||
|
|
||
| const ( | ||
| GiteaServerFinalizer string = "foregroundDeleteGiteaServer" | ||
| ) | ||
|
|
||
| // GiteaServerStatus defines the observed state of GiteaServer | ||
| type GiteaServerStatus struct { | ||
| // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
| // Important: Run "make" to regenerate code after modifying this file | ||
|
Comment on lines
+57
to
+58
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop these |
||
|
|
||
| // Status of the chart | ||
| ChartStatus string `json:"chartStatus,omitempty"` | ||
|
|
||
| // Route for the service | ||
| Route string `json:"route,omitempty"` | ||
|
|
||
| // Last action related to the Gitea deployment | ||
| // +operator-sdk:csv:customresourcedefinitions:type=status | ||
| LastStep string `json:"lastStep,omitempty"` | ||
|
|
||
| // Last error encountered by the pattern | ||
| // +operator-sdk:csv:customresourcedefinitions:type=status | ||
| LastError string `json:"lastError,omitempty"` | ||
| } | ||
|
|
||
| //+kubebuilder:object:root=true | ||
| //+kubebuilder:subresource:status | ||
|
|
||
| // GiteaServer is the Schema for the giteaservers API | ||
| type GiteaServer struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Spec GiteaServerSpec `json:"spec,omitempty"` | ||
| Status GiteaServerStatus `json:"status,omitempty"` | ||
| } | ||
|
|
||
| //+kubebuilder:object:root=true | ||
|
|
||
| // GiteaServerList contains a list of GiteaServer | ||
| type GiteaServerList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []GiteaServer `json:"items"` | ||
| } | ||
|
|
||
| func init() { | ||
| SchemeBuilder.Register(&GiteaServer{}, &GiteaServerList{}) | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| apiVersion: apiextensions.k8s.io/v1 | ||
| kind: CustomResourceDefinition | ||
| metadata: | ||
| annotations: | ||
| controller-gen.kubebuilder.io/version: v0.11.4 | ||
| creationTimestamp: null | ||
| name: giteaservers.gitops.hybrid-cloud-patterns.io | ||
| spec: | ||
| group: gitops.hybrid-cloud-patterns.io | ||
| names: | ||
| kind: GiteaServer | ||
| listKind: GiteaServerList | ||
| plural: giteaservers | ||
| singular: giteaserver | ||
| scope: Namespaced | ||
| versions: | ||
| - name: v1alpha1 | ||
| schema: | ||
| openAPIV3Schema: | ||
| description: GiteaServer is the Schema for the giteaservers 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/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: GiteaServerSpec defines the desired state of GiteaServer | ||
| properties: | ||
| chartName: | ||
| type: string | ||
| helmChartUrl: | ||
| type: string | ||
| namespace: | ||
| type: string | ||
| releaseName: | ||
| type: string | ||
| repoName: | ||
| type: string | ||
| type: object | ||
| status: | ||
| description: GiteaServerStatus defines the observed state of GiteaServer | ||
| properties: | ||
| chartStatus: | ||
| description: Status of the chart | ||
| type: string | ||
| lastError: | ||
| description: Last error encountered by the pattern | ||
| type: string | ||
| lastStep: | ||
| description: Last action related to the Gitea deployment | ||
| type: string | ||
| route: | ||
| description: Route for the service | ||
| type: string | ||
| type: object | ||
| type: object | ||
| served: true | ||
| storage: true | ||
| subresources: | ||
| status: {} | ||
| status: | ||
| acceptedNames: | ||
| kind: "" | ||
| plural: "" | ||
| conditions: null | ||
| storedVersions: null |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| creationTimestamp: null | ||
| name: patterns-operator-manager-role | ||
| rules: | ||
| - apiGroups: | ||
| - route.openshift.io | ||
| resources: | ||
| - routes | ||
| - routes/custom-host | ||
| verbs: | ||
| - create | ||
| - delete | ||
| - get | ||
| - list | ||
| - patch | ||
| - update | ||
| - watch |
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.
You do not need this, when you instance
settings = cli.New()you get an EnvSettings dict and there you can overrideRepositoryConfigandRepositoryCacheto something writable. I think you can totally use/tmpfor this