Skip to content

Commit

Permalink
Integrate the artifacts server in the inventory controller (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
irinamihai authored Jan 13, 2025
1 parent b4fc10f commit f94f1f4
Show file tree
Hide file tree
Showing 15 changed files with 368 additions and 34 deletions.
19 changes: 16 additions & 3 deletions api/inventory/v1alpha1/inventory_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ type ServerConfig struct {
Enabled bool `json:"enabled"`
}

// ArtifactsServerConfig contains the configuration for the artifacts server.
type ArtifactsServerConfig struct {
//+kubebuilder:default:={enabled:true}
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Server Configuration",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:bool"}
ServerConfig `json:",inline"`
}

// ResourceServerConfig contains the configuration for the resource server.
type ResourceServerConfig struct {
//+kubebuilder:default:={enabled:true}
Expand Down Expand Up @@ -141,6 +148,10 @@ type InventorySpec struct {
//+optional
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Cloud ID",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
CloudID *string `json:"cloudID"`
// ArtifactsServerConfig contains the configuration for the artifacts server.
//+optional
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Artifacts Server Configuration",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
ArtifactsServerConfig ArtifactsServerConfig `json:"artifactsServerConfig,omitempty"`
// ResourceServerConfig contains the configuration for the resource server.
//+optional
//+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Resource Server Configuration",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"}
Expand Down Expand Up @@ -178,12 +189,14 @@ type DeploymentsStatus struct {
ResourceServerStatus string `json:"resourceServerStatus,omitempty"`
// +operator-sdk:csv:customresourcedefinitions:type=status,displayName="Alarm Server Status"
AlarmServerStatus string `json:"alarmServerStatus,omitempty"`
// +operator-sdk:csv:customresourcedefinitions:type=status,displayName="Artifacts Server Status"
ArtifactsServerStatus string `json:"artifactsServerStatus,omitempty"`
}

type UsedServerConfig struct {
MetadataServerUsedConfig []string `json:"metadataServerUsedConfig,omitempty"`
ResourceServerUsedConfig []string `json:"resourceServerUsedConfig,omitempty"`
DeploymentManagerServerUsedConfig []string `json:"deploymentManagerServerUsedConfig,omitempty"`
ArtifactsServerUsedConfig []string `json:"artifactsServerUsedConfig,omitempty"`
MetadataServerUsedConfig []string `json:"metadataServerUsedConfig,omitempty"`
ResourceServerUsedConfig []string `json:"resourceServerUsedConfig,omitempty"`
}

// InventoryStatus defines the observed state of Inventory
Expand Down
27 changes: 22 additions & 5 deletions api/inventory/v1alpha1/zz_generated.deepcopy.go

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

17 changes: 16 additions & 1 deletion bundle/manifests/o2ims.oran.openshift.io_inventories.yaml

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

8 changes: 8 additions & 0 deletions bundle/manifests/oran-o2ims.clusterserviceversion.yaml

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

17 changes: 16 additions & 1 deletion config/crd/bases/o2ims.oran.openshift.io_inventories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ spec:
required:
- enabled
type: object
artifactsServerConfig:
default:
enabled: true
description: ArtifactsServerConfig contains the configuration for
the artifacts server.
properties:
enabled:
default: true
description: Enabled indicates if the server should be started.
type: boolean
required:
- enabled
type: object
caBundleName:
description: |-
CaBundleName references a config map that contains a set of custom CA certificates to be used when communicating
Expand Down Expand Up @@ -296,6 +309,8 @@ spec:
properties:
alarmServerStatus:
type: string
artifactsServerStatus:
type: string
deploymentServerStatus:
type: string
metadataServerStatus:
Expand All @@ -315,7 +330,7 @@ spec:
type: string
usedServerConfig:
properties:
deploymentManagerServerUsedConfig:
artifactsServerUsedConfig:
items:
type: string
type: array
Expand Down
8 changes: 8 additions & 0 deletions config/manifests/bases/oran-o2ims.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ spec:
being first and the root CA being last.
displayName: TLS client certificate
path: alarmServerConfig.clientTLS.clientCertificateName
- description: ArtifactsServerConfig contains the configuration for the artifacts
server.
displayName: Artifacts Server Configuration
path: artifactsServerConfig
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:text
- description: |-
CaBundleName references a config map that contains a set of custom CA certificates to be used when communicating
with any outside entity (e.g., the SMO, the authorization server, etc.) that has its TLS certificate signed by
Expand Down Expand Up @@ -319,6 +325,8 @@ spec:
path: deploymentStatus
- displayName: Alarm Server Status
path: deploymentStatus.alarmServerStatus
- displayName: Artifacts Server Status
path: deploymentStatus.artifactsServerStatus
- displayName: Deployment Server Status
path: deploymentStatus.deploymentServerStatus
- displayName: Metadata Server Status
Expand Down
4 changes: 4 additions & 0 deletions config/testing/client-service-account-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ rules:
- /o2ims-infrastructureMonitoring/api_versions
- /o2ims-infrastructureCluster/*
- /o2ims-infrastructureCluster/api_versions
- /o2ims-infrastructureArtifacts/*
- /o2ims-infrastructureArtifacts/api_versions
- /o2ims-infrastructureArtifacts/v1/managedInfrastructureTemplates
- /o2ims-infrastructureArtifacts/v1/managedInfrastructureTemplates/*
verbs:
- get
- nonResourceURLs:
Expand Down
Loading

0 comments on commit f94f1f4

Please sign in to comment.