Skip to content

Commit

Permalink
Added InternalEngineComponent CR spawning to reconcile (#886)
Browse files Browse the repository at this point in the history
* Added InternalHubComponent CR spawning to reconcile

Signed-off-by: Nathaniel Graham <[email protected]>

* Updated test environment with internal crd

Signed-off-by: Nathaniel Graham <[email protected]>

* fixed typo

Signed-off-by: Nathaniel Graham <[email protected]>

* moved CRD around

Signed-off-by: Nathaniel Graham <[email protected]>

* trial run for typemeta

Signed-off-by: Nathaniel Graham <[email protected]>

* updated CRD to match new group API

Signed-off-by: Nathaniel Graham <[email protected]>

* updated CRD... again

Signed-off-by: Nathaniel Graham <[email protected]>

* let's try typemeta specifically

Signed-off-by: Nathaniel Graham <[email protected]>

* trying GetNamespace()

Signed-off-by: Nathaniel Graham <[email protected]>

* hardcoded CR namespace

Signed-off-by: Nathaniel Graham <[email protected]>

* Un-hardcoded namespace

Signed-off-by: Nathaniel Graham <[email protected]>

* updated RBAC for internalhubcomponent CRD

Signed-off-by: Nathaniel Graham <[email protected]>

* removed CRD from test-crds

Signed-off-by: Nathaniel Graham <[email protected]>

* removed err return for investigation

Signed-off-by: Nathaniel Graham <[email protected]>

* returning err again

Signed-off-by: Nathaniel Graham <[email protected]>

* testcase to check if CRD exists

Signed-off-by: Nathaniel Graham <[email protected]>

* hopefully fixed namespace issue

Signed-off-by: Nathaniel Graham <[email protected]>

* added ensureNoInternalHubComponent

Signed-off-by: Nathaniel Graham <[email protected]>

* updated ensureNoInternalHubComponent error catch

Signed-off-by: Nathaniel Graham <[email protected]>

* removed gitignore item

Signed-off-by: Nathaniel Graham <[email protected]>

* fixed error catch bug

Signed-off-by: Nathaniel Graham <[email protected]>

* added unit test

Signed-off-by: Nathaniel Graham <[email protected]>

* commented out test

Signed-off-by: Nathaniel Graham <[email protected]>

* error line describes object now

Signed-off-by: Nathaniel Graham <[email protected]>

* updated component name

Signed-off-by: Nathaniel Graham <[email protected]>

* updated deletion error logic

Signed-off-by: Nathaniel Graham <[email protected]>

* updated Test

Signed-off-by: Nathaniel Graham <[email protected]>

* only test enabled

Signed-off-by: Nathaniel Graham <[email protected]>

* added test for create with all components enabled

Signed-off-by: Nathaniel Graham <[email protected]>

* fixed test bug

Signed-off-by: Nathaniel Graham <[email protected]>

* moved test case to new block

Signed-off-by: Nathaniel Graham <[email protected]>

* added timeout and interval

Signed-off-by: Nathaniel Graham <[email protected]>

* disabled consoleMCE

Signed-off-by: Nathaniel Graham <[email protected]>

* updated tests

Signed-off-by: Nathaniel Graham <[email protected]>

* new test case for all components disabled

Signed-off-by: Nathaniel Graham <[email protected]>

* updated test case

Signed-off-by: Nathaniel Graham <[email protected]>

* updated test

Signed-off-by: Nathaniel Graham <[email protected]>

* updated Test

Signed-off-by: Nathaniel Graham <[email protected]>

* added apierrors.IsNotFound to assisted installer

Signed-off-by: Nathaniel Graham <[email protected]>

* updated deleteTemplate

Signed-off-by: Nathaniel Graham <[email protected]>

* updated deleteTemplate

Signed-off-by: Nathaniel Graham <[email protected]>

* updated deleteTemplate

Signed-off-by: Nathaniel Graham <[email protected]>

* added !

Signed-off-by: Nathaniel Graham <[email protected]>

* updated ensureNoInternalHubComponent

Signed-off-by: Nathaniel Graham <[email protected]>

* enabled ImageBasedInstallOperator for test

Signed-off-by: Nathaniel Graham <[email protected]>

* set console version for ConsoleMCE

Signed-off-by: Nathaniel Graham <[email protected]>

* updated OCP version

Signed-off-by: Nathaniel Graham <[email protected]>

* re-disabled consoleMCE

Signed-off-by: Nathaniel Graham <[email protected]>

* renamed InternalHubComponent to InternalEngineComponent

Signed-off-by: Nathaniel Graham <[email protected]>

---------

Signed-off-by: Nathaniel Graham <[email protected]>
  • Loading branch information
ngraham20 authored Aug 22, 2024
1 parent d863329 commit 02b6162
Show file tree
Hide file tree
Showing 11 changed files with 615 additions and 33 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ test/function_tests/results/*

test/mock-component-image/bin
test/mock-component-image/scripts/_pycache_
hack/bundle-automation/tmp/

hack/bundle-automation/tmp/
18 changes: 18 additions & 0 deletions api/v1/multiclusterengine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,24 @@ type MultiClusterEngineList struct {
Items []MultiClusterEngine `json:"items"`
}

// +kubebuilder:object:root=true
// +operator-sdk:csv:customresourcedefinitions:displayName="InternalEngineComponent"
type InternalEngineComponent struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec InternalEngineComponentSpec `json:"spec,omitempty"`
}

// +kubebuilder:object:root=true
type InternalEngineComponentList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []InternalEngineComponent `json:"items"`
}

type InternalEngineComponentSpec struct{}

func init() {
SchemeBuilder.Register(&MultiClusterEngine{}, &MultiClusterEngineList{})
SchemeBuilder.Register(&InternalEngineComponent{}, &InternalEngineComponentList{})
}
74 changes: 73 additions & 1 deletion api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions bundle/manifests/multicluster-engine.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ spec:
spec:
clusterPermissions:
- rules:
- apiGroups:
- multicluster.openshift.io
resources:
- internalenginecomponents
verbs:
- create
- get
- delete
- patch
- list
- watch
- apiGroups:
- ""
resources:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
name: internalenginecomponents.multicluster.openshift.io
spec:
group: multicluster.openshift.io
names:
kind: InternalEngineComponent
listKind: InternalEngineComponentList
plural: internalenginecomponents
singular: internalenginecomponent
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
type: object
type: object
served: true
storage: true
11 changes: 11 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2041,6 +2041,17 @@ rules:
- patch
- update
- watch
- apiGroups:
- multicluster.openshift.io
resources:
- internalenginecomponents
verbs:
- create
- delete
- get
- list
- patch
- watch
- apiGroups:
- multicluster.openshift.io
resources:
Expand Down
Loading

0 comments on commit 02b6162

Please sign in to comment.