UNCLASSIFIED

Commit 09ef6eeb authored by Jason van Brackel's avatar Jason van Brackel
Browse files

feat: Add CI Config file to project reconciler

parent 19224546
......@@ -101,7 +101,7 @@ resources:
controller: true
domain: valkyrie.dso.mil
group: gitlab
kind: GitlabCredentials
kind: GitLabCredentials
path: valkyrie.dso.mil/valkyrie-api/apis/gitlab/v1alpha1
version: v1alpha1
- api:
......
......@@ -12,14 +12,14 @@ import (
)
const (
errorUnableToFetchGitlabCredentials = "unable to fetch gitlab credentials"
errorUnableToFetchGitLabCredentials = "unable to fetch gitlab credentials"
errorUnableToFetchSecret = "unable to fetch secret from gitlab credentials"
errorUnableToCreateGitlabClient = "unable to create gitlab client"
errorUnableToCreateGitLabClient = "unable to create gitlab client"
)
// ClientConfiguration represents an object whose purpose is to setup a Gitlab client given
// ClientConfiguration represents an object whose purpose is to setup a GitLab client given
type ClientConfiguration interface {
// SetupClient pulls the GitlabCredentials from Kubernetes and supplies the Gitlab user and access token.
// SetupClient pulls the GitLabCredentials from Kubernetes and supplies the GitLab user and access token.
SetupClient(client client.Client, credentialsName string) (gitlabClient.Client, error)
}
......@@ -31,18 +31,18 @@ type ClientConfigurationImpl struct {
Req ctrl.Request
}
// SetupClient looks up the gitlab credentials to get the access token and username for connecting to Gitlab
// SetupClient looks up the gitlab credentials to get the access token and username for connecting to GitLab
// on behalf of the reconciler.
func (c ClientConfigurationImpl) SetupClient(client client.Client, credentialsName string) (gitlabClient.Client, error) {
// Get the Gitlab Credentials
// Get the GitLab Credentials
var gitLabCredentialsName = types.NamespacedName{
Namespace: c.Req.Namespace,
Name: credentialsName,
}
var gitlabCredentials gitlabv1alpha1.GitlabCredentials
var gitlabCredentials gitlabv1alpha1.GitLabCredentials
if err := client.Get(c.Ctx, gitLabCredentialsName, &gitlabCredentials); err != nil {
c.Log.Error(err, errorUnableToFetchGitlabCredentials)
c.Log.Error(err, errorUnableToFetchGitLabCredentials)
return nil, err
}
......@@ -58,13 +58,13 @@ func (c ClientConfigurationImpl) SetupClient(client client.Client, credentialsNa
return nil, err
}
// Login to Gitlab
// Login to GitLab
var accessToken = string(secret.Data[gitlabCredentials.Spec.AccessTokenKey])
var returnClient gitlabClient.Client
var err error
if returnClient, err = gitlabClient.NewClient(accessToken, gitlabCredentials.Spec.URL, nil); err != nil {
c.Log.Error(err, errorUnableToCreateGitlabClient, "username", gitlabCredentials.Spec.Username, "url", gitlabCredentials.Spec.URL)
c.Log.Error(err, errorUnableToCreateGitLabClient, "username", gitlabCredentials.Spec.Username, "url", gitlabCredentials.Spec.URL)
return nil, err
}
......
......@@ -26,8 +26,8 @@ type DNSRepoCredentialSpec struct {
// RepoURL is the url for the DNS git repository. For example: https://code.il2.dso.mil/platform-one/products/valkyrie/dso-dns.git
RepoURL string `json:"repoUrl,omitempty"`
// GitlabProjectID is the project ID of the DNS project in Gitlab
GitlabProjectID int `json:"gitlabProjectId,omitempty"`
// GitLabProjectID is the project ID of the DNS project in GitLab
GitLabProjectID int `json:"gitlabProjectId,omitempty"`
// UsernameSecRef is the username of project bot will be used to clone the repo
UsernameSecRef v1.SecretKeySelector `json:"usernameSecretRef,omitempty"`
......
......@@ -69,7 +69,7 @@ func initVarsDNSRepoCredential() testVarsDNSRepoCredential {
// leave scaffold Foo value for testing?
testVars.testObjectSpec1 = DNSRepoCredentialSpec{
RepoURL: "https://test.git",
GitlabProjectID: 4351,
GitLabProjectID: 4351,
UsernameSecRef: v1.SecretKeySelector{
LocalObjectReference: v1.LocalObjectReference{Name: "secret"},
Key: "username",
......@@ -81,7 +81,7 @@ func initVarsDNSRepoCredential() testVarsDNSRepoCredential {
}
testVars.testObjectSpec2 = DNSRepoCredentialSpec{
RepoURL: "https://test22.git",
GitlabProjectID: 4351,
GitLabProjectID: 4351,
UsernameSecRef: v1.SecretKeySelector{
LocalObjectReference: v1.LocalObjectReference{Name: "secret"},
Key: "username",
......
......@@ -21,24 +21,24 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// GitlabCredentialsSpec defines the desired state of GitlabCredentials, this stores a Gitlab username
// and Access Token for communicating with the Gitlab API.
type GitlabCredentialsSpec struct {
// GitLabCredentialsSpec defines the desired state of GitLabCredentials, this stores a GitLab username
// and Access Token for communicating with the GitLab API.
type GitLabCredentialsSpec struct {
// URL is the url for the GitLab API that will be contacted.
URL string `json:"url,omitempty"`
// Username is the Gitlab username for the account that will be communicating with the Gitlab API
// Username is the GitLab username for the account that will be communicating with the GitLab API
Username string `json:"username,omitempty"`
//AccessToken is the SecretRef to the secret containing the Gitlab Access Token for the user.
//AccessToken is the SecretRef to the secret containing the GitLab Access Token for the user.
AccessToken v1.SecretReference `json:"accessToken,omitempty"`
//AccessTokenKey is the key of the secret data that contains the Gitlab Access Token for the user.
//AccessTokenKey is the key of the secret data that contains the GitLab Access Token for the user.
AccessTokenKey string `json:"accessTokenKey"`
}
// GitlabCredentialsStatus defines the observed state of GitlabCredentials
type GitlabCredentialsStatus struct {
// GitLabCredentialsStatus defines the observed state of GitLabCredentials
type GitLabCredentialsStatus struct {
// LastUsedTime is the time that this credential was last used to access a GitLab API
LastUsedDate metav1.Time `json:"lastUsedDate"`
}
......@@ -46,24 +46,24 @@ type GitlabCredentialsStatus struct {
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// GitlabCredentials is the Schema for the gitlabcredentials API
type GitlabCredentials struct {
// GitLabCredentials is the Schema for the gitlabcredentials API
type GitLabCredentials struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec GitlabCredentialsSpec `json:"spec,omitempty"`
Status GitlabCredentialsStatus `json:"status,omitempty"`
Spec GitLabCredentialsSpec `json:"spec,omitempty"`
Status GitLabCredentialsStatus `json:"status,omitempty"`
}
//+kubebuilder:object:root=true
// GitlabCredentialsList contains a list of GitlabCredentials
type GitlabCredentialsList struct {
// GitLabCredentialsList contains a list of GitLabCredentials
type GitLabCredentialsList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []GitlabCredentials `json:"items"`
Items []GitLabCredentials `json:"items"`
}
func init() {
SchemeBuilder.Register(&GitlabCredentials{}, &GitlabCredentialsList{})
SchemeBuilder.Register(&GitLabCredentials{}, &GitLabCredentialsList{})
}
......@@ -12,7 +12,7 @@ import (
)
// Reusable test variables
type testVarsGitlabcredentials = struct {
type testVarsGitLabcredentials = struct {
testKind string
testApiversion string
testSpec string
......@@ -23,24 +23,24 @@ type testVarsGitlabcredentials = struct {
expectedSpec string
expectedStatus string
testObject1 GitlabCredentials
testObject2 GitlabCredentials
testObject1 GitLabCredentials
testObject2 GitLabCredentials
objectItems1 []GitlabCredentials
objectList1 GitlabCredentialsList
objectItems1 []GitLabCredentials
objectList1 GitLabCredentialsList
objectItems2 []GitlabCredentials
objectList2 GitlabCredentialsList
objectItems2 []GitLabCredentials
objectList2 GitLabCredentialsList
testObjectSpec1 GitlabCredentialsSpec
testObjectSpec2 GitlabCredentialsSpec
testObjectSpec1 GitLabCredentialsSpec
testObjectSpec2 GitLabCredentialsSpec
testObjectStatus1 GitlabCredentialsStatus
testObjectStatus2 GitlabCredentialsStatus
testObjectStatus1 GitLabCredentialsStatus
testObjectStatus2 GitLabCredentialsStatus
}
func initVarsGitlabCredentials() testVarsGitlabcredentials {
testVars := testVarsGitlabcredentials{}
func initVarsGitLabCredentials() testVarsGitLabcredentials {
testVars := testVarsGitLabcredentials{}
testVars.testKind = "TestKind"
testVars.testApiversion = "v22"
......@@ -53,27 +53,27 @@ func initVarsGitlabCredentials() testVarsGitlabcredentials {
testVars.expectedStatus = testVars.testStatus
var object1Metatype metav1.TypeMeta = metav1.TypeMeta{Kind: testVars.testKind, APIVersion: testVars.testApiversion}
testVars.testObject1 = GitlabCredentials{TypeMeta: object1Metatype}
testVars.testObject1 = GitLabCredentials{TypeMeta: object1Metatype}
var object2Metatype metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind2", APIVersion: "V99"}
testVars.testObject2 = GitlabCredentials{TypeMeta: object2Metatype}
testVars.testObject2 = GitLabCredentials{TypeMeta: object2Metatype}
var objectList1Metatype metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind_List", APIVersion: "V12"}
var objectItems1 []GitlabCredentials = []GitlabCredentials{testVars.testObject1, testVars.testObject2}
testVars.objectList1 = GitlabCredentialsList{TypeMeta: objectList1Metatype, Items: objectItems1}
var objectItems1 []GitLabCredentials = []GitLabCredentials{testVars.testObject1, testVars.testObject2}
testVars.objectList1 = GitLabCredentialsList{TypeMeta: objectList1Metatype, Items: objectItems1}
var objectList2Metatype metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind_List", APIVersion: "V12"}
var objectItems2 []GitlabCredentials = []GitlabCredentials{testVars.testObject2}
testVars.objectList2 = GitlabCredentialsList{TypeMeta: objectList2Metatype, Items: objectItems2}
var objectItems2 []GitLabCredentials = []GitLabCredentials{testVars.testObject2}
testVars.objectList2 = GitLabCredentialsList{TypeMeta: objectList2Metatype, Items: objectItems2}
testVars.testObjectSpec1 = GitlabCredentialsSpec{
testVars.testObjectSpec1 = GitLabCredentialsSpec{
URL: "https://example1.com",
Username: "",
AccessToken: v1.SecretReference{
Name: "mySecret",
Namespace: "aNamespace",
}}
testVars.testObjectSpec2 = GitlabCredentialsSpec{
testVars.testObjectSpec2 = GitLabCredentialsSpec{
URL: "https://example.com",
Username: "user2",
AccessToken: v1.SecretReference{
......@@ -83,12 +83,12 @@ func initVarsGitlabCredentials() testVarsGitlabcredentials {
}
// leave scaffold Foo value for testing?
testVars.testObjectStatus1 = GitlabCredentialsStatus{
testVars.testObjectStatus1 = GitLabCredentialsStatus{
LastUsedDate: metav1.Time{
Time: time.Now(),
},
}
testVars.testObjectStatus2 = GitlabCredentialsStatus{
testVars.testObjectStatus2 = GitLabCredentialsStatus{
LastUsedDate: metav1.Time{
Time: time.Now(),
},
......@@ -97,7 +97,7 @@ func initVarsGitlabCredentials() testVarsGitlabcredentials {
return testVars
}
func TestGroupVars_GitlabCredentials(t *testing.T) {
func TestGroupVars_GitLabCredentials(t *testing.T) {
xType := reflect.TypeOf(GroupVersion)
// convert object type to string
......@@ -110,9 +110,9 @@ func TestGroupVars_GitlabCredentials(t *testing.T) {
t.Log("Success")
}
// Test Type called GitlabCredentials
func TestTypes_GitlabCredentials(t *testing.T) {
testVariables := initVarsGitlabCredentials()
// Test Type called GitLabCredentials
func TestTypes_GitLabCredentials(t *testing.T) {
testVariables := initVarsGitLabCredentials()
want := testVariables.expectedApiversion
got := testVariables.testObject1.APIVersion
......@@ -123,8 +123,8 @@ func TestTypes_GitlabCredentials(t *testing.T) {
}
// DeepCopy
func TestDeepCopy_DeepCopy_GitlabCredentials(t *testing.T) {
testVariables := initVarsGitlabCredentials()
func TestDeepCopy_DeepCopy_GitLabCredentials(t *testing.T) {
testVariables := initVarsGitLabCredentials()
newObject := testVariables.testObject1.DeepCopy()
......@@ -144,7 +144,7 @@ func TestDeepCopy_DeepCopy_GitlabCredentials(t *testing.T) {
t.Errorf("got %s want %s", got, want)
}
var nilTestPtr *GitlabCredentials = nil
var nilTestPtr *GitLabCredentials = nil
var val = nilTestPtr.DeepCopyObject()
if val != nil {
t.Errorf("got %s want %s", "not nil", "nil")
......@@ -153,8 +153,8 @@ func TestDeepCopy_DeepCopy_GitlabCredentials(t *testing.T) {
t.Log("Success")
}
func TestDeepCopy_DeepCopyInto_GitlabCredentials(t *testing.T) {
testVariables := initVarsGitlabCredentials()
func TestDeepCopy_DeepCopyInto_GitLabCredentials(t *testing.T) {
testVariables := initVarsGitLabCredentials()
testVariables.testObject1.DeepCopyInto(&testVariables.testObject2)
......@@ -167,11 +167,11 @@ func TestDeepCopy_DeepCopyInto_GitlabCredentials(t *testing.T) {
t.Log("Success")
}
func TestDeepCopy_DeepCopyObject_GitlabCredentials(t *testing.T) {
testVariables := initVarsGitlabCredentials()
func TestDeepCopy_DeepCopyObject_GitLabCredentials(t *testing.T) {
testVariables := initVarsGitLabCredentials()
newRuntimeObject := testVariables.testObject1.DeepCopyObject()
newObject := newRuntimeObject.(*GitlabCredentials)
newObject := newRuntimeObject.(*GitLabCredentials)
got := newObject.APIVersion
want := testVariables.expectedApiversion
......@@ -181,8 +181,8 @@ func TestDeepCopy_DeepCopyObject_GitlabCredentials(t *testing.T) {
t.Log("Success")
}
func TestDeepCopy_DeepCopyList_GitlabCredentials(t *testing.T) {
testVariables := initVarsGitlabCredentials()
func TestDeepCopy_DeepCopyList_GitLabCredentials(t *testing.T) {
testVariables := initVarsGitLabCredentials()
newObjectList := testVariables.objectList1.DeepCopy()
got := newObjectList.Items[0].APIVersion
......@@ -193,7 +193,7 @@ func TestDeepCopy_DeepCopyList_GitlabCredentials(t *testing.T) {
}
// a typed pointer set to nil
var nilTestPtr *GitlabCredentialsList = nil
var nilTestPtr *GitLabCredentialsList = nil
var val = nilTestPtr.DeepCopy()
if val != nil {
t.Errorf("got %s want %s", "not nil", "nil")
......@@ -201,8 +201,8 @@ func TestDeepCopy_DeepCopyList_GitlabCredentials(t *testing.T) {
t.Log("Success")
}
func TestDeepCopy_DeepCopyIntoList_GitlabCredentials(t *testing.T) {
testVariables := initVarsGitlabCredentials()
func TestDeepCopy_DeepCopyIntoList_GitLabCredentials(t *testing.T) {
testVariables := initVarsGitLabCredentials()
testVariables.objectList1.DeepCopyInto(&testVariables.objectList2)
......@@ -215,11 +215,11 @@ func TestDeepCopy_DeepCopyIntoList_GitlabCredentials(t *testing.T) {
t.Log("Success")
}
func TestDeepCopy_DeepCopyListObject_GitlabCredentials(t *testing.T) {
testVariables := initVarsGitlabCredentials()
func TestDeepCopy_DeepCopyListObject_GitLabCredentials(t *testing.T) {
testVariables := initVarsGitLabCredentials()
newRuntimeObject := testVariables.objectList1.DeepCopyObject()
newObject := newRuntimeObject.(*GitlabCredentialsList)
newObject := newRuntimeObject.(*GitLabCredentialsList)
got := newObject.Items[0].APIVersion
want := testVariables.expectedApiversion
......@@ -227,7 +227,7 @@ func TestDeepCopy_DeepCopyListObject_GitlabCredentials(t *testing.T) {
t.Errorf("got %s want %s", got, want)
}
var nilTestPtr *GitlabCredentialsList = nil
var nilTestPtr *GitLabCredentialsList = nil
var val = nilTestPtr.DeepCopyObject()
if val != nil {
t.Errorf("got %s want %s", "not nil", "nil")
......@@ -236,8 +236,8 @@ func TestDeepCopy_DeepCopyListObject_GitlabCredentials(t *testing.T) {
t.Log("Success")
}
func TestDeepCopy_DeepCopySpec_GitlabCredentials(t *testing.T) {
testVariables := initVarsGitlabCredentials()
func TestDeepCopy_DeepCopySpec_GitLabCredentials(t *testing.T) {
testVariables := initVarsGitLabCredentials()
newObjectList := testVariables.testObjectSpec1.DeepCopy()
......@@ -245,7 +245,7 @@ func TestDeepCopy_DeepCopySpec_GitlabCredentials(t *testing.T) {
Expect(newObjectList).To(Equal(testVariables.testObjectSpec1))
})
var nilTestPtr *GitlabCredentialsSpec = nil
var nilTestPtr *GitLabCredentialsSpec = nil
var val = nilTestPtr.DeepCopy()
if val != nil {
t.Errorf("got %s want %s", "not nil", "nil")
......@@ -253,8 +253,8 @@ func TestDeepCopy_DeepCopySpec_GitlabCredentials(t *testing.T) {
t.Log("Success")
}
func TestDeepCopy_DeepCopySpecInto_GitlabCredentials(t *testing.T) {
testVariables := initVarsGitlabCredentials()
func TestDeepCopy_DeepCopySpecInto_GitLabCredentials(t *testing.T) {
testVariables := initVarsGitLabCredentials()
testVariables.testObjectSpec1.DeepCopyInto(&testVariables.testObjectSpec2)
......@@ -263,8 +263,8 @@ func TestDeepCopy_DeepCopySpecInto_GitlabCredentials(t *testing.T) {
})
}
func TestDeepCopy_DeepCopyStatus_GitlabCredentials(t *testing.T) {
testVariables := initVarsGitlabCredentials()
func TestDeepCopy_DeepCopyStatus_GitLabCredentials(t *testing.T) {
testVariables := initVarsGitLabCredentials()
newObjectStatus := testVariables.testObjectStatus1.DeepCopy()
......@@ -273,7 +273,7 @@ func TestDeepCopy_DeepCopyStatus_GitlabCredentials(t *testing.T) {
})
// a typed pointer set to nil
var nilTestPtr *GitlabCredentialsStatus = nil
var nilTestPtr *GitLabCredentialsStatus = nil
var val = nilTestPtr.DeepCopy()
if val != nil {
t.Errorf("got %s want %s", "not nil", "nil")
......@@ -282,8 +282,8 @@ func TestDeepCopy_DeepCopyStatus_GitlabCredentials(t *testing.T) {
t.Log("Success")
}
func TestDeepCopy_DeepCopyStatusInto_GitlabCredentials(t *testing.T) {
testVariables := initVarsGitlabCredentials()
func TestDeepCopy_DeepCopyStatusInto_GitLabCredentials(t *testing.T) {
testVariables := initVarsGitLabCredentials()
testVariables.testObjectStatus1.DeepCopyInto(&testVariables.testObjectStatus2)
......
......@@ -26,17 +26,17 @@ type GroupSpec struct {
// +kubebuilder:validation:required
FullPath string `json:"path"`
// Name is the name of the Group and will be used as part of the URL in Gitlab
// Name is the name of the Group and will be used as part of the URL in GitLab
// +kubebuilder:validation:Required
Name string `json:"name"`
// Description is the Gitlab Description for the group
// Description is the GitLab Description for the group
// +kubebuilder:validation:optional
Description string `json:"description"`
// GitlabCredentialsName is the name of the object in this namespace that contains authentication
// GitLabCredentialsName is the name of the object in this namespace that contains authentication
// information for logging into the
GitlabCredentialsName string `json:"gitlabCredentialsName"`
GitLabCredentialsName string `json:"gitlabCredentialsName"`
// KustomizeProductionPath is the relative path for the kustomization manifest for production use
// +kubebuilder:validation:required
......
......@@ -69,12 +69,12 @@ func initVarsGroup() testVarsGroup {
testVars.testObjectSpec1 = GroupSpec{
Name: "testGroup1",
GitlabCredentialsName: "nameOfTheCredentials",
GitLabCredentialsName: "nameOfTheCredentials",
Description: "testDescription1",
}
testVars.testObjectSpec2 = GroupSpec{
Name: "testGroup2",
GitlabCredentialsName: "nameOfCredentials2",
GitLabCredentialsName: "nameOfCredentials2",
ProjectSpecs: nil,
Description: "testDescription2",
}
......
......@@ -34,9 +34,9 @@ type ProjectSpec struct {
// +kubebuilder:validation:required
FullPath string `json:"path"`
// GitlabCredentialsName is the name of the object in this namespace that contains authentication
// GitLabCredentialsName is the name of the object in this namespace that contains authentication
// information for logging into the
GitlabCredentialsName string `json:"gitlabCredentialsName"`
GitLabCredentialsName string `json:"gitlabCredentialsName"`
// ImpactLevel is the RMF Impact Level for this Project
// +kubebuilder:validation:Enum=2;4;5;6
......@@ -61,6 +61,10 @@ type ProjectSpec struct {
// ManifestImage is the name of the DockerImage for the Project application
// +kubebuilder:validation:required
ManifestImage string `json:"manifestImage"`
// CiConfigurationPath is the GitLab path to the CI configuration file in the CI/CD Settings of the project
// +kubebuilder:validation:required
CiConfigurationPath string `json:"ciConfigurationPath"`
}
// ProjectStatus defines the observed state of Project
......
......@@ -214,7 +214,7 @@ func (in *DNSRepoMergeRequestStatus) DeepCopy() *DNSRepoMergeRequestStatus {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GitlabCredentials) DeepCopyInto(out *GitlabCredentials) {
func (in *GitLabCredentials) DeepCopyInto(out *GitLabCredentials) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
......@@ -222,18 +222,18 @@ func (in *GitlabCredentials) DeepCopyInto(out *GitlabCredentials) {
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitlabCredentials.
func (in *GitlabCredentials) DeepCopy() *GitlabCredentials {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitLabCredentials.
func (in *GitLabCredentials) DeepCopy() *GitLabCredentials {
if in == nil {
return nil
}
out := new(GitlabCredentials)
out := new(GitLabCredentials)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *GitlabCredentials) DeepCopyObject() runtime.Object {
func (in *GitLabCredentials) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
......@@ -241,31 +241,31 @@ func (in *GitlabCredentials) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GitlabCredentialsList) DeepCopyInto(out *GitlabCredentialsList) {
func (in *GitLabCredentialsList) DeepCopyInto(out *GitLabCredentialsList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]GitlabCredentials, len(*in))
*out = make([]GitLabCredentials, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitlabCredentialsList.
func (in *GitlabCredentialsList) DeepCopy() *GitlabCredentialsList {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitLabCredentialsList.
func (in *GitLabCredentialsList) DeepCopy() *GitLabCredentialsList {
if in == nil {
return nil
}
out := new(GitlabCredentialsList)
out := new(GitLabCredentialsList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *GitlabCredentialsList) DeepCopyObject() runtime.Object {
func (in *GitLabCredentialsList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
......@@ -273,33 +273,33 @@ func (in *GitlabCredentialsList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GitlabCredentialsSpec) DeepCopyInto(out *GitlabCredentialsSpec) {
func (in *GitLabCredentialsSpec) DeepCopyInto(out *GitLabCredentialsSpec) {
*out = *in
out.AccessToken = in.AccessToken
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitlabCredentialsSpec.
func (in *GitlabCredentialsSpec) DeepCopy() *GitlabCredentialsSpec {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitLabCredentialsSpec.
func (in *GitLabCredentialsSpec) DeepCopy() *GitLabCredentialsSpec {
if in == nil {
return nil
}
out := new(GitlabCredentialsSpec)
out := new(GitLabCredentialsSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GitlabCredentialsStatus) DeepCopyInto(out *GitlabCredentialsStatus) {
func (in *GitLabCredentialsStatus) DeepCopyInto(out *GitLabCredentialsStatus) {
*out = *in
in.LastUsedDate.DeepCopyInto(&out.LastUsedDate)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitlabCredentialsStatus.
func (in *GitlabCredentialsStatus) DeepCopy() *GitlabCredentialsStatus {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitLabCredentialsStatus.
func (in *GitLabCredentialsStatus) DeepCopy() *GitLabCredentialsStatus {
if in == nil {
return nil
}
out := new(GitlabCredentialsStatus)
out := new(GitLabCredentialsStatus)
in.DeepCopyInto(out)
return out
}
......
......@@ -69,7 +69,7 @@ func TestClient_GetUser(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -88,7 +88,7 @@ func TestClient_GetUser(t *testing.T) {
}{
{
name: "GetUser 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{userID: 1},
want: &testUser,
wantErr: false,
......@@ -134,7 +134,7 @@ func TestClient_GetUserByUsername(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab Client object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -154,7 +154,7 @@ func TestClient_GetUserByUsername(t *testing.T) {
}{
{
name: "GetUserBuUsername 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{username: &testUsername},
want: &testUser,
want1: http.StatusFound,
......@@ -162,7 +162,7 @@ func TestClient_GetUserByUsername(t *testing.T) {
},
{
name: "GetUserBuUsername 2",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{username: &testUsername},
want: nil,
want1: http.StatusNotFound,
......@@ -235,7 +235,7 @@ func TestClient_GetUsers(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -254,21 +254,21 @@ func TestClient_GetUsers(t *testing.T) {
}{
{
name: "GetUsers 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{search: nil},
want: testUserArray,
wantErr: false,
},
{
name: "GetUsers 2",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{search: &search},
want: testUserArray,
wantErr: false,
},
{
name: "GetUsers Empty",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{search: &testEmptySearch},
want: testEmptyUserArray,
wantErr: false,
......@@ -317,7 +317,7 @@ func TestClient_AddUser(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -337,7 +337,7 @@ func TestClient_AddUser(t *testing.T) {
}{
{
name: "AddUser 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{createUserOptions: &gogitlab.CreateUserOptions{Name: &testName, Username: &testUsername, Password: &testPassword}},
want: &testUser1,
wantErr: false,
......@@ -381,7 +381,7 @@ func TestClient_UpdateUser(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
updatedName := "Updated Name"
type fields struct {
......@@ -403,7 +403,7 @@ func TestClient_UpdateUser(t *testing.T) {
}{
{
name: "UpdateUser 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{user: &testUser1, modifyUserOptions: gogitlab.ModifyUserOptions{Name: &updatedName}},
want: &testUser1,
wantErr: false,
......@@ -465,7 +465,7 @@ func TestClient_DeleteUser(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -486,14 +486,14 @@ func TestClient_DeleteUser(t *testing.T) {
}{
{
name: "DeleteUser Success",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{userID: testUserID, waitInterval: 1000, waitCount: 10},
want: http.StatusOK,
wantErr: false,
},
{
name: "DeleteUser Timeout",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{userID: testUserID, waitInterval: 1000, waitCount: 1},
want: http.StatusRequestTimeout,
wantErr: false,
......@@ -544,7 +544,7 @@ func TestClient_DeleteUserByUsername(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -563,14 +563,14 @@ func TestClient_DeleteUserByUsername(t *testing.T) {
}{
{
name: "DeleteUserByUsername Success",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{username: testUsername},
want: http.StatusAccepted,
wantErr: false,
},
{
name: "DeleteUserByUsername Not Found",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{username: testUsername},
want: http.StatusNotFound,
wantErr: false,
......@@ -634,7 +634,7 @@ func TestClient_GetGroup(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -653,7 +653,7 @@ func TestClient_GetGroup(t *testing.T) {
}{
{
name: "GetGroup 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{userID: 1},
want: &testGroup,
wantErr: false,
......@@ -708,7 +708,7 @@ func TestClient_GetGroupByFullPath(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab Client object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -728,7 +728,7 @@ func TestClient_GetGroupByFullPath(t *testing.T) {
}{
{
name: "GetGroups 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{fullPath: &testFullPath1},
want: &testGroup1,
want1: http.StatusFound,
......@@ -780,7 +780,7 @@ func TestClient_GetGroups(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -799,14 +799,14 @@ func TestClient_GetGroups(t *testing.T) {
}{
{
name: "GetGroups 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{search: nil},
want: testGroupArray,
wantErr: false,
},
{
name: "GetGroups 2",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{search: &search},
want: testGroupArray,
wantErr: false,
......@@ -854,7 +854,7 @@ func TestClient_AddGroup(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -874,7 +874,7 @@ func TestClient_AddGroup(t *testing.T) {
}{
{
name: "AddGroup 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{createGroupOptions: gogitlab.CreateGroupOptions{Name: &testGroupName}},
want: &testGroup,
wantErr: false,
......@@ -924,7 +924,7 @@ func TestClient_AddGroupMember(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab Client object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -946,7 +946,7 @@ func TestClient_AddGroupMember(t *testing.T) {
}{
{
name: "AddGroupMember 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{groupID: &testGroupID, userID: &testUserID, accessLevel: testAccessLevel},
want: &testGroupMember,
want1: http.StatusOK,
......@@ -994,7 +994,7 @@ func TestClient_UpdateGroup(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab Client object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -1015,7 +1015,7 @@ func TestClient_UpdateGroup(t *testing.T) {
}{
{
name: "UpdateGroup 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{groupID: testGroupID, updateGroupOptions: &gogitlab.UpdateGroupOptions{Name: &testUpdatedName}},
want: &testUpdatedGroup,
want1: http.StatusOK,
......@@ -1075,7 +1075,7 @@ func TestClient_DeleteGroup(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -1096,14 +1096,14 @@ func TestClient_DeleteGroup(t *testing.T) {
}{
{
name: "DeleteGroup Success",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{groupID: testGroupID, waitInterval: 1000, waitCount: 10},
want: http.StatusOK,
wantErr: false,
},
{
name: "DeleteGroup Timeout",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{groupID: testGroupID, waitInterval: 1000, waitCount: 1},
want: http.StatusRequestTimeout,
wantErr: false,
......@@ -1151,7 +1151,7 @@ func TestClient_GetProject(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -1170,7 +1170,7 @@ func TestClient_GetProject(t *testing.T) {
}{
{
name: "GetGroup 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{projectID: 1},
want: &testProject,
wantErr: false,
......@@ -1216,7 +1216,7 @@ func TestClient_GetProjects(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
// test objects
search := "searchstring"
......@@ -1237,14 +1237,14 @@ func TestClient_GetProjects(t *testing.T) {
}{
{
name: "GetProjects 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{search: nil},
want: testProjectArray,
wantErr: false,
},
{
name: "GetProjects 2",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{search: &search},
want: testProjectArray,
wantErr: false,
......@@ -1292,7 +1292,7 @@ func TestClient_GetProjectByFullPath(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab Client object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -1312,7 +1312,7 @@ func TestClient_GetProjectByFullPath(t *testing.T) {
}{
{
name: "GetProjects 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{fullPath: &testProjectFullPath1},
want: &testProject1,
want1: http.StatusFound,
......@@ -1363,7 +1363,7 @@ func TestClient_AddProject(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -1383,7 +1383,7 @@ func TestClient_AddProject(t *testing.T) {
}{
{
name: "AddGroup 1",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{createProjectOptions: &createTestProjectOptions},
want1: 200,
want: &testProject,
......@@ -1434,7 +1434,7 @@ func TestClient_UpdateProject(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab Client object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -1455,7 +1455,7 @@ func TestClient_UpdateProject(t *testing.T) {
}{
{
name: "UpdateProject Success",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{projectID: testProjectID},
want: &testUpdatedProject,
want1: http.StatusOK,
......@@ -1514,7 +1514,7 @@ func TestClient_DeleteProject(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab Client object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -1535,14 +1535,14 @@ func TestClient_DeleteProject(t *testing.T) {
}{
{
name: "DeleteProject Success",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{projectID: testProjectID, waitInterval: 1000, waitCount: 10},
want: http.StatusOK,
wantErr: false,
},
{
name: "DeleteProject Timeout",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{projectID: testProjectID, waitInterval: 1000, waitCount: 1},
want: http.StatusRequestTimeout,
wantErr: false,
......@@ -1603,7 +1603,7 @@ func TestClient_GetMergeRequests(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab Client object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -1625,7 +1625,7 @@ func TestClient_GetMergeRequests(t *testing.T) {
}{
{
name: "UpdateProject Success",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{projectID: testProjectID, sourceBranch: testSourceBranch, targetBranch: testTargetBranch},
want: testGetMRs,
want1: http.StatusOK,
......@@ -1691,7 +1691,7 @@ func TestClient_CreateMergeRequest(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab Client object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -1713,7 +1713,7 @@ func TestClient_CreateMergeRequest(t *testing.T) {
}{
{
name: "UpdateProject Success",
fields: fields{client: testGitlabClient, token: testToken, apiURL: testAPIUrl},
fields: fields{client: testGitLabClient, token: testToken, apiURL: testAPIUrl},
args: args{projectID: testProjectID, mrOptions: &gogitlab.CreateMergeRequestOptions{
SourceBranch: &testSourceBranch,
TargetBranch: &testTargetBranch,
......@@ -1790,7 +1790,7 @@ func TestClientImpl_AddGroupVariable(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -1813,7 +1813,7 @@ func TestClientImpl_AddGroupVariable(t *testing.T) {
{
name: "Test Group Variable",
fields: fields{
client: testGitlabClient,
client: testGitLabClient,
token: testToken,
apiURL: testAPIUrl,
},
......@@ -1889,7 +1889,7 @@ func TestClientImpl_UpdateGroupVariable(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -1912,7 +1912,7 @@ func TestClientImpl_UpdateGroupVariable(t *testing.T) {
{
name: "Test Update Group Variable",
fields: fields{
client: testGitlabClient,
client: testGitLabClient,
token: testToken,
apiURL: testAPIUrl,
},
......@@ -1969,7 +1969,7 @@ func TestClientImpl_DeleteGroupVariable(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
token string
......@@ -1989,7 +1989,7 @@ func TestClientImpl_DeleteGroupVariable(t *testing.T) {
{
name: "Test Delete Group Variable",
fields: fields{
client: testGitlabClient,
client: testGitLabClient,
token: testToken,
apiURL: testAPIUrl,
},
......@@ -2062,7 +2062,7 @@ func TestClientImpl_AddProjectVariable(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -2085,7 +2085,7 @@ func TestClientImpl_AddProjectVariable(t *testing.T) {
{
name: "Test Group Variable",
fields: fields{
client: testGitlabClient,
client: testGitLabClient,
token: testToken,
apiURL: testAPIUrl,
},
......@@ -2161,7 +2161,7 @@ func TestClientImpl_UpdateProjectVariable(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -2184,7 +2184,7 @@ func TestClientImpl_UpdateProjectVariable(t *testing.T) {
{
name: "Test UpdateProjectVariable",
fields: fields{
client: testGitlabClient,
client: testGitLabClient,
token: testToken,
apiURL: testAPIUrl,
},
......@@ -2241,7 +2241,7 @@ func TestClientImpl_DeleteProjectVariable(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -2262,7 +2262,7 @@ func TestClientImpl_DeleteProjectVariable(t *testing.T) {
{
name: "Test DeleteProjectVariable",
fields: fields{
client: testGitlabClient,
client: testGitLabClient,
token: testToken,
apiURL: testAPIUrl,
},
......@@ -2327,7 +2327,7 @@ func TestClientImpl_GetGroupVariable(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -2349,7 +2349,7 @@ func TestClientImpl_GetGroupVariable(t *testing.T) {
{
name: "Test GetGroupVariable",
fields: fields{
client: testGitlabClient,
client: testGitLabClient,
token: testToken,
apiURL: testAPIUrl,
},
......@@ -2418,7 +2418,7 @@ func TestClientImpl_GetProjectVariable(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
token string
......@@ -2439,7 +2439,7 @@ func TestClientImpl_GetProjectVariable(t *testing.T) {
{
name: "Test GetProjectVariable",
fields: fields{
client: testGitlabClient,
client: testGitLabClient,
token: testToken,
apiURL: testAPIUrl,
},
......@@ -2509,7 +2509,7 @@ func TestClientImpl_GetGroupVariables(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
......@@ -2530,7 +2530,7 @@ func TestClientImpl_GetGroupVariables(t *testing.T) {
{
name: "Test GetGroupVariables",
fields: fields{
client: testGitlabClient,
client: testGitLabClient,
token: testToken,
apiURL: testAPIUrl,
},
......@@ -2599,7 +2599,7 @@ func TestClientImpl_GetProjectVariables(t *testing.T) {
testAPIUrl := "https://test/api/v4/"
testToken := "token"
// create a gitlab ClientImpl object, inject http client to allow for mocking using httpmock
testGitlabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
testGitLabClient, _ := gogitlab.NewClient(testToken, gogitlab.WithBaseURL(testAPIUrl), gogitlab.WithHTTPClient(testHTTPClient))
type fields struct {
client *gogitlab.Client
token string
......@@ -2620,7 +2620,7 @@ func TestClientImpl_GetProjectVariables(t *testing.T) {
{
name: "Test GetProjectVariables",
fields: fields{
client: testGitlabClient,
client: testGitLabClient,
token: testToken,
apiURL: testAPIUrl,
},
......
......@@ -37,8 +37,8 @@ spec:
description: DNSRepoCredentialSpec defines the desired state of DNSRepoCredential
properties:
gitlabProjectId:
description: GitlabProjectID is the project ID of the DNS project
in Gitlab
description: GitLabProjectID is the project ID of the DNS project
in GitLab
type: integer
repoUrl:
description: 'RepoURL is the url for the DNS git repository. For example:
......
......@@ -10,8 +10,8 @@ metadata:
spec:
group: gitlab.valkyrie.dso.mil
names:
kind: GitlabCredentials
listKind: GitlabCredentialsList
kind: GitLabCredentials
listKind: GitLabCredentialsList
plural: gitlabcredentials
singular: gitlabcredentials
scope: Namespaced
......@@ -19,7 +19,7 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: GitlabCredentials is the Schema for the gitlabcredentials API
description: GitLabCredentials is the Schema for the gitlabcredentials API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
......@@ -34,13 +34,13 @@ spec:
metadata:
type: object
spec:
description: GitlabCredentialsSpec defines the desired state of GitlabCredentials,
this stores a Gitlab username and Access Token for communicating with
the Gitlab API.
description: GitLabCredentialsSpec defines the desired state of GitLabCredentials,
this stores a GitLab username and Access Token for communicating with
the GitLab API.
properties:
accessToken:
description: AccessToken is the SecretRef to the secret containing
the Gitlab Access Token for the user.
the GitLab Access Token for the user.
properties:
name:
description: Name is unique within a namespace to reference a
......@@ -53,20 +53,20 @@ spec:
type: object
accessTokenKey:
description: AccessTokenKey is the key of the secret data that contains
the Gitlab Access Token for the user.
the GitLab Access Token for the user.
type: string
url:
description: URL is the url for the GitLab API that will be contacted.
type: string
username:
description: Username is the Gitlab username for the account that
will be communicating with the Gitlab API
description: Username is the GitLab username for the account that
will be communicating with the GitLab API
type: string
required:
- accessTokenKey
type: object
status:
description: GitlabCredentialsStatus defines the observed state of GitlabCredentials
description: GitLabCredentialsStatus defines the observed state of GitLabCredentials
properties:
lastUsedDate:
description: LastUsedTime is the time that this credential was last
......
......@@ -37,10 +37,10 @@ spec:
description: GroupSpec defines the desired state of Group
properties:
description:
description: Description is the Gitlab Description for the group
description: Description is the GitLab Description for the group
type: string
gitlabCredentialsName:
description: GitlabCredentialsName is the name of the object in this
description: GitLabCredentialsName is the name of the object in this
namespace that contains authentication information for logging into
the
type: string
......@@ -58,7 +58,7 @@ spec:
type: string
name:
description: Name is the name of the Group and will be used as part
of the URL in Gitlab
of the URL in GitLab
type: string
path:
description: FullPath is the gitlab path for this Project
......@@ -70,8 +70,12 @@ spec:
items:
description: ProjectSpec defines the desired state of Project
properties:
ciConfigurationPath:
description: CiConfigurationPath is the GitLab path to the CI
configuration file in the CI/CD Settings of the project
type: string
gitlabCredentialsName:
description: GitlabCredentialsName is the name of the object
description: GitLabCredentialsName is the name of the object
in this namespace that contains authentication information
for logging into the
type: string
......@@ -118,6 +122,7 @@ spec:
will be created for this Project
type: string
required:
- ciConfigurationPath
- gitlabCredentialsName
- groupId
- impactLevel
......
......@@ -36,8 +36,12 @@ spec:
spec:
description: ProjectSpec defines the desired state of Project
properties:
ciConfigurationPath:
description: CiConfigurationPath is the GitLab path to the CI configuration
file in the CI/CD Settings of the project
type: string
gitlabCredentialsName:
description: GitlabCredentialsName is the name of the object in this
description: GitLabCredentialsName is the name of the object in this
namespace that contains authentication information for logging into
the
type: string
......@@ -84,6 +88,7 @@ spec:
be created for this Project
type: string
required:
- ciConfigurationPath
- gitlabCredentialsName
- groupId
- impactLevel
......
......@@ -7,7 +7,7 @@ data:
accesstoken: cGFzc3dvcmQ=
---
apiVersion: gitlab.valkyrie.dso.mil/v1alpha1
kind: GitlabCredentials
kind: GitLabCredentials
metadata:
name: gitlab-credentials
namespace: default
......
......@@ -105,10 +105,10 @@ func (r *DNSRepoMergeRequestReconciler) Reconcile(ctx context.Context, req ctrl.
}
repoURL := credential.Spec.RepoURL
projectID := credential.Spec.GitlabProjectID
projectID := credential.Spec.GitLabProjectID
//create Gitlab client for API calls
gitlabAPIURL := getGitlabAPIURL(repoURL)
//create GitLab client for API calls
gitlabAPIURL := getGitLabAPIURL(repoURL)
var gitlabClient gitlab.Client
if r.gitlabTestClient != nil {
gitlabClient = r.gitlabTestClient
......@@ -222,7 +222,7 @@ func cleanUpOldResources(dnsMergeRequest gitlabv1alpha1.DNSRepoMergeRequest, log
//example input: https://code.il2.dso.mil/platform-one/products/valkyrie/dso-dns.git
//example output: https://code.il2.dso.mil/api/v4
func getGitlabAPIURL(repoURL string) string {
func getGitLabAPIURL(repoURL string) string {
subs := strings.Split(repoURL, "/")
return subs[0] + "/" + subs[1] + "/" + subs[2] + "/api/v4"
}
......
......@@ -128,7 +128,7 @@ var _ = Describe("Reconcile", func() {
ObjectMeta: metav1.ObjectMeta{},
Spec: gitlabv1alpha1.DNSRepoCredentialSpec{
RepoURL: "https://test",
GitlabProjectID: 4148,
GitLabProjectID: 4148,
UsernameSecRef: v1.SecretKeySelector{
LocalObjectReference: v1.LocalObjectReference{Name: "secretName"},
Key: "username",
......@@ -198,7 +198,7 @@ var _ = Describe("Reconcile", func() {
ObjectMeta: metav1.ObjectMeta{},
Spec: gitlabv1alpha1.DNSRepoCredentialSpec{
RepoURL: "https://test",
GitlabProjectID: 4148,
GitLabProjectID: 4148,
UsernameSecRef: v1.SecretKeySelector{
LocalObjectReference: v1.LocalObjectReference{Name: "secretName"},
Key: "username",
......@@ -246,7 +246,7 @@ var _ = Describe("Reconcile", func() {
Name: repoCred.Spec.UsernameSecRef.Name,
}] = &secret
sut.gitlabTestClient = &MockGitlabClient{
sut.gitlabTestClient = &MockGitLabClient{
getMRByIDFunc: func(projectID int, mrID int) (*gitlab.MergeRequest, error) {
return &gitlab.MergeRequest{
ProjectID: projectID,
......@@ -307,7 +307,7 @@ var _ = Describe("Reconcile", func() {
ObjectMeta: metav1.ObjectMeta{},
Spec: gitlabv1alpha1.DNSRepoCredentialSpec{
RepoURL: "https://test",
GitlabProjectID: 4148,
GitLabProjectID: 4148,
UsernameSecRef: v1.SecretKeySelector{
LocalObjectReference: v1.LocalObjectReference{Name: "secretName"},
Key: "username",
......@@ -359,7 +359,7 @@ var _ = Describe("Reconcile", func() {
Name: repoCred.Spec.UsernameSecRef.Name,
}] = &secret
sut.gitlabTestClient = &MockGitlabClient{
sut.gitlabTestClient = &MockGitLabClient{
getMRByIDFunc: func(projectID int, mrID int) (*gitlab.MergeRequest, error) {
return &gitlab.MergeRequest{
ProjectID: projectID,
......@@ -416,7 +416,7 @@ var _ = Describe("Reconcile", func() {
ObjectMeta: metav1.ObjectMeta{},
Spec: gitlabv1alpha1.DNSRepoCredentialSpec{
RepoURL: "https://test",
GitlabProjectID: 4148,
GitLabProjectID: 4148,
UsernameSecRef: v1.SecretKeySelector{
LocalObjectReference: v1.LocalObjectReference{Name: "secretName"},
Key: "username",
......@@ -468,7 +468,7 @@ var _ = Describe("Reconcile", func() {
Name: repoCred.Spec.UsernameSecRef.Name,
}] = &secret
sut.gitlabTestClient = &MockGitlabClient{
sut.gitlabTestClient = &MockGitLabClient{
getMRByIDFunc: func(projectID int, mrID int) (*gitlab.MergeRequest, error) {
return &gitlab.MergeRequest{
ProjectID: projectID,
......@@ -578,7 +578,7 @@ var _ = Describe("Reconcile", func() {
ObjectMeta: metav1.ObjectMeta{},
Spec: gitlabv1alpha1.DNSRepoCredentialSpec{
RepoURL: "https://test",
GitlabProjectID: 4148,
GitLabProjectID: 4148,
UsernameSecRef: v1.SecretKeySelector{
LocalObjectReference: v1.LocalObjectReference{Name: "secretName"},
Key: "username",
......@@ -630,7 +630,7 @@ var _ = Describe("Reconcile", func() {
Name: repoCred.Spec.UsernameSecRef.Name,
}] = &secret
sut.gitlabTestClient = &MockGitlabClient{
sut.gitlabTestClient = &MockGitLabClient{
getMRByIDFunc: func(projectID int, mrID int) (*gitlab.MergeRequest, error) {
return &gitlab.MergeRequest{
ProjectID: projectID,
......
......@@ -27,7 +27,7 @@ import (
gitlabv1alpha1 "valkyrie.dso.mil/valkyrie-api/apis/gitlab/v1alpha1"
)
// CredentialsReconciler reconciles a GitlabCredentials object
// CredentialsReconciler reconciles a GitLabCredentials object
type CredentialsReconciler struct {
client.Client
Log logr.Logger
......@@ -52,6 +52,6 @@ func (r *CredentialsReconciler) Reconcile(ctx context.Context, req ctrl.Request)
// SetupWithManager sets up the controller with the Manager.
func (r *CredentialsReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&gitlabv1alpha1.GitlabCredentials{}).
For(&gitlabv1alpha1.GitLabCredentials{}).
Complete(r)
}
......@@ -41,7 +41,7 @@ var _ = Describe("gitlabcredentials_controller", func() {
})
})
Describe("SetupWithManager", func() {
gitlabv1alpha1.SchemeBuilder.Register(&gitlabv1alpha1.GitlabCredentials{}, &gitlabv1alpha1.GitlabCredentialsList{})
gitlabv1alpha1.SchemeBuilder.Register(&gitlabv1alpha1.GitLabCredentials{}, &gitlabv1alpha1.GitLabCredentialsList{})
sut := CredentialsReconciler{
Client: nil,
Log: nil,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment