diff --git a/fleetshard/pkg/central/reconciler/reconciler_test.go b/fleetshard/pkg/central/reconciler/reconciler_test.go index 866ec6fac3..7bcda8cf5c 100644 --- a/fleetshard/pkg/central/reconciler/reconciler_test.go +++ b/fleetshard/pkg/central/reconciler/reconciler_test.go @@ -177,7 +177,7 @@ func centralDBPasswordSecretObject() *v1.Secret { } } -func conditionForType(conditions []private.DataPlaneClusterUpdateStatusRequestConditions, conditionType string) (*private.DataPlaneClusterUpdateStatusRequestConditions, bool) { +func conditionForType(conditions []private.DataPlaneCentralStatusConditions, conditionType string) (*private.DataPlaneCentralStatusConditions, bool) { for _, c := range conditions { if c.Type == conditionType { return &c, true diff --git a/fleetshard/pkg/central/reconciler/status.go b/fleetshard/pkg/central/reconciler/status.go index 46d0405cc9..0bb0af537e 100644 --- a/fleetshard/pkg/central/reconciler/status.go +++ b/fleetshard/pkg/central/reconciler/status.go @@ -4,7 +4,7 @@ import "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/private" func readyStatus() *private.DataPlaneCentralStatus { return &private.DataPlaneCentralStatus{ - Conditions: []private.DataPlaneClusterUpdateStatusRequestConditions{ + Conditions: []private.DataPlaneCentralStatusConditions{ { Type: "Ready", Status: "True", @@ -15,7 +15,7 @@ func readyStatus() *private.DataPlaneCentralStatus { func deletedStatus() *private.DataPlaneCentralStatus { return &private.DataPlaneCentralStatus{ - Conditions: []private.DataPlaneClusterUpdateStatusRequestConditions{ + Conditions: []private.DataPlaneCentralStatusConditions{ { Type: "Ready", Status: "False", @@ -27,7 +27,7 @@ func deletedStatus() *private.DataPlaneCentralStatus { func installingStatus() *private.DataPlaneCentralStatus { return &private.DataPlaneCentralStatus{ - Conditions: []private.DataPlaneClusterUpdateStatusRequestConditions{ + Conditions: []private.DataPlaneCentralStatusConditions{ { Type: "Ready", Status: "False", diff --git a/internal/dinosaur/pkg/api/dbapi/data_plane_cluster_status.go b/internal/dinosaur/pkg/api/dbapi/data_plane_cluster_status.go index 01b896fc58..0bc54f6d4b 100644 --- a/internal/dinosaur/pkg/api/dbapi/data_plane_cluster_status.go +++ b/internal/dinosaur/pkg/api/dbapi/data_plane_cluster_status.go @@ -1,16 +1,17 @@ package dbapi -// DataPlaneClusterStatus ... -type DataPlaneClusterStatus struct { - Conditions []DataPlaneClusterStatusCondition +// AddonInstallation represents the actual information about addons installed on the cluster +type AddonInstallation struct { + ID string + Version string + SourceImage string + PackageImage string + ParametersSHA256Sum string } -// DataPlaneClusterStatusCondition ... -type DataPlaneClusterStatusCondition struct { - Type string - Reason string - Status string - Message string +// DataPlaneClusterStatus is the actual state reported from the data plane cluster +type DataPlaneClusterStatus struct { + Addons []AddonInstallation } // DataPlaneClusterConfigObservability ... diff --git a/internal/dinosaur/pkg/api/private/api/openapi.yaml b/internal/dinosaur/pkg/api/private/api/openapi.yaml index cc323fc1ce..ba988d80ad 100644 --- a/internal/dinosaur/pkg/api/private/api/openapi.yaml +++ b/internal/dinosaur/pkg/api/private/api/openapi.yaml @@ -345,20 +345,21 @@ components: DataPlaneClusterUpdateStatusRequest: description: Schema for the request to update a data plane cluster's status example: - conditions: - - reason: reason - type: type - message: message - status: status - - reason: reason - type: type - message: message - status: status + addons: + - packageImage: packageImage + parametersSHA256Sum: parametersSHA256Sum + id: id + sourceImage: sourceImage + version: version + - packageImage: packageImage + parametersSHA256Sum: parametersSHA256Sum + id: id + sourceImage: sourceImage + version: version properties: - conditions: - description: The cluster data plane conditions + addons: items: - $ref: '#/components/schemas/DataPlaneClusterUpdateStatusRequest_conditions' + $ref: '#/components/schemas/DataPlaneClusterUpdateStatusRequest_addons' type: array type: object DataPlaneCentralStatus: @@ -369,7 +370,7 @@ components: conditions: description: The status conditions of a Central items: - $ref: '#/components/schemas/DataPlaneClusterUpdateStatusRequest_conditions' + $ref: '#/components/schemas/DataPlaneCentralStatus_conditions' type: array routes: description: Routes created for a Central @@ -514,12 +515,25 @@ components: type: array rhacs_operators: $ref: '#/components/schemas/RHACSOperatorConfigs' - DataPlaneClusterUpdateStatusRequest_conditions: + DataPlaneClusterUpdateStatusRequest_addons: example: - reason: reason - type: type - message: message - status: status + packageImage: packageImage + parametersSHA256Sum: parametersSHA256Sum + id: id + sourceImage: sourceImage + version: version + properties: + id: + type: string + version: + type: string + sourceImage: + type: string + packageImage: + type: string + parametersSHA256Sum: + type: string + DataPlaneCentralStatus_conditions: properties: type: type: string diff --git a/internal/dinosaur/pkg/api/private/model_data_plane_central_status.go b/internal/dinosaur/pkg/api/private/model_data_plane_central_status.go index b4c5abbea8..f8519590f8 100644 --- a/internal/dinosaur/pkg/api/private/model_data_plane_central_status.go +++ b/internal/dinosaur/pkg/api/private/model_data_plane_central_status.go @@ -13,7 +13,7 @@ package private // DataPlaneCentralStatus Schema of the status object for a Central type DataPlaneCentralStatus struct { // The status conditions of a Central - Conditions []DataPlaneClusterUpdateStatusRequestConditions `json:"conditions,omitempty"` + Conditions []DataPlaneCentralStatusConditions `json:"conditions,omitempty"` // Routes created for a Central Routes []DataPlaneCentralStatusRoutes `json:"routes,omitempty"` // Map of Secrets created for a Central diff --git a/internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request_conditions.go b/internal/dinosaur/pkg/api/private/model_data_plane_central_status_conditions.go similarity index 77% rename from internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request_conditions.go rename to internal/dinosaur/pkg/api/private/model_data_plane_central_status_conditions.go index 1d2c68663d..5307df0556 100644 --- a/internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request_conditions.go +++ b/internal/dinosaur/pkg/api/private/model_data_plane_central_status_conditions.go @@ -10,8 +10,8 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. package private -// DataPlaneClusterUpdateStatusRequestConditions struct for DataPlaneClusterUpdateStatusRequestConditions -type DataPlaneClusterUpdateStatusRequestConditions struct { +// DataPlaneCentralStatusConditions struct for DataPlaneCentralStatusConditions +type DataPlaneCentralStatusConditions struct { Type string `json:"type,omitempty"` Reason string `json:"reason,omitempty"` Message string `json:"message,omitempty"` diff --git a/internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request.go b/internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request.go index a8447c9bb5..61b02ebff8 100644 --- a/internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request.go +++ b/internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request.go @@ -12,6 +12,5 @@ package private // DataPlaneClusterUpdateStatusRequest Schema for the request to update a data plane cluster's status type DataPlaneClusterUpdateStatusRequest struct { - // The cluster data plane conditions - Conditions []DataPlaneClusterUpdateStatusRequestConditions `json:"conditions,omitempty"` + Addons []DataPlaneClusterUpdateStatusRequestAddons `json:"addons,omitempty"` } diff --git a/internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request_addons.go b/internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request_addons.go new file mode 100644 index 0000000000..d13671c0ca --- /dev/null +++ b/internal/dinosaur/pkg/api/private/model_data_plane_cluster_update_status_request_addons.go @@ -0,0 +1,20 @@ +/* + * Red Hat Advanced Cluster Security Service Fleet Manager + * + * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager APIs that are used by internal services e.g fleetshard operators. + * + * API version: 1.4.0 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. +package private + +// DataPlaneClusterUpdateStatusRequestAddons struct for DataPlaneClusterUpdateStatusRequestAddons +type DataPlaneClusterUpdateStatusRequestAddons struct { + Id string `json:"id,omitempty"` + Version string `json:"version,omitempty"` + SourceImage string `json:"sourceImage,omitempty"` + PackageImage string `json:"packageImage,omitempty"` + ParametersSHA256Sum string `json:"parametersSHA256Sum,omitempty"` +} diff --git a/internal/dinosaur/pkg/handlers/data_plane_cluster.go b/internal/dinosaur/pkg/handlers/data_plane_cluster.go index f395beea52..6f7fc0f99d 100644 --- a/internal/dinosaur/pkg/handlers/data_plane_cluster.go +++ b/internal/dinosaur/pkg/handlers/data_plane_cluster.go @@ -35,12 +35,8 @@ func (h *dataPlaneClusterHandler) UpdateDataPlaneClusterStatus(w http.ResponseWr handlers.ValidateLength(&dataPlaneClusterID, "id", &handlers.MinRequiredFieldLength, nil), }, Action: func() (interface{}, *errors.ServiceError) { - ctx := r.Context() - dataPlaneClusterStatus, err := presenters.ConvertDataPlaneClusterStatus(dataPlaneClusterUpdateRequest) - if err != nil { - return nil, errors.Validation(err.Error()) - } - svcErr := h.service.UpdateDataPlaneClusterStatus(ctx, dataPlaneClusterID, dataPlaneClusterStatus) + dataPlaneClusterStatus := presenters.ConvertDataPlaneClusterStatus(dataPlaneClusterUpdateRequest) + svcErr := h.service.UpdateDataPlaneClusterStatus(dataPlaneClusterID, dataPlaneClusterStatus) return nil, svcErr }, } diff --git a/internal/dinosaur/pkg/migrations/20231123000000_add_cluster_addons.go b/internal/dinosaur/pkg/migrations/20231123000000_add_cluster_addons.go new file mode 100644 index 0000000000..6deeda0d04 --- /dev/null +++ b/internal/dinosaur/pkg/migrations/20231123000000_add_cluster_addons.go @@ -0,0 +1,39 @@ +package migrations + +import ( + "github.com/go-gormigrate/gormigrate/v2" + "github.com/pkg/errors" + "github.com/stackrox/acs-fleet-manager/pkg/api" + "github.com/stackrox/acs-fleet-manager/pkg/db" + "gorm.io/gorm" +) + +func addClusterAddons() *gormigrate.Migration { + type Cluster struct { + db.Model + Addons api.JSON `json:"addons"` + } + + migrationID := "20231123000000" + colName := "Addons" + + return &gormigrate.Migration{ + ID: migrationID, + Migrate: func(tx *gorm.DB) error { + if !tx.Migrator().HasColumn(&Cluster{}, colName) { + if err := tx.Migrator().AddColumn(&Cluster{}, colName); err != nil { + return errors.Wrapf(err, "adding column %s in migration %s", colName, migrationID) + } + } + return nil + }, + Rollback: func(tx *gorm.DB) error { + if tx.Migrator().HasColumn(&Cluster{}, colName) { + if err := tx.Migrator().DropColumn(&Cluster{}, colName); err != nil { + return errors.Wrapf(err, "rolling back from column %s in migration %s", colName, migrationID) + } + } + return nil + }, + } +} diff --git a/internal/dinosaur/pkg/migrations/migrations.go b/internal/dinosaur/pkg/migrations/migrations.go index 4ee2b4e78b..1da85cff79 100644 --- a/internal/dinosaur/pkg/migrations/migrations.go +++ b/internal/dinosaur/pkg/migrations/migrations.go @@ -51,6 +51,7 @@ func getMigrations() []*gormigrate.Migration { removeCentralAndScannerOverrides(), addExpiredAtFieldToCentralRequests(), addExpirationLeaseType(), + addClusterAddons(), } } diff --git a/internal/dinosaur/pkg/presenters/data_plane_cluster_status.go b/internal/dinosaur/pkg/presenters/data_plane_cluster_status.go index 4c99a4e546..3a6becb1ad 100644 --- a/internal/dinosaur/pkg/presenters/data_plane_cluster_status.go +++ b/internal/dinosaur/pkg/presenters/data_plane_cluster_status.go @@ -6,18 +6,21 @@ import ( ) // ConvertDataPlaneClusterStatus ... -func ConvertDataPlaneClusterStatus(status private.DataPlaneClusterUpdateStatusRequest) (*dbapi.DataPlaneClusterStatus, error) { - var res dbapi.DataPlaneClusterStatus - res.Conditions = make([]dbapi.DataPlaneClusterStatusCondition, len(status.Conditions)) - for i, cond := range status.Conditions { - res.Conditions[i] = dbapi.DataPlaneClusterStatusCondition{ - Type: cond.Type, - Reason: cond.Reason, - Status: cond.Status, - Message: cond.Message, - } +func ConvertDataPlaneClusterStatus(status private.DataPlaneClusterUpdateStatusRequest) dbapi.DataPlaneClusterStatus { + var addonInstallations []dbapi.AddonInstallation + for _, addon := range status.Addons { + addonInstallations = append(addonInstallations, dbapi.AddonInstallation{ + ID: addon.Id, + Version: addon.Version, + SourceImage: addon.SourceImage, + PackageImage: addon.PackageImage, + ParametersSHA256Sum: addon.ParametersSHA256Sum, + }) + } + + return dbapi.DataPlaneClusterStatus{ + Addons: addonInstallations, } - return &res, nil } // PresentDataPlaneClusterConfig ... @@ -32,6 +35,5 @@ func PresentDataPlaneClusterConfig(config *dbapi.DataPlaneClusterConfig) private }, }, } - return res } diff --git a/internal/dinosaur/pkg/services/data_plane_cluster.go b/internal/dinosaur/pkg/services/data_plane_cluster.go index 18b5457c37..9b11af12ff 100644 --- a/internal/dinosaur/pkg/services/data_plane_cluster.go +++ b/internal/dinosaur/pkg/services/data_plane_cluster.go @@ -2,23 +2,21 @@ package services import ( "context" + "encoding/json" "fmt" - "time" "github.com/goava/di" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/dbapi" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/config" "github.com/stackrox/acs-fleet-manager/pkg/client/observatorium" - "github.com/stackrox/acs-fleet-manager/pkg/metrics" - "github.com/stackrox/acs-fleet-manager/pkg/api" "github.com/stackrox/acs-fleet-manager/pkg/errors" ) // DataPlaneClusterService ... type DataPlaneClusterService interface { - UpdateDataPlaneClusterStatus(ctx context.Context, clusterID string, status *dbapi.DataPlaneClusterStatus) *errors.ServiceError + UpdateDataPlaneClusterStatus(clusterID string, status dbapi.DataPlaneClusterStatus) *errors.ServiceError GetDataPlaneClusterConfig(ctx context.Context, clusterID string) (*dbapi.DataPlaneClusterConfig, *errors.ServiceError) } @@ -61,7 +59,7 @@ func (d *dataPlaneClusterService) GetDataPlaneClusterConfig(ctx context.Context, } // UpdateDataPlaneClusterStatus ... -func (d *dataPlaneClusterService) UpdateDataPlaneClusterStatus(ctx context.Context, clusterID string, status *dbapi.DataPlaneClusterStatus) *errors.ServiceError { +func (d *dataPlaneClusterService) UpdateDataPlaneClusterStatus(clusterID string, status dbapi.DataPlaneClusterStatus) *errors.ServiceError { cluster, svcErr := d.ClusterService.FindClusterByID(clusterID) if svcErr != nil { return svcErr @@ -71,9 +69,6 @@ func (d *dataPlaneClusterService) UpdateDataPlaneClusterStatus(ctx context.Conte return errors.BadRequest("Cluster agent with ID '%s' not found", clusterID) } - // We calculate the status based on the stats received by the Fleet operator - // BEFORE performing the scaling actions. If scaling actions are performed later - // then it will be reflected on the next data plane cluster status report err := d.setClusterStatus(cluster, status) if err != nil { return errors.ToServiceError(err) @@ -82,19 +77,15 @@ func (d *dataPlaneClusterService) UpdateDataPlaneClusterStatus(ctx context.Conte return nil } -func (d *dataPlaneClusterService) setClusterStatus(cluster *api.Cluster, status *dbapi.DataPlaneClusterStatus) error { - if cluster.Status != api.ClusterReady { - clusterIsWaitingForFleetShardOperator := cluster.Status == api.ClusterWaitingForFleetShardOperator - err := d.ClusterService.UpdateStatus(*cluster, api.ClusterReady) - if err != nil { - return fmt.Errorf("updating cluster status to %s: %w", api.ClusterReady, err) - } - if clusterIsWaitingForFleetShardOperator { - metrics.UpdateClusterCreationDurationMetric(metrics.JobTypeClusterCreate, time.Since(cluster.CreatedAt)) - } - metrics.UpdateClusterStatusSinceCreatedMetric(*cluster, api.ClusterReady) +func (d *dataPlaneClusterService) setClusterStatus(cluster *api.Cluster, status dbapi.DataPlaneClusterStatus) error { + addonsJSON, err := json.Marshal(status.Addons) + if err != nil { + return fmt.Errorf("marshal fleetshardAddonStatus to JSON: %w", err) + } + cluster.Addons = addonsJSON + if err := d.ClusterService.Update(*cluster); err != nil { + return fmt.Errorf("updating cluster status: %w", err) } - return nil } diff --git a/internal/dinosaur/test/integration/data_plane_endpoints_test.go b/internal/dinosaur/test/integration/data_plane_endpoints_test.go index af4bd3ad20..25baf19b74 100644 --- a/internal/dinosaur/test/integration/data_plane_endpoints_test.go +++ b/internal/dinosaur/test/integration/data_plane_endpoints_test.go @@ -1,10 +1,26 @@ package integration import ( + "encoding/json" + "fmt" + "net/http" + "testing" + + "github.com/golang-jwt/jwt/v4" + . "github.com/onsi/gomega" clustersmgmtv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1" + "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/dbapi" + "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/private" + "github.com/stackrox/acs-fleet-manager/internal/dinosaur/test" + "github.com/stackrox/acs-fleet-manager/pkg/api" "github.com/stackrox/acs-fleet-manager/test/mocks" ) +const ( + issuerURL = "https://sso.redhat.com/auth/realms/redhat-external" + orgID = "16134752" +) + func mockedClusterWithMetricsInfo(computeNodes int) (*clustersmgmtv1.Cluster, error) { clusterBuilder := mocks.GetMockClusterBuilder(nil) clusterNodeBuilder := clustersmgmtv1.NewClusterNodes() @@ -12,3 +28,86 @@ func mockedClusterWithMetricsInfo(computeNodes int) (*clustersmgmtv1.Cluster, er clusterBuilder.Nodes(clusterNodeBuilder) return clusterBuilder.Build() } + +func TestDataPlaneClusterStatus(t *testing.T) { + ocmServerBuilder := mocks.NewMockConfigurableServerBuilder() + mockedGetClusterResponse, err := mockedClusterWithMetricsInfo(mocks.MockClusterComputeNodes) + if err != nil { + t.Fatalf(err.Error()) + } + + ocmServerBuilder.SetClusterGetResponse(mockedGetClusterResponse, nil) + ocmServer := ocmServerBuilder.Build() + defer ocmServer.Close() + h, _, tearDown := test.NewDinosaurHelper(t, ocmServer) + defer tearDown() + + clusterID := api.NewID() + account := h.NewAllowedServiceAccount() + claims := jwt.MapClaims{ + "iss": issuerURL, + "org_id": orgID, + } + ctx := h.NewAuthenticatedContext(account, claims) + token := h.CreateJWTStringWithClaim(account, claims) + + config := private.NewConfiguration() + config.BasePath = fmt.Sprintf("http://%s", test.TestServices.ServerConfig.BindAddress) + config.DefaultHeader = map[string]string{ + "Authorization": "Bearer " + token, + } + privateClient := private.NewAPIClient(config) + + db := test.TestServices.DBFactory.New() + cluster := &api.Cluster{ + Meta: api.Meta{ + ID: clusterID, + }, + ClusterID: clusterID, + MultiAZ: true, + Region: "baremetal", + CloudProvider: "baremetal", + Status: api.ClusterReady, + IdentityProviderID: "some-id", + ClusterDNS: "some-cluster-dns", + ProviderType: api.ClusterProviderStandalone, + } + + err = db.Create(cluster).Error + Expect(err).NotTo(HaveOccurred()) + + resp, err := privateClient.AgentClustersApi.UpdateAgentClusterStatus(ctx, clusterID, private.DataPlaneClusterUpdateStatusRequest{ + Addons: []private.DataPlaneClusterUpdateStatusRequestAddons{ + { + Id: "acs-fleetshard", + Version: "0.2.0", + SourceImage: "quay.io/osd-addons/acs-fleetshard-index@sha256:71eaaccb4d3962043eac953fb3c19a6cc6a88b18c472dd264efc5eb3da4960ac", + PackageImage: "quay.io/osd-addons/acs-fleetshard-package@sha256:3e4fc039662b876c83dd4b48a9608d6867a12ab4932c5b7297bfbe50ba8ee61c", + ParametersSHA256Sum: "f54d2c5cb370f4f87a31ccd8f72d97a85d89838720bd69278d1d40ee1cea00dc", // pragma: allowlist secret + }, + }, + }) + Expect(err).NotTo(HaveOccurred()) + Expect(resp.StatusCode).To(Equal(http.StatusOK)) + + clusterDetails := &api.Cluster{ + ClusterID: cluster.ID, + } + + err = db.Where(clusterDetails).First(cluster).Error + Expect(err).ToNot(HaveOccurred()) + + Expect(cluster.Addons).NotTo(BeEmpty()) + + var addonInstallations []dbapi.AddonInstallation + err = json.Unmarshal(cluster.Addons, &addonInstallations) + Expect(err).ToNot(HaveOccurred()) + Expect(addonInstallations).To(HaveLen(1)) + + fleetshardAddon := addonInstallations[0] + Expect(fleetshardAddon.ID).To(Equal("acs-fleetshard")) + Expect(fleetshardAddon.Version).To(Equal("0.2.0")) + Expect(fleetshardAddon.SourceImage).To(Equal("quay.io/osd-addons/acs-fleetshard-index@sha256:71eaaccb4d3962043eac953fb3c19a6cc6a88b18c472dd264efc5eb3da4960ac")) + Expect(fleetshardAddon.PackageImage).To(Equal("quay.io/osd-addons/acs-fleetshard-package@sha256:3e4fc039662b876c83dd4b48a9608d6867a12ab4932c5b7297bfbe50ba8ee61c")) + Expect(fleetshardAddon.ParametersSHA256Sum).To(Equal("f54d2c5cb370f4f87a31ccd8f72d97a85d89838720bd69278d1d40ee1cea00dc")) // pragma: allowlist secret +} diff --git a/openapi/fleet-manager-private.yaml b/openapi/fleet-manager-private.yaml index 93e88dd8ac..7251a289a5 100644 --- a/openapi/fleet-manager-private.yaml +++ b/openapi/fleet-manager-private.yaml @@ -351,24 +351,23 @@ components: type: object DataPlaneClusterUpdateStatusRequest: - # TODO are there any fields that should be required? - # TODO are there any fields that should be nullable? (this is, a pointer in the resulting generated Go code) description: "Schema for the request to update a data plane cluster's status" type: object properties: - conditions: - description: "The cluster data plane conditions" + addons: type: array items: type: object properties: - type: + id: type: string - reason: + version: type: string - message: + sourceImage: type: string - status: + packageImage: + type: string + parametersSHA256Sum: type: string DataPlaneCentralStatus: description: "Schema of the status object for a Central" diff --git a/pkg/api/cluster_types.go b/pkg/api/cluster_types.go index 60f5114ba3..33d7f9ecde 100644 --- a/pkg/api/cluster_types.go +++ b/pkg/api/cluster_types.go @@ -159,6 +159,8 @@ type Cluster struct { SupportedInstanceType string `json:"supported_instance_type"` // The cluster is "schedulable" if tenants can be placed there. Schedulable bool `json:"schedulable"` + // stores the actual information about addons installed on the cluster + Addons JSON `json:"addons"` } // ClusterList ...