-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a new util package for gitea and moved there: const and funct…
…ion(s) Signed-off-by: cmoulliard <[email protected]>
- Loading branch information
1 parent
d1ed81a
commit f0754f7
Showing
3 changed files
with
47 additions
and
44 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package util | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
const ( | ||
// hardcoded values from what we have in the yaml installation file. | ||
GiteaNamespace = "gitea" | ||
GiteaAdminSecret = "gitea-credential" | ||
GiteaAdminTokenName = "admin" | ||
GiteaAdminTokenFieldName = "token" | ||
// this is the URL accessible outside cluster. resolves to localhost | ||
GiteaIngressURL = "%s://gitea.cnoe.localtest.me:%s" | ||
// this is the URL accessible within cluster for ArgoCD to fetch resources. | ||
// resolves to cluster ip | ||
GiteaSvcURL = "%s://%s%s:%s%s" | ||
) | ||
|
||
func GiteaAdminSecretObject() corev1.Secret { | ||
return corev1.Secret{ | ||
TypeMeta: metav1.TypeMeta{ | ||
Kind: "Secret", | ||
APIVersion: "v1", | ||
}, | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: GiteaAdminSecret, | ||
Namespace: GiteaNamespace, | ||
}, | ||
} | ||
} |