From 4d26ed1fd56f134c9261f80203bae99f3080fdc9 Mon Sep 17 00:00:00 2001 From: "andrew.greene" Date: Thu, 15 Jul 2021 07:48:33 -0600 Subject: [PATCH] fix: remove customer types --- PROJECT | 45 -- .../authorizingofficial_scaffold_test.go | 287 ----------- .../v1alpha1/authorizingofficial_types.go | 82 --- ...nformationsecurityofficer_scaffold_test.go | 287 ----------- .../chiefinformationsecurityofficer_types.go | 79 --- .../v1alpha1/customer_scaffold_test.go | 287 ----------- apis/customer/v1alpha1/customer_types.go | 63 --- apis/customer/v1alpha1/groupversion_info.go | 36 -- .../v1alpha1/organization_scaffold_test.go | 287 ----------- apis/customer/v1alpha1/organization_types.go | 68 --- .../v1alpha1/systemowner_scaffold_test.go | 287 ----------- apis/customer/v1alpha1/systemowner_types.go | 79 --- .../v1alpha1/zz_generated.deepcopy.go | 474 ------------------ .../customer.valkyrie.dso.mil_customers.yaml | 0 config/crd/kustomization.yaml | 15 - .../cainjection_in_authorizingofficials.yaml | 7 - ...n_in_chiefinformationsecurityofficers.yaml | 7 - .../crd/patches/cainjection_in_customers.yaml | 7 - .../patches/cainjection_in_organizations.yaml | 7 - .../patches/cainjection_in_systemowners.yaml | 7 - .../webhook_in_authorizingofficials.yaml | 16 - ...k_in_chiefinformationsecurityofficers.yaml | 16 - config/crd/patches/webhook_in_customers.yaml | 14 - .../crd/patches/webhook_in_organizations.yaml | 14 - .../crd/patches/webhook_in_systemowners.yaml | 16 - .../rbac/authorizingofficial_editor_role.yaml | 24 - .../rbac/authorizingofficial_viewer_role.yaml | 20 - ...nformationsecurityofficer_editor_role.yaml | 24 - ...nformationsecurityofficer_viewer_role.yaml | 20 - config/rbac/customer_editor_role.yaml | 24 - config/rbac/customer_viewer_role.yaml | 20 - config/rbac/organization_editor_role.yaml | 24 - config/rbac/organization_viewer_role.yaml | 20 - config/rbac/role.yaml | 130 ----- config/rbac/systemowner_editor_role.yaml | 24 - config/rbac/systemowner_viewer_role.yaml | 20 - ...customer_v1alpha1_authorizingofficial.yaml | 7 - ...lpha1_chiefinformationsecurityofficer.yaml | 7 - .../samples/customer_v1alpha1_customer.yaml | 7 - .../customer_v1alpha1_organization.yaml | 7 - .../customer_v1alpha1_systemowner.yaml | 7 - .../authorizingofficial_controller.go | 62 --- ...efinformationsecurityofficer_controller.go | 62 --- controllers/customer/customer_controller.go | 63 --- .../customer/organization_controller.go | 63 --- controllers/customer/suite_test.go | 92 ---- .../customer/systemowner_controller.go | 62 --- .../dnsrepocredential_controller_test.go | 5 +- .../gitlabcredentials_controller_test.go | 5 +- driver.go | 23 - driver_test.go | 16 - main.go | 2 - 52 files changed, 4 insertions(+), 3323 deletions(-) delete mode 100644 apis/customer/v1alpha1/authorizingofficial_scaffold_test.go delete mode 100644 apis/customer/v1alpha1/authorizingofficial_types.go delete mode 100644 apis/customer/v1alpha1/chiefinformationsecurityofficer_scaffold_test.go delete mode 100644 apis/customer/v1alpha1/chiefinformationsecurityofficer_types.go delete mode 100644 apis/customer/v1alpha1/customer_scaffold_test.go delete mode 100644 apis/customer/v1alpha1/customer_types.go delete mode 100644 apis/customer/v1alpha1/groupversion_info.go delete mode 100644 apis/customer/v1alpha1/organization_scaffold_test.go delete mode 100644 apis/customer/v1alpha1/organization_types.go delete mode 100644 apis/customer/v1alpha1/systemowner_scaffold_test.go delete mode 100644 apis/customer/v1alpha1/systemowner_types.go delete mode 100644 apis/customer/v1alpha1/zz_generated.deepcopy.go mode change 100755 => 100644 config/crd/bases/customer.valkyrie.dso.mil_customers.yaml delete mode 100644 config/crd/patches/cainjection_in_authorizingofficials.yaml delete mode 100644 config/crd/patches/cainjection_in_chiefinformationsecurityofficers.yaml delete mode 100644 config/crd/patches/cainjection_in_customers.yaml delete mode 100644 config/crd/patches/cainjection_in_organizations.yaml delete mode 100644 config/crd/patches/cainjection_in_systemowners.yaml delete mode 100644 config/crd/patches/webhook_in_authorizingofficials.yaml delete mode 100644 config/crd/patches/webhook_in_chiefinformationsecurityofficers.yaml delete mode 100644 config/crd/patches/webhook_in_customers.yaml delete mode 100644 config/crd/patches/webhook_in_organizations.yaml delete mode 100644 config/crd/patches/webhook_in_systemowners.yaml delete mode 100644 config/rbac/authorizingofficial_editor_role.yaml delete mode 100644 config/rbac/authorizingofficial_viewer_role.yaml delete mode 100644 config/rbac/chiefinformationsecurityofficer_editor_role.yaml delete mode 100644 config/rbac/chiefinformationsecurityofficer_viewer_role.yaml delete mode 100644 config/rbac/customer_editor_role.yaml delete mode 100644 config/rbac/customer_viewer_role.yaml delete mode 100644 config/rbac/organization_editor_role.yaml delete mode 100644 config/rbac/organization_viewer_role.yaml delete mode 100644 config/rbac/systemowner_editor_role.yaml delete mode 100644 config/rbac/systemowner_viewer_role.yaml delete mode 100644 config/samples/customer_v1alpha1_authorizingofficial.yaml delete mode 100644 config/samples/customer_v1alpha1_chiefinformationsecurityofficer.yaml delete mode 100644 config/samples/customer_v1alpha1_customer.yaml delete mode 100644 config/samples/customer_v1alpha1_organization.yaml delete mode 100644 config/samples/customer_v1alpha1_systemowner.yaml delete mode 100644 controllers/customer/authorizingofficial_controller.go delete mode 100644 controllers/customer/chiefinformationsecurityofficer_controller.go delete mode 100644 controllers/customer/customer_controller.go delete mode 100644 controllers/customer/organization_controller.go delete mode 100644 controllers/customer/suite_test.go delete mode 100644 controllers/customer/systemowner_controller.go diff --git a/PROJECT b/PROJECT index 46ef62e..b52f58d 100644 --- a/PROJECT +++ b/PROJECT @@ -5,24 +5,6 @@ multigroup: true projectName: valkyrie-api repo: valkyrie.dso.mil/valkyrie-api resources: -- api: - crdVersion: v1 - namespaced: true - controller: true - domain: valkyrie.dso.mil - group: customer - kind: Customer - path: valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1 - version: v1alpha1 -- api: - crdVersion: v1 - namespaced: true - controller: true - domain: valkyrie.dso.mil - group: customer - kind: Organization - path: valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1 - version: v1alpha1 - api: crdVersion: v1 namespaced: true @@ -86,33 +68,6 @@ resources: kind: SdElementsPipelineConfiguration path: valkyrie.dso.mil/valkyrie-api/apis/gitlab/v1alpha1 version: v1alpha1 -- api: - crdVersion: v1 - namespaced: true - controller: true - domain: valkyrie.dso.mil - group: customer - kind: AuthorizingOfficial - path: valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1 - version: v1alpha1 -- api: - crdVersion: v1 - namespaced: true - controller: true - domain: valkyrie.dso.mil - group: customer - kind: SystemOwner - path: valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1 - version: v1alpha1 -- api: - crdVersion: v1 - namespaced: true - controller: true - domain: valkyrie.dso.mil - group: customer - kind: ChiefInformationSecurityOfficer - path: valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1 - version: v1alpha1 - api: crdVersion: v1 namespaced: true diff --git a/apis/customer/v1alpha1/authorizingofficial_scaffold_test.go b/apis/customer/v1alpha1/authorizingofficial_scaffold_test.go deleted file mode 100644 index c7609e6..0000000 --- a/apis/customer/v1alpha1/authorizingofficial_scaffold_test.go +++ /dev/null @@ -1,287 +0,0 @@ -package v1alpha1 - -import ( - "reflect" - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// Reusable test variables -type testVarsAuthorizingOfficial = struct { - testKind string - testApiversion string - testSpec string - testStatus string - - expectedKind string - expectedApiversion string - expectedSpec string - expectedStatus string - - testObject1 AuthorizingOfficial - testObject2 AuthorizingOfficial - - objectItems1 []AuthorizingOfficial - objectList1 AuthorizingOfficialList - - objectItems2 []AuthorizingOfficial - objectList2 AuthorizingOfficialList - - // leave scaffold Foo value for testing? - testObjectSpec1 AuthorizingOfficialSpec - testObjectSpec2 AuthorizingOfficialSpec - - // leave scaffold Foo value for testing? - testObjectStatus1 AuthorizingOfficialStatus - testObjectStatus2 AuthorizingOfficialStatus -} - -func initVarsAuthorizingOfficial() testVarsAuthorizingOfficial { - testVars := testVarsAuthorizingOfficial{} - - testVars.testKind = "TestKind" - testVars.testApiversion = "v22" - testVars.testSpec = "test spec value" - testVars.testStatus = "test status value" - - testVars.expectedApiversion = testVars.testApiversion - testVars.expectedKind = testVars.testKind - testVars.expectedSpec = testVars.testSpec - testVars.expectedStatus = testVars.testStatus - - var object1MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: testVars.testKind, APIVersion: testVars.testApiversion} - testVars.testObject1 = AuthorizingOfficial{TypeMeta: object1MetaType} - - var object2MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind2", APIVersion: "V99"} - testVars.testObject2 = AuthorizingOfficial{TypeMeta: object2MetaType} - - var objectList1MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind_List", APIVersion: "V12"} - var objectItems1 []AuthorizingOfficial = []AuthorizingOfficial{testVars.testObject1, testVars.testObject2} - // test_object_list = AuthorizingOfficialList(objectList1MetaType,nil,object_items) - testVars.objectList1 = AuthorizingOfficialList{TypeMeta: objectList1MetaType, Items: objectItems1} - - var objectList2MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind_List", APIVersion: "V12"} - var objectItems2 []AuthorizingOfficial = []AuthorizingOfficial{testVars.testObject2} - // test_object_list = AuthorizingOfficialList(objectList1MetaType,nil,object_items) - testVars.objectList2 = AuthorizingOfficialList{TypeMeta: objectList2MetaType, Items: objectItems2} - - // leave scaffold Foo value for testing? - testVars.testObjectSpec1 = AuthorizingOfficialSpec{Dummy: testVars.testSpec} - testVars.testObjectSpec2 = AuthorizingOfficialSpec{Dummy: "other value"} - - // leave scaffold Foo value for testing? - testVars.testObjectStatus1 = AuthorizingOfficialStatus{Dummy: testVars.testStatus} - testVars.testObjectStatus2 = AuthorizingOfficialStatus{Dummy: "other value"} - - return testVars -} - -func TestGroupVars_AuthorizingOfficial(t *testing.T) { - - xType := reflect.TypeOf(GroupVersion) - // convert object type to string - got := xType.String() - want := "schema.GroupVersion" - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -// Test Type called AuthorizingOfficial -func TestTypes_AuthorizingOfficial(t *testing.T) { - lTestVars := initVarsAuthorizingOfficial() - want := lTestVars.expectedApiversion - - got := lTestVars.testObject1.APIVersion - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -// DeepCopy -func TestDeepCopy_DeepCopy_AuthorizingOfficial(t *testing.T) { - lTestVars := initVarsAuthorizingOfficial() - - newObject := lTestVars.testObject1.DeepCopy() - - // check api version - got := newObject.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // check kind - got = newObject.Kind - want = lTestVars.expectedKind - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *AuthorizingOfficial = nil - var val = nilTestPtr.DeepCopyObject() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopyInto_AuthorizingOfficial(t *testing.T) { - lTestVars := initVarsAuthorizingOfficial() - - lTestVars.testObject1.DeepCopyInto(&lTestVars.testObject2) - - got := lTestVars.testObject2.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyObject_AuthorizingOfficial(t *testing.T) { - lTestVars := initVarsAuthorizingOfficial() - - newRuntimeObject := lTestVars.testObject1.DeepCopyObject() - newObject := newRuntimeObject.(*AuthorizingOfficial) - got := newObject.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyList_AuthorizingOfficial(t *testing.T) { - lTestVars := initVarsAuthorizingOfficial() - newObjectList := lTestVars.objectList1.DeepCopy() - - got := newObjectList.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // a typed pointer set to nil - var nilTestPtr *AuthorizingOfficialList = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyIntoList_AuthorizingOfficial(t *testing.T) { - lTestVars := initVarsAuthorizingOfficial() - - lTestVars.objectList1.DeepCopyInto(&lTestVars.objectList2) - - got := lTestVars.objectList2.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyListObject_AuthorizingOfficial(t *testing.T) { - lTestVars := initVarsAuthorizingOfficial() - - newRuntimeObject := lTestVars.objectList1.DeepCopyObject() - newObject := newRuntimeObject.(*AuthorizingOfficialList) - got := newObject.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *AuthorizingOfficialList = nil - var val = nilTestPtr.DeepCopyObject() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopySpec_AuthorizingOfficial(t *testing.T) { - lTestVars := initVarsAuthorizingOfficial() - - newObjectList := lTestVars.testObjectSpec1.DeepCopy() - - got := newObjectList.Dummy - want := lTestVars.expectedSpec - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *AuthorizingOfficialSpec = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopySpecInto_AuthorizingOfficial(t *testing.T) { - lTestVars := initVarsAuthorizingOfficial() - - lTestVars.testObjectSpec1.DeepCopyInto(&lTestVars.testObjectSpec2) - - got := lTestVars.testObjectSpec2.Dummy - want := lTestVars.expectedSpec - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyStatus_AuthorizingOfficial(t *testing.T) { - lTestVars := initVarsAuthorizingOfficial() - - newObjectStatus := lTestVars.testObjectStatus1.DeepCopy() - - got := newObjectStatus.Dummy - want := lTestVars.expectedStatus - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // a typed pointer set to nil - var nilTestPtr *AuthorizingOfficialStatus = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopyStatusInto_AuthorizingOfficial(t *testing.T) { - lTestVars := initVarsAuthorizingOfficial() - - lTestVars.testObjectStatus1.DeepCopyInto(&lTestVars.testObjectStatus2) - - got := lTestVars.testObjectStatus2.Dummy - want := lTestVars.expectedStatus - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} diff --git a/apis/customer/v1alpha1/authorizingofficial_types.go b/apis/customer/v1alpha1/authorizingofficial_types.go deleted file mode 100644 index c5a5552..0000000 --- a/apis/customer/v1alpha1/authorizingofficial_types.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2021. - -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" -) - -// 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. - -// AuthorizingOfficialSpec defines the desired state of AuthorizingOfficial -type AuthorizingOfficialSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // Name is the full name of the AuthorizingOfficial. - Name string `json:"name,omitempty"` - - // Title is the military or professional title of the AuthorizingOfficial - Title string `json:"title,omitempty"` - - //Organization is the name of the organization of the AuthorizingOfficial - Organization string `json:"organization,omitempty"` - - //Email is the email address of the AuthorizingOfficial - Email string `json:"email,omitempty"` - - //Phone is the phone number of the AuthorizingOfficial - Phone string `json:"phone,omitempty"` - - // test Dummy is an example field of Project. Edit project_types.go to remove/update - Dummy string `json:"dummy,omitempty"` -} - -// AuthorizingOfficialStatus defines the observed state of AuthorizingOfficial -type AuthorizingOfficialStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // test Dummy is an example field of Project. Edit project_types.go to remove/update - Dummy string `json:"dummy,omitempty"` -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// AuthorizingOfficial is the Schema for the authorizingofficials API -type AuthorizingOfficial struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec AuthorizingOfficialSpec `json:"spec,omitempty"` - Status AuthorizingOfficialStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// AuthorizingOfficialList contains a list of AuthorizingOfficial -type AuthorizingOfficialList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []AuthorizingOfficial `json:"items"` -} - -func init() { - SchemeBuilder.Register(&AuthorizingOfficial{}, &AuthorizingOfficialList{}) -} diff --git a/apis/customer/v1alpha1/chiefinformationsecurityofficer_scaffold_test.go b/apis/customer/v1alpha1/chiefinformationsecurityofficer_scaffold_test.go deleted file mode 100644 index 6efed57..0000000 --- a/apis/customer/v1alpha1/chiefinformationsecurityofficer_scaffold_test.go +++ /dev/null @@ -1,287 +0,0 @@ -package v1alpha1 - -import ( - "reflect" - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// Reusable test variables -type testVarsChiefInformationSecurityOfficer = struct { - testKind string - testApiversion string - testSpec string - testStatus string - - expectedKind string - expectedApiversion string - expectedSpec string - expectedStatus string - - testObject1 ChiefInformationSecurityOfficer - testObject2 ChiefInformationSecurityOfficer - - objectItems1 []ChiefInformationSecurityOfficer - objectList1 ChiefInformationSecurityOfficerList - - objectItems2 []ChiefInformationSecurityOfficer - objectList2 ChiefInformationSecurityOfficerList - - // leave scaffold Foo value for testing? - testObjectSpec1 ChiefInformationSecurityOfficerSpec - testObjectSpec2 ChiefInformationSecurityOfficerSpec - - // leave scaffold Foo value for testing? - testObjectStatus1 ChiefInformationSecurityOfficerStatus - testObjectStatus2 ChiefInformationSecurityOfficerStatus -} - -func initVarsChiefInformationSecurityOfficer() testVarsChiefInformationSecurityOfficer { - testVars := testVarsChiefInformationSecurityOfficer{} - - testVars.testKind = "TestKind" - testVars.testApiversion = "v22" - testVars.testSpec = "test spec value" - testVars.testStatus = "test status value" - - testVars.expectedApiversion = testVars.testApiversion - testVars.expectedKind = testVars.testKind - testVars.expectedSpec = testVars.testSpec - testVars.expectedStatus = testVars.testStatus - - var object1MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: testVars.testKind, APIVersion: testVars.testApiversion} - testVars.testObject1 = ChiefInformationSecurityOfficer{TypeMeta: object1MetaType} - - var object2MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind2", APIVersion: "V99"} - testVars.testObject2 = ChiefInformationSecurityOfficer{TypeMeta: object2MetaType} - - var objectList1MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind_List", APIVersion: "V12"} - var objectItems1 []ChiefInformationSecurityOfficer = []ChiefInformationSecurityOfficer{testVars.testObject1, testVars.testObject2} - // test_object_list = ChiefInformationSecurityOfficerList(objectList1MetaType,nil,object_items) - testVars.objectList1 = ChiefInformationSecurityOfficerList{TypeMeta: objectList1MetaType, Items: objectItems1} - - var objectList2MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind_List", APIVersion: "V12"} - var objectItems2 []ChiefInformationSecurityOfficer = []ChiefInformationSecurityOfficer{testVars.testObject2} - // test_object_list = ChiefInformationSecurityOfficerList(objectList1MetaType,nil,object_items) - testVars.objectList2 = ChiefInformationSecurityOfficerList{TypeMeta: objectList2MetaType, Items: objectItems2} - - // leave scaffold Foo value for testing? - testVars.testObjectSpec1 = ChiefInformationSecurityOfficerSpec{Dummy: testVars.testSpec} - testVars.testObjectSpec2 = ChiefInformationSecurityOfficerSpec{Dummy: "other value"} - - // leave scaffold Foo value for testing? - testVars.testObjectStatus1 = ChiefInformationSecurityOfficerStatus{Dummy: testVars.testStatus} - testVars.testObjectStatus2 = ChiefInformationSecurityOfficerStatus{Dummy: "other value"} - - return testVars -} - -func TestGroupVars_ChiefInformationSecurityOfficer(t *testing.T) { - - xType := reflect.TypeOf(GroupVersion) - // convert object type to string - got := xType.String() - want := "schema.GroupVersion" - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -// Test Type called ChiefInformationSecurityOfficer -func TestTypes_ChiefInformationSecurityOfficer(t *testing.T) { - lTestVars := initVarsChiefInformationSecurityOfficer() - want := lTestVars.expectedApiversion - - got := lTestVars.testObject1.APIVersion - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -// DeepCopy -func TestDeepCopy_DeepCopy_ChiefInformationSecurityOfficer(t *testing.T) { - lTestVars := initVarsChiefInformationSecurityOfficer() - - newObject := lTestVars.testObject1.DeepCopy() - - // check api version - got := newObject.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // check kind - got = newObject.Kind - want = lTestVars.expectedKind - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *ChiefInformationSecurityOfficer = nil - var val = nilTestPtr.DeepCopyObject() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopyInto_ChiefInformationSecurityOfficer(t *testing.T) { - lTestVars := initVarsChiefInformationSecurityOfficer() - - lTestVars.testObject1.DeepCopyInto(&lTestVars.testObject2) - - got := lTestVars.testObject2.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyObject_ChiefInformationSecurityOfficer(t *testing.T) { - lTestVars := initVarsChiefInformationSecurityOfficer() - - newRuntimeObject := lTestVars.testObject1.DeepCopyObject() - newObject := newRuntimeObject.(*ChiefInformationSecurityOfficer) - got := newObject.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyList_ChiefInformationSecurityOfficer(t *testing.T) { - lTestVars := initVarsChiefInformationSecurityOfficer() - newObjectList := lTestVars.objectList1.DeepCopy() - - got := newObjectList.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // a typed pointer set to nil - var nilTestPtr *ChiefInformationSecurityOfficerList = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyIntoList_ChiefInformationSecurityOfficer(t *testing.T) { - lTestVars := initVarsChiefInformationSecurityOfficer() - - lTestVars.objectList1.DeepCopyInto(&lTestVars.objectList2) - - got := lTestVars.objectList2.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyListObject_ChiefInformationSecurityOfficer(t *testing.T) { - lTestVars := initVarsChiefInformationSecurityOfficer() - - newRuntimeObject := lTestVars.objectList1.DeepCopyObject() - newObject := newRuntimeObject.(*ChiefInformationSecurityOfficerList) - got := newObject.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *ChiefInformationSecurityOfficerList = nil - var val = nilTestPtr.DeepCopyObject() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopySpec_ChiefInformationSecurityOfficer(t *testing.T) { - lTestVars := initVarsChiefInformationSecurityOfficer() - - newObjectList := lTestVars.testObjectSpec1.DeepCopy() - - got := newObjectList.Dummy - want := lTestVars.expectedSpec - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *ChiefInformationSecurityOfficerSpec = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopySpecInto_ChiefInformationSecurityOfficer(t *testing.T) { - lTestVars := initVarsChiefInformationSecurityOfficer() - - lTestVars.testObjectSpec1.DeepCopyInto(&lTestVars.testObjectSpec2) - - got := lTestVars.testObjectSpec2.Dummy - want := lTestVars.expectedSpec - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyStatus_ChiefInformationSecurityOfficer(t *testing.T) { - lTestVars := initVarsChiefInformationSecurityOfficer() - - newObjectStatus := lTestVars.testObjectStatus1.DeepCopy() - - got := newObjectStatus.Dummy - want := lTestVars.expectedStatus - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // a typed pointer set to nil - var nilTestPtr *ChiefInformationSecurityOfficerStatus = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopyStatusInto_ChiefInformationSecurityOfficer(t *testing.T) { - lTestVars := initVarsChiefInformationSecurityOfficer() - - lTestVars.testObjectStatus1.DeepCopyInto(&lTestVars.testObjectStatus2) - - got := lTestVars.testObjectStatus2.Dummy - want := lTestVars.expectedStatus - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} diff --git a/apis/customer/v1alpha1/chiefinformationsecurityofficer_types.go b/apis/customer/v1alpha1/chiefinformationsecurityofficer_types.go deleted file mode 100644 index 31cf065..0000000 --- a/apis/customer/v1alpha1/chiefinformationsecurityofficer_types.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright 2021. - -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" -) - -// 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. - -// ChiefInformationSecurityOfficerSpec defines the desired state of ChiefInformationSecurityOfficer -type ChiefInformationSecurityOfficerSpec struct { - // Name is the full name of the ChiefInformationSecurityOfficer. - Name string `json:"name,omitempty"` - - // Title is the military or professional title of the ChiefInformationSecurityOfficer - Title string `json:"title,omitempty"` - - //Organization is the name of the organization of the ChiefInformationSecurityOfficer - Organization string `json:"organization,omitempty"` - - //Email is the email address of the ChiefInformationSecurityOfficer - Email string `json:"email,omitempty"` - - //Phone is the phone number of the ChiefInformationSecurityOfficer - Phone string `json:"phone,omitempty"` - - // test Dummy is an example field of Project. Edit project_types.go to remove/update - Dummy string `json:"dummy,omitempty"` -} - -// ChiefInformationSecurityOfficerStatus defines the observed state of ChiefInformationSecurityOfficer -type ChiefInformationSecurityOfficerStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // test Dummy is an example field of Project. Edit project_types.go to remove/update - Dummy string `json:"dummy,omitempty"` -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// ChiefInformationSecurityOfficer is the Schema for the chiefinformationsecurityofficers API -type ChiefInformationSecurityOfficer struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ChiefInformationSecurityOfficerSpec `json:"spec,omitempty"` - Status ChiefInformationSecurityOfficerStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// ChiefInformationSecurityOfficerList contains a list of ChiefInformationSecurityOfficer -type ChiefInformationSecurityOfficerList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ChiefInformationSecurityOfficer `json:"items"` -} - -func init() { - SchemeBuilder.Register(&ChiefInformationSecurityOfficer{}, &ChiefInformationSecurityOfficerList{}) -} diff --git a/apis/customer/v1alpha1/customer_scaffold_test.go b/apis/customer/v1alpha1/customer_scaffold_test.go deleted file mode 100644 index 55c444c..0000000 --- a/apis/customer/v1alpha1/customer_scaffold_test.go +++ /dev/null @@ -1,287 +0,0 @@ -package v1alpha1 - -import ( - "reflect" - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// Reusable test variables -type testVarsCustomer = struct { - testKind string - testApiversion string - testSpec string - testStatus string - - expectedKind string - expectedApiversion string - expectedSpec string - expectedStatus string - - testObject1 Customer - testObject2 Customer - - objectItems1 []Customer - objectList1 CustomerList - - objectItems2 []Customer - objectList2 CustomerList - - // leave scaffold Foo value for testing? - testObjectSpec1 CustomerSpec - testObjectSpec2 CustomerSpec - - // leave scaffold Foo value for testing? - testObjectStatus1 CustomerStatus - testObjectStatus2 CustomerStatus -} - -func initVarsCustomer() testVarsCustomer { - testVars := testVarsCustomer{} - - testVars.testKind = "TestKind" - testVars.testApiversion = "v22" - testVars.testSpec = "test spec value" - testVars.testStatus = "test status value" - - testVars.expectedApiversion = testVars.testApiversion - testVars.expectedKind = testVars.testKind - testVars.expectedSpec = testVars.testSpec - testVars.expectedStatus = testVars.testStatus - - var object1MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: testVars.testKind, APIVersion: testVars.testApiversion} - testVars.testObject1 = Customer{TypeMeta: object1MetaType} - - var object2MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind2", APIVersion: "V99"} - testVars.testObject2 = Customer{TypeMeta: object2MetaType} - - var objectList1MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind_List", APIVersion: "V12"} - var objectItems1 []Customer = []Customer{testVars.testObject1, testVars.testObject2} - // test_object_list = CustomerList(objectList1MetaType,nil,object_items) - testVars.objectList1 = CustomerList{TypeMeta: objectList1MetaType, Items: objectItems1} - - var objectList2MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind_List", APIVersion: "V12"} - var objectItems2 []Customer = []Customer{testVars.testObject2} - // test_object_list = CustomerList(objectList1MetaType,nil,object_items) - testVars.objectList2 = CustomerList{TypeMeta: objectList2MetaType, Items: objectItems2} - - // leave scaffold Foo value for testing? - testVars.testObjectSpec1 = CustomerSpec{Dummy: testVars.testSpec} - testVars.testObjectSpec2 = CustomerSpec{Dummy: "other value"} - - // leave scaffold Foo value for testing? - testVars.testObjectStatus1 = CustomerStatus{Dummy: testVars.testStatus} - testVars.testObjectStatus2 = CustomerStatus{Dummy: "other value"} - - return testVars -} - -func TestGroupVars_Customer(t *testing.T) { - - xType := reflect.TypeOf(GroupVersion) - // convert object type to string - got := xType.String() - want := "schema.GroupVersion" - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -// Test Type called Customer -func TestTypes_Customer(t *testing.T) { - lTestVars := initVarsCustomer() - want := lTestVars.expectedApiversion - - got := lTestVars.testObject1.APIVersion - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -// DeepCopy -func TestDeepCopy_DeepCopy_Customer(t *testing.T) { - lTestVars := initVarsCustomer() - - newObject := lTestVars.testObject1.DeepCopy() - - // check api version - got := newObject.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // check kind - got = newObject.Kind - want = lTestVars.expectedKind - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *Customer = nil - var val = nilTestPtr.DeepCopyObject() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopyInto_Customer(t *testing.T) { - lTestVars := initVarsCustomer() - - lTestVars.testObject1.DeepCopyInto(&lTestVars.testObject2) - - got := lTestVars.testObject2.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyObject_Customer(t *testing.T) { - lTestVars := initVarsCustomer() - - newRuntimeObject := lTestVars.testObject1.DeepCopyObject() - newObject := newRuntimeObject.(*Customer) - got := newObject.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyList_Customer(t *testing.T) { - lTestVars := initVarsCustomer() - newObjectList := lTestVars.objectList1.DeepCopy() - - got := newObjectList.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // a typed pointer set to nil - var nilTestPtr *CustomerList = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyIntoList_Customer(t *testing.T) { - lTestVars := initVarsCustomer() - - lTestVars.objectList1.DeepCopyInto(&lTestVars.objectList2) - - got := lTestVars.objectList2.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyListObject_Customer(t *testing.T) { - lTestVars := initVarsCustomer() - - newRuntimeObject := lTestVars.objectList1.DeepCopyObject() - newObject := newRuntimeObject.(*CustomerList) - got := newObject.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *CustomerList = nil - var val = nilTestPtr.DeepCopyObject() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopySpec_Customer(t *testing.T) { - lTestVars := initVarsCustomer() - - newObjectList := lTestVars.testObjectSpec1.DeepCopy() - - got := newObjectList.Dummy - want := lTestVars.expectedSpec - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *CustomerSpec = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopySpecInto_Customer(t *testing.T) { - lTestVars := initVarsCustomer() - - lTestVars.testObjectSpec1.DeepCopyInto(&lTestVars.testObjectSpec2) - - got := lTestVars.testObjectSpec2.Dummy - want := lTestVars.expectedSpec - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyStatus_Customer(t *testing.T) { - lTestVars := initVarsCustomer() - - newObjectStatus := lTestVars.testObjectStatus1.DeepCopy() - - got := newObjectStatus.Dummy - want := lTestVars.expectedStatus - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // a typed pointer set to nil - var nilTestPtr *CustomerStatus = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopyStatusInto_Customer(t *testing.T) { - lTestVars := initVarsCustomer() - - lTestVars.testObjectStatus1.DeepCopyInto(&lTestVars.testObjectStatus2) - - got := lTestVars.testObjectStatus2.Dummy - want := lTestVars.expectedStatus - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} diff --git a/apis/customer/v1alpha1/customer_types.go b/apis/customer/v1alpha1/customer_types.go deleted file mode 100644 index 9fc3eec..0000000 --- a/apis/customer/v1alpha1/customer_types.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2021. - -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" -) - -// CustomerSpec defines the desired state of Customer -type CustomerSpec struct { - // Organization is the organizational information for this customer based upon the organization record in AutoBot - Organization OrganizationSpec `json:"Organization,omitempty"` - - // test dummy - do not remove - Dummy string `json:"dummy,omitempty"` -} - -// CustomerStatus defines the observed state of Customer -type CustomerStatus struct { - //TODO Figureout what this looks like - - // test dummy - do not remove - Dummy string `json:"dummy,omitempty"` -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// Customer is the Schema for the customers API -type Customer struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec CustomerSpec `json:"spec,omitempty"` - Status CustomerStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// CustomerList contains a list of Customer -type CustomerList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Customer `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Customer{}, &CustomerList{}) -} diff --git a/apis/customer/v1alpha1/groupversion_info.go b/apis/customer/v1alpha1/groupversion_info.go deleted file mode 100644 index c0bb447..0000000 --- a/apis/customer/v1alpha1/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2021. - -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 contains API Schema definitions for the customer v1alpha1 API group -//+kubebuilder:object:generate=true -//+groupName=customer.valkyrie.dso.mil -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "customer.valkyrie.dso.mil", Version: "v1alpha1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/apis/customer/v1alpha1/organization_scaffold_test.go b/apis/customer/v1alpha1/organization_scaffold_test.go deleted file mode 100644 index c5dfb21..0000000 --- a/apis/customer/v1alpha1/organization_scaffold_test.go +++ /dev/null @@ -1,287 +0,0 @@ -package v1alpha1 - -import ( - "reflect" - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// Reusable test variables -type testVarsOrganization = struct { - testKind string - testApiversion string - testSpec string - testStatus string - - expectedKind string - expectedApiversion string - expectedSpec string - expectedStatus string - - testObject1 Organization - testObject2 Organization - - objectItems1 []Organization - objectList1 OrganizationList - - objectItems2 []Organization - objectList2 OrganizationList - - // leave scaffold Foo value for testing? - testObjectSpec1 OrganizationSpec - testObjectSpec2 OrganizationSpec - - // leave scaffold Foo value for testing? - testObjectStatus1 OrganizationStatus - testObjectStatus2 OrganizationStatus -} - -func initVarsOrganization() testVarsOrganization { - testVars := testVarsOrganization{} - - testVars.testKind = "TestKind" - testVars.testApiversion = "v22" - testVars.testSpec = "test spec value" - testVars.testStatus = "test status value" - - testVars.expectedApiversion = testVars.testApiversion - testVars.expectedKind = testVars.testKind - testVars.expectedSpec = testVars.testSpec - testVars.expectedStatus = testVars.testStatus - - var object1MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: testVars.testKind, APIVersion: testVars.testApiversion} - testVars.testObject1 = Organization{TypeMeta: object1MetaType} - - var object2MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind2", APIVersion: "V99"} - testVars.testObject2 = Organization{TypeMeta: object2MetaType} - - var objectList1MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind_List", APIVersion: "V12"} - var objectItems1 []Organization = []Organization{testVars.testObject1, testVars.testObject2} - // test_object_list = OrganizationList(objectList1MetaType,nil,object_items) - testVars.objectList1 = OrganizationList{TypeMeta: objectList1MetaType, Items: objectItems1} - - var objectList2MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind_List", APIVersion: "V12"} - var objectItems2 []Organization = []Organization{testVars.testObject2} - // test_object_list = OrganizationList(objectList1MetaType,nil,object_items) - testVars.objectList2 = OrganizationList{TypeMeta: objectList2MetaType, Items: objectItems2} - - // leave scaffold Foo value for testing? - testVars.testObjectSpec1 = OrganizationSpec{Dummy: testVars.testSpec} - testVars.testObjectSpec2 = OrganizationSpec{Dummy: "other value"} - - // leave scaffold Foo value for testing? - testVars.testObjectStatus1 = OrganizationStatus{Dummy: testVars.testStatus} - testVars.testObjectStatus2 = OrganizationStatus{Dummy: "other value"} - - return testVars -} - -func TestGroupVars_Organization(t *testing.T) { - - xType := reflect.TypeOf(GroupVersion) - // convert object type to string - got := xType.String() - want := "schema.GroupVersion" - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -// Test Type called Organization -func TestTypes_Organization(t *testing.T) { - lTestVars := initVarsOrganization() - want := lTestVars.expectedApiversion - - got := lTestVars.testObject1.APIVersion - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -// DeepCopy -func TestDeepCopy_DeepCopy_Organization(t *testing.T) { - lTestVars := initVarsOrganization() - - newObject := lTestVars.testObject1.DeepCopy() - - // check api version - got := newObject.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // check kind - got = newObject.Kind - want = lTestVars.expectedKind - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *Organization = nil - var val = nilTestPtr.DeepCopyObject() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopyInto_Organization(t *testing.T) { - lTestVars := initVarsOrganization() - - lTestVars.testObject1.DeepCopyInto(&lTestVars.testObject2) - - got := lTestVars.testObject2.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyObject_Organization(t *testing.T) { - lTestVars := initVarsOrganization() - - newRuntimeObject := lTestVars.testObject1.DeepCopyObject() - newObject := newRuntimeObject.(*Organization) - got := newObject.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyList_Organization(t *testing.T) { - lTestVars := initVarsOrganization() - newObjectList := lTestVars.objectList1.DeepCopy() - - got := newObjectList.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // a typed pointer set to nil - var nilTestPtr *OrganizationList = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyIntoList_Organization(t *testing.T) { - lTestVars := initVarsOrganization() - - lTestVars.objectList1.DeepCopyInto(&lTestVars.objectList2) - - got := lTestVars.objectList2.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyListObject_Organization(t *testing.T) { - lTestVars := initVarsOrganization() - - newRuntimeObject := lTestVars.objectList1.DeepCopyObject() - newObject := newRuntimeObject.(*OrganizationList) - got := newObject.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *OrganizationList = nil - var val = nilTestPtr.DeepCopyObject() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopySpec_Organization(t *testing.T) { - lTestVars := initVarsOrganization() - - newObjectList := lTestVars.testObjectSpec1.DeepCopy() - - got := newObjectList.Dummy - want := lTestVars.expectedSpec - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *OrganizationSpec = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopySpecInto_Organization(t *testing.T) { - lTestVars := initVarsOrganization() - - lTestVars.testObjectSpec1.DeepCopyInto(&lTestVars.testObjectSpec2) - - got := lTestVars.testObjectSpec2.Dummy - want := lTestVars.expectedSpec - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyStatus_Organization(t *testing.T) { - lTestVars := initVarsOrganization() - - newObjectStatus := lTestVars.testObjectStatus1.DeepCopy() - - got := newObjectStatus.Dummy - want := lTestVars.expectedStatus - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // a typed pointer set to nil - var nilTestPtr *OrganizationStatus = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopyStatusInto_Organization(t *testing.T) { - lTestVars := initVarsOrganization() - - lTestVars.testObjectStatus1.DeepCopyInto(&lTestVars.testObjectStatus2) - - got := lTestVars.testObjectStatus2.Dummy - want := lTestVars.expectedStatus - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} diff --git a/apis/customer/v1alpha1/organization_types.go b/apis/customer/v1alpha1/organization_types.go deleted file mode 100644 index 0752004..0000000 --- a/apis/customer/v1alpha1/organization_types.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2021. - -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" -) - -// OrganizationSpec defines the desired state of Organization -type OrganizationSpec struct { - // AuthorizingOfficial is the official authorizing the applications on Platform One for this organization. - AuthorizingOfficial AuthorizingOfficialSpec `json:"authorizing_official"` - - // SystemOwner is the owner for Platform One Party Bus - SystemOwner SystemOwnerSpec `json:"system_owner"` - - //ChiefInformationSecurityOfficer is the leading security officer responsible for security of Platform One. - ChiefInformationSecurityOfficer ChiefInformationSecurityOfficerSpec `json:"chief_information_security_officer"` - - // test Dummy is an example field of Project. Edit project_types.go to remove/update - Dummy string `json:"dummy,omitempty"` -} - -// OrganizationStatus defines the observed state of Organization -type OrganizationStatus struct { - // TODO: Figure out what the status should be for organization - // test Dummy is an example field of Project. Edit project_types.go to remove/update - Dummy string `json:"dummy,omitempty"` -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// Organization is the Schema for the organizations API -type Organization struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec OrganizationSpec `json:"spec,omitempty"` - Status OrganizationStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// OrganizationList contains a list of Organization -type OrganizationList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Organization `json:"items"` -} - -func init() { - SchemeBuilder.Register(&Organization{}, &OrganizationList{}) -} diff --git a/apis/customer/v1alpha1/systemowner_scaffold_test.go b/apis/customer/v1alpha1/systemowner_scaffold_test.go deleted file mode 100644 index 87abe53..0000000 --- a/apis/customer/v1alpha1/systemowner_scaffold_test.go +++ /dev/null @@ -1,287 +0,0 @@ -package v1alpha1 - -import ( - "reflect" - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// Reusable test variables -type testVarsSystemOwner = struct { - testKind string - testApiversion string - testSpec string - testStatus string - - expectedKind string - expectedApiversion string - expectedSpec string - expectedStatus string - - testObject1 SystemOwner - testObject2 SystemOwner - - objectItems1 []SystemOwner - objectList1 SystemOwnerList - - objectItems2 []SystemOwner - objectList2 SystemOwnerList - - // leave scaffold Foo value for testing? - testObjectSpec1 SystemOwnerSpec - testObjectSpec2 SystemOwnerSpec - - // leave scaffold Foo value for testing? - testObjectStatus1 SystemOwnerStatus - testObjectStatus2 SystemOwnerStatus -} - -func initVarsSystemOwner() testVarsSystemOwner { - testVars := testVarsSystemOwner{} - - testVars.testKind = "TestKind" - testVars.testApiversion = "v22" - testVars.testSpec = "test spec value" - testVars.testStatus = "test status value" - - testVars.expectedApiversion = testVars.testApiversion - testVars.expectedKind = testVars.testKind - testVars.expectedSpec = testVars.testSpec - testVars.expectedStatus = testVars.testStatus - - var object1MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: testVars.testKind, APIVersion: testVars.testApiversion} - testVars.testObject1 = SystemOwner{TypeMeta: object1MetaType} - - var object2MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind2", APIVersion: "V99"} - testVars.testObject2 = SystemOwner{TypeMeta: object2MetaType} - - var objectList1MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind_List", APIVersion: "V12"} - var objectItems1 []SystemOwner = []SystemOwner{testVars.testObject1, testVars.testObject2} - // test_object_list = SystemOwnerList(objectList1MetaType,nil,object_items) - testVars.objectList1 = SystemOwnerList{TypeMeta: objectList1MetaType, Items: objectItems1} - - var objectList2MetaType metav1.TypeMeta = metav1.TypeMeta{Kind: "TestKind_List", APIVersion: "V12"} - var objectItems2 []SystemOwner = []SystemOwner{testVars.testObject2} - // test_object_list = SystemOwnerList(objectList1MetaType,nil,object_items) - testVars.objectList2 = SystemOwnerList{TypeMeta: objectList2MetaType, Items: objectItems2} - - // leave scaffold Foo value for testing? - testVars.testObjectSpec1 = SystemOwnerSpec{Dummy: testVars.testSpec} - testVars.testObjectSpec2 = SystemOwnerSpec{Dummy: "other value"} - - // leave scaffold Foo value for testing? - testVars.testObjectStatus1 = SystemOwnerStatus{Dummy: testVars.testStatus} - testVars.testObjectStatus2 = SystemOwnerStatus{Dummy: "other value"} - - return testVars -} - -func TestGroupVars_SystemOwner(t *testing.T) { - - xType := reflect.TypeOf(GroupVersion) - // convert object type to string - got := xType.String() - want := "schema.GroupVersion" - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -// Test Type called SystemOwner -func TestTypes_SystemOwner(t *testing.T) { - lTestVars := initVarsSystemOwner() - want := lTestVars.expectedApiversion - - got := lTestVars.testObject1.APIVersion - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -// DeepCopy -func TestDeepCopy_DeepCopy_SystemOwner(t *testing.T) { - lTestVars := initVarsSystemOwner() - - newObject := lTestVars.testObject1.DeepCopy() - - // check api version - got := newObject.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // check kind - got = newObject.Kind - want = lTestVars.expectedKind - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *SystemOwner = nil - var val = nilTestPtr.DeepCopyObject() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopyInto_SystemOwner(t *testing.T) { - lTestVars := initVarsSystemOwner() - - lTestVars.testObject1.DeepCopyInto(&lTestVars.testObject2) - - got := lTestVars.testObject2.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyObject_SystemOwner(t *testing.T) { - lTestVars := initVarsSystemOwner() - - newRuntimeObject := lTestVars.testObject1.DeepCopyObject() - newObject := newRuntimeObject.(*SystemOwner) - got := newObject.APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyList_SystemOwner(t *testing.T) { - lTestVars := initVarsSystemOwner() - newObjectList := lTestVars.objectList1.DeepCopy() - - got := newObjectList.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // a typed pointer set to nil - var nilTestPtr *SystemOwnerList = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyIntoList_SystemOwner(t *testing.T) { - lTestVars := initVarsSystemOwner() - - lTestVars.objectList1.DeepCopyInto(&lTestVars.objectList2) - - got := lTestVars.objectList2.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyListObject_SystemOwner(t *testing.T) { - lTestVars := initVarsSystemOwner() - - newRuntimeObject := lTestVars.objectList1.DeepCopyObject() - newObject := newRuntimeObject.(*SystemOwnerList) - got := newObject.Items[0].APIVersion - want := lTestVars.expectedApiversion - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *SystemOwnerList = nil - var val = nilTestPtr.DeepCopyObject() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopySpec_SystemOwner(t *testing.T) { - lTestVars := initVarsSystemOwner() - - newObjectList := lTestVars.testObjectSpec1.DeepCopy() - - got := newObjectList.Dummy - want := lTestVars.expectedSpec - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - var nilTestPtr *SystemOwnerSpec = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopySpecInto_SystemOwner(t *testing.T) { - lTestVars := initVarsSystemOwner() - - lTestVars.testObjectSpec1.DeepCopyInto(&lTestVars.testObjectSpec2) - - got := lTestVars.testObjectSpec2.Dummy - want := lTestVars.expectedSpec - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} - -func TestDeepCopy_DeepCopyStatus_SystemOwner(t *testing.T) { - lTestVars := initVarsSystemOwner() - - newObjectStatus := lTestVars.testObjectStatus1.DeepCopy() - - got := newObjectStatus.Dummy - want := lTestVars.expectedStatus - - if got != want { - t.Errorf("got %s want %s", got, want) - } - - // a typed pointer set to nil - var nilTestPtr *SystemOwnerStatus = nil - var val = nilTestPtr.DeepCopy() - if val != nil { - t.Errorf("got %s want %s", "not nil", "nil") - } - - t.Log("Success") -} - -func TestDeepCopy_DeepCopyStatusInto_SystemOwner(t *testing.T) { - lTestVars := initVarsSystemOwner() - - lTestVars.testObjectStatus1.DeepCopyInto(&lTestVars.testObjectStatus2) - - got := lTestVars.testObjectStatus2.Dummy - want := lTestVars.expectedStatus - - if got != want { - t.Errorf("got %s want %s", got, want) - } - t.Log("Success") -} diff --git a/apis/customer/v1alpha1/systemowner_types.go b/apis/customer/v1alpha1/systemowner_types.go deleted file mode 100644 index 7fe66c1..0000000 --- a/apis/customer/v1alpha1/systemowner_types.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright 2021. - -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" -) - -// 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. - -// SystemOwnerSpec defines the desired state of SystemOwner -type SystemOwnerSpec struct { - // Name is the full name of the SystemOwner. - Name string `json:"name,omitempty"` - - // Title is the military or professional title of the SystemOwner - Title string `json:"title,omitempty"` - - //Organization is the name of the organization of the SystemOwner - Organization string `json:"organization,omitempty"` - - //Email is the email address of the SystemOwner - Email string `json:"email,omitempty"` - - //Phone is the phone number of the SystemOwner - Phone string `json:"phone,omitempty"` - - // test Dummy is an example field of Project. Edit project_types.go to remove/update - Dummy string `json:"dummy,omitempty"` -} - -// SystemOwnerStatus defines the observed state of SystemOwner -type SystemOwnerStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // test Dummy is an example field of Project. Edit project_types.go to remove/update - Dummy string `json:"dummy,omitempty"` -} - -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// SystemOwner is the Schema for the systemowners API -type SystemOwner struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec SystemOwnerSpec `json:"spec,omitempty"` - Status SystemOwnerStatus `json:"status,omitempty"` -} - -//+kubebuilder:object:root=true - -// SystemOwnerList contains a list of SystemOwner -type SystemOwnerList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []SystemOwner `json:"items"` -} - -func init() { - SchemeBuilder.Register(&SystemOwner{}, &SystemOwnerList{}) -} diff --git a/apis/customer/v1alpha1/zz_generated.deepcopy.go b/apis/customer/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 368bc29..0000000 --- a/apis/customer/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,474 +0,0 @@ -// +build !ignore_autogenerated - -/* -Copyright 2021. - -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. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthorizingOfficial) DeepCopyInto(out *AuthorizingOfficial) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthorizingOfficial. -func (in *AuthorizingOfficial) DeepCopy() *AuthorizingOfficial { - if in == nil { - return nil - } - out := new(AuthorizingOfficial) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AuthorizingOfficial) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthorizingOfficialList) DeepCopyInto(out *AuthorizingOfficialList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AuthorizingOfficial, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthorizingOfficialList. -func (in *AuthorizingOfficialList) DeepCopy() *AuthorizingOfficialList { - if in == nil { - return nil - } - out := new(AuthorizingOfficialList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AuthorizingOfficialList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthorizingOfficialSpec) DeepCopyInto(out *AuthorizingOfficialSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthorizingOfficialSpec. -func (in *AuthorizingOfficialSpec) DeepCopy() *AuthorizingOfficialSpec { - if in == nil { - return nil - } - out := new(AuthorizingOfficialSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AuthorizingOfficialStatus) DeepCopyInto(out *AuthorizingOfficialStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthorizingOfficialStatus. -func (in *AuthorizingOfficialStatus) DeepCopy() *AuthorizingOfficialStatus { - if in == nil { - return nil - } - out := new(AuthorizingOfficialStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ChiefInformationSecurityOfficer) DeepCopyInto(out *ChiefInformationSecurityOfficer) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiefInformationSecurityOfficer. -func (in *ChiefInformationSecurityOfficer) DeepCopy() *ChiefInformationSecurityOfficer { - if in == nil { - return nil - } - out := new(ChiefInformationSecurityOfficer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ChiefInformationSecurityOfficer) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ChiefInformationSecurityOfficerList) DeepCopyInto(out *ChiefInformationSecurityOfficerList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ChiefInformationSecurityOfficer, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiefInformationSecurityOfficerList. -func (in *ChiefInformationSecurityOfficerList) DeepCopy() *ChiefInformationSecurityOfficerList { - if in == nil { - return nil - } - out := new(ChiefInformationSecurityOfficerList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ChiefInformationSecurityOfficerList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ChiefInformationSecurityOfficerSpec) DeepCopyInto(out *ChiefInformationSecurityOfficerSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiefInformationSecurityOfficerSpec. -func (in *ChiefInformationSecurityOfficerSpec) DeepCopy() *ChiefInformationSecurityOfficerSpec { - if in == nil { - return nil - } - out := new(ChiefInformationSecurityOfficerSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ChiefInformationSecurityOfficerStatus) DeepCopyInto(out *ChiefInformationSecurityOfficerStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChiefInformationSecurityOfficerStatus. -func (in *ChiefInformationSecurityOfficerStatus) DeepCopy() *ChiefInformationSecurityOfficerStatus { - if in == nil { - return nil - } - out := new(ChiefInformationSecurityOfficerStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Customer) DeepCopyInto(out *Customer) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Customer. -func (in *Customer) DeepCopy() *Customer { - if in == nil { - return nil - } - out := new(Customer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Customer) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomerList) DeepCopyInto(out *CustomerList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Customer, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomerList. -func (in *CustomerList) DeepCopy() *CustomerList { - if in == nil { - return nil - } - out := new(CustomerList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *CustomerList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomerSpec) DeepCopyInto(out *CustomerSpec) { - *out = *in - out.Organization = in.Organization -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomerSpec. -func (in *CustomerSpec) DeepCopy() *CustomerSpec { - if in == nil { - return nil - } - out := new(CustomerSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CustomerStatus) DeepCopyInto(out *CustomerStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomerStatus. -func (in *CustomerStatus) DeepCopy() *CustomerStatus { - if in == nil { - return nil - } - out := new(CustomerStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Organization) DeepCopyInto(out *Organization) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Organization. -func (in *Organization) DeepCopy() *Organization { - if in == nil { - return nil - } - out := new(Organization) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Organization) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OrganizationList) DeepCopyInto(out *OrganizationList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Organization, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrganizationList. -func (in *OrganizationList) DeepCopy() *OrganizationList { - if in == nil { - return nil - } - out := new(OrganizationList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OrganizationList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OrganizationSpec) DeepCopyInto(out *OrganizationSpec) { - *out = *in - out.AuthorizingOfficial = in.AuthorizingOfficial - out.SystemOwner = in.SystemOwner - out.ChiefInformationSecurityOfficer = in.ChiefInformationSecurityOfficer -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrganizationSpec. -func (in *OrganizationSpec) DeepCopy() *OrganizationSpec { - if in == nil { - return nil - } - out := new(OrganizationSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OrganizationStatus) DeepCopyInto(out *OrganizationStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OrganizationStatus. -func (in *OrganizationStatus) DeepCopy() *OrganizationStatus { - if in == nil { - return nil - } - out := new(OrganizationStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SystemOwner) DeepCopyInto(out *SystemOwner) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.Spec = in.Spec - out.Status = in.Status -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemOwner. -func (in *SystemOwner) DeepCopy() *SystemOwner { - if in == nil { - return nil - } - out := new(SystemOwner) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SystemOwner) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SystemOwnerList) DeepCopyInto(out *SystemOwnerList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]SystemOwner, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemOwnerList. -func (in *SystemOwnerList) DeepCopy() *SystemOwnerList { - if in == nil { - return nil - } - out := new(SystemOwnerList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SystemOwnerList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SystemOwnerSpec) DeepCopyInto(out *SystemOwnerSpec) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemOwnerSpec. -func (in *SystemOwnerSpec) DeepCopy() *SystemOwnerSpec { - if in == nil { - return nil - } - out := new(SystemOwnerSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SystemOwnerStatus) DeepCopyInto(out *SystemOwnerStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemOwnerStatus. -func (in *SystemOwnerStatus) DeepCopy() *SystemOwnerStatus { - if in == nil { - return nil - } - out := new(SystemOwnerStatus) - in.DeepCopyInto(out) - return out -} diff --git a/config/crd/bases/customer.valkyrie.dso.mil_customers.yaml b/config/crd/bases/customer.valkyrie.dso.mil_customers.yaml old mode 100755 new mode 100644 diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 0431143..361d850 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -2,16 +2,11 @@ # since it depends on service name and namespace that are out of this kustomize package. # It should be run by config/default resources: -- bases/customer.valkyrie.dso.mil_customers.yaml -- bases/customer.valkyrie.dso.mil_organizations.yaml - bases/gitlab.valkyrie.dso.mil_groups.yaml - bases/gitlab.valkyrie.dso.mil_projects.yaml - bases/gitlab.valkyrie.dso.mil_pipelines.yaml - bases/gitlab.valkyrie.dso.mil_sonarqubepipelineconfigurations.yaml - bases/gitlab.valkyrie.dso.mil_sdelementspipelineconfigurations.yaml -- bases/customer.valkyrie.dso.mil_authorizingofficials.yaml -- bases/customer.valkyrie.dso.mil_systemowners.yaml -- bases/customer.valkyrie.dso.mil_chiefinformationsecurityofficers.yaml - bases/sonarqube.valkyrie.dso.mil_projects.yaml - bases/fortify.valkyrie.dso.mil_fortifycredentials.yaml - bases/fortify.valkyrie.dso.mil_fortifypipelineconfigurations.yaml @@ -25,8 +20,6 @@ resources: patchesStrategicMerge: # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. # patches here are for enabling the conversion webhook for each CRD -#- patches/webhook_in_customers.yaml -#- patches/webhook_in_organizations.yaml #- patches/webhook_in_groups.yaml #- patches/webhook_in_projects.yaml #- patches/webhook_in_pipelines.yaml @@ -34,9 +27,6 @@ patchesStrategicMerge: #- patches/webhook_in_twistlockpipelineconfigurations.yaml #- patches/webhook_in_sonarqubepipelineconfigurations.yaml #- patches/webhook_in_sdelementspipelineconfigurations.yaml -#- patches/webhook_in_authorizingofficials.yaml -#- patches/webhook_in_systemowners.yaml -#- patches/webhook_in_chiefinformationsecurityofficers.yaml #- patches/webhook_in_fortifycredentials.yaml #- patches/webhook_in_gitlabcredentials.yaml #- patches/webhook_in_twistlockcredentials.yaml @@ -46,8 +36,6 @@ patchesStrategicMerge: # [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix. # patches here are for enabling the CA injection for each CRD -#- patches/cainjection_in_customers.yaml -#- patches/cainjection_in_organizations.yaml #- patches/cainjection_in_groups.yaml #- patches/cainjection_in_projects.yaml #- patches/cainjection_in_pipelines.yaml @@ -55,9 +43,6 @@ patchesStrategicMerge: #- patches/cainjection_in_twistlockpipelineconfigurations.yaml #- patches/cainjection_in_sonarqubepipelineconfigurations.yaml #- patches/cainjection_in_sdelementspipelineconfigurations.yaml -#- patches/cainjection_in_authorizingofficials.yaml -#- patches/cainjection_in_systemowners.yaml -#- patches/cainjection_in_chiefinformationsecurityofficers.yaml #- patches/cainjection_in_fortifycredentials.yaml #- patches/cainjection_in_gitlabcredentials.yaml #- patches/cainjection_in_twistlockcredentials.yaml diff --git a/config/crd/patches/cainjection_in_authorizingofficials.yaml b/config/crd/patches/cainjection_in_authorizingofficials.yaml deleted file mode 100644 index 67b3388..0000000 --- a/config/crd/patches/cainjection_in_authorizingofficials.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: authorizingofficials.customer.valkyrie.dso.mil diff --git a/config/crd/patches/cainjection_in_chiefinformationsecurityofficers.yaml b/config/crd/patches/cainjection_in_chiefinformationsecurityofficers.yaml deleted file mode 100644 index 7109ff3..0000000 --- a/config/crd/patches/cainjection_in_chiefinformationsecurityofficers.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: chiefinformationsecurityofficers.customer.valkyrie.dso.mil diff --git a/config/crd/patches/cainjection_in_customers.yaml b/config/crd/patches/cainjection_in_customers.yaml deleted file mode 100644 index 4672046..0000000 --- a/config/crd/patches/cainjection_in_customers.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: customers.customer.valkyrie.dso.mil diff --git a/config/crd/patches/cainjection_in_organizations.yaml b/config/crd/patches/cainjection_in_organizations.yaml deleted file mode 100644 index bf88b2f..0000000 --- a/config/crd/patches/cainjection_in_organizations.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: organizations.customer.valkyrie.dso.mil diff --git a/config/crd/patches/cainjection_in_systemowners.yaml b/config/crd/patches/cainjection_in_systemowners.yaml deleted file mode 100644 index dc425a7..0000000 --- a/config/crd/patches/cainjection_in_systemowners.yaml +++ /dev/null @@ -1,7 +0,0 @@ -# The following patch adds a directive for certmanager to inject CA into the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: systemowners.customer.valkyrie.dso.mil diff --git a/config/crd/patches/webhook_in_authorizingofficials.yaml b/config/crd/patches/webhook_in_authorizingofficials.yaml deleted file mode 100644 index 8872ec7..0000000 --- a/config/crd/patches/webhook_in_authorizingofficials.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: authorizingofficials.customer.valkyrie.dso.mil -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: system - name: webhook-service - path: /convert - conversionReviewVersions: - - v1 diff --git a/config/crd/patches/webhook_in_chiefinformationsecurityofficers.yaml b/config/crd/patches/webhook_in_chiefinformationsecurityofficers.yaml deleted file mode 100644 index af0d150..0000000 --- a/config/crd/patches/webhook_in_chiefinformationsecurityofficers.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: chiefinformationsecurityofficers.customer.valkyrie.dso.mil -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: system - name: webhook-service - path: /convert - conversionReviewVersions: - - v1 diff --git a/config/crd/patches/webhook_in_customers.yaml b/config/crd/patches/webhook_in_customers.yaml deleted file mode 100644 index a24cae7..0000000 --- a/config/crd/patches/webhook_in_customers.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: customers.customer.valkyrie.dso.mil -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: system - name: webhook-service - path: /convert diff --git a/config/crd/patches/webhook_in_organizations.yaml b/config/crd/patches/webhook_in_organizations.yaml deleted file mode 100644 index 7b4c571..0000000 --- a/config/crd/patches/webhook_in_organizations.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: organizations.customer.valkyrie.dso.mil -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: system - name: webhook-service - path: /convert diff --git a/config/crd/patches/webhook_in_systemowners.yaml b/config/crd/patches/webhook_in_systemowners.yaml deleted file mode 100644 index 2f1dbe0..0000000 --- a/config/crd/patches/webhook_in_systemowners.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# The following patch enables a conversion webhook for the CRD -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: systemowners.customer.valkyrie.dso.mil -spec: - conversion: - strategy: Webhook - webhook: - clientConfig: - service: - namespace: system - name: webhook-service - path: /convert - conversionReviewVersions: - - v1 diff --git a/config/rbac/authorizingofficial_editor_role.yaml b/config/rbac/authorizingofficial_editor_role.yaml deleted file mode 100644 index 60e7b69..0000000 --- a/config/rbac/authorizingofficial_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit authorizingofficials. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: authorizingofficial-editor-role -rules: -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - authorizingofficials - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - authorizingofficials/status - verbs: - - get diff --git a/config/rbac/authorizingofficial_viewer_role.yaml b/config/rbac/authorizingofficial_viewer_role.yaml deleted file mode 100644 index 5ac9f5d..0000000 --- a/config/rbac/authorizingofficial_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view authorizingofficials. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: authorizingofficial-viewer-role -rules: -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - authorizingofficials - verbs: - - get - - list - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - authorizingofficials/status - verbs: - - get diff --git a/config/rbac/chiefinformationsecurityofficer_editor_role.yaml b/config/rbac/chiefinformationsecurityofficer_editor_role.yaml deleted file mode 100644 index 426ee51..0000000 --- a/config/rbac/chiefinformationsecurityofficer_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit chiefinformationsecurityofficers. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: chiefinformationsecurityofficer-editor-role -rules: -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - chiefinformationsecurityofficers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - chiefinformationsecurityofficers/status - verbs: - - get diff --git a/config/rbac/chiefinformationsecurityofficer_viewer_role.yaml b/config/rbac/chiefinformationsecurityofficer_viewer_role.yaml deleted file mode 100644 index 3612e59..0000000 --- a/config/rbac/chiefinformationsecurityofficer_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view chiefinformationsecurityofficers. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: chiefinformationsecurityofficer-viewer-role -rules: -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - chiefinformationsecurityofficers - verbs: - - get - - list - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - chiefinformationsecurityofficers/status - verbs: - - get diff --git a/config/rbac/customer_editor_role.yaml b/config/rbac/customer_editor_role.yaml deleted file mode 100644 index 9355d50..0000000 --- a/config/rbac/customer_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit customers. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: customer-editor-role -rules: -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - customers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - customers/status - verbs: - - get diff --git a/config/rbac/customer_viewer_role.yaml b/config/rbac/customer_viewer_role.yaml deleted file mode 100644 index 5942f1d..0000000 --- a/config/rbac/customer_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view customers. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: customer-viewer-role -rules: -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - customers - verbs: - - get - - list - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - customers/status - verbs: - - get diff --git a/config/rbac/organization_editor_role.yaml b/config/rbac/organization_editor_role.yaml deleted file mode 100644 index cde33b8..0000000 --- a/config/rbac/organization_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit organizations. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: organization-editor-role -rules: -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - organizations - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - organizations/status - verbs: - - get diff --git a/config/rbac/organization_viewer_role.yaml b/config/rbac/organization_viewer_role.yaml deleted file mode 100644 index a969e6d..0000000 --- a/config/rbac/organization_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view organizations. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: organization-viewer-role -rules: -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - organizations - verbs: - - get - - list - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - organizations/status - verbs: - - get diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 00647e5..f1443c2 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -22,136 +22,6 @@ rules: - get - list - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - authorizingofficials - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - authorizingofficials/finalizers - verbs: - - update -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - authorizingofficials/status - verbs: - - get - - patch - - update -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - chiefinformationsecurityofficers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - chiefinformationsecurityofficers/finalizers - verbs: - - update -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - chiefinformationsecurityofficers/status - verbs: - - get - - patch - - update -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - customers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - customers/finalizers - verbs: - - update -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - customers/status - verbs: - - get - - patch - - update -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - organizations - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - organizations/finalizers - verbs: - - update -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - organizations/status - verbs: - - get - - patch - - update -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - systemowners - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - systemowners/finalizers - verbs: - - update -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - systemowners/status - verbs: - - get - - patch - - update - apiGroups: - fortify.valkyrie.dso.mil resources: diff --git a/config/rbac/systemowner_editor_role.yaml b/config/rbac/systemowner_editor_role.yaml deleted file mode 100644 index 9392717..0000000 --- a/config/rbac/systemowner_editor_role.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# permissions for end users to edit systemowners. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: systemowner-editor-role -rules: -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - systemowners - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - systemowners/status - verbs: - - get diff --git a/config/rbac/systemowner_viewer_role.yaml b/config/rbac/systemowner_viewer_role.yaml deleted file mode 100644 index 88224ef..0000000 --- a/config/rbac/systemowner_viewer_role.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# permissions for end users to view systemowners. -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: systemowner-viewer-role -rules: -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - systemowners - verbs: - - get - - list - - watch -- apiGroups: - - customer.valkyrie.dso.mil - resources: - - systemowners/status - verbs: - - get diff --git a/config/samples/customer_v1alpha1_authorizingofficial.yaml b/config/samples/customer_v1alpha1_authorizingofficial.yaml deleted file mode 100644 index ba736d8..0000000 --- a/config/samples/customer_v1alpha1_authorizingofficial.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: customer.valkyrie.dso.mil/v1alpha1 -kind: AuthorizingOfficial -metadata: - name: authorizingofficial-sample -spec: - # Add fields here - foo: bar diff --git a/config/samples/customer_v1alpha1_chiefinformationsecurityofficer.yaml b/config/samples/customer_v1alpha1_chiefinformationsecurityofficer.yaml deleted file mode 100644 index f9a1208..0000000 --- a/config/samples/customer_v1alpha1_chiefinformationsecurityofficer.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: customer.valkyrie.dso.mil/v1alpha1 -kind: ChiefInformationSecurityOfficer -metadata: - name: chiefinformationsecurityofficer-sample -spec: - # Add fields here - foo: bar diff --git a/config/samples/customer_v1alpha1_customer.yaml b/config/samples/customer_v1alpha1_customer.yaml deleted file mode 100644 index 9aa4122..0000000 --- a/config/samples/customer_v1alpha1_customer.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: customer.valkyrie.dso.mil/v1alpha1 -kind: Customer -metadata: - name: customer-sample -spec: - # Add fields here - foo: bar diff --git a/config/samples/customer_v1alpha1_organization.yaml b/config/samples/customer_v1alpha1_organization.yaml deleted file mode 100644 index 3a1ca43..0000000 --- a/config/samples/customer_v1alpha1_organization.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: customer.valkyrie.dso.mil/v1alpha1 -kind: Organization -metadata: - name: organization-sample -spec: - # Add fields here - foo: bar diff --git a/config/samples/customer_v1alpha1_systemowner.yaml b/config/samples/customer_v1alpha1_systemowner.yaml deleted file mode 100644 index a637659..0000000 --- a/config/samples/customer_v1alpha1_systemowner.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: customer.valkyrie.dso.mil/v1alpha1 -kind: SystemOwner -metadata: - name: systemowner-sample -spec: - # Add fields here - foo: bar diff --git a/controllers/customer/authorizingofficial_controller.go b/controllers/customer/authorizingofficial_controller.go deleted file mode 100644 index 8b33c49..0000000 --- a/controllers/customer/authorizingofficial_controller.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2021. - -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 customer - -import ( - "context" - - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" - - customerv1alpha1 "valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1" -) - -// AuthorizingOfficialReconciler reconciles a AuthorizingOfficial object -type AuthorizingOfficialReconciler struct { - client.Client - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=authorizingofficials,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=authorizingofficials/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=authorizingofficials/finalizers,verbs=update - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the AuthorizingOfficial object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile -func (r *AuthorizingOfficialReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - _ = log.FromContext(ctx) - - // your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *AuthorizingOfficialReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&customerv1alpha1.AuthorizingOfficial{}). - Complete(r) -} diff --git a/controllers/customer/chiefinformationsecurityofficer_controller.go b/controllers/customer/chiefinformationsecurityofficer_controller.go deleted file mode 100644 index f88f942..0000000 --- a/controllers/customer/chiefinformationsecurityofficer_controller.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2021. - -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 customer - -import ( - "context" - - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" - - customerv1alpha1 "valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1" -) - -// ChiefInformationSecurityOfficerReconciler reconciles a ChiefInformationSecurityOfficer object -type ChiefInformationSecurityOfficerReconciler struct { - client.Client - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=chiefinformationsecurityofficers,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=chiefinformationsecurityofficers/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=chiefinformationsecurityofficers/finalizers,verbs=update - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the ChiefInformationSecurityOfficer object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile -func (r *ChiefInformationSecurityOfficerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - _ = log.FromContext(ctx) - - // your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *ChiefInformationSecurityOfficerReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&customerv1alpha1.ChiefInformationSecurityOfficer{}). - Complete(r) -} diff --git a/controllers/customer/customer_controller.go b/controllers/customer/customer_controller.go deleted file mode 100644 index 136c2bd..0000000 --- a/controllers/customer/customer_controller.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2021. - -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 customer - -import ( - "context" - - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - - customerv1alpha1 "valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1" -) - -// Reconciler reconciles a Customer object -type Reconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=customers,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=customers/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=customers/finalizers,verbs=update - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Customer object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.7.2/pkg/reconcile -func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - _ = r.Log.WithValues("customer", req.NamespacedName) - - // your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&customerv1alpha1.Customer{}). - Complete(r) -} diff --git a/controllers/customer/organization_controller.go b/controllers/customer/organization_controller.go deleted file mode 100644 index 8833392..0000000 --- a/controllers/customer/organization_controller.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2021. - -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 customer - -import ( - "context" - - "github.com/go-logr/logr" - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - - customerv1alpha1 "valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1" -) - -// OrganizationReconciler reconciles a Organization object -type OrganizationReconciler struct { - client.Client - Log logr.Logger - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=organizations,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=organizations/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=organizations/finalizers,verbs=update - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the Organization object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.7.2/pkg/reconcile -func (r *OrganizationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - _ = r.Log.WithValues("organization", req.NamespacedName) - - // your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *OrganizationReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&customerv1alpha1.Organization{}). - Complete(r) -} diff --git a/controllers/customer/suite_test.go b/controllers/customer/suite_test.go deleted file mode 100644 index 8bb85e7..0000000 --- a/controllers/customer/suite_test.go +++ /dev/null @@ -1,92 +0,0 @@ -/* -Copyright 2021. - -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 customer - -import ( - "path/filepath" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/rest" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/envtest" - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - customerv1alpha1 "valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1" - //+kubebuilder:scaffold:imports -) - -// These tests use Ginkgo (BDD-style Go testing framework). Refer to -// http://onsi.github.io/ginkgo/ to learn more about Ginkgo. - -var cfg *rest.Config -var k8sClient client.Client -var testEnv *envtest.Environment - -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecsWithDefaultAndCustomReporters(t, - "Controller Suite", - []Reporter{printer.NewlineReporter{}}) -} - -var _ = BeforeSuite(func() { - logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) - - By("bootstrapping test environment") - testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, - ErrorIfCRDPathMissing: true, - } - - cfg, err := testEnv.Start() - Expect(err).NotTo(HaveOccurred()) - Expect(cfg).NotTo(BeNil()) - - err = customerv1alpha1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - err = customerv1alpha1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - err = customerv1alpha1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - err = customerv1alpha1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - err = customerv1alpha1.AddToScheme(scheme.Scheme) - Expect(err).NotTo(HaveOccurred()) - - //+kubebuilder:scaffold:scheme - - k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme}) - Expect(err).NotTo(HaveOccurred()) - Expect(k8sClient).NotTo(BeNil()) - -}, 60) - -var _ = AfterSuite(func() { - By("tearing down the test environment") - err := testEnv.Stop() - Expect(err).NotTo(HaveOccurred()) -}) diff --git a/controllers/customer/systemowner_controller.go b/controllers/customer/systemowner_controller.go deleted file mode 100644 index 92be7c3..0000000 --- a/controllers/customer/systemowner_controller.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2021. - -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 customer - -import ( - "context" - - "k8s.io/apimachinery/pkg/runtime" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" - - customerv1alpha1 "valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1" -) - -// SystemOwnerReconciler reconciles a SystemOwner object -type SystemOwnerReconciler struct { - client.Client - Scheme *runtime.Scheme -} - -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=systemowners,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=systemowners/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=customer.valkyrie.dso.mil,resources=systemowners/finalizers,verbs=update - -// Reconcile is part of the main kubernetes reconciliation loop which aims to -// move the current state of the cluster closer to the desired state. -// TODO(user): Modify the Reconcile function to compare the state specified by -// the SystemOwner object against the actual cluster state, and then -// perform operations to make the cluster state reflect the state specified by -// the user. -// -// For more details, check Reconcile and its Result here: -// - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile -func (r *SystemOwnerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { - _ = log.FromContext(ctx) - - // your logic here - - return ctrl.Result{}, nil -} - -// SetupWithManager sets up the controller with the Manager. -func (r *SystemOwnerReconciler) SetupWithManager(mgr ctrl.Manager) error { - return ctrl.NewControllerManagedBy(mgr). - For(&customerv1alpha1.SystemOwner{}). - Complete(r) -} diff --git a/controllers/gitlab/dnsrepocredential_controller_test.go b/controllers/gitlab/dnsrepocredential_controller_test.go index 01c86a2..e313d6b 100755 --- a/controllers/gitlab/dnsrepocredential_controller_test.go +++ b/controllers/gitlab/dnsrepocredential_controller_test.go @@ -6,7 +6,6 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" - "valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1" gitlabv1alpha1 "valkyrie.dso.mil/valkyrie-api/apis/gitlab/v1alpha1" ) @@ -42,14 +41,14 @@ var _ = Describe("dnsrepocredential_controller", func() { }) }) Describe("SetupWithManager", func() { - v1alpha1.SchemeBuilder.Register(&gitlabv1alpha1.DNSRepoCredential{}, &gitlabv1alpha1.DNSRepoCredentialList{}) + gitlabv1alpha1.SchemeBuilder.Register(&gitlabv1alpha1.DNSRepoCredential{}, &gitlabv1alpha1.DNSRepoCredentialList{}) sut := DNSRepoCredentialReconciler{ Client: nil, Log: nil, Scheme: nil, } mgr := MockManager{ - builder: v1alpha1.SchemeBuilder, + builder: gitlabv1alpha1.SchemeBuilder, Log: &MockLogger{}, addHealthzCheckFunction: nil, addHealthzCheckWasCalled: false, diff --git a/controllers/gitlab/gitlabcredentials_controller_test.go b/controllers/gitlab/gitlabcredentials_controller_test.go index 5bf034b..eddd2b3 100755 --- a/controllers/gitlab/gitlabcredentials_controller_test.go +++ b/controllers/gitlab/gitlabcredentials_controller_test.go @@ -6,7 +6,6 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" - "valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1" gitlabv1alpha1 "valkyrie.dso.mil/valkyrie-api/apis/gitlab/v1alpha1" ) @@ -42,14 +41,14 @@ var _ = Describe("gitlabcredentials_controller", func() { }) }) Describe("SetupWithManager", func() { - v1alpha1.SchemeBuilder.Register(&gitlabv1alpha1.GitlabCredentials{}, &gitlabv1alpha1.GitlabCredentialsList{}) + gitlabv1alpha1.SchemeBuilder.Register(&gitlabv1alpha1.GitlabCredentials{}, &gitlabv1alpha1.GitlabCredentialsList{}) sut := CredentialsReconciler{ Client: nil, Log: nil, Scheme: nil, } mgr := MockManager{ - builder: v1alpha1.SchemeBuilder, + builder: gitlabv1alpha1.SchemeBuilder, Log: &MockLogger{}, addHealthzCheckFunction: nil, addHealthzCheckWasCalled: false, diff --git a/driver.go b/driver.go index a228849..12d8b99 100755 --- a/driver.go +++ b/driver.go @@ -9,7 +9,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" "sigs.k8s.io/controller-runtime/pkg/manager" "valkyrie.dso.mil/valkyrie-api/controllers" - customercontrollers "valkyrie.dso.mil/valkyrie-api/controllers/customer" fortifycontrollers "valkyrie.dso.mil/valkyrie-api/controllers/fortify" gitlabcontrollers "valkyrie.dso.mil/valkyrie-api/controllers/gitlab" twistlockcontrollers "valkyrie.dso.mil/valkyrie-api/controllers/twistlock" @@ -122,16 +121,6 @@ func (d driverImpl) newManager(metricsAddress string, healthProbeAddress string, func (d driverImpl) instantiateControllers(mgr manager.Manager) []controllers.ManagedController { if d.instantiateControllersOverride == nil { return []controllers.ManagedController{ - &customercontrollers.Reconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("customer").WithName("Customer"), - Scheme: mgr.GetScheme(), - }, - &customercontrollers.OrganizationReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("customer").WithName("Organization"), - Scheme: mgr.GetScheme(), - }, &gitlabcontrollers.GroupReconciler{ Client: mgr.GetClient(), Log: ctrl.Log.WithName("controllers").WithName("gitlab").WithName("Group"), @@ -177,18 +166,6 @@ func (d driverImpl) instantiateControllers(mgr manager.Manager) []controllers.Ma Log: ctrl.Log.WithName("controllers").WithName("gitlab").WithName("SdElementsPipelineConfiguration"), Scheme: mgr.GetScheme(), }, - &customercontrollers.AuthorizingOfficialReconciler{ - Client: mgr.GetClient(), - Scheme: mgr.GetScheme(), - }, - &customercontrollers.SystemOwnerReconciler{ - Client: mgr.GetClient(), - Scheme: mgr.GetScheme(), - }, - &customercontrollers.ChiefInformationSecurityOfficerReconciler{ - Client: mgr.GetClient(), - Scheme: mgr.GetScheme(), - }, &gitlabcontrollers.CredentialsReconciler{ Client: mgr.GetClient(), Log: ctrl.Log.WithName("controllers").WithName("gitlab").WithName("GitlabCredentials"), diff --git a/driver_test.go b/driver_test.go index 5d284d2..ae9241a 100755 --- a/driver_test.go +++ b/driver_test.go @@ -9,7 +9,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" "sigs.k8s.io/controller-runtime/pkg/manager" "valkyrie.dso.mil/valkyrie-api/controllers" - "valkyrie.dso.mil/valkyrie-api/controllers/customer" "valkyrie.dso.mil/valkyrie-api/controllers/fortify" "valkyrie.dso.mil/valkyrie-api/controllers/gitlab" "valkyrie.dso.mil/valkyrie-api/controllers/twistlock" @@ -20,12 +19,6 @@ var _ = Describe("instantiateControllers", func() { program := &driverImpl{} mgr := MockManager{} controllers := program.instantiateControllers(&mgr) - It("Should create a Customer Controller", func() { - Expect(controllers[0]).To(BeAssignableToTypeOf(&customer.Reconciler{})) - }) - It("Should create a Organization Controller", func() { - Expect(controllers[1]).To(BeAssignableToTypeOf(&customer.OrganizationReconciler{})) - }) It("Should create a Group Controller", func() { Expect(controllers[2]).To(BeAssignableToTypeOf(&gitlab.GroupReconciler{})) }) @@ -53,15 +46,6 @@ var _ = Describe("instantiateControllers", func() { It("Should create an SD Elements Configuration Controller", func() { Expect(controllers[10]).To(BeAssignableToTypeOf(&gitlab.SdElementsPipelineConfigurationReconciler{})) }) - It("Should create a Authorizing Official Controller", func() { - Expect(controllers[11]).To(BeAssignableToTypeOf(&customer.AuthorizingOfficialReconciler{})) - }) - It("Should create a System Owner Controller", func() { - Expect(controllers[12]).To(BeAssignableToTypeOf(&customer.SystemOwnerReconciler{})) - }) - It("Should create a ChiefInformationSecurityOfficer Controller", func() { - Expect(controllers[13]).To(BeAssignableToTypeOf(&customer.ChiefInformationSecurityOfficerReconciler{})) - }) It("Should create a GitlabCredentials Controller", func() { Expect(controllers[14]).To(BeAssignableToTypeOf(&gitlab.CredentialsReconciler{})) }) diff --git a/main.go b/main.go index 3791946..ca39115 100644 --- a/main.go +++ b/main.go @@ -28,7 +28,6 @@ import ( _ "k8s.io/client-go/plugin/pkg/client/auth" ctrl "sigs.k8s.io/controller-runtime" - customerv1alpha1 "valkyrie.dso.mil/valkyrie-api/apis/customer/v1alpha1" fortifyv1alpha1 "valkyrie.dso.mil/valkyrie-api/apis/fortify/v1alpha1" gitlabv1alpha1 "valkyrie.dso.mil/valkyrie-api/apis/gitlab/v1alpha1" sonarqubev1alpha1 "valkyrie.dso.mil/valkyrie-api/apis/sonarqube/v1alpha1" @@ -47,7 +46,6 @@ var ( func init() { utilruntime.Must(clientgoscheme.AddToScheme(scheme)) - utilruntime.Must(customerv1alpha1.AddToScheme(scheme)) utilruntime.Must(gitlabv1alpha1.AddToScheme(scheme)) utilruntime.Must(sonarqubev1alpha1.AddToScheme(scheme)) utilruntime.Must(fortifyv1alpha1.AddToScheme(scheme)) -- GitLab