diff --git a/.secrets.baseline b/.secrets.baseline index 7cbacd7a00..553af45d8d 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -349,7 +349,7 @@ "filename": "internal/dinosaur/pkg/api/public/api/openapi.yaml", "hashed_secret": "5b455797b93de5b6a19633ba22127c8a610f5c1b", "is_verified": false, - "line_number": 1663 + "line_number": 1531 } ], "pkg/client/iam/client_moq.go": [ @@ -564,5 +564,5 @@ } ] }, - "generated_at": "2023-10-23T12:42:41Z" + "generated_at": "2023-10-26T17:49:33Z" } diff --git a/cmd/fleet-manager/main_test.go b/cmd/fleet-manager/main_test.go index 9839861b48..a0bc231d7c 100644 --- a/cmd/fleet-manager/main_test.go +++ b/cmd/fleet-manager/main_test.go @@ -38,7 +38,7 @@ func TestInjections(t *testing.T) { var bootList []environments.BootService env.MustResolve(&bootList) - Expect(len(bootList)).To(Equal(7)) + Expect(len(bootList)).To(Equal(6)) _, ok := bootList[0].(*server.APIServer) Expect(ok).To(Equal(true)) diff --git a/fleetshard/pkg/central/reconciler/reconciler.go b/fleetshard/pkg/central/reconciler/reconciler.go index 48305bd29d..4a85b09d08 100644 --- a/fleetshard/pkg/central/reconciler/reconciler.go +++ b/fleetshard/pkg/central/reconciler/reconciler.go @@ -10,7 +10,6 @@ import ( "net/url" "reflect" "sort" - "strconv" "sync/atomic" "time" @@ -27,7 +26,6 @@ import ( "github.com/stackrox/acs-fleet-manager/fleetshard/pkg/util" centralConstants "github.com/stackrox/acs-fleet-manager/internal/dinosaur/constants" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/private" - "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/converters" "github.com/stackrox/acs-fleet-manager/pkg/client/fleetmanager" "github.com/stackrox/acs-fleet-manager/pkg/features" "github.com/stackrox/rox/operator/apis/platform/v1alpha1" @@ -156,7 +154,7 @@ func (r *CentralReconciler) Reconcile(ctx context.Context, remoteCentral private if err != nil { return nil, errors.Wrap(err, "checking if central changed") } - needsReconcile := r.needsReconcile(changed, remoteCentral, central) + needsReconcile := r.needsReconcile(changed, central) if !needsReconcile && r.shouldSkipReadyCentral(remoteCentral) { return nil, ErrCentralNotChanged @@ -271,113 +269,13 @@ func (r *CentralReconciler) Reconcile(ctx context.Context, remoteCentral private } func (r *CentralReconciler) getInstanceConfig(remoteCentral *private.ManagedCentral) (*v1alpha1.Central, error) { - var central *v1alpha1.Central - var err error - if r.shouldUseGitopsConfig(remoteCentral) { - if central, err = r.getInstanceConfigWithGitops(remoteCentral); err != nil { - return nil, err - } - } else { - if central, err = r.getLegacyInstanceConfig(remoteCentral); err != nil { - return nil, err - } - } - if err := r.applyCentralConfig(remoteCentral, central); err != nil { - return nil, err - } - return central, nil -} - -func (r *CentralReconciler) shouldUseGitopsConfig(remoteCentral *private.ManagedCentral) bool { - return features.GitOpsCentrals.Enabled() && len(remoteCentral.Spec.CentralCRYAML) > 0 -} - -func (r *CentralReconciler) getInstanceConfigWithGitops(remoteCentral *private.ManagedCentral) (*v1alpha1.Central, error) { var central = new(v1alpha1.Central) if err := yaml2.Unmarshal([]byte(remoteCentral.Spec.CentralCRYAML), central); err != nil { return nil, errors.Wrap(err, "failed to unmarshal central yaml") } - return central, nil -} - -func (r *CentralReconciler) getLegacyInstanceConfig(remoteCentral *private.ManagedCentral) (*v1alpha1.Central, error) { - if remoteCentral == nil { - return nil, errInvalidArguments - } - - remoteCentralName := remoteCentral.Metadata.Name - remoteCentralNamespace := remoteCentral.Metadata.Namespace - - monitoringExposeEndpointEnabled := v1alpha1.ExposeEndpointEnabled - centralResources, err := converters.ConvertPrivateResourceRequirementsToCoreV1(&remoteCentral.Spec.Central.Resources) - if err != nil { - return nil, errors.Wrap(err, "converting Central resources") - } - scannerAnalyzerResources, err := converters.ConvertPrivateResourceRequirementsToCoreV1(&remoteCentral.Spec.Scanner.Analyzer.Resources) - if err != nil { - return nil, errors.Wrap(err, "converting Scanner Analyzer resources") - } - scannerAnalyzerScaling := converters.ConvertPrivateScalingToV1(&remoteCentral.Spec.Scanner.Analyzer.Scaling) - scannerDbResources, err := converters.ConvertPrivateResourceRequirementsToCoreV1(&remoteCentral.Spec.Scanner.Db.Resources) - if err != nil { - return nil, errors.Wrap(err, "converting Scanner DB resources") - } - - scannerComponentEnabled := v1alpha1.ScannerComponentEnabled - - central := &v1alpha1.Central{ - ObjectMeta: metav1.ObjectMeta{ - Name: remoteCentralName, - Namespace: remoteCentralNamespace, - Labels: map[string]string{ - k8s.ManagedByLabelKey: k8s.ManagedByFleetshardValue, - tenantIDLabelKey: remoteCentral.Id, - instanceTypeLabelKey: remoteCentral.Spec.Central.InstanceType, - orgIDLabelKey: remoteCentral.Spec.Auth.OwnerOrgId, - }, - Annotations: map[string]string{ - centralPVCAnnotationKey: strconv.FormatBool(r.managedDBEnabled), - managedServicesAnnotation: "true", - orgNameAnnotationKey: remoteCentral.Spec.Auth.OwnerOrgName, - }, - }, - Spec: v1alpha1.CentralSpec{ - Central: &v1alpha1.CentralComponentSpec{ - Monitoring: &v1alpha1.Monitoring{ - ExposeEndpoint: &monitoringExposeEndpointEnabled, - }, - DeploymentSpec: v1alpha1.DeploymentSpec{ - Resources: ¢ralResources, - }, - }, - Scanner: &v1alpha1.ScannerComponentSpec{ - Analyzer: &v1alpha1.ScannerAnalyzerComponent{ - DeploymentSpec: v1alpha1.DeploymentSpec{ - Resources: &scannerAnalyzerResources, - }, - Scaling: &scannerAnalyzerScaling, - }, - DB: &v1alpha1.DeploymentSpec{ - Resources: &scannerDbResources, - }, - Monitoring: &v1alpha1.Monitoring{ - ExposeEndpoint: &monitoringExposeEndpointEnabled, - }, - ScannerComponent: &scannerComponentEnabled, - }, - Customize: &v1alpha1.CustomizeSpec{ - Annotations: map[string]string{ - orgNameAnnotationKey: remoteCentral.Spec.Auth.OwnerOrgName, - }, - Labels: map[string]string{ - orgIDLabelKey: remoteCentral.Spec.Auth.OwnerOrgId, - tenantIDLabelKey: remoteCentral.Id, - instanceTypeLabelKey: remoteCentral.Spec.Central.InstanceType, - }, - }, - }, + if err := r.applyCentralConfig(remoteCentral, central); err != nil { + return nil, err } - return central, nil } @@ -1691,15 +1589,12 @@ func (r *CentralReconciler) shouldSkipReadyCentral(remoteCentral private.Managed isRemoteCentralReady(&remoteCentral) } -func (r *CentralReconciler) needsReconcile(changed bool, remoteCentral private.ManagedCentral, central *v1alpha1.Central) bool { +func (r *CentralReconciler) needsReconcile(changed bool, central *v1alpha1.Central) bool { if changed { return true } - if r.shouldUseGitopsConfig(&remoteCentral) { - forceReconcile, ok := central.Labels["rhacs.redhat.com/force-reconcile"] - return ok && forceReconcile == "true" - } - return remoteCentral.ForceReconcile == "always" + forceReconcile, ok := central.Labels["rhacs.redhat.com/force-reconcile"] + return ok && forceReconcile == "true" } var resourcesChart = charts.MustGetChart("tenant-resources", nil) diff --git a/fleetshard/pkg/central/reconciler/reconciler_test.go b/fleetshard/pkg/central/reconciler/reconciler_test.go index fbd08fe984..c788f4e975 100644 --- a/fleetshard/pkg/central/reconciler/reconciler_test.go +++ b/fleetshard/pkg/central/reconciler/reconciler_test.go @@ -7,7 +7,6 @@ import ( "encoding/base64" "fmt" "net/http" - "strconv" "strings" "testing" "time" @@ -56,8 +55,6 @@ const ( conditionTypeReady = "Ready" clusterName = "test-cluster" environment = "test" - operatorVersion = "4.0.1" - operatorImage = "quay.io/rhacs-eng/stackrox-operator:" + operatorVersion ) var ( @@ -113,10 +110,12 @@ var simpleManagedCentral = private.ManagedCentral{ DataEndpoint: private.ManagedCentralAllOfSpecDataEndpoint{ Host: fmt.Sprintf("acs-data-%s.acs.rhcloud.test", centralID), }, - Central: private.ManagedCentralAllOfSpecCentral{ - InstanceType: "standard", - }, - OperatorImage: operatorImage, + InstanceType: "standard", + CentralCRYAML: ` +metadata: + name: ` + centralName + ` + namespace: ` + centralNamespace + ` +`, }, } @@ -206,16 +205,7 @@ func TestReconcileCreate(t *testing.T) { err = fakeClient.Get(context.TODO(), client.ObjectKey{Name: centralName, Namespace: centralNamespace}, central) require.NoError(t, err) assert.Equal(t, centralName, central.GetName()) - assert.Equal(t, simpleManagedCentral.Id, central.GetLabels()[tenantIDLabelKey]) - assert.Equal(t, simpleManagedCentral.Id, central.Spec.Customize.Labels[tenantIDLabelKey]) - assert.Equal(t, environment, central.Spec.Customize.Annotations[envAnnotationKey]) - assert.Equal(t, clusterName, central.Spec.Customize.Annotations[clusterNameAnnotationKey]) - assert.Equal(t, simpleManagedCentral.Spec.Auth.OwnerOrgName, central.Spec.Customize.Annotations[orgNameAnnotationKey]) - assert.Equal(t, simpleManagedCentral.Spec.Auth.OwnerOrgId, central.Spec.Customize.Labels[orgIDLabelKey]) - assert.Equal(t, simpleManagedCentral.Spec.Central.InstanceType, central.Spec.Customize.Labels[instanceTypeLabelKey]) assert.Equal(t, "1", central.GetAnnotations()[util.RevisionAnnotationKey]) - assert.Equal(t, "false", central.GetAnnotations()[centralPVCAnnotationKey]) - assert.Equal(t, "true", central.GetAnnotations()[managedServicesAnnotation]) assert.Equal(t, true, *central.Spec.Central.Exposure.Route.Enabled) route := &openshiftRouteV1.Route{} @@ -261,7 +251,6 @@ func TestReconcileCreateWithManagedDB(t *testing.T) { central := &v1alpha1.Central{} err = fakeClient.Get(context.TODO(), client.ObjectKey{Name: centralName, Namespace: centralNamespace}, central) require.NoError(t, err) - assert.Equal(t, "true", central.GetAnnotations()[centralPVCAnnotationKey]) route := &openshiftRouteV1.Route{} err = fakeClient.Get(context.TODO(), client.ObjectKey{Name: centralReencryptRouteName, Namespace: centralNamespace}, route) @@ -478,7 +467,13 @@ func TestIgnoreCacheForCentralForceReconcileAlways(t *testing.T) { managedCentral := simpleManagedCentral managedCentral.RequestStatus = centralConstants.CentralRequestStatusReady.String() - managedCentral.ForceReconcile = "always" + managedCentral.Spec.CentralCRYAML = ` +metadata: + name: ` + centralName + ` + namespace: ` + centralNamespace + ` + labels: + rhacs.redhat.com/force-reconcile: "true" +` expectedHash, err := util.MD5SumFromJSONStruct(&managedCentral) require.NoError(t, err) @@ -2137,7 +2132,7 @@ func TestReconciler_applyAnnotations(t *testing.T) { }, c.Spec.Customize.Annotations) } -func TestReconciler_getInstanceConfigWithGitops(t *testing.T) { +func TestReconciler_getInstanceConfig(t *testing.T) { tcs := []struct { name string @@ -2157,7 +2152,6 @@ kind: Central metadata: name: central namespace: rhacs -spec: {} `, expectCentral: &v1alpha1.Central{ TypeMeta: metav1.TypeMeta{ @@ -2168,6 +2162,64 @@ spec: {} Name: "central", Namespace: "rhacs", }, + Spec: v1alpha1.CentralSpec{ + Central: &v1alpha1.CentralComponentSpec{ + Exposure: &v1alpha1.Exposure{ + Route: &v1alpha1.ExposureRoute{ + Enabled: pointer.Bool(false), + }, + }, + DeclarativeConfiguration: &v1alpha1.DeclarativeConfiguration{ + Secrets: []v1alpha1.LocalSecretReference{ + { + Name: "cloud-service-sensible-declarative-configs", + }, { + Name: "cloud-service-manual-declarative-configs", + }, + }, + }, + Telemetry: &v1alpha1.Telemetry{ + Enabled: pointer.Bool(false), + Storage: &v1alpha1.TelemetryStorage{ + Endpoint: pointer.String(""), + Key: pointer.String(""), + }, + }, + }, + Customize: &v1alpha1.CustomizeSpec{ + Annotations: map[string]string{ + "rhacs.redhat.com/environment": "", + "rhacs.redhat.com/cluster-name": "", + }, + EnvVars: []v1.EnvVar{ + { + Name: "http_proxy", + Value: "http://egress-proxy.rhacs.svc:3128", + }, { + Name: "HTTP_PROXY", + Value: "http://egress-proxy.rhacs.svc:3128", + }, { + Name: "https_proxy", + Value: "http://egress-proxy.rhacs.svc:3128", + }, { + Name: "HTTPS_PROXY", + Value: "http://egress-proxy.rhacs.svc:3128", + }, { + Name: "all_proxy", + Value: "http://egress-proxy.rhacs.svc:3128", + }, { + Name: "ALL_PROXY", + Value: "http://egress-proxy.rhacs.svc:3128", + }, { + Name: "no_proxy", + Value: ":0,central.rhacs.svc:443,central.rhacs:443,central:443,kubernetes.default.svc.cluster.local.:443,scanner-db.rhacs.svc:5432,scanner-db.rhacs:5432,scanner-db:5432,scanner.rhacs.svc:8080,scanner.rhacs.svc:8443,scanner.rhacs:8080,scanner.rhacs:8443,scanner:8080,scanner:8443", + }, { + Name: "NO_PROXY", + Value: ":0,central.rhacs.svc:443,central.rhacs:443,central:443,kubernetes.default.svc.cluster.local.:443,scanner-db.rhacs.svc:5432,scanner-db.rhacs:5432,scanner-db:5432,scanner.rhacs.svc:8080,scanner.rhacs.svc:8443,scanner.rhacs:8080,scanner.rhacs:8443,scanner:8080,scanner:8443", + }, + }, + }, + }, }, }, } @@ -2180,7 +2232,7 @@ spec: {} CentralCRYAML: tc.yaml, }, } - c, err := r.getInstanceConfigWithGitops(mc) + c, err := r.getInstanceConfig(mc) if tc.expectErr { assert.Error(t, err) } else { @@ -2191,49 +2243,3 @@ spec: {} } } - -func TestReconciler_shouldUseGitopsConfig(t *testing.T) { - tcs := []struct { - name string - managedCentral *private.ManagedCentral - featureFlagEnabled bool - expect bool - }{ - { - name: "should return true when centralCRYAML is set and feature flag is enabled", - managedCentral: &private.ManagedCentral{ - Spec: private.ManagedCentralAllOfSpec{ - CentralCRYAML: "foo", - }, - }, - featureFlagEnabled: true, - expect: true, - }, { - name: "should return false when centralCRYAML is set and feature flag is disabled", - managedCentral: &private.ManagedCentral{ - Spec: private.ManagedCentralAllOfSpec{ - CentralCRYAML: "foo", - }, - }, - featureFlagEnabled: false, - expect: false, - }, { - name: "should return false when centralCRYAML is not set and feature flag is enabled", - managedCentral: &private.ManagedCentral{ - Spec: private.ManagedCentralAllOfSpec{ - CentralCRYAML: "", - }, - }, - featureFlagEnabled: true, - expect: false, - }, - } - - for _, tc := range tcs { - t.Run(tc.name, func(t *testing.T) { - t.Setenv("RHACS_GITOPS_ENABLED", strconv.FormatBool(tc.featureFlagEnabled)) - r := &CentralReconciler{} - assert.Equal(t, tc.expect, r.shouldUseGitopsConfig(tc.managedCentral)) - }) - } -} diff --git a/internal/dinosaur/pkg/api/admin/private/api/openapi.yaml b/internal/dinosaur/pkg/api/admin/private/api/openapi.yaml index 4045a41d9e..fda37c870a 100644 --- a/internal/dinosaur/pkg/api/admin/private/api/openapi.yaml +++ b/internal/dinosaur/pkg/api/admin/private/api/openapi.yaml @@ -320,62 +320,6 @@ paths: security: - Bearer: [] summary: Return the details of Central instance by ID - patch: - operationId: updateCentralById - parameters: - - description: The ID of record - in: path - name: id - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CentralUpdateRequest' - description: Central update data - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Central' - description: Central updated by ID - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Bad request - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Auth token is invalid - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: User is not authorised to access the service - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: No Central found with the specified ID - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Unexpected error occurred - security: - - Bearer: [] - summary: Update a Central instance by ID /api/rhacs/v1/admin/centrals/{id}/rotate-secrets: post: parameters: @@ -504,70 +448,6 @@ paths: security: - Bearer: [] summary: Delete a Central directly in the Database by ID - /api/rhacs/v1/admin/centrals/default-version: - get: - operationId: getCentralDefaultVersion - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/CentralDefaultVersion' - description: Return current central default version - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Auth token is invalid - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: User is not authorised to access the service - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Unexpected error occurred - security: - - Bearer: [] - summary: Get the current central default version - post: - operationId: setCentralDefaultVersion - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CentralDefaultVersion' - description: Central version data - required: true - responses: - "200": - description: Central default version set to new value - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Auth token is invalid - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: User is not authorised to access the service - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Unexpected error occurred - security: - - Bearer: [] - summary: Set the central default version components: schemas: Central: @@ -582,49 +462,6 @@ components: allOf: - $ref: '#/components/schemas/List' - $ref: '#/components/schemas/CentralList_allOf' - CentralUpdateRequest: - example: - central: - resources: - requests: - key: requests - limits: - key: limits - force_reconcile: force_reconcile - scanner: - analyzer: - scaling: - maxReplicas: 1 - autoScaling: autoScaling - minReplicas: 1 - replicas: 1 - resources: - requests: - key: requests - limits: - key: limits - db: - resources: - requests: - key: requests - limits: - key: limits - properties: - central: - $ref: '#/components/schemas/CentralSpec' - scanner: - $ref: '#/components/schemas/ScannerSpec' - force_reconcile: - type: string - type: object - CentralDefaultVersion: - example: - version: quay.io/rhacs-eng/stackrox-operator:3.74.1 - properties: - version: - example: quay.io/rhacs-eng/stackrox-operator:3.74.1 - type: string - type: object CentralRotateSecretsRequest: example: rotate_rhsso_client_credentials: true @@ -649,32 +486,8 @@ components: description: Schema for the request body sent to /centrals POST example: cloud_account_id: cloud_account_id - central: - resources: - requests: - key: requests - limits: - key: limits multi_az: true name: name - scanner: - analyzer: - scaling: - maxReplicas: 1 - autoScaling: autoScaling - minReplicas: 1 - replicas: 1 - resources: - requests: - key: requests - limits: - key: limits - db: - resources: - requests: - key: requests - limits: - key: limits cloud_provider: cloud_provider region: region properties: @@ -697,69 +510,9 @@ components: description: The region where the Central component cluster will be created in type: string - central: - $ref: '#/components/schemas/CentralSpec' - scanner: - $ref: '#/components/schemas/ScannerSpec' required: - name type: object - CentralSpec: - example: - resources: - requests: - key: requests - limits: - key: limits - properties: - resources: - $ref: '#/components/schemas/ResourceRequirements' - type: object - ResourceRequirements: - example: - requests: - key: requests - limits: - key: limits - properties: - requests: - additionalProperties: - type: string - type: object - limits: - additionalProperties: - type: string - type: object - type: object - ResourceList: - additionalProperties: - type: string - type: object - ScannerSpec: - example: - analyzer: - scaling: - maxReplicas: 1 - autoScaling: autoScaling - minReplicas: 1 - replicas: 1 - resources: - requests: - key: requests - limits: - key: limits - db: - resources: - requests: - key: requests - limits: - key: limits - properties: - analyzer: - $ref: '#/components/schemas/ScannerSpec_analyzer' - db: - $ref: '#/components/schemas/ScannerSpec_db' - type: object CentralRequest: allOf: - $ref: '#/components/schemas/ObjectReference' @@ -838,12 +591,6 @@ components: type: string namespace: type: string - central: - $ref: '#/components/schemas/CentralSpec' - scanner: - $ref: '#/components/schemas/ScannerSpec' - force_reconcile: - type: string CentralList_allOf: properties: items: @@ -859,54 +606,6 @@ components: type: string operation_id: type: string - ScannerSpec_analyzer_scaling: - example: - maxReplicas: 1 - autoScaling: autoScaling - minReplicas: 1 - replicas: 1 - properties: - autoScaling: - type: string - replicas: - format: int32 - minimum: 1 - type: integer - minReplicas: - format: int32 - minimum: 1 - type: integer - maxReplicas: - format: int32 - minimum: 1 - type: integer - ScannerSpec_analyzer: - example: - scaling: - maxReplicas: 1 - autoScaling: autoScaling - minReplicas: 1 - replicas: 1 - resources: - requests: - key: requests - limits: - key: limits - properties: - resources: - $ref: '#/components/schemas/ResourceRequirements' - scaling: - $ref: '#/components/schemas/ScannerSpec_analyzer_scaling' - ScannerSpec_db: - example: - resources: - requests: - key: requests - limits: - key: limits - properties: - resources: - $ref: '#/components/schemas/ResourceRequirements' CentralRequest_allOf: example: '{"$ref":"#/components/examples/CentralRequestExample"}' properties: diff --git a/internal/dinosaur/pkg/api/admin/private/api_default.go b/internal/dinosaur/pkg/api/admin/private/api_default.go index 6563e96c27..4d4035d960 100644 --- a/internal/dinosaur/pkg/api/admin/private/api_default.go +++ b/internal/dinosaur/pkg/api/admin/private/api_default.go @@ -731,110 +731,6 @@ func (a *DefaultApiService) GetCentralById(ctx _context.Context, id string) (Cen return localVarReturnValue, localVarHTTPResponse, nil } -/* -GetCentralDefaultVersion Get the current central default version - - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - -@return CentralDefaultVersion -*/ -func (a *DefaultApiService) GetCentralDefaultVersion(ctx _context.Context) (CentralDefaultVersion, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue CentralDefaultVersion - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/api/rhacs/v1/admin/centrals/default-version" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 401 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - // GetCentralsOpts Optional parameters for the method 'GetCentrals' type GetCentralsOpts struct { Page optional.String @@ -973,228 +869,3 @@ func (a *DefaultApiService) GetCentrals(ctx _context.Context, localVarOptionals return localVarReturnValue, localVarHTTPResponse, nil } - -/* -SetCentralDefaultVersion Set the central default version - - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param centralDefaultVersion Central version data -*/ -func (a *DefaultApiService) SetCentralDefaultVersion(ctx _context.Context, centralDefaultVersion CentralDefaultVersion) (*_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/api/rhacs/v1/admin/centrals/default-version" - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = ¢ralDefaultVersion - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 401 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -/* -UpdateCentralById Update a Central instance by ID - - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - - @param id The ID of record - - @param centralUpdateRequest Central update data - -@return Central -*/ -func (a *DefaultApiService) UpdateCentralById(ctx _context.Context, id string, centralUpdateRequest CentralUpdateRequest) (Central, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Central - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/api/rhacs/v1/admin/centrals/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", _neturl.QueryEscape(parameterToString(id, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = ¢ralUpdateRequest - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(r) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/internal/dinosaur/pkg/api/admin/private/model_central.go b/internal/dinosaur/pkg/api/admin/private/model_central.go index 4a4d4fb074..0845239fb8 100644 --- a/internal/dinosaur/pkg/api/admin/private/model_central.go +++ b/internal/dinosaur/pkg/api/admin/private/model_central.go @@ -42,7 +42,4 @@ type Central struct { RoutesCreated bool `json:"routes_created,omitempty"` ClusterId string `json:"cluster_id,omitempty"` Namespace string `json:"namespace,omitempty"` - Central CentralSpec `json:"central,omitempty"` - Scanner ScannerSpec `json:"scanner,omitempty"` - ForceReconcile string `json:"force_reconcile,omitempty"` } diff --git a/internal/dinosaur/pkg/api/admin/private/model_central_default_version.go b/internal/dinosaur/pkg/api/admin/private/model_central_default_version.go deleted file mode 100644 index 2df0c60dcd..0000000000 --- a/internal/dinosaur/pkg/api/admin/private/model_central_default_version.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager Admin API - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager Admin APIs that can be used by RHACS Managed Service Operations Team. - * - * API version: 0.0.3 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package private - -// CentralDefaultVersion struct for CentralDefaultVersion -type CentralDefaultVersion struct { - Version string `json:"version,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/admin/private/model_central_request_payload.go b/internal/dinosaur/pkg/api/admin/private/model_central_request_payload.go index 6ad5bee7b0..caf7f628e7 100644 --- a/internal/dinosaur/pkg/api/admin/private/model_central_request_payload.go +++ b/internal/dinosaur/pkg/api/admin/private/model_central_request_payload.go @@ -21,7 +21,5 @@ type CentralRequestPayload struct { // The name of the Central component. It must consist of lower-case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character, and can not be longer than 32 characters. Name string `json:"name"` // The region where the Central component cluster will be created in - Region string `json:"region,omitempty"` - Central CentralSpec `json:"central,omitempty"` - Scanner ScannerSpec `json:"scanner,omitempty"` + Region string `json:"region,omitempty"` } diff --git a/internal/dinosaur/pkg/api/admin/private/model_central_spec.go b/internal/dinosaur/pkg/api/admin/private/model_central_spec.go deleted file mode 100644 index b84dab1830..0000000000 --- a/internal/dinosaur/pkg/api/admin/private/model_central_spec.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager Admin API - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager Admin APIs that can be used by RHACS Managed Service Operations Team. - * - * API version: 0.0.3 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package private - -// CentralSpec struct for CentralSpec -type CentralSpec struct { - Resources ResourceRequirements `json:"resources,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/admin/private/model_central_update_request.go b/internal/dinosaur/pkg/api/admin/private/model_central_update_request.go deleted file mode 100644 index fa294c52d7..0000000000 --- a/internal/dinosaur/pkg/api/admin/private/model_central_update_request.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager Admin API - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager Admin APIs that can be used by RHACS Managed Service Operations Team. - * - * API version: 0.0.3 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package private - -// CentralUpdateRequest struct for CentralUpdateRequest -type CentralUpdateRequest struct { - Central CentralSpec `json:"central,omitempty"` - Scanner ScannerSpec `json:"scanner,omitempty"` - ForceReconcile string `json:"force_reconcile,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/admin/private/model_resource_requirements.go b/internal/dinosaur/pkg/api/admin/private/model_resource_requirements.go deleted file mode 100644 index 337a22657e..0000000000 --- a/internal/dinosaur/pkg/api/admin/private/model_resource_requirements.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager Admin API - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager Admin APIs that can be used by RHACS Managed Service Operations Team. - * - * API version: 0.0.3 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package private - -// ResourceRequirements struct for ResourceRequirements -type ResourceRequirements struct { - Requests map[string]string `json:"requests,omitempty"` - Limits map[string]string `json:"limits,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/admin/private/model_scanner_spec.go b/internal/dinosaur/pkg/api/admin/private/model_scanner_spec.go deleted file mode 100644 index ab566c69c0..0000000000 --- a/internal/dinosaur/pkg/api/admin/private/model_scanner_spec.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager Admin API - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager Admin APIs that can be used by RHACS Managed Service Operations Team. - * - * API version: 0.0.3 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package private - -// ScannerSpec struct for ScannerSpec -type ScannerSpec struct { - Analyzer ScannerSpecAnalyzer `json:"analyzer,omitempty"` - Db ScannerSpecDb `json:"db,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/admin/private/model_scanner_spec_analyzer.go b/internal/dinosaur/pkg/api/admin/private/model_scanner_spec_analyzer.go deleted file mode 100644 index d0f47198ec..0000000000 --- a/internal/dinosaur/pkg/api/admin/private/model_scanner_spec_analyzer.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager Admin API - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager Admin APIs that can be used by RHACS Managed Service Operations Team. - * - * API version: 0.0.3 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package private - -// ScannerSpecAnalyzer struct for ScannerSpecAnalyzer -type ScannerSpecAnalyzer struct { - Resources ResourceRequirements `json:"resources,omitempty"` - Scaling ScannerSpecAnalyzerScaling `json:"scaling,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/admin/private/model_scanner_spec_analyzer_scaling.go b/internal/dinosaur/pkg/api/admin/private/model_scanner_spec_analyzer_scaling.go deleted file mode 100644 index 78859de11e..0000000000 --- a/internal/dinosaur/pkg/api/admin/private/model_scanner_spec_analyzer_scaling.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager Admin API - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager Admin APIs that can be used by RHACS Managed Service Operations Team. - * - * API version: 0.0.3 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package private - -// ScannerSpecAnalyzerScaling struct for ScannerSpecAnalyzerScaling -type ScannerSpecAnalyzerScaling struct { - AutoScaling string `json:"autoScaling,omitempty"` - Replicas int32 `json:"replicas,omitempty"` - MinReplicas int32 `json:"minReplicas,omitempty"` - MaxReplicas int32 `json:"maxReplicas,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/admin/private/model_scanner_spec_db.go b/internal/dinosaur/pkg/api/admin/private/model_scanner_spec_db.go deleted file mode 100644 index 6f5d22dd5f..0000000000 --- a/internal/dinosaur/pkg/api/admin/private/model_scanner_spec_db.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager Admin API - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager Admin APIs that can be used by RHACS Managed Service Operations Team. - * - * API version: 0.0.3 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package private - -// ScannerSpecDb struct for ScannerSpecDb -type ScannerSpecDb struct { - Resources ResourceRequirements `json:"resources,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/dbapi/central_default_version.go b/internal/dinosaur/pkg/api/dbapi/central_default_version.go deleted file mode 100644 index 6a9ddb474d..0000000000 --- a/internal/dinosaur/pkg/api/dbapi/central_default_version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dbapi - -import ( - "time" -) - -// CentralDefaultVersion is the type used for entries in the CentralDefaultVersion table -type CentralDefaultVersion struct { - ID uint64 - CreatedAt time.Time - Version string `json:"version"` -} diff --git a/internal/dinosaur/pkg/api/dbapi/central_request_types.go b/internal/dinosaur/pkg/api/dbapi/central_request_types.go index 0e1957ff92..4f3eeaf48c 100644 --- a/internal/dinosaur/pkg/api/dbapi/central_request_types.go +++ b/internal/dinosaur/pkg/api/dbapi/central_request_types.go @@ -57,14 +57,6 @@ type CentralRequest struct { // PlacementID field should be updated every time when a CentralRequest is assigned to an OSD cluster (even if it's the same one again). PlacementID string `json:"placement_id"` - // Central schema is defined by dbapi.CentralSpec. - Central api.JSON `json:"central"` - // Scanner schema is defined by dbapi.ScannerSpec. - Scanner api.JSON `json:"scanner"` - - // OperatorImage operator image which reconciles the Central instance - OperatorImage string `json:"desired_operator_image"` - // The type of central instance (eval or standard). InstanceType string `json:"instance_type"` // the quota service type for the central, e.g. ams, quota-management-list. @@ -91,12 +83,6 @@ type CentralRequest struct { // All we need to integrate Central with an IdP. AuthConfig - - // ForceReconcile will be set by the admin API to indicate to fleetshard-sync that this instance needs - // to be reconciled even if it has not changed and is in a state were reconciliation should be skipped. - // Set this to "always" to force reconcilation. Set it to any other string to force a - // one time reconcilation or to stop from reconciling always. - ForceReconcile string `json:"force_reconcile"` } // CentralList ... @@ -186,53 +172,3 @@ func (k *CentralRequest) GetDataHost() string { } return fmt.Sprintf("acs-data-%s.%s", k.ID, k.Host) } - -// GetCentralSpec retrieves the CentralSpec from the CentralRequest in unmarshalled form. -func (k *CentralRequest) GetCentralSpec() (*CentralSpec, error) { - var centralSpec = DefaultCentralSpec - if len(k.Central) > 0 { - err := json.Unmarshal(k.Central, ¢ralSpec) - if err != nil { - return nil, fmt.Errorf("unmarshalling CentralSpec: %w", err) - } - } - return ¢ralSpec, nil -} - -// GetScannerSpec retrieves the ScannerSpec from the CentralRequest in unmarshalled form. -func (k *CentralRequest) GetScannerSpec() (*ScannerSpec, error) { - var scannerSpec = DefaultScannerSpec - if len(k.Scanner) > 0 { - err := json.Unmarshal(k.Scanner, &scannerSpec) - if err != nil { - return nil, fmt.Errorf("unmarshalling ScannerSpec: %w", err) - } - } - return &scannerSpec, nil -} - -// SetCentralSpec updates the CentralSpec within the CentralRequest. -func (k *CentralRequest) SetCentralSpec(centralSpec *CentralSpec) error { - centralSpecBytes, err := json.Marshal(centralSpec) - if err != nil { - return fmt.Errorf("marshalling CentralSpec into JSON: %w", err) - } - err = k.Central.UnmarshalJSON(centralSpecBytes) - if err != nil { - return fmt.Errorf("updating CentralSpec within CentralRequest: %w", err) - } - return nil -} - -// SetScannerSpec updates the ScannerSpec within the CentralRequest. -func (k *CentralRequest) SetScannerSpec(scannerSpec *ScannerSpec) error { - scannerSpecBytes, err := json.Marshal(scannerSpec) - if err != nil { - return fmt.Errorf("marshalling ScannerSpec into JSON: %w", err) - } - err = k.Scanner.UnmarshalJSON(scannerSpecBytes) - if err != nil { - return fmt.Errorf("updating ScannerSpec within CentralRequest: %w", err) - } - return nil -} diff --git a/internal/dinosaur/pkg/api/private/api/openapi.yaml b/internal/dinosaur/pkg/api/private/api/openapi.yaml index f3a88f9334..cc323fc1ce 100644 --- a/internal/dinosaur/pkg/api/private/api/openapi.yaml +++ b/internal/dinosaur/pkg/api/private/api/openapi.yaml @@ -323,21 +323,6 @@ components: kind: type: string type: object - ResourceList: - additionalProperties: - type: string - type: object - ResourceRequirements: - properties: - requests: - additionalProperties: - type: string - type: object - limits: - additionalProperties: - type: string - type: object - type: object ManagedCentral: allOf: - $ref: '#/components/schemas/PrivateObjectReference' @@ -492,51 +477,13 @@ components: properties: host: type: string - ManagedCentral_allOf_spec_central: + ManagedCentral_allOf_spec: properties: instanceType: enum: - eval - standard type: string - resources: - $ref: '#/components/schemas/ResourceRequirements' - ManagedCentral_allOf_spec_scanner_analyzer_scaling: - properties: - autoScaling: - type: string - replicas: - format: int32 - minimum: 1 - type: integer - minReplicas: - format: int32 - minimum: 1 - type: integer - maxReplicas: - format: int32 - minimum: 1 - type: integer - ManagedCentral_allOf_spec_scanner_analyzer: - properties: - scaling: - $ref: '#/components/schemas/ManagedCentral_allOf_spec_scanner_analyzer_scaling' - resources: - $ref: '#/components/schemas/ResourceRequirements' - ManagedCentral_allOf_spec_scanner_db: - properties: - host: - type: string - resources: - $ref: '#/components/schemas/ResourceRequirements' - ManagedCentral_allOf_spec_scanner: - properties: - analyzer: - $ref: '#/components/schemas/ManagedCentral_allOf_spec_scanner_analyzer' - db: - $ref: '#/components/schemas/ManagedCentral_allOf_spec_scanner_db' - ManagedCentral_allOf_spec: - properties: centralCRYAML: type: string owners: @@ -549,12 +496,6 @@ components: $ref: '#/components/schemas/ManagedCentral_allOf_spec_uiEndpoint' dataEndpoint: $ref: '#/components/schemas/ManagedCentral_allOf_spec_dataEndpoint' - operatorImage: - type: string - central: - $ref: '#/components/schemas/ManagedCentral_allOf_spec_central' - scanner: - $ref: '#/components/schemas/ManagedCentral_allOf_spec_scanner' ManagedCentral_allOf: properties: metadata: @@ -563,8 +504,6 @@ components: $ref: '#/components/schemas/ManagedCentral_allOf_spec' requestStatus: type: string - forceReconcile: - type: string ManagedCentralList_allOf: example: '{"kind":"ManagedCentralList","items":{"$ref":"#/components/examples/ManagedCentralExample"}}' properties: diff --git a/internal/dinosaur/pkg/api/private/model_managed_central.go b/internal/dinosaur/pkg/api/private/model_managed_central.go index 010f0f18c8..bedbedf8a6 100644 --- a/internal/dinosaur/pkg/api/private/model_managed_central.go +++ b/internal/dinosaur/pkg/api/private/model_managed_central.go @@ -12,10 +12,9 @@ package private // ManagedCentral struct for ManagedCentral type ManagedCentral struct { - Id string `json:"id,omitempty"` - Kind string `json:"kind,omitempty"` - Metadata ManagedCentralAllOfMetadata `json:"metadata,omitempty"` - Spec ManagedCentralAllOfSpec `json:"spec,omitempty"` - RequestStatus string `json:"requestStatus,omitempty"` - ForceReconcile string `json:"forceReconcile,omitempty"` + Id string `json:"id,omitempty"` + Kind string `json:"kind,omitempty"` + Metadata ManagedCentralAllOfMetadata `json:"metadata,omitempty"` + Spec ManagedCentralAllOfSpec `json:"spec,omitempty"` + RequestStatus string `json:"requestStatus,omitempty"` } diff --git a/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec.go b/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec.go index ff5e370ea9..47e06301a6 100644 --- a/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec.go +++ b/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec.go @@ -12,12 +12,10 @@ package private // ManagedCentralAllOfSpec struct for ManagedCentralAllOfSpec type ManagedCentralAllOfSpec struct { + InstanceType string `json:"instanceType,omitempty"` CentralCRYAML string `json:"centralCRYAML,omitempty"` Owners []string `json:"owners,omitempty"` Auth ManagedCentralAllOfSpecAuth `json:"auth,omitempty"` UiEndpoint ManagedCentralAllOfSpecUiEndpoint `json:"uiEndpoint,omitempty"` DataEndpoint ManagedCentralAllOfSpecDataEndpoint `json:"dataEndpoint,omitempty"` - OperatorImage string `json:"operatorImage,omitempty"` - Central ManagedCentralAllOfSpecCentral `json:"central,omitempty"` - Scanner ManagedCentralAllOfSpecScanner `json:"scanner,omitempty"` } diff --git a/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_central.go b/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_central.go deleted file mode 100644 index b33a136a8c..0000000000 --- a/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_central.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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 - -// ManagedCentralAllOfSpecCentral struct for ManagedCentralAllOfSpecCentral -type ManagedCentralAllOfSpecCentral struct { - InstanceType string `json:"instanceType,omitempty"` - Resources ResourceRequirements `json:"resources,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_scanner.go b/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_scanner.go deleted file mode 100644 index 19b3bc0390..0000000000 --- a/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_scanner.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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 - -// ManagedCentralAllOfSpecScanner struct for ManagedCentralAllOfSpecScanner -type ManagedCentralAllOfSpecScanner struct { - Analyzer ManagedCentralAllOfSpecScannerAnalyzer `json:"analyzer,omitempty"` - Db ManagedCentralAllOfSpecScannerDb `json:"db,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_scanner_analyzer.go b/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_scanner_analyzer.go deleted file mode 100644 index 3dec04bdae..0000000000 --- a/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_scanner_analyzer.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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 - -// ManagedCentralAllOfSpecScannerAnalyzer struct for ManagedCentralAllOfSpecScannerAnalyzer -type ManagedCentralAllOfSpecScannerAnalyzer struct { - Scaling ManagedCentralAllOfSpecScannerAnalyzerScaling `json:"scaling,omitempty"` - Resources ResourceRequirements `json:"resources,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_scanner_analyzer_scaling.go b/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_scanner_analyzer_scaling.go deleted file mode 100644 index bab77e1151..0000000000 --- a/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_scanner_analyzer_scaling.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 - -// ManagedCentralAllOfSpecScannerAnalyzerScaling struct for ManagedCentralAllOfSpecScannerAnalyzerScaling -type ManagedCentralAllOfSpecScannerAnalyzerScaling struct { - AutoScaling string `json:"autoScaling,omitempty"` - Replicas int32 `json:"replicas,omitempty"` - MinReplicas int32 `json:"minReplicas,omitempty"` - MaxReplicas int32 `json:"maxReplicas,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_scanner_db.go b/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_scanner_db.go deleted file mode 100644 index 0d11ef1428..0000000000 --- a/internal/dinosaur/pkg/api/private/model_managed_central_all_of_spec_scanner_db.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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 - -// ManagedCentralAllOfSpecScannerDb struct for ManagedCentralAllOfSpecScannerDb -type ManagedCentralAllOfSpecScannerDb struct { - Host string `json:"host,omitempty"` - Resources ResourceRequirements `json:"resources,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/private/model_resource_requirements.go b/internal/dinosaur/pkg/api/private/model_resource_requirements.go deleted file mode 100644 index 29e48be8ff..0000000000 --- a/internal/dinosaur/pkg/api/private/model_resource_requirements.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * 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 - -// ResourceRequirements struct for ResourceRequirements -type ResourceRequirements struct { - Requests map[string]string `json:"requests,omitempty"` - Limits map[string]string `json:"limits,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/public/api/openapi.yaml b/internal/dinosaur/pkg/api/public/api/openapi.yaml index 21d33f2ce6..b720d63fd6 100644 --- a/internal/dinosaur/pkg/api/public/api/openapi.yaml +++ b/internal/dinosaur/pkg/api/public/api/openapi.yaml @@ -1261,26 +1261,6 @@ components: allOf: - $ref: '#/components/schemas/List' - $ref: '#/components/schemas/ErrorList_allOf' - ResourceList: - additionalProperties: - type: string - type: object - ResourceRequirements: - example: - requests: - key: requests - limits: - key: limits - properties: - requests: - additionalProperties: - type: string - type: object - limits: - additionalProperties: - type: string - type: object - type: object CentralRequest: allOf: - $ref: '#/components/schemas/ObjectReference' @@ -1289,42 +1269,6 @@ components: allOf: - $ref: '#/components/schemas/List' - $ref: '#/components/schemas/CentralRequestList_allOf' - CentralSpec: - example: - resources: - requests: - key: requests - limits: - key: limits - properties: - resources: - $ref: '#/components/schemas/ResourceRequirements' - type: object - ScannerSpec: - example: - analyzer: - scaling: - maxReplicas: 1 - autoScaling: autoScaling - minReplicas: 1 - replicas: 1 - resources: - requests: - key: requests - limits: - key: limits - db: - resources: - requests: - key: requests - limits: - key: limits - properties: - analyzer: - $ref: '#/components/schemas/ScannerSpec_analyzer' - db: - $ref: '#/components/schemas/ScannerSpec_db' - type: object VersionMetadata: allOf: - $ref: '#/components/schemas/ObjectReference' @@ -1342,32 +1286,8 @@ components: description: Schema for the request body sent to /centrals POST example: cloud_account_id: cloud_account_id - central: - resources: - requests: - key: requests - limits: - key: limits multi_az: true name: name - scanner: - analyzer: - scaling: - maxReplicas: 1 - autoScaling: autoScaling - minReplicas: 1 - replicas: 1 - resources: - requests: - key: requests - limits: - key: limits - db: - resources: - requests: - key: requests - limits: - key: limits cloud_provider: cloud_provider region: region properties: @@ -1390,10 +1310,6 @@ components: description: The region where the Central component cluster will be created in type: string - central: - $ref: '#/components/schemas/CentralSpec' - scanner: - $ref: '#/components/schemas/ScannerSpec' required: - name type: object @@ -1579,54 +1495,6 @@ components: allOf: - $ref: '#/components/schemas/CentralRequest' type: array - ScannerSpec_analyzer_scaling: - example: - maxReplicas: 1 - autoScaling: autoScaling - minReplicas: 1 - replicas: 1 - properties: - autoScaling: - type: string - replicas: - format: int32 - minimum: 1 - type: integer - minReplicas: - format: int32 - minimum: 1 - type: integer - maxReplicas: - format: int32 - minimum: 1 - type: integer - ScannerSpec_analyzer: - example: - scaling: - maxReplicas: 1 - autoScaling: autoScaling - minReplicas: 1 - replicas: 1 - resources: - requests: - key: requests - limits: - key: limits - properties: - resources: - $ref: '#/components/schemas/ResourceRequirements' - scaling: - $ref: '#/components/schemas/ScannerSpec_analyzer_scaling' - ScannerSpec_db: - example: - resources: - requests: - key: requests - limits: - key: limits - properties: - resources: - $ref: '#/components/schemas/ResourceRequirements' VersionMetadata_allOf: example: '{"kind":"APIVersion","id":"v1","href":"/api/rhacs/v1","collections":[{"id":"centrals","href":"/api/rhacs/v1/centrals","kind":"CentralList"}]}' properties: diff --git a/internal/dinosaur/pkg/api/public/model_central_request_payload.go b/internal/dinosaur/pkg/api/public/model_central_request_payload.go index 44508ec251..73c76c5600 100644 --- a/internal/dinosaur/pkg/api/public/model_central_request_payload.go +++ b/internal/dinosaur/pkg/api/public/model_central_request_payload.go @@ -21,7 +21,5 @@ type CentralRequestPayload struct { // The name of the Central component. It must consist of lower-case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character, and can not be longer than 32 characters. Name string `json:"name"` // The region where the Central component cluster will be created in - Region string `json:"region,omitempty"` - Central CentralSpec `json:"central,omitempty"` - Scanner ScannerSpec `json:"scanner,omitempty"` + Region string `json:"region,omitempty"` } diff --git a/internal/dinosaur/pkg/api/public/model_central_spec.go b/internal/dinosaur/pkg/api/public/model_central_spec.go deleted file mode 100644 index b48e829490..0000000000 --- a/internal/dinosaur/pkg/api/public/model_central_spec.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager is a Rest API to manage instances of ACS components. - * - * API version: 1.2.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package public - -// CentralSpec struct for CentralSpec -type CentralSpec struct { - Resources ResourceRequirements `json:"resources,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/public/model_resource_requirements.go b/internal/dinosaur/pkg/api/public/model_resource_requirements.go deleted file mode 100644 index 7580d4f2c1..0000000000 --- a/internal/dinosaur/pkg/api/public/model_resource_requirements.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager is a Rest API to manage instances of ACS components. - * - * API version: 1.2.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package public - -// ResourceRequirements struct for ResourceRequirements -type ResourceRequirements struct { - Requests map[string]string `json:"requests,omitempty"` - Limits map[string]string `json:"limits,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/public/model_scanner_spec.go b/internal/dinosaur/pkg/api/public/model_scanner_spec.go deleted file mode 100644 index 66cb0aac9c..0000000000 --- a/internal/dinosaur/pkg/api/public/model_scanner_spec.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager is a Rest API to manage instances of ACS components. - * - * API version: 1.2.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package public - -// ScannerSpec struct for ScannerSpec -type ScannerSpec struct { - Analyzer ScannerSpecAnalyzer `json:"analyzer,omitempty"` - Db ScannerSpecDb `json:"db,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/public/model_scanner_spec_analyzer.go b/internal/dinosaur/pkg/api/public/model_scanner_spec_analyzer.go deleted file mode 100644 index d7465130b0..0000000000 --- a/internal/dinosaur/pkg/api/public/model_scanner_spec_analyzer.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager is a Rest API to manage instances of ACS components. - * - * API version: 1.2.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package public - -// ScannerSpecAnalyzer struct for ScannerSpecAnalyzer -type ScannerSpecAnalyzer struct { - Resources ResourceRequirements `json:"resources,omitempty"` - Scaling ScannerSpecAnalyzerScaling `json:"scaling,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/public/model_scanner_spec_analyzer_scaling.go b/internal/dinosaur/pkg/api/public/model_scanner_spec_analyzer_scaling.go deleted file mode 100644 index 397951891d..0000000000 --- a/internal/dinosaur/pkg/api/public/model_scanner_spec_analyzer_scaling.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager is a Rest API to manage instances of ACS components. - * - * API version: 1.2.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package public - -// ScannerSpecAnalyzerScaling struct for ScannerSpecAnalyzerScaling -type ScannerSpecAnalyzerScaling struct { - AutoScaling string `json:"autoScaling,omitempty"` - Replicas int32 `json:"replicas,omitempty"` - MinReplicas int32 `json:"minReplicas,omitempty"` - MaxReplicas int32 `json:"maxReplicas,omitempty"` -} diff --git a/internal/dinosaur/pkg/api/public/model_scanner_spec_db.go b/internal/dinosaur/pkg/api/public/model_scanner_spec_db.go deleted file mode 100644 index 1931a07547..0000000000 --- a/internal/dinosaur/pkg/api/public/model_scanner_spec_db.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Red Hat Advanced Cluster Security Service Fleet Manager - * - * Red Hat Advanced Cluster Security (RHACS) Service Fleet Manager is a Rest API to manage instances of ACS components. - * - * API version: 1.2.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. -package public - -// ScannerSpecDb struct for ScannerSpecDb -type ScannerSpecDb struct { - Resources ResourceRequirements `json:"resources,omitempty"` -} diff --git a/internal/dinosaur/pkg/config/central.go b/internal/dinosaur/pkg/config/central.go index 73843d98ce..e4bd35bd1d 100644 --- a/internal/dinosaur/pkg/config/central.go +++ b/internal/dinosaur/pkg/config/central.go @@ -16,9 +16,6 @@ type CentralConfig struct { CentralTLSKeyFile string `json:"central_tls_key_file"` EnableCentralExternalCertificate bool `json:"enable_central_external_certificate"` CentralDomainName string `json:"central_domain_name"` - // CentralDefaultVersion is the default version for new Central instances. If this is set to a - // non empty value, fleet-manager will store it as the new default value in its database on start up. - CentralDefaultVersion string `json:"central_default_version"` CentralLifespan *CentralLifespanConfig `json:"central_lifespan"` Quota *CentralQuotaConfig `json:"central_quota"` @@ -56,7 +53,6 @@ func (c *CentralConfig) AddFlags(fs *pflag.FlagSet) { fs.BoolVar(&c.CentralLifespan.EnableDeletionOfExpiredCentral, "enable-deletion-of-expired-central", c.CentralLifespan.EnableDeletionOfExpiredCentral, "Enable the deletion of centrals when its life span has expired") fs.IntVar(&c.CentralLifespan.CentralLifespanInHours, "central-lifespan", c.CentralLifespan.CentralLifespanInHours, "The desired lifespan of a Central instance") fs.StringVar(&c.CentralDomainName, "central-domain-name", c.CentralDomainName, "The domain name to use for Central instances") - fs.StringVar(&c.CentralDefaultVersion, "central-default-version", c.CentralDefaultVersion, "The default version for Central instances") fs.StringVar(&c.Quota.Type, "quota-type", c.Quota.Type, "The type of the quota service to be used. The available options are: 'ams' for AMS backed implementation and 'quota-management-list' for quota list backed implementation (default).") fs.BoolVar(&c.Quota.AllowEvaluatorInstance, "allow-evaluator-instance", c.Quota.AllowEvaluatorInstance, "Allow the creation of central evaluator instances") diff --git a/internal/dinosaur/pkg/converters/resourceutil.go b/internal/dinosaur/pkg/converters/resourceutil.go deleted file mode 100644 index d269f9ef40..0000000000 --- a/internal/dinosaur/pkg/converters/resourceutil.go +++ /dev/null @@ -1,189 +0,0 @@ -package converters - -import ( - "fmt" - - admin "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/admin/private" - adminPrivate "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/admin/private" - "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/pkg/api/public" - "github.com/stackrox/rox/operator/apis/platform/v1alpha1" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" -) - -// ConvertPublicScalingToV1 converts public API Scanner Scaling configuration into v1alpha1 Scanner Scaling configuration. -func ConvertPublicScalingToV1(scaling *public.ScannerSpecAnalyzerScaling) (v1alpha1.ScannerAnalyzerScaling, error) { - if scaling == nil { - return v1alpha1.ScannerAnalyzerScaling{}, nil - } - autoScaling := scaling.AutoScaling - return v1alpha1.ScannerAnalyzerScaling{ - AutoScaling: (*v1alpha1.AutoScalingPolicy)(&autoScaling), // TODO: validate. - Replicas: &scaling.Replicas, - MinReplicas: &scaling.MinReplicas, - MaxReplicas: &scaling.MaxReplicas, - }, nil -} - -// ConvertAdminPrivateScalingToV1 converts admin API Scanner Scaling configuration into v1alpha1 Scanner Scaling configuration. -func ConvertAdminPrivateScalingToV1(scaling *adminPrivate.ScannerSpecAnalyzerScaling) (v1alpha1.ScannerAnalyzerScaling, error) { - if scaling == nil { - return v1alpha1.ScannerAnalyzerScaling{}, nil - } - autoScaling := scaling.AutoScaling - return v1alpha1.ScannerAnalyzerScaling{ - AutoScaling: (*v1alpha1.AutoScalingPolicy)(&autoScaling), // TODO(create-ticket): validate. - Replicas: &scaling.Replicas, - MinReplicas: &scaling.MinReplicas, - MaxReplicas: &scaling.MaxReplicas, - }, nil -} - -// ConvertPrivateScalingToV1 converts private API Scanner Scaling configuration into v1alpha1 Scanner Scaling configuration. -func ConvertPrivateScalingToV1(scaling *private.ManagedCentralAllOfSpecScannerAnalyzerScaling) v1alpha1.ScannerAnalyzerScaling { - if scaling == nil { - return v1alpha1.ScannerAnalyzerScaling{} - } - autoScaling := scaling.AutoScaling - return v1alpha1.ScannerAnalyzerScaling{ - AutoScaling: (*v1alpha1.AutoScalingPolicy)(&autoScaling), // TODO: validate. - Replicas: &scaling.Replicas, - MinReplicas: &scaling.MinReplicas, - MaxReplicas: &scaling.MaxReplicas, - } -} - -// ConvertScalingToPublic converts the internal dbapi ScannerAnalyzerScaling model into the ScannerSpecAnalyzerScaling model from the public API. -func ConvertScalingToPublic(from *dbapi.ScannerAnalyzerScaling) public.ScannerSpecAnalyzerScaling { - return public.ScannerSpecAnalyzerScaling{ - AutoScaling: from.AutoScaling, - Replicas: from.Replicas, - MinReplicas: from.MinReplicas, - MaxReplicas: from.MaxReplicas, - } -} - -// convertCoreV1ResourceListToMap converts corev1 ResourceList into generic map. -func convertCoreV1ResourceListToMap(v1ResourceList corev1.ResourceList) map[string]string { - v1Resources := (map[corev1.ResourceName]resource.Quantity)(v1ResourceList) - if v1Resources == nil { - return nil - } - resources := make(map[string]string) - - for name, qty := range v1Resources { - if qtyString := qtyAsString(qty); qtyString != "" { - resources[name.String()] = qtyString - } - } - if len(resources) == 0 { - return nil - } - return resources -} - -// ConvertCoreV1ResourceRequirementsToPublic converts corev1 ResourceRequirements into public API ResourceRequirements. -func ConvertCoreV1ResourceRequirementsToPublic(v1Resources *corev1.ResourceRequirements) public.ResourceRequirements { - return public.ResourceRequirements{ - Limits: convertCoreV1ResourceListToMap(v1Resources.Limits), - Requests: convertCoreV1ResourceListToMap(v1Resources.Requests), - } -} - -// ConvertCoreV1ResourceRequirementsToPrivate converts corev1 ResourceRequirements into private API ResourceRequirements. -func ConvertCoreV1ResourceRequirementsToPrivate(v1Resources *corev1.ResourceRequirements) private.ResourceRequirements { - return private.ResourceRequirements{ - Limits: convertCoreV1ResourceListToMap(v1Resources.Limits), - Requests: convertCoreV1ResourceListToMap(v1Resources.Requests), - } -} - -// ConvertCoreV1ResourceRequirementsToAdmin converts corev1 ResourceRequirements into private admin API ResourceRequirements. -func ConvertCoreV1ResourceRequirementsToAdmin(v1Resources *corev1.ResourceRequirements) admin.ResourceRequirements { - return admin.ResourceRequirements{ - Limits: convertCoreV1ResourceListToMap(v1Resources.Limits), - Requests: convertCoreV1ResourceListToMap(v1Resources.Requests), - } -} - -// ConvertPublicResourceRequirementsToCoreV1 converts public API ResourceRequirements into corev1 ResourceRequirements. -func ConvertPublicResourceRequirementsToCoreV1(res *public.ResourceRequirements) (corev1.ResourceRequirements, error) { - requests, err := apiResourcesToCoreV1(res.Requests) - if err != nil { - return corev1.ResourceRequirements{}, err - } - - limits, err := apiResourcesToCoreV1(res.Limits) - if err != nil { - return corev1.ResourceRequirements{}, err - } - - return corev1.ResourceRequirements{ - Limits: limits, - Requests: requests, - }, nil -} - -// ConvertPrivateResourceRequirementsToCoreV1 converts private API ResourceRequirements into corev1 ResourceRequirements. -func ConvertPrivateResourceRequirementsToCoreV1(res *private.ResourceRequirements) (corev1.ResourceRequirements, error) { - requests, err := apiResourcesToCoreV1(res.Requests) - if err != nil { - return corev1.ResourceRequirements{}, err - } - - limits, err := apiResourcesToCoreV1(res.Limits) - if err != nil { - return corev1.ResourceRequirements{}, err - } - - return corev1.ResourceRequirements{ - Limits: limits, - Requests: requests, - }, nil -} - -// ConvertAdminPrivateRequirementsToCoreV1 converts admin API ResourceRequirements into corev1 ResourceRequirements. -func ConvertAdminPrivateRequirementsToCoreV1(res *adminPrivate.ResourceRequirements) (corev1.ResourceRequirements, error) { - requests, err := apiResourcesToCoreV1(res.Requests) - if err != nil { - return corev1.ResourceRequirements{}, err - } - - limits, err := apiResourcesToCoreV1(res.Limits) - if err != nil { - return corev1.ResourceRequirements{}, err - } - - return corev1.ResourceRequirements{ - Limits: limits, - Requests: requests, - }, nil -} - -func apiResourcesToCoreV1(resources map[string]string) (map[corev1.ResourceName]resource.Quantity, error) { - var v1Resources map[corev1.ResourceName]resource.Quantity - for name, qty := range resources { - if qty == "" { - continue - } - resourceQty, err := resource.ParseQuantity(qty) - if err != nil { - return nil, fmt.Errorf("parsing quantity %q for resource %s: %v", qty, name, err) - } - if v1Resources == nil { - v1Resources = make(map[corev1.ResourceName]resource.Quantity) - } - v1Resources[corev1.ResourceName(name)] = resourceQty - } - return v1Resources, nil -} - -func qtyAsString(qty resource.Quantity) string { - if qty == (resource.Quantity{}) { - // Otherwise a zero-value Quantity would produce the non-zero-value string "0". - return "" - } - return (&qty).String() -} diff --git a/internal/dinosaur/pkg/converters/resourceutil_test.go b/internal/dinosaur/pkg/converters/resourceutil_test.go deleted file mode 100644 index c63958c3c3..0000000000 --- a/internal/dinosaur/pkg/converters/resourceutil_test.go +++ /dev/null @@ -1,14 +0,0 @@ -package converters - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "k8s.io/apimachinery/pkg/api/resource" -) - -func TestQuantityToStringConverter(t *testing.T) { - assert.Equal(t, qtyAsString(resource.Quantity{}), "") - assert.Equal(t, qtyAsString(resource.MustParse("1m")), "1m") - assert.Equal(t, qtyAsString(resource.MustParse("2000G")), "2T") -} diff --git a/internal/dinosaur/pkg/generated/bindata.go b/internal/dinosaur/pkg/generated/bindata.go index 7fd4a03bd8..8ce360e520 100644 --- a/internal/dinosaur/pkg/generated/bindata.go +++ b/internal/dinosaur/pkg/generated/bindata.go @@ -79,7 +79,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _fleetManagerYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x7b\x73\xdb\xb6\xb2\xf8\xff\xfe\x14\xfb\x53\x7f\x67\x7c\xda\xb1\x64\x49\x7e\x24\xd1\xdc\xde\x19\x27\x76\x12\xf7\x24\x4e\xea\x47\xd3\xb4\x73\x46\x86\x48\x48\x42\x4c\x02\x0c\x00\xda\x56\xee\xb9\xdf\xfd\x0e\x1e\x24\xc1\xa7\x28\x39\x0f\xa7\xb5\x67\x3a\x8d\x48\x60\xb9\xbb\xd8\x5d\xec\x02\xbb\x00\x8b\x30\x45\x11\x19\xc1\x4e\xaf\xdf\xeb\xc3\x0f\x40\x31\xf6\x41\xce\x89\x00\x24\x60\x4a\xb8\x90\x10\x10\x8a\x41\x32\x40\x41\xc0\x6e\x40\xb0\x10\xc3\xf1\xe1\x91\x50\x8f\xae\x28\xbb\x31\xad\x55\x07\x0a\x16\x1c\xf8\xcc\x8b\x43\x4c\x65\x6f\xe3\x07\x38\x08\x02\xc0\xd4\x8f\x18\xa1\x52\x80\x8f\xa7\x84\x62\x1f\xe6\x98\x63\xb8\x21\x41\x00\x13\x0c\x3e\x11\x1e\xbb\xc6\x1c\x4d\x02\x0c\x93\x85\xfa\x12\xc4\x02\x73\xd1\x83\xe3\x29\x48\xdd\x56\x7d\xc0\x62\xc7\xe0\x0a\xe3\xc8\x60\x92\x41\xee\x44\x9c\x5c\x23\x89\x3b\x5b\x80\x7c\x45\x03\x0e\x55\x53\x39\xc7\xd0\x09\x11\x45\x33\xec\x77\x05\xe6\xd7\xc4\xc3\xa2\x8b\x22\xd2\xb5\xed\x7b\x0b\x14\x06\x1d\x98\x92\x00\x6f\x10\x3a\x65\xa3\x0d\x00\x49\x64\x80\x47\x70\x8a\x7d\x78\x89\x24\x1c\xf8\xd7\x88\x7a\xd8\x87\x67\x41\x2c\x24\xe6\x70\x86\xbd\x98\x13\xb9\x80\x33\x03\x10\x9e\x07\x18\x4b\x78\xad\x3f\xc3\x37\x00\xae\x31\x17\x84\xd1\x11\x0c\x7a\xc3\x5e\x7f\x03\xc0\xc7\xc2\xe3\x24\x92\xfa\xe1\x72\xb8\xff\x3c\x7d\x79\xf0\xec\xec\xc7\x6a\xf8\x86\x17\xa7\x58\x48\x38\x78\x7b\xac\x88\x34\xf4\x01\xa1\x42\x2a\x80\x02\xd8\x14\x0e\x9e\x9d\x81\xc7\xc2\x88\x51\x4c\xa5\xe8\x6d\x28\xda\x31\x17\x8a\xbc\x2e\xc4\x3c\x18\xc1\x5c\xca\x48\x8c\xb6\xb7\x51\x44\x7a\x6a\xe4\xc4\x9c\x4c\x65\xcf\x63\xe1\x06\x40\x01\xe3\xd7\x88\x50\xf8\x67\xc4\x99\x1f\x7b\xea\xc9\x8f\x60\xc0\x55\x03\x13\x12\xcd\xf0\x32\x90\x67\x12\xcd\x08\x9d\x55\x02\x1a\x6d\x6f\x07\xcc\x43\xc1\x9c\x09\x39\x7a\xdc\xef\xf7\xcb\xdd\xd3\xf7\x59\xcf\xed\x72\x2b\x2f\xe6\x1c\x53\x09\x3e\x0b\x11\xa1\x1b\x11\x92\x73\xcd\x01\x85\xe6\x36\x9f\x23\x4f\x6c\x5f\x0f\x46\xba\xdf\x0c\x4b\xf3\x0f\x50\x62\xcc\x91\x02\x70\xec\x8f\xd4\xf3\xdf\xcc\x68\xbe\xc6\x12\xf9\x48\x22\xdb\x8a\x63\x11\x31\x2a\xb0\x48\xba\x01\x74\x86\xfd\x7e\x27\xfb\x09\xe0\x31\x2a\x31\x95\xee\x23\x00\x14\x45\x01\xf1\xf4\x07\xb6\x3f\x08\x46\xf3\x6f\x01\x84\x37\xc7\x21\x2a\x3e\x05\xf8\xff\x1c\x4f\x47\xd0\xf9\x61\x3b\x1b\xd6\x6d\xd3\x56\x6c\x17\x50\xec\x38\x9d\x73\x0c\xb1\xed\x20\xcc\xd3\x22\xe2\x30\x44\x7c\xa1\x44\x53\xc6\x9c\x0a\xad\x36\xd7\xc5\xb6\x45\xc6\x6d\x63\xce\x19\x17\xdb\xff\x43\xfc\xff\x5d\xca\xc4\x23\xd5\xf6\xe9\xe2\xd8\xbf\x8f\xec\xd3\xc8\xd5\x32\xed\x05\x96\xa0\x49\x55\xc6\x29\x25\xa0\x92\x67\x69\x33\x92\x34\x93\x68\xe6\x90\xd8\x35\x2d\x84\x7d\x10\x21\x8e\x42\x2c\xad\x5e\x26\x4d\xaa\x30\xcd\x5a\x6e\x13\xbf\x53\x37\x14\xed\x46\x41\xdc\xdb\x21\x78\x45\x84\xac\x1d\x06\xf5\x52\x59\xb6\x88\x09\x41\xd4\x54\x91\x63\x65\xe5\x70\x04\xc5\x2e\xca\x60\xe6\xba\xd5\x0c\x4f\x89\xbf\x42\x22\x19\x2f\xe7\xaf\x35\xd8\x67\xba\xf5\x7d\x64\x73\x0e\xc1\x5a\x56\xbf\xb9\xca\x50\xdd\x2b\xa0\x9a\x6b\x78\x41\xf1\x6d\x84\x3d\x89\x7d\x2b\xfa\xcc\xd3\x36\xd7\xbf\x17\x5a\xac\xfe\xf0\x2d\x0a\xa3\xc0\x65\x7e\xf2\xb7\xd7\xef\x1f\x99\x97\xe5\x77\xd5\x1f\x4a\x60\x6d\x67\x5d\x3b\x4d\xe2\x67\x84\x46\x09\x20\xc7\x82\xc5\xdc\xc3\x62\x0b\x44\xec\xcd\x95\x77\x75\x33\xc7\xca\xb5\x81\x10\xdd\x92\x30\x0e\xc1\x3a\x27\xe0\xa1\x08\x79\xca\x09\x98\x23\x01\x13\x8c\x29\x70\x8c\xbc\x79\xca\x52\x61\x9d\x04\x57\x6a\x9f\x62\xc4\x31\x1f\xc1\x9f\xff\x2e\x09\xae\x87\xa9\xe4\x28\x68\x69\xa5\x9f\x99\xd6\x8e\x9d\xce\x0d\xf7\xb9\xf2\xf5\xd2\x3e\xca\x11\x61\x34\x58\x00\x8a\xe5\x9c\x71\xf2\xc9\x78\x67\xda\x75\x03\x42\x0d\x0b\x50\x88\x81\xf1\x19\xa2\x44\x98\x4e\xc8\xf0\x86\xdd\x50\xcc\xf3\x6f\xd8\xd4\x74\x89\xb0\x47\xa6\x44\xf9\x45\x06\x9b\xde\x7d\x54\x24\x8b\xdb\x29\xfe\x18\xe3\xbc\xd1\x6a\x96\xba\x7c\xbf\x17\x58\x9e\x5a\xaa\xd6\x95\xc5\x3c\xc0\x82\x58\xb6\xf8\xee\x3b\x22\xe7\xcf\x11\x09\xb0\xff\x8c\x63\xcd\x23\x63\x1c\x3e\x0f\x3e\x0d\x90\x6b\xad\x8f\x85\x00\xdc\x80\x80\x29\x8b\xa9\xaf\xe7\xde\xc3\x6c\xe0\x77\xfb\x83\x7b\xe2\x2b\x34\x8f\xf7\x6e\x7f\xb0\x2e\x27\xb3\xae\xb5\xac\x3a\x88\xe5\x1c\x24\xbb\xc2\x5a\x19\x09\xbd\x46\x01\xf1\x5d\x26\xed\x7c\x27\x4c\xda\x59\x9f\x49\x3b\xcb\x98\x74\x21\x30\x07\xca\x64\xc1\x4e\x21\xcf\xc3\xc2\x1a\x6a\x63\x7b\x5d\xc6\xed\x7e\x27\x8c\xdb\x5d\x9f\x71\xbb\xcb\x18\x77\xc2\x4a\xba\x78\x43\xe4\xdc\xb1\xd0\xc7\x87\x80\x6f\x89\x90\xa2\xde\x5f\xb8\xaf\xac\xfb\xac\xd3\x7f\x89\x75\xcb\x1c\xa3\xa5\xb3\x38\x54\x39\x15\xa8\x34\x1e\x99\x55\xf4\x71\x80\x25\xae\x9c\xd8\xcd\xab\x25\x73\xfb\x7f\x52\x4c\xce\xd5\xf4\xac\xe6\x75\x33\x93\x3b\x5a\x33\x65\xdc\xac\xf7\x64\x3e\x00\xe2\x0e\xff\x06\x3f\xea\xce\xc8\x0f\x09\x25\x42\x72\x24\x15\xe5\xd3\x75\x27\x7c\x80\xa1\x01\x68\xfa\x2a\x74\xb6\x00\x51\xdf\x60\x47\xa6\x40\xa4\x5e\x0c\x09\x04\x53\xa1\x94\xbc\xc3\xa7\xaa\x23\x31\x42\x47\xf0\x31\xc6\x7c\xe1\x0c\x33\x45\x21\x1e\x01\x12\x0b\xea\xd5\x0d\xfe\x5b\xcc\xa7\x8c\x87\xfa\x8b\xc8\x33\xae\x12\x05\x44\x4d\xaf\x39\x67\x94\xc5\x02\x42\x44\xa9\x5e\xf9\x68\x12\x7a\xb9\x88\xf0\x08\x26\x8c\x05\x18\x51\xe7\x8d\x1a\x7f\xc2\xb1\x3f\x02\xc9\x63\xdc\xe8\x20\x0d\xeb\xdd\xf7\x43\x2d\x18\xb9\x09\xe3\xfb\x50\xde\xdd\x7e\x5f\xe3\x4e\x18\x5d\xdf\xfe\x15\x41\xd4\xaf\x9a\xa8\x59\xd5\xc8\x91\x89\x0f\xcb\x61\xce\x83\x3f\xf2\xe0\x8f\x3c\xf8\x23\xca\x1f\x31\x36\xe5\x0e\x5e\x49\x0e\xc0\xdf\xd6\x37\xb9\x1b\x1b\x8b\x00\xd6\xf7\x53\x12\x17\xc4\x80\x6b\x76\x41\x5a\xb9\x35\xe5\x99\xb6\xd5\x8a\x67\xdd\xba\x86\x01\x12\x31\x51\xbd\xa6\xe1\xa9\xc8\x33\x71\x7d\xaa\xdc\x9e\x23\xe4\xcd\xc1\x02\xd3\x4b\x2e\x08\x04\xa1\xb3\xa0\xd2\x8b\x50\xbe\x47\xe1\xbd\x72\x4a\x7a\xa0\x03\x5c\x6c\xf6\xa8\x6e\x52\x0e\xc9\x39\xd2\x0e\x8a\x6a\xa9\x03\x58\xa5\xdb\xaa\x83\x71\x62\x72\x90\x63\x39\xc7\x54\x2a\xb9\x4b\xfd\x2c\x9c\xb0\xf8\x2f\xe6\xa4\x68\x9a\x9e\x32\xdf\x91\x92\xca\xf8\xdf\xd9\xa0\xa8\x54\xd5\x66\x45\xad\x56\xd3\xf6\x4b\x3a\x6f\xd1\x22\x60\xc8\xcf\x2b\x6d\x9d\xca\x5e\x9c\x9d\xe2\x19\x29\xdb\x8a\x25\x6a\x9a\x74\xab\x59\xb5\x39\xba\x58\x0b\x6a\xd2\xad\x04\x75\x6d\xa7\xf1\x3b\x5b\x55\x7b\xcb\xc4\x97\x5f\x56\xcb\xfb\x3d\x9e\x87\xa3\xef\xd5\x93\x4e\x56\xe7\xee\xe0\x49\x17\x40\x3c\x78\xd2\x0f\x9e\x74\xc2\xa4\xcf\xec\x49\xa7\x60\x5f\xa3\xdb\x83\x20\x60\x37\xd8\x3f\xb6\x79\x0f\xa7\x66\x9f\xe4\x0e\xdf\x5b\x06\xb3\x12\x91\x73\xcc\x43\x71\xc2\x64\x62\x03\xee\xf0\xfd\x1a\x50\xcd\x91\xc4\x94\xf1\x09\xf1\x7d\x4c\x01\x13\xbd\xa3\x34\xc1\x1e\x8a\x05\xce\xbc\x0d\x22\x5a\x85\x1b\xc0\xf2\x7d\x93\x9d\x29\x1a\x87\x13\xac\xd7\x71\xb2\x0c\x13\xed\xda\x78\x88\xc2\x04\x5b\x1f\xcb\x3a\x38\x44\x98\x6f\x16\x77\xaf\x7a\xdf\x65\x30\xf3\x05\x17\x57\xcf\x33\xff\x0e\xfb\xe9\x06\x21\xf8\x0c\x0b\xba\x29\x4d\xe8\xe2\xf2\xec\xc9\x77\xc2\xb3\x27\x27\x28\xc4\xcf\x18\x9d\x06\xc4\x93\xeb\xf3\xaf\x0a\x4c\xbd\xb1\x54\xfc\xd0\x2d\x33\xb9\xf3\xb1\x34\x71\x8d\xdd\x89\xf4\xec\x14\x65\x96\x02\x89\x48\x59\xfe\x5d\x86\x87\x5f\x70\xe9\xfa\x80\x42\x5c\x17\x15\xc2\xcd\x9c\x04\x09\x2f\xe9\x4c\x33\xb6\x10\x0f\xb6\x8f\x04\x9d\xe8\x32\x8b\x9f\xaa\xa0\x39\x1b\xd6\x15\x4b\xe2\x49\x92\x47\xa1\xa7\xa8\x8a\xf6\xde\xd0\x60\x01\x3c\xdd\xa2\x67\x02\x27\xb1\x9f\x35\x69\x88\xe3\x7c\xb8\x56\xb5\x8a\x6c\x42\xb8\x36\x11\x5b\xcd\xfe\xba\x58\x85\x49\x6d\xb6\xbd\x0b\xda\xb0\x84\x25\xf0\xed\x5c\xfa\x62\x86\x0f\xac\xe0\xd6\xab\xbe\x9f\xc7\x9d\x77\x20\x75\xea\x5d\xf6\x1c\x53\x9f\x22\xbf\x20\xe1\x5f\x95\x8b\x2b\x5a\x88\x63\xe3\x2f\xfe\x1a\x63\xbe\xb8\x83\x5b\x5f\x01\xa6\x53\xef\xa8\xaf\xe0\xbf\xde\x5f\xce\x7d\x66\xaf\xfe\xef\xeb\xa8\xdf\x75\xc9\xfb\x21\xef\xac\xcd\xec\xbd\x56\x06\x69\x84\x66\xce\x50\x2d\x6d\x2e\xc8\xa7\x55\x9a\x33\xee\x63\xfe\x74\xb1\xca\x07\x30\xe2\xde\xbc\x62\x8d\x37\x60\xb1\x3f\x8e\x38\xbb\x26\x3e\xae\xc8\x6e\x6d\xcc\xf9\x14\x71\x14\x31\xae\x24\x44\x83\x81\x14\x4c\xdd\xd4\xac\x5a\xbd\x2d\x34\xfa\x32\x13\xb4\x41\x17\xfb\xad\x71\x85\xaf\x3a\x61\xbb\x8c\xc8\xcf\xd7\x0f\x26\xbf\x8d\xc9\x7f\xb0\x5c\xf7\xcd\x72\x35\x9a\x15\x9d\x19\xbb\xcd\xf5\x92\xf9\xda\x36\xc6\x76\x4f\xf3\x4c\x6a\x14\xba\x8d\xed\x31\x8b\xf7\xf7\xc4\x02\x25\x84\x7d\x33\x43\x64\xb8\xf1\x60\x86\x1e\xcc\x50\xfa\xf7\xed\xcd\x10\xf1\x57\x30\x42\x5f\xd6\xdb\x4a\x96\x64\xc7\x72\x11\xd5\xda\x3a\xe4\x79\x2c\xa6\x72\x45\xeb\x66\x2c\x41\xd2\x17\x6e\xe6\xc4\x9b\xc3\x04\x07\x8c\xce\x92\x3c\xff\x4d\x61\x17\x48\x3e\x69\x89\x68\x32\x6f\x07\x16\x4e\x1b\xbb\x06\x7f\x03\xc3\x96\xf0\xe3\xc1\xb4\x3d\x98\xb6\xf4\xef\xb3\x99\xb6\x1f\xd4\x7f\x70\x3e\xc7\x02\xeb\x35\xcd\x64\xd9\xb2\x3b\x45\x1e\xa1\x33\xe0\x38\xd0\xeb\x96\x69\x01\xb5\xed\xd3\x50\x3c\xb4\x1d\x62\xc9\x89\x27\xb6\x75\xb2\xc9\x98\x23\x3a\xc3\xcb\x0d\x8a\xed\x64\x92\xb3\x24\x09\xb1\xc0\x9c\x60\x01\xba\xbb\xc9\x5b\x81\xc9\x22\x5d\xa9\x4c\x33\x89\x8a\x36\xe4\xb5\x81\xf3\x74\x71\xaa\x3a\xfe\xea\xe4\xbb\x7c\x61\x0f\xe9\x97\xb3\x37\x27\x80\x38\x47\x0b\x65\x4e\xde\x72\x16\x62\x39\xc7\x71\x46\x19\x9b\x7c\xc0\x9e\x14\x30\xe5\x2c\x04\x36\x11\x98\x5f\x23\xc9\x38\x89\xc3\x6f\x21\x70\x96\x4f\x19\x97\x1e\xec\xcb\x83\x7d\x49\xff\xbe\x33\xd7\xc9\x8f\x8d\x0d\x58\xc9\x1f\x92\x4a\x01\x83\x15\xba\x4c\x49\xa0\xfe\x5f\x9f\x63\x58\x61\xfe\x56\x34\x7c\xc6\x4b\x93\xeb\xd8\x3b\x93\x89\x20\x1f\x2c\xde\x12\x8b\xe7\xf2\xe9\xc1\xe6\x3d\xd8\xbc\xf4\xef\x3b\xb3\x79\x2b\x5a\xa3\x29\xf6\x95\xe1\x68\xe1\x89\xa1\x20\x48\x35\x98\x50\x10\x1e\x47\x11\xd6\x67\xee\x4c\x19\x0f\x91\xd4\x7b\xd8\x08\x66\xe4\x1a\xd3\x25\xf6\x29\xf9\xa8\x55\xbd\xaf\x63\x96\x12\x94\x1c\x1a\x90\x6b\x9d\x24\xbe\x95\x96\x94\x65\x52\xa9\x9a\x6e\x47\x01\x22\xad\xe5\xd1\xa4\x38\x0b\xc9\x09\x9d\xb9\x86\xe5\x2f\xb3\x63\xfc\x9a\x08\x41\xe8\xec\x6d\x22\x88\x77\xd8\x35\xae\x01\xf5\x60\x90\x57\xdd\x39\xde\xad\x67\x52\xa6\x9f\x7a\x5b\x55\x97\xc8\x7f\x17\x3c\xfa\xac\x29\x75\x0f\x93\xd6\x97\x9d\xb4\x36\xb2\x57\xaa\xa7\xa5\xc5\x00\x79\xa3\x9d\xc0\x53\x3c\xc5\x1c\x53\x2f\x45\xd3\x18\x4a\xe3\x21\x26\x9f\xe7\x6a\xf2\x90\xc4\xa5\x93\xf8\x2e\x5d\x95\xd6\xf5\x8a\xd0\xe5\x8d\xe6\x8a\x88\xa6\x46\xca\x15\x1c\xa5\x73\x8f\xad\x7f\x70\xb8\xa0\xbe\xe2\xfc\x8c\xd0\x0c\x3b\x3f\x05\xf9\xe4\xfe\x94\x4c\xa6\x55\x44\xba\xf4\x46\xe2\x50\xac\x46\x78\x2b\xaa\x14\x16\xe5\x46\x2a\xb4\x99\x39\xc5\x38\x0a\xb9\xe5\xad\x34\xce\xcd\xcd\xb4\x6c\x26\x4d\x50\x10\xbc\x99\x2e\x93\x93\x44\xaa\x0b\x42\xe0\xba\x39\x15\xfc\xa8\xe3\x09\x68\x45\xf4\x4b\xa2\x5e\xc9\x1b\xd0\x03\x89\x2a\xd4\xb2\xb6\x79\xea\xbb\x8c\xf3\x62\x57\xd9\x29\x3d\x88\x6a\x2d\x86\xe4\x23\x8f\x95\xb9\xa0\x05\xaa\x1a\x45\x1d\x90\x15\xde\x54\x36\x6f\x6d\x87\x4e\x6d\x02\xac\x4b\x6c\x05\xbe\xc8\xf7\x89\x62\x1e\x0a\xde\x56\x60\x5d\xe2\x5f\x02\xf5\xd4\x28\x5b\x88\xd3\x7d\x87\xd6\x3a\x92\xa4\x2b\xba\x94\x35\xd1\xe4\x12\x92\x31\x3f\x20\x21\xb9\x0b\x8c\x7c\xca\xe0\x57\x52\x8f\xb2\x89\x32\xcd\xc3\x38\x90\x64\x8c\x3e\xb5\x90\x21\xf7\xa8\xb2\xec\x2f\x37\x33\x76\x7e\x43\x41\x8c\xc5\x08\xfe\x44\xb6\xd2\x60\x0b\x22\x8e\x23\xa4\x46\x71\xcb\xec\x91\x08\xc2\xa8\xfe\xc5\x31\xf2\x17\x5b\x30\xd5\x27\xf9\x6c\x81\x8f\xd3\xd7\x5b\xe6\x64\x09\x42\x67\xff\x86\xe2\xd4\x56\xab\x8c\xf9\xdd\xf7\x66\x34\x4f\xf4\xe9\x51\x53\xd0\x1b\x26\x10\x0b\x93\x35\xe6\xe3\x28\x60\x8b\x1e\x3c\x67\x3c\x99\x41\xe1\xe0\xdd\xd9\x8a\x18\xd8\x7d\xad\x0a\x93\x90\xc7\xc1\x7c\xdb\xee\xd6\xc0\xf1\x61\xeb\xcf\x24\x43\x56\xad\xce\xe5\x6a\x49\xb0\x5b\x52\x6d\x46\x2e\x3d\x3b\xd5\xc9\x3b\xb0\x95\xcf\x5e\x61\xa3\x2b\xc7\xa7\x11\xc4\xa2\x8b\x91\x90\xdd\x81\x0e\xf7\x56\x61\x9b\xae\x77\x6d\x6d\x73\x75\x05\x6a\xeb\x11\x31\xaa\x76\x71\x7c\x71\xfa\x6a\xd5\x4e\x87\x48\xa2\x95\xba\x99\x6a\x95\x31\x92\xc5\x2e\x26\x76\x1c\x81\x8f\x24\xee\x4a\x12\xe2\xb6\x20\xe3\xc8\xff\xdc\x20\x8d\xb6\x8d\x57\x9c\xe8\x92\x73\x67\xdb\xb6\xcf\x6d\x1e\xb7\xec\x85\xab\xdc\xd2\x75\x4b\x29\xcb\x69\xd9\x5f\x72\xd6\xad\x44\x5d\x3b\x64\xd0\x59\x96\xa6\xae\x5d\x32\xe8\x0c\xf2\x4f\xb5\x0b\x56\x7a\x6a\x5c\xae\xd2\x63\x35\x5b\x17\x99\x7c\xb7\x1a\xd4\x2f\xeb\x46\x14\x86\x20\xfb\x6b\x1e\x8c\xaa\x1a\x5e\xfb\xec\x2c\xc2\xde\xca\xbe\x80\x3d\x39\x71\xd5\x89\xdc\xf5\x3f\x0c\x12\x67\x9e\x2e\x66\x5f\x03\x09\x44\x51\xb0\xf8\x94\xb7\x7e\x2b\x7a\x76\x95\x74\xac\x4f\x4b\xf2\x27\x3c\x14\x10\x3a\xab\x1e\xeb\x12\x72\x4d\x08\x6a\x3a\x63\xc9\xce\xaa\x21\x42\x93\x1d\x31\x04\xea\xa0\xb9\x02\x6a\x5d\x64\x92\xfd\x25\x66\x92\x50\xb9\x33\xac\x78\x1f\x12\x4a\xc2\x38\x1c\xc1\xa0\xf4\x32\x24\xf4\xf4\x1b\x7d\x19\xdd\x7e\xe5\x2f\xfb\x93\xfb\x23\x80\x85\x13\xa7\xbf\x92\x7b\xdc\x64\xc1\x0f\xde\x1e\x5b\xa4\x0a\x66\x57\xbd\xbc\x2e\xd8\xe2\xb9\x41\x2b\xb7\xc2\x9e\x6f\xe1\xb1\x20\xc0\xfa\x5c\x8c\x12\xc7\xba\x06\x66\xb2\x20\x5f\xae\x0a\xae\x82\xbe\x5d\xdf\x3c\x3f\x05\x15\xe7\x9e\xfa\x88\xb9\x16\xc1\xaf\x65\xea\x2b\x07\x30\x77\xc4\x70\x02\x33\x7f\xf6\xbb\xee\x9e\xd6\xcc\x25\xe5\xc7\xf6\xb8\xdc\x64\x87\x00\x26\xcc\x4f\xd0\x2f\x8d\x7b\xfe\xf8\x17\xf3\x17\xa2\xdb\x71\x72\x7a\xee\xd8\x96\x1d\xe7\x8e\xba\x68\x69\xed\xab\x60\x97\x4a\x77\xf5\x09\xfd\x59\xd9\x2e\x8a\x88\xc5\x7f\xb9\x86\xd6\xc6\x78\x15\xf8\xb7\x90\x83\x4a\xb2\x9b\x62\x88\x63\xea\xeb\xaa\xc5\xf5\xcf\x20\xce\x13\xe8\x86\x32\x95\x67\xa8\xb4\x11\x82\xf4\x34\x21\xe6\x2f\x40\x60\x2a\x55\xa4\x97\xea\x0c\xbc\x7d\x73\x76\xbe\x51\xc7\xbe\xae\x8e\x36\x56\x1c\xe4\xda\x30\xb4\x34\xd4\x85\xc4\xc1\x1b\x7d\x21\x85\x5b\xf9\x9a\x6a\x46\x1a\x96\x25\x25\xf1\x84\x96\xc4\xa1\x30\x7d\x36\x05\xa3\x35\x98\xa0\x34\x16\x4d\x4f\x18\x0a\x08\xbd\x32\xc1\xb1\xc2\x4b\x49\x66\xe2\xda\x2f\xfb\x7e\x55\x94\x9a\x1f\x27\x2c\x4d\xbd\xb4\x02\xce\x63\x7d\x17\x88\xc7\xe8\x94\xcc\xe2\x5a\x36\x48\xa6\x98\xa0\x41\x1f\xfc\x51\xc2\xa0\x18\xfa\x16\x43\xc5\x7c\xc0\xab\xe8\xa6\x76\x1d\xa0\xf2\x6b\x3d\x38\x96\x10\xc6\x42\x2a\xb4\x84\x4d\xfb\x0c\xd8\x0d\xe6\x5d\x0f\x09\x0c\x28\x88\xe6\x88\xc6\x21\xe6\x2a\x36\x9e\x23\x8e\x3c\x89\xb9\x00\xc6\x61\xb3\xbb\xb9\xa5\xd4\x96\xdb\xc3\xc3\x10\x35\xad\x27\x58\xba\x6d\xcd\xa1\x93\x98\xfa\xf9\x56\x25\x98\xa6\x9d\x87\xa8\xde\x93\x99\x60\x08\x18\x9d\x61\x25\xdf\x88\xc2\xce\xd0\xf9\x78\xaf\xb3\x6c\x5c\xca\x6b\x01\x15\xa7\x07\xa8\x26\x8d\xf2\xe8\xd9\x9b\x45\xd6\x90\x4b\x03\xab\xad\xd7\xed\x38\xf8\x19\x69\xc2\x38\xdc\x6d\x61\x38\xfe\xb9\x8d\x1a\x8a\x95\x48\xdf\x2c\x38\xac\x2f\x89\x82\x6f\x15\x1b\xba\x28\x7d\x37\xa1\xa1\x8b\xb4\x33\xc6\x59\x91\xc7\x37\x1d\xe1\xaa\x5a\x13\xf8\x96\xe3\x5b\x7b\x3a\xd8\xfd\x1d\x5d\x83\x72\x85\xfe\x56\x3a\x01\x76\x75\x35\x5d\xab\xec\x34\xcc\xd8\xc5\x9d\xb3\x3c\xa0\xcc\xa9\x51\x96\x50\x91\x9c\x1e\xf4\x61\x04\xa1\x07\xef\xac\x11\xdc\xcc\xe1\xb5\xa9\x27\xcf\xe5\x06\xb9\x61\x6a\xee\x5c\x50\xf2\x31\xc6\x40\x7c\x4c\x25\x99\x12\x9c\x1d\x7a\x6c\x3e\xbd\x14\xb8\x4f\x44\x14\xa0\xc5\xb8\x79\x2a\x3c\x71\xa6\xc1\x82\x53\xa2\xdc\x28\x0b\x04\xa2\x98\x47\x4c\xe0\x16\x93\x4c\xf3\xe7\x5e\xc6\x21\xa2\x30\xe5\x04\x53\x3f\x58\x54\x50\x97\xc7\x61\x4b\x23\x91\x2c\xc8\x5f\xa2\x1b\x71\xb9\x1c\x03\x4c\xd1\x24\xc0\x0d\xac\x7d\x67\x5d\xd4\x0a\x9a\x89\x48\xba\x1b\xf2\xf5\xb6\x00\xa1\x33\x35\x41\xbf\x39\x3b\x4c\x26\xbf\x0a\x24\xf2\x1e\x48\x95\x43\x69\x01\x17\x4d\x54\xb5\x10\x1f\x66\xbf\x14\x6b\x50\x32\x33\xeb\x7f\x7b\xdf\x4c\xc2\x0d\xca\x9b\xdf\x9d\x68\x5b\xee\x55\x89\x74\x41\xc6\x4e\x7a\xf0\x1b\xe1\x33\x42\x09\xfa\xdc\xb2\x66\x91\xf8\x5c\x32\x66\x3e\x36\x45\x71\x20\x47\x30\x45\x81\xc8\x1c\xf3\xb4\x42\x69\x9c\x5b\x8e\xaf\x0f\x3f\xb5\x4b\x5c\xf6\xf5\x92\xde\xfa\xfb\xc2\x29\x7c\x4a\xce\xe5\x32\x24\x55\xa0\x5a\x9c\x1a\x2a\xa6\x85\x0a\x86\x2e\x53\x1b\xf3\xa4\x8e\x3a\xdd\xe4\x87\x5c\x4d\x4a\x92\xd8\x97\xd4\xa6\xfc\xa0\xdb\x54\x16\x34\xd4\xba\x09\x6b\x4c\xfd\x4b\x2a\x26\x20\x59\x42\x1a\xd0\x49\x74\xf6\xa8\xff\xd2\x8f\xdf\xe2\xdd\xa0\x2f\xd9\xe3\x0f\x67\xb3\xe1\xb3\x57\x9f\xa6\x71\x79\xae\x6f\xb5\xca\x96\x4e\xf6\x25\x14\x56\x98\xf2\x8b\x46\xa3\x66\xb4\x52\x42\x5a\x37\xfd\x96\xae\x44\xc6\x09\x9b\xaa\x90\xfe\x5e\x71\xe5\xde\xc8\x54\x8b\x65\xd3\xe6\x2c\x87\x5a\x4e\x5d\x9b\x8d\xf4\x75\x54\xaa\x89\x7e\x03\xd6\xd0\x9e\xff\x44\x4b\xba\x75\xa5\x95\x44\x61\x54\x46\xad\xbc\x24\xed\x2c\x45\xef\xef\xe6\x49\x2b\x77\x37\xa7\x01\x56\xf4\xf6\x59\x3c\x09\x70\x83\x71\xd0\x00\x5d\x9d\x2e\xa6\xec\x7f\x01\xad\xae\xaf\x0a\x80\xaf\xa7\xd7\x2e\x12\x7f\x77\xcd\x76\x79\xd1\x71\x85\xe1\xb9\xc9\x29\x27\x8c\x9e\x62\xa1\xa6\xc9\x8d\x1a\x32\x5c\x08\xf7\xcc\x1a\xdc\x6f\xad\x2b\x95\x1d\xaf\xc8\x3d\xcf\xed\xbf\x96\xc9\xab\x94\x99\x16\x41\xa5\xfd\x68\xa7\x44\xc6\x1d\x28\x38\x5e\x9e\x86\xe9\xb9\x71\x62\x43\xfb\x8d\x72\x8a\x6d\xa6\x8e\xe6\x28\x76\x52\x73\x9f\x1e\x86\xe3\x43\x73\x41\xa0\xc7\x78\x7a\xe8\x7e\x21\xbf\xb8\x02\x39\x42\x47\x10\x21\x39\x2f\x0e\x7c\xb6\xdd\x91\xd4\xce\xe5\xf1\x48\x9e\x3a\x60\xdc\xb3\xe3\x4b\xd8\x05\x98\xce\xe4\x5c\x7b\xe6\x24\xc4\x40\x28\x84\x84\xc6\x2a\x08\x51\xee\xb0\x39\x12\x40\x32\x7b\xa4\xa2\x39\x35\x36\x57\x13\x52\x79\xe4\x78\x35\x7d\x45\x0d\xa9\xd6\x8f\xd4\x89\xde\xcb\xb4\xba\xbc\x53\x6a\x37\x34\x46\xb0\xbb\x33\xec\xdb\xa7\xe5\x64\xeb\x22\x8b\x20\xd5\x3f\x0b\x3d\x29\x26\x2c\x8c\xa5\x7d\xda\x96\x87\x49\x7b\x5d\x75\x83\x3d\x46\x7d\x01\x13\x2c\x6f\xf4\x29\xa5\x48\x22\x48\x2b\xb0\xbf\x2c\xc7\x76\xfa\xad\x58\x36\xe8\x3f\xee\xd7\xf3\xac\xc8\x12\x87\x67\x16\xbe\x2d\x60\xca\xf3\xcc\x3e\x6c\xc3\xb2\xe4\x9e\xd7\x24\x1c\x90\x0c\xa6\x58\x7a\xf3\x1e\x3c\x57\xff\xcb\xd5\x31\xdd\xcc\x31\x05\x1c\x46\x72\xd1\x33\xfd\x54\x54\x44\xb0\xd0\x35\xef\x49\x88\xa4\x51\xa6\x69\xe5\x90\xc6\x48\xf4\x1a\x39\x9b\xb7\x65\x25\x4b\x56\x1d\xe8\x26\x7c\x4e\x2f\xba\xc8\x92\xb8\x0d\x13\x9c\xe4\xf2\x46\x0e\xbc\x35\xb7\x79\xfb\xf8\xb6\x24\x13\x6e\xe8\xd8\xc2\x4c\x94\xc7\xaf\x98\x5a\x6e\xc7\x2e\x59\xaf\x74\x73\xca\x0d\xd2\x4e\x0a\x7c\x23\xd2\x27\xd9\x29\xd1\x8a\x5d\x4a\xd8\x31\xf2\xe6\x2e\xd1\x9f\x91\x8c\x62\xee\x7b\x4a\x46\xbf\x6f\x08\xb1\xa7\xd0\x55\x2e\xd8\xfc\xa7\x9b\xf6\x3c\xb3\xd7\xc5\xd8\x4b\x49\x55\x27\x15\x2f\x7b\x9c\x48\xcc\x09\xea\x69\x05\x16\x0b\x2a\xd1\x6d\xba\xda\x92\xda\x7a\x20\xc2\x41\x28\x24\x01\xe2\xc9\x16\x9c\xdb\x05\xc3\x65\x02\xf8\x12\xbc\x40\x9f\xaf\xcd\xa6\x80\x28\x9c\xfd\xfa\x4a\xef\x1a\x63\x73\x5b\x7e\x02\x4b\xdf\x49\x62\x4a\x85\xed\x11\xdb\xba\xbf\x09\xe5\x11\x5d\x24\x60\xa7\x2c\x08\xd8\x8d\x0a\x9d\x2f\xbd\xdc\xbe\xab\xb8\x84\x29\xc1\x81\x2f\x46\x1b\x29\xd0\x9f\x72\x59\x96\xe5\xc7\x36\x8f\xd2\x7d\x91\xdb\x22\xcd\xbd\xd0\x8b\x1e\x63\xa7\x2c\xeb\x27\x27\xaf\xd2\x79\x38\xe7\x78\xea\xfc\xcc\x75\xc8\xad\x07\x38\xcf\x4b\xa9\xce\x3f\xb9\xdb\xbb\xea\xa7\x7b\x26\x6f\x1e\x09\x9d\xa3\xea\xfc\x36\x4b\x1e\xce\x83\xc2\x1e\xfd\x4f\x4e\xee\xa6\xf3\xd0\xe6\x51\x66\xcc\x73\x52\x68\xb7\x9c\xf9\x4e\x99\xa2\xcc\xca\xa4\xb7\xef\x67\x83\x25\xe7\x98\x70\x8d\xfe\x16\x24\xc7\xaa\x67\xa3\x66\x84\xc4\x19\xa3\xcb\xcb\x4b\xf1\x31\x2b\x30\xd1\xdb\x9e\x48\x78\xee\xfb\xac\xf1\xf9\x3a\x68\xc0\x18\x51\x7f\x9c\xee\x03\x2a\xda\xef\x82\xd9\x96\x33\xec\xf5\x98\x1e\x1b\x71\x75\xf5\x86\x6e\xca\x64\x4d\xd4\xdf\x02\xc6\x81\x98\x36\x5a\x8f\xf5\xaa\x9b\x32\xea\x5b\xea\x59\x36\x7c\x66\x5d\x4e\x05\x07\xc6\xc0\x3b\x14\x2a\x84\x7a\xa9\xb5\x88\x02\xe6\xe3\xdc\x04\x5a\xb6\x20\x05\x03\x01\x8e\x11\x49\xa8\xeb\xd4\xd8\x3d\x63\x18\x2d\x80\xbb\xda\x36\x21\x17\x81\x9a\x20\x19\x37\xd5\xf3\xe6\x30\xcc\x6a\xbb\x95\x99\x2d\xdd\x28\x33\x53\x8e\x54\x34\xdb\xab\x25\x76\x4a\xef\x25\xe7\x8d\x54\xf6\xcd\x9c\xb1\x02\x7b\x51\x82\x35\x34\xe9\x7d\xcf\x06\x31\x35\x3a\x97\x79\xfb\x71\xb9\x05\x97\x8a\x71\xea\xff\x5a\x4d\xd5\x3f\x8c\x7e\x5e\x9a\x8d\xf3\x4b\xa3\x9c\x97\x19\x6c\x15\x0f\x20\x7d\x8b\xa4\x19\xf0\xcb\xff\xfa\x6f\xd5\xeb\xe7\x4b\x2d\x32\x97\xaf\x8e\xff\x75\x74\x99\x99\xcd\xa4\xd7\x07\x46\xa8\x6d\x7f\x70\x72\x78\x69\x60\xbf\x39\xbd\xec\xc1\x4b\x76\x83\xaf\x31\xdf\x82\x05\x8b\xb5\x69\x55\x54\xa2\x34\xfd\x85\x4d\x61\xd0\xb7\xdd\x75\x75\xb1\xa5\x46\x8f\xbd\xc3\xe3\xa3\x54\x98\xaa\x94\xb1\xa4\x8a\xf6\xec\x9b\x24\x8f\xe1\x32\x5c\x74\xad\xcd\x35\xb8\x39\xcb\xcd\x7a\xd7\xa4\xad\x42\xe6\xb5\xf1\x67\xc8\xe0\x9a\x3c\x84\x1c\xfb\xe1\x67\x40\x37\xc2\xed\xfe\x67\xd4\xfd\xf7\x2a\x04\x20\xf3\x1d\x9d\x72\xa2\x73\x26\xec\xd9\x16\x97\xe1\x62\x4d\x94\x03\x72\x85\x21\x5c\xfc\x63\xb8\xf7\x45\xec\x86\xb6\x8b\x6e\x5e\x44\x6a\x1b\x1d\x8b\x82\x64\x76\xa4\xfb\x1c\x09\x88\x30\x0f\x89\x50\xd6\x5f\xa9\x88\xc0\xe6\xf8\x24\x6e\x8b\xd0\x1d\x21\x38\x61\x12\xf7\x12\x14\xcd\x64\x9d\x95\x2b\x2b\x81\xb6\x45\xa7\x7a\xe1\x3d\xe9\x5d\x6f\xa0\xac\xb3\xa5\x05\xae\xc6\xec\x54\x9b\x98\x0a\xdf\x28\x67\x41\xa0\x68\xd8\x5a\x09\x4a\x67\x7d\x03\x56\x59\x54\x90\x44\x4e\xe5\x29\xbf\x14\x2e\x95\xa4\x4f\x6f\x75\xa9\x28\x40\xc7\x10\xb9\x59\x60\xb2\xa8\xe1\x55\x0b\xbc\xdb\xb2\x13\x5f\xa3\x60\x5c\x5b\x29\x91\xb0\x16\xe7\xce\x9c\x51\x8d\x7d\xc4\xfd\xe5\xfd\x92\x96\xaa\x6f\x72\x80\x82\x4e\x8d\x4b\x50\xb0\x27\x28\xb8\x74\xe1\x11\x4c\xf4\x53\xfb\xd0\xfc\x78\x6e\xa3\xbf\x5f\xde\x25\x99\x72\x86\xe8\xb9\x94\xd1\x46\x91\xb0\xc2\xcd\x63\x09\xf8\xc2\xea\x93\x4d\x42\x82\x4e\x5a\x35\x94\x91\x58\x48\xa0\x83\x8e\x23\x35\xc9\x78\x77\x6c\x42\x21\x8a\x88\x4c\x6b\x01\x0a\xd7\x93\x2d\xfb\x34\x8e\xbb\x37\xf8\x33\x7d\xba\xb2\xa0\xa2\x06\x01\xbd\x36\x8c\x76\xd0\x13\x6f\x6f\xf2\xa4\xdb\x1f\x3e\xde\xe9\xee\x4e\xa7\x8f\xbb\x4f\x26\x4f\x70\xd7\x47\xc3\x61\xff\x89\x8f\x06\x8f\xbc\x9d\xec\xcb\x76\xe9\xd9\xea\x56\xf6\xbc\x31\x1d\x78\xbb\xd5\x37\xe0\x07\x88\x38\x9a\x85\x68\xa4\xac\x1a\xbb\xd1\xc7\x1b\x0a\xec\x71\x2c\x5d\xa1\x93\xb1\x18\x41\x47\x57\xec\xb5\x65\x57\x9a\x00\xe8\x5a\xa3\xe6\xa1\x37\x95\x60\xd0\x41\x11\x19\x5b\x32\xc6\x96\xdd\x0d\xc3\xe0\x20\xe4\x96\x7b\x41\x47\x09\xa8\x18\x6d\x1b\xd6\x74\xdb\xb0\xa3\x67\x85\xb9\xa7\xbb\xf4\x3c\x16\x96\x80\x27\x65\x61\x45\xf0\x3e\x92\xe8\xee\xdf\xc8\x6a\xc8\xf4\x65\x79\xfd\xee\xa0\xdf\xed\xef\x9d\x0f\x86\xa3\xbd\xc1\x68\xb8\xdb\xeb\xef\xed\x0c\x76\x87\x7f\x64\x3d\x9c\x12\xb1\x52\x8f\xfd\xd1\xce\x7e\x6f\x67\x7f\x38\xec\x3f\x76\x7a\x24\xb5\x5c\xd0\x19\xf6\xf6\x7b\xfd\xec\x45\xde\xa4\xa4\xa6\xa6\x42\xc0\x9f\xeb\x22\xb2\xe4\x6e\x36\x93\x90\xfd\x97\x15\x7a\x53\x31\xf7\x20\xf5\xdf\xb7\xd4\xe7\xeb\x1e\xa1\x83\x6c\xad\x7f\xd5\x4d\x43\xd9\x95\x4e\xc5\xb1\x6f\xaf\x22\x15\x77\xca\x14\x54\xa2\x45\x7d\x60\x39\x13\xb0\x9c\x31\x58\x91\x17\x58\x5a\x56\xec\xae\xa3\x7f\x4d\x3a\xf8\x15\xf5\x10\x1a\x26\xa0\xe5\xea\xd8\xa0\x92\xb0\x44\x2d\xc1\x55\xcd\x20\xa7\x8c\xd0\xac\x90\xf0\xa5\x95\x12\xbe\x92\x62\xc2\x5a\xca\x09\x6b\x29\x28\x34\x4d\x4d\xb0\x4c\xf7\x2a\x92\x96\x97\xa8\x5d\x39\x63\x18\xd2\x79\xaa\xc2\xeb\xcb\x3d\xcb\xa5\x9e\x41\xe7\x20\x44\x9f\x18\x85\x77\x78\x92\xd4\x28\x39\x6d\x93\xe4\xb0\x4c\xf8\xca\x19\xb8\x2d\x50\x75\xd3\x5f\x53\x44\x2b\xa4\xb6\x80\xda\xc5\x19\x1c\x21\x21\xb7\xc0\xc9\x68\x6b\xc2\x0d\x9a\xf2\xc6\xe0\xcf\x2c\xaa\xd8\xb2\x91\x89\xd9\x92\xa8\xcb\x33\xaa\x21\xac\xbc\x5d\x3e\xd6\x08\x8f\xc7\x23\x70\x67\x40\xcc\xc7\x13\xce\xae\x30\x97\x2c\x22\x9e\xdd\x9b\x19\x4f\x16\x12\x8b\x31\xa1\xe3\xfc\xa9\x39\xa9\x4a\x8c\xcd\xb1\x2c\x8c\x8f\x09\x1b\xdb\x25\xe5\x14\x6e\xb7\x78\x1f\x90\xb2\xa0\x11\xf1\x46\x30\x1e\x7b\x8c\x8a\x38\xc4\x7c\xcc\xa6\x53\x81\x9d\x5b\xcd\xca\xc9\x38\x5d\x67\x4b\x1e\x06\xfb\x83\xc1\xfe\xa3\xfe\x70\xa7\xdf\xef\xf7\xf3\x02\x6d\x82\xb1\xc7\xbb\x83\xbd\xdd\x65\xbd\xf7\x6b\x7b\xef\x3d\x7e\xfc\x78\x59\xef\x27\xb5\xbd\x1f\xed\x0f\x87\xee\x20\x55\x24\x8d\xfc\x45\x86\x69\xe9\x90\x94\x86\xa3\x36\x73\xa1\xc0\x89\xda\x0c\x85\x6e\x71\xeb\x1f\x3a\xf9\x07\x15\x93\x95\xb3\xf1\x6f\x5b\x67\x4f\x4c\xf3\x5d\x7b\xcb\xfe\x52\x0b\x61\xf2\x8c\xfa\x65\xaf\xb9\x70\x2a\x58\xe5\x5c\x6d\x2e\x4a\xde\xce\x75\xd7\xa7\x25\x41\x47\x17\x21\x76\x5f\xbf\x78\x7d\xde\xcd\xbd\x4e\xdd\xa7\x33\xe7\x2a\xf7\xe4\x92\x77\x73\x19\x6c\x6a\x3d\xcc\xd2\x9d\xbe\xf4\xfd\x67\x5d\xdf\x95\x2e\xb7\x39\xae\xaf\x7b\x80\x12\x74\x06\xe4\xdd\x31\x09\x3f\xbe\xf0\xf8\x61\xfc\x6a\x7f\x80\x2e\x6e\x8f\xff\xf8\xf8\xf4\xfc\xe3\xc9\x29\x4a\x19\x53\x73\xa9\xf4\x03\x63\x1a\xae\xe6\xab\x62\xce\xf0\x4e\xbc\x19\x36\xb2\x66\x58\xc5\x19\x13\x34\x82\x64\x8a\x5e\x81\x73\x6b\xe0\x23\xb8\xd0\x53\x91\x7a\xab\x9d\xc0\xe2\x05\x93\xe6\x0c\xd1\x72\x80\x34\x82\xdc\x67\x47\xb0\xec\x2b\xce\xb5\x0d\x2c\x88\x43\x6a\x16\x8c\x15\x74\xbb\xba\x09\x9b\xc4\xdf\xec\xc1\x59\x55\x3b\xbd\xf8\x3f\xb2\x5e\xe3\x96\xdd\x7e\xcb\x3b\xa0\xc9\x53\xe3\xb2\xf6\xe0\x57\xb3\x80\x6b\xc6\x66\x04\xc4\x87\x9f\x61\xe0\xf2\xa7\x38\xd2\xc1\xbb\xc3\x17\xf1\x62\x72\xcc\x8f\xe8\x2d\x3f\xc0\xe1\xa3\xe1\xee\xec\xe3\xd5\x15\x39\xbc\x4e\x47\x7a\xc9\x91\x9a\x95\xa3\x3d\xb8\xd3\x68\x0f\x1a\x47\x7b\x50\x31\xda\xa1\xc1\x51\xe7\x12\x65\x02\x9e\xda\x77\x70\x8f\xae\x5d\x9d\x05\xc5\xc3\x1e\xab\x48\x7e\x74\x17\x8a\x1f\x35\x11\xfc\xa8\x82\xde\x36\xb7\x2e\xa7\xd8\x6b\xe3\x8e\xef\x1d\x0d\x69\x28\x6a\x91\x37\x27\x8c\xfb\x3f\x6f\x0e\xc8\xbf\x76\xfc\xf8\xb7\xf7\xc7\xd7\xd7\x7b\xef\xaf\x5f\x05\x8b\x4f\x83\xf0\xc5\xe9\xce\x2f\x8b\x8f\x27\x9b\xd9\x31\xa1\x0d\xd6\xeb\xfd\x9b\x47\xb3\xe1\x6c\xff\xe5\xb9\x7f\xf1\xaf\x0b\x34\xbc\x12\x2f\x1f\x0f\xaf\x7e\x3d\xdc\x59\x24\x2c\x29\x9e\x70\x5a\x69\xce\xef\x24\xc3\x83\x46\x19\x1e\x54\xc9\x70\x66\x93\xae\x31\x27\xd3\x05\xfc\xf2\xee\xdc\x1c\x20\x3b\x02\x7b\x70\x85\x9f\x5e\x3c\x69\x16\x0c\xcc\xf1\xb2\xad\x58\xb2\x73\x31\x3f\x9a\xdf\x84\xbf\x3f\x8d\xde\xbd\x9d\x1e\x0f\x83\x13\x7c\x15\xf9\xbb\x7f\x1c\x26\x2c\x29\x5e\x9b\x59\xc5\x92\xdd\xbb\x70\x64\xb7\x89\x21\xbb\x55\xfc\x10\x98\xc3\xe6\x94\xb1\xee\x04\xf1\xcd\xb6\xb7\xbf\xf7\x1a\x14\xfd\xfd\xce\x05\x39\x9a\x7f\xa2\x0e\x13\x3e\x44\xfe\xee\xfb\x67\x29\x13\xda\xde\xc6\x5f\xc5\x9d\xbd\xbb\x70\x67\xaf\x89\x3b\x7b\xcb\xb9\x33\x47\x22\x39\xdc\xc0\xd9\x09\xce\xae\xbc\xdf\x37\x4b\x1e\xba\x66\xda\xee\x1e\x2e\xe5\xd4\xd5\xad\xe2\xd4\x6f\x6f\xf1\xf1\x90\x9d\xe0\x0f\xfe\xce\xef\x4f\x53\x46\xd5\x5c\xf1\xdf\xa8\x50\xc3\x3b\x29\xd4\xb0\x51\xa1\x86\x15\x2c\x4a\x95\x46\x2a\x64\x61\x8e\xae\xb1\xad\x68\xc7\x14\x92\x13\x03\x6b\x99\x70\xf5\xfb\xb3\x4f\xef\x34\xed\x09\x13\x5e\x5d\x3f\x7f\xf2\xe1\xf5\xaf\xef\x13\x26\x34\x5d\x11\x5f\xc5\x80\x9d\xfd\xbb\x30\xc0\xed\x5d\x66\x80\xfb\x36\x67\x61\x51\x60\x7c\x0e\x22\x00\x05\x7a\x41\x4b\x1f\x40\x58\x4b\xf6\xfe\xd5\xfb\xbe\x1a\xfb\x4f\x19\xfd\xef\xf1\xdc\xdf\x39\xb2\x96\xa2\x7c\xa2\x6f\x15\xa9\x4f\xee\x42\xe9\x93\x26\x42\x9f\x54\x5a\x4e\x7b\x68\x60\x72\x44\x72\x83\x21\xc4\x47\xc9\x30\xee\xbf\x9f\xcd\xa7\xaf\x9f\xcc\x5e\x9c\x8a\x97\xd7\x47\xef\x52\xf2\x5a\x4f\x97\x5f\x93\x48\x27\xae\xeb\x98\x0d\xf9\xe4\xcc\x4a\x50\x9e\xbd\xc0\x72\x04\x6f\x9e\xbd\xee\x1e\xfd\xde\x7d\x32\xb2\x0b\xc9\xe6\x90\x49\x45\x4c\xd6\x06\xdf\xca\x6e\xb6\x88\xd8\x1d\x90\xdb\xfe\x4e\x40\xfd\x20\xfc\xd8\xff\x38\xf5\x1e\x09\x22\xd1\x9e\x08\x3e\x5c\x3f\x76\x63\x61\xe5\xaf\x26\x47\x30\x28\xca\x07\xb3\x3d\xff\xf1\xe3\x8f\xfd\x80\x7b\xfe\xf5\xee\xec\x11\x0a\x26\x8f\x44\x30\x9d\xd1\x0f\x3b\xfe\x7c\x22\x3e\xfc\xe3\xff\xfd\xf3\xe8\xf7\xf3\xd3\x03\xf8\xc9\x10\xdb\xd3\x7c\xf9\x39\x2b\xbe\x74\x60\x13\x01\x9b\xbb\xfd\xdd\xcd\x2d\xcd\x06\xfd\xf3\xd9\xab\x8b\xb3\xf3\xa3\xd3\x64\x6a\xe8\xef\x6e\xea\xfd\xfd\x74\x28\xdd\x2a\x4e\xd5\x7e\x30\xdb\x63\x7c\xaf\x7f\x4d\xe2\xfe\x23\x86\xd5\x40\xcd\xf9\x95\x37\xdc\xf7\x67\x53\xf9\x61\x80\xbc\x4d\x97\x7b\xcf\x2c\x1d\x9b\xcb\x88\x70\x5c\x8d\x1f\x9b\x26\xd6\x73\xf1\x8e\x2f\xf6\xa9\xf8\x38\x19\x8a\x93\xf0\xf9\x87\xbd\xc9\xef\xd1\xe1\xa3\x67\xa8\xb3\xf1\x7f\x01\x00\x00\xff\xff\xfc\xba\xe1\x59\x97\xa8\x00\x00") +var _fleetManagerYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x7b\x53\x1b\xb9\xb2\xf8\xff\x7c\x8a\xfe\x39\xbf\x53\x9c\xdd\xc2\xc6\x36\x6f\xd7\xcd\xad\x22\x81\x24\xec\x49\x08\xcb\x63\xb3\xd9\xad\x53\x46\x9e\x91\x6d\x85\x19\x69\x90\x34\x06\xe7\x9e\xfb\xdd\x6f\x49\x9a\x87\xe6\xe9\x31\x84\x04\x76\xa1\x6a\x6b\xe3\x19\xa9\xa7\xdf\x6a\x49\xad\x16\x0b\x30\x45\x01\x19\xc0\x46\xa7\xdb\xe9\xc2\x0b\xa0\x18\xbb\x20\xa7\x44\x00\x12\x30\x26\x5c\x48\xf0\x08\xc5\x20\x19\x20\xcf\x63\x37\x20\x98\x8f\xe1\xe8\xe0\x50\xa8\x47\x57\x94\xdd\x98\xd6\xaa\x03\x85\x08\x1c\xb8\xcc\x09\x7d\x4c\x65\x67\xe5\x05\xec\x7b\x1e\x60\xea\x06\x8c\x50\x29\xc0\xc5\x63\x42\xb1\x0b\x53\xcc\x31\xdc\x10\xcf\x83\x11\x06\x97\x08\x87\xcd\x30\x47\x23\x0f\xc3\x68\xae\xbe\x04\xa1\xc0\x5c\x74\xe0\x68\x0c\x52\xb7\x55\x1f\x88\xb0\x63\x70\x85\x71\x60\x30\x49\x21\xb7\x02\x4e\x66\x48\xe2\xd6\x1a\x20\x57\xd1\x80\x7d\xd5\x54\x4e\x31\xb4\x7c\x44\xd1\x04\xbb\x6d\x81\xf9\x8c\x38\x58\xb4\x51\x40\xda\x51\xfb\xce\x1c\xf9\x5e\x0b\xc6\xc4\xc3\x2b\x84\x8e\xd9\x60\x05\x40\x12\xe9\xe1\x01\x9c\x62\x17\xde\x21\x09\xfb\xee\x0c\x51\x07\xbb\xf0\xda\x0b\x85\xc4\x1c\xce\xb0\x13\x72\x22\xe7\x70\x66\x00\xc2\x1b\x0f\x63\x09\x1f\xf4\x67\xf8\x0a\xc0\x0c\x73\x41\x18\x1d\x40\xaf\xd3\xef\x74\x57\x00\x5c\x2c\x1c\x4e\x02\xa9\x1f\x2e\x86\xfb\xcf\xd3\x77\xfb\xaf\xcf\x7e\x2a\x87\x6f\x78\x71\x8a\x85\x84\xfd\x93\x23\x45\xa4\xa1\x0f\x08\x15\x52\x01\x14\xc0\xc6\xb0\xff\xfa\x0c\x1c\xe6\x07\x8c\x62\x2a\x45\x67\x45\xd1\x8e\xb9\x50\xe4\xb5\x21\xe4\xde\x00\xa6\x52\x06\x62\xb0\xbe\x8e\x02\xd2\x51\x92\x13\x53\x32\x96\x1d\x87\xf9\x2b\x00\x39\x8c\x3f\x20\x42\xe1\x9f\x01\x67\x6e\xe8\xa8\x27\x3f\x81\x01\x57\x0e\x4c\x48\x34\xc1\x8b\x40\x9e\x49\x34\x21\x74\x52\x0a\x68\xb0\xbe\xee\x31\x07\x79\x53\x26\xe4\x60\xb7\xdb\xed\x16\xbb\x27\xef\xd3\x9e\xeb\xc5\x56\x4e\xc8\x39\xa6\x12\x5c\xe6\x23\x42\x57\x02\x24\xa7\x9a\x03\x0a\xcd\x75\x3e\x45\x8e\x58\x9f\xf5\x06\xba\xdf\x04\x4b\xf3\x0f\x50\x6a\xcc\x91\x02\x70\xe4\x0e\xd4\xf3\xdf\x8c\x34\x3f\x60\x89\x5c\x24\x51\xd4\x8a\x63\x11\x30\x2a\xb0\x88\xbb\x01\xb4\xfa\xdd\x6e\x2b\xfd\x09\xe0\x30\x2a\x31\x95\xf6\x23\x00\x14\x04\x1e\x71\xf4\x07\xd6\xbf\x08\x46\xb3\x6f\x01\x84\x33\xc5\x3e\xca\x3f\x05\xf8\xff\x1c\x8f\x07\xd0\x7a\xb1\x9e\x8a\x75\xdd\xb4\x15\xeb\x39\x14\x5b\x56\xe7\x0c\x43\xa2\x76\xe0\x67\x69\x11\xa1\xef\x23\x3e\x57\xaa\x29\x43\x4e\x85\x36\x9b\x59\xbe\x6d\x9e\x71\xeb\x98\x73\xc6\xc5\xfa\xff\x10\xf7\x7f\x17\x32\xf1\x50\xb5\x7d\x35\x3f\x72\x1f\x23\xfb\x34\x72\x95\x4c\x7b\x8b\x25\x68\x52\x95\x73\x4a\x08\x28\xe5\x59\xd2\x8c\xc4\xcd\x24\x9a\x58\x24\xb6\x4d\x0b\x11\x3d\x08\x10\x47\x3e\x96\x91\x5d\xc6\x4d\xca\x30\x4d\x5b\xae\x13\xb7\x55\x25\x8a\x66\x52\x10\x8f\x56\x04\xef\x89\x90\x95\x62\x50\x2f\x95\x67\x0b\x98\x10\x44\x0d\x15\x19\x56\x96\x8a\xc3\xcb\x77\x51\x0e\x33\xd3\xad\x42\x3c\x05\xfe\x0a\x89\x64\xb8\x98\xbf\x91\xc3\x3e\xd3\xad\x1f\x23\x9b\x33\x08\x56\xb2\xfa\xe3\x55\x8a\xea\x56\x0e\xd5\x4c\xc3\x0b\x8a\x6f\x03\xec\x48\xec\x46\xaa\xcf\x1c\xed\x73\xdd\x47\x61\xc5\xea\x0f\xdf\x22\x3f\xf0\x6c\xe6\xc7\x7f\x5b\xdd\xee\xa1\x79\x59\x7c\x57\xfe\xa1\x18\xd6\x7a\xda\xb5\x55\xa7\x7e\x46\x69\x94\x02\x72\x2c\x58\xc8\x1d\x2c\xd6\x40\x84\xce\x54\x45\x57\x37\x53\xac\x42\x1b\xf0\xd1\x2d\xf1\x43\x1f\xa2\xe0\x04\x1c\x14\x20\x47\x05\x01\x53\x24\x60\x84\x31\x05\x8e\x91\x33\x4d\x58\x2a\xa2\x20\xc1\xd6\xda\x57\x18\x71\xcc\x07\xf0\xe7\xbf\x0b\x8a\xeb\x60\x2a\x39\xf2\x1a\x7a\xe9\xd7\xa6\xb5\xe5\xa7\x33\xe2\x3e\x57\xb1\x5e\xd2\x47\x05\x22\x8c\x7a\x73\x40\xa1\x9c\x32\x4e\xbe\x9a\xe8\x4c\x87\x6e\x40\xa8\x61\x01\xf2\x31\x30\x3e\x41\x94\x08\xd3\x09\x19\xde\xb0\x1b\x8a\x79\xf6\x0d\x1b\x9b\x2e\x01\x76\xc8\x98\xa8\xb8\xc8\x60\xd3\x79\x8c\x86\x14\xe1\x76\x8a\xaf\x43\x9c\x75\x5a\xf5\x5a\x97\xed\xf7\x16\xcb\xd3\x88\xaa\xbb\xea\x62\x16\x60\x4e\x2d\x1b\x7c\xf7\x13\x91\xd3\x37\x88\x78\xd8\x7d\xcd\xb1\xe6\x91\x71\x0e\xdf\x06\x9f\x1a\xc8\x95\xde\x27\x82\x00\xdc\x80\x80\x31\x0b\xa9\xab\xc7\xde\x83\x54\xf0\x9b\xdd\xde\x23\x89\x15\xea\xe5\xbd\xd9\xed\xdd\x95\x93\x69\xd7\x4a\x56\xed\x87\x72\x0a\x92\x5d\x61\x6d\x8c\x84\xce\x90\x47\x5c\x9b\x49\x1b\x4f\x84\x49\x1b\x77\x67\xd2\xc6\x22\x26\x5d\x08\xcc\x81\x32\x99\xf3\x53\xc8\x71\xb0\x88\x1c\xb5\xf1\xbd\x36\xe3\x36\x9f\x08\xe3\x36\xef\xce\xb8\xcd\x45\x8c\x3b\x66\x05\x5b\xbc\x21\x72\x6a\x79\xe8\xa3\x03\xc0\xb7\x44\x48\x51\x1d\x2f\x3c\x56\xd6\x7d\xd3\xe1\xbf\xc0\xba\x45\x81\xd1\xc2\x51\x1c\xca\x82\x0a\x54\x90\x47\xea\x15\x5d\xec\x61\x89\x4b\x07\x76\xf3\x6a\xc1\xd8\xfe\x9f\x04\x93\x73\x35\x3c\xab\x71\xdd\x8c\xe4\x96\xd5\x8c\x19\x37\xeb\x3d\x69\x0c\x80\xb8\xc5\xbf\xde\x4f\xba\x33\x72\x7d\x42\x89\x90\x1c\x49\x45\xf9\xf8\xae\x03\x3e\x40\xdf\x00\x34\x7d\x15\x3a\x6b\x80\xa8\x6b\xb0\x23\x63\x20\x52\x2f\x86\x78\x82\xa9\xa9\x94\xbc\xc7\xa7\xca\x67\x62\x84\x0e\xe0\x3a\xc4\x7c\x6e\x89\x99\x22\x1f\x0f\x00\x89\x39\x75\xaa\x84\x7f\x82\xf9\x98\x71\x5f\x7f\x11\x39\x26\x54\xa2\x80\xa8\xe9\x35\xe5\x8c\xb2\x50\x80\x8f\x28\xd5\x2b\x1f\x75\x4a\x2f\xe7\x01\x1e\xc0\x88\x31\x0f\x23\x6a\xbd\x51\xf2\x27\x1c\xbb\x03\x90\x3c\xc4\xb5\x01\x52\xbf\x3a\x7c\x3f\xd0\x8a\x91\x19\x30\x9e\x86\xf1\x6e\x76\xbb\x1a\x77\xc2\xe8\xdd\xfd\x5f\x1e\x44\xf5\xaa\x89\x1a\x55\x8d\x1e\x99\xf9\x61\x71\x9a\xf3\x1c\x8f\x3c\xc7\x23\xcf\xf1\x88\x8a\x47\x8c\x4f\xb9\x47\x54\x92\x01\xf0\xb7\x8d\x4d\xee\xc7\xc6\x3c\x80\xbb\xc7\x29\x71\x08\x62\xc0\xd5\x87\x20\x8d\xc2\x9a\xe2\x48\xdb\x68\xc5\xb3\x6a\x5d\xc3\x00\x09\x98\x28\x5f\xd3\x70\xd4\xcc\x33\x0e\x7d\xca\xc2\x9e\x43\xe4\x4c\x21\x02\xa6\x97\x5c\x10\x08\x42\x27\x5e\x69\x14\xa1\x62\x8f\xdc\x7b\x15\x94\x74\x40\x4f\x70\xb1\xd9\xa3\xba\x49\x38\x24\xa7\x48\x07\x28\xaa\xa5\x9e\xc0\x2a\xdb\x56\x1d\x4c\x10\x93\x81\x1c\xca\x29\xa6\x52\xe9\x5d\x12\x67\xe1\x98\xc5\x7f\xb1\x20\x45\xd3\xf4\x8a\xb9\x96\x96\x94\xce\xff\xad\x0d\x8a\x52\x53\xad\x37\xd4\x72\x33\x6d\xbe\xa4\x73\x82\xe6\x1e\x43\x6e\xd6\x68\xab\x4c\xf6\xe2\xec\x14\x4f\x48\xd1\x57\x2c\x30\xd3\xb8\x5b\xc5\xaa\xcd\xe1\xc5\x9d\xa0\xc6\xdd\x0a\x50\xef\x1c\x34\x3e\xb1\x55\xb5\x13\x26\x1e\x7e\x59\x2d\x1b\xf7\x38\x0e\x0e\x9e\x6a\x24\x1d\xaf\xce\xdd\x23\x92\xce\x81\x78\x8e\xa4\x9f\x23\xe9\x98\x49\xdf\x38\x92\x4e\xc0\x7e\x40\xb7\xfb\x9e\xc7\x6e\xb0\x7b\x14\xe5\x3d\x9c\x9a\x7d\x92\x7b\x7c\x6f\x11\xcc\x52\x44\xce\x31\xf7\xc5\x31\x93\xb1\x0f\xb8\xc7\xf7\x2b\x40\xd5\xcf\x24\xc6\x8c\x8f\x88\xeb\x62\x0a\x98\xe8\x1d\xa5\x11\x76\x50\x28\x70\x1a\x6d\x10\xd1\x68\xba\x01\x2c\xdb\x37\xde\x99\xa2\xa1\x3f\xc2\x7a\x1d\x27\xcd\x30\xd1\xa1\x8d\x83\x28\x8c\x70\x14\x63\x45\x01\x0e\x11\xe6\x9b\xf9\xdd\xab\xce\x93\x9c\xcc\x3c\xe0\xe2\xea\x79\x1a\xdf\x61\x37\xd9\x20\x04\x97\x61\x41\x57\xa5\x99\xba\xd8\x3c\xdb\x7b\x22\x3c\xdb\x3b\x46\x3e\x7e\xcd\xe8\xd8\x23\x8e\xbc\x3b\xff\xca\xc0\x54\x3b\x4b\xc5\x0f\xdd\x32\xd5\x3b\x17\x4b\x33\xaf\x89\x76\x22\x9d\x68\x88\x32\x4b\x81\x44\x24\x2c\x7f\x92\xd3\xc3\x07\x5c\xba\xde\xa7\x10\x56\xcd\x0a\xe1\x66\x4a\xbc\x98\x97\x74\xa2\x19\x9b\x9b\x0f\x36\x9f\x09\x5a\xb3\xcb\x74\xfe\x54\x06\xcd\xda\xb0\x2e\x59\x12\x8f\x93\x3c\x72\x3d\x45\xd9\x6c\xef\x23\xf5\xe6\xc0\x93\x2d\x7a\x26\x70\x3c\xf7\x8b\x5c\x1a\xe2\x38\x3b\x5d\x2b\x5b\x45\x36\x53\xb8\x26\x33\xb6\x8a\xfd\x75\xb1\x0c\x93\x9a\x6c\x7b\xe7\xac\x61\x01\x4b\xe0\xc7\x85\xf4\xf9\x0c\x1f\x58\x22\xac\x57\x7d\xbf\x4d\x38\x6f\x41\x6a\x55\x87\xec\x19\xa6\xbe\x42\x6e\x4e\xc3\xbf\x2b\x17\x97\xf4\x10\x47\x26\x5e\xfc\x35\xc4\x7c\x7e\x8f\xb0\xbe\x04\x4c\xab\x3a\x50\x5f\x22\x7e\x7d\xbc\x9c\xfb\xc6\x51\xfd\xdf\x37\x50\xbf\xef\x92\xf7\x73\xde\x59\x93\xd1\xfb\x4e\x19\xa4\x01\x9a\x58\xa2\x5a\xd8\x5c\x90\xaf\xcb\x34\x67\xdc\xc5\xfc\xd5\x7c\x99\x0f\x60\xc4\x9d\x69\xc9\x1a\xaf\xc7\x42\x77\x18\x70\x36\x23\x2e\x2e\xc9\x6e\xad\xcd\xf9\x14\x61\x10\x30\xae\x34\x44\x83\x81\x04\x4c\xd5\xd0\xac\x5a\x9d\xe4\x1a\x3d\xcc\x00\x6d\xd0\xc5\x6e\x63\x5c\xe1\xbb\x0e\xd8\x36\x23\xb2\xe3\xf5\xb3\xcb\x6f\xe2\xf2\x9f\x3d\xd7\x63\xf3\x5c\xb5\x6e\x45\x67\xc6\xae\x73\xbd\x64\x7e\x67\x1f\x13\x75\x4f\xf2\x4c\x2a\x0c\xba\x89\xef\x31\x8b\xf7\x8f\xc4\x03\xc5\x84\xfd\x30\x47\x64\xb8\xf1\xec\x86\x9e\xdd\x50\xf2\xf7\xe3\xdd\x10\x71\x97\x70\x42\x0f\x1b\x6d\xc5\x4b\xb2\x43\x39\x0f\x2a\x7d\x1d\x72\x1c\x16\x52\xb9\xa4\x77\x33\x9e\x20\xee\x0b\x37\x53\xe2\x4c\x61\x84\x3d\x46\x27\x71\x9e\xff\xaa\x88\x16\x48\xbe\x6a\x8d\xa8\x73\x6f\xfb\x11\x9c\x26\x7e\x0d\xfe\x06\x8e\x2d\xe6\xc7\xb3\x6b\x7b\x76\x6d\xc9\xdf\x37\x73\x6d\x2f\xd4\x7f\x70\x3e\xc5\x02\xeb\x35\xcd\x78\xd9\xb2\x3d\x46\x0e\xa1\x13\xe0\xd8\xd3\xeb\x96\xc9\x01\xea\xa8\x4f\xcd\xe1\xa1\x75\x1f\x4b\x4e\x1c\xb1\xae\x93\x4d\x86\x1c\xd1\x09\x5e\xec\x50\xa2\x4e\x26\x39\x4b\x12\x1f\x0b\xcc\x09\x16\xa0\xbb\x9b\xbc\x15\x18\xcd\x93\x95\xca\x24\x93\x28\xef\x43\x3e\x18\x38\xaf\xe6\xa7\xaa\xe3\xaf\x56\xbe\xcb\x03\x47\x48\xbf\x9c\x7d\x3c\x06\xc4\x39\x9a\x2b\x77\x72\xc2\x99\x8f\xe5\x14\x87\x29\x65\x6c\xf4\x05\x3b\x52\xc0\x98\x33\x1f\xd8\x48\x60\x3e\x43\x92\x71\x12\xfa\x3f\x42\xe1\x22\x3e\xa5\x5c\x7a\xf6\x2f\xcf\xfe\x25\xf9\x7b\x62\xa1\x93\x1b\x1a\x1f\xb0\x54\x3c\x24\x95\x01\x7a\x4b\x74\x19\x13\x4f\xfd\xbf\x3a\xc7\xb0\xc4\xfd\x2d\xe9\xf8\x4c\x94\x26\xef\xe2\xef\x4c\x26\x82\x7c\xf6\x78\x0b\x3c\x9e\xcd\xa7\x67\x9f\xf7\xec\xf3\x92\xbf\x27\xe6\xf3\x96\xf4\x46\x63\xec\x2a\xc7\xd1\x20\x12\x43\x9e\x97\x58\x30\xa1\x20\x1c\x8e\x02\xac\x6b\xee\x8c\x19\xf7\x91\xd4\x7b\xd8\x08\x26\x64\x86\xe9\x02\xff\x14\x7f\x34\x32\xbd\xef\xe3\x96\x62\x94\x2c\x1a\x90\xed\x9d\x24\xbe\x95\x11\x29\x8b\xb4\x52\x35\x5d\x0f\x3c\x44\x1a\xeb\xa3\x49\x71\x16\x92\x13\x3a\xb1\x1d\xcb\x5f\x66\xc7\xf8\x03\x11\x82\xd0\xc9\x49\xac\x88\xf7\xd8\x35\xae\x00\xf5\xec\x90\x97\xdd\x39\xde\xac\x66\x52\x6a\x9f\x7a\x5b\x55\x1f\x91\x7f\x12\x3c\xfa\xa6\x29\x75\xcf\x83\xd6\xc3\x0e\x5a\x2b\xe9\x2b\xd5\x33\xa2\xc5\x00\xf9\xa8\x83\xc0\x53\x3c\xc6\x1c\x53\x27\x41\xd3\x38\x4a\x13\x21\xc6\x9f\xe7\x6a\xf0\x90\xc4\xa6\x93\xb8\x36\x5d\xa5\xde\xf5\x8a\xd0\xc5\x8d\xa6\x8a\x88\xba\x46\x2a\x14\x1c\x24\x63\x4f\x74\xfe\xc1\xe2\x82\xfa\x8a\xf5\x33\x40\x13\x6c\xfd\x14\xe4\xab\xfd\x53\x32\x99\x9c\x22\xd2\x47\x6f\x24\xf6\xc5\x72\x84\x37\xa2\x4a\x61\x51\x6c\xa4\xa6\x36\x13\xeb\x30\x8e\x42\x6e\x71\x2b\x8d\x73\x7d\x33\xad\x9b\x71\x13\xe4\x79\x1f\xc7\x8b\xf4\x24\xd6\xea\x9c\x12\xd8\x61\x4e\x09\x3f\xaa\x78\x02\xda\x10\xdd\x82\xaa\x97\xf2\x06\xb4\x20\x51\x89\x59\x56\x36\x4f\x62\x97\x61\x56\xed\x4a\x3b\x25\x85\xa8\xee\xc4\x90\xec\xcc\x63\x69\x2e\x68\x85\x2a\x47\x51\x4f\xc8\x72\x6f\x4a\x9b\x37\xf6\x43\xd9\x9c\xb8\xef\x24\xff\xa2\x0d\x9a\xe6\x7e\xe8\x49\x32\x44\x5f\x1b\x30\xc9\xae\xc5\x95\xfe\x65\x5c\x7f\xeb\x37\xe4\x85\x58\x0c\xe0\x4f\x14\xa5\xd2\xaf\x41\xc0\x71\x80\x94\x98\xd7\xcc\x26\x80\x20\x8c\xea\x5f\x1c\x23\x77\xbe\x06\x63\x5d\xaa\x66\x0d\x5c\x9c\xbc\x5e\x33\xa5\x13\x08\x9d\xfc\x1b\xf2\xbe\xbb\x52\xdb\xb2\xdb\xcb\xf5\x68\x1e\xeb\xf2\x48\x63\xd0\x3b\x02\x10\x0a\x93\x16\xe5\xe2\xc0\x63\xf3\x0e\xbc\x61\x3c\x1e\x22\x60\xff\xd3\xd9\x92\x18\x44\x1b\x37\x25\x3a\x9f\xc5\xc1\x7c\x3b\xda\x8e\x80\xa3\x83\xc6\x9f\x89\x45\x56\xae\xaf\xc5\xe3\x80\x10\xed\xb9\x34\x91\x5c\x52\x1c\xd4\xda\x58\x8f\x8e\xf6\x3a\xb9\x9d\x9c\x0c\x9f\x06\x10\x8a\x36\x46\x42\xb6\x7b\x7a\x3e\xb3\x0c\xdb\xf4\x81\xce\xc6\x4e\x45\x1f\xb1\x6c\x2c\x11\x63\x6a\x17\x47\x17\xa7\xef\x97\xed\x74\x80\x24\x5a\xaa\x9b\x39\x8e\x31\x44\x32\xdf\xc5\x4c\x8e\x06\xe0\x22\x89\xdb\x92\xf8\xb8\x29\xc8\x30\x70\xbf\x35\x48\x63\x6d\xc3\x25\x3d\x79\x5c\x58\xb5\x69\xfb\xcc\xee\x68\xc3\x5e\xb8\x2c\xee\xba\xeb\x59\xc1\x62\xde\xf1\x43\x0e\x2b\xa5\xa8\xeb\x88\x03\x5a\x8b\xf2\xb0\x75\xcc\x01\xad\x5e\xf6\xa9\x8e\x31\x0a\x4f\x4d\x4c\x51\x78\xac\x86\xa3\x3c\x93\xef\x77\xc8\xf2\x61\xc7\xc9\x9c\x08\xd2\xbf\x7a\x61\x94\x1d\x52\xcd\x15\x60\xfd\x4e\x83\x69\x9d\xbc\xf7\x4f\x8e\x22\xa4\x72\x42\x52\x2f\x67\x39\xc9\x4d\x0d\x5a\x99\x05\xa7\x56\x2e\x3e\xf3\x3c\xac\x8f\x89\x17\x18\xd9\x36\x30\xe3\xf5\xa9\xe2\x21\xb9\x32\xe8\xeb\xd5\xcd\xb3\x0a\x9b\xd7\xd4\xea\x00\xb2\x12\xc1\xef\xa5\x18\xa5\x02\xcc\x54\xdc\x8c\x61\x66\x4b\x21\xeb\xee\xc9\x11\x92\xf8\x34\x5e\x54\x3d\x32\x5e\x30\x83\x11\x73\x63\xf4\x0b\x72\xcf\x56\x43\x30\x7f\x3e\xba\x1d\xc6\xc5\x24\x87\xd1\x29\xbc\xcc\xc9\xef\x86\x33\x96\x32\xd8\x85\x93\x6c\xba\x60\x75\x7a\x8a\x0d\x05\x24\xc2\xbf\x30\xf1\x68\x1e\x11\x96\xe0\xdf\x40\x0f\x4a\xc9\xae\x8b\x38\x8e\xa8\xab\x0f\xf1\xdc\xbd\x24\x67\x96\x40\x3b\xf0\x29\x2d\x29\xd0\x44\x09\x92\xe2\x1a\xcc\x9d\x83\xc0\x54\xaa\xb8\x30\xb1\x19\x38\xf9\x78\x76\xbe\x52\xc5\xbe\xb6\x8e\x4d\x96\x14\x72\x65\xd0\x5a\x10\x75\x2e\x8f\xe6\x46\xd7\x67\xb7\x0f\x82\x25\x96\x91\x04\x71\xf1\x09\x51\x42\x0b\xea\x90\x1b\x7e\xeb\x42\xd7\x0a\x4c\x50\x12\xb9\x26\x05\x37\x3c\x42\xaf\x4c\x28\xad\xf0\x52\x9a\x19\x07\x02\x8b\xbe\x5f\x16\xd3\x66\xe5\x84\xa5\x39\x3e\xa8\x80\xf3\x50\x97\xc6\x77\x18\x1d\x93\x49\x58\xc9\x06\xc9\x14\x13\x34\xe8\xfd\x3f\x0a\x18\xe4\x03\xe5\x7c\x60\x99\x0d\x8f\x15\xdd\x34\x9a\x35\x94\x7e\xad\x03\x47\x12\xfc\x50\x48\x85\x96\x88\xb2\xa0\x3c\x76\x83\x79\xdb\x41\x02\x03\xf2\x82\x29\xa2\xa1\x8f\xb9\x8a\xa4\xa7\x88\x23\x47\x62\x2e\x80\x71\x58\x6d\xaf\xae\x29\xb3\xe5\x51\x2d\x1d\x44\x4d\xeb\x11\x96\x76\x5b\x53\x83\x0d\x53\x37\xdb\xaa\x00\xd3\xb4\x73\x10\xd5\x4b\x94\x23\x0c\x1e\xa3\x13\xac\xf4\x1b\x51\xd8\xe8\x5b\x1f\xef\xb4\x16\xc9\xa5\x38\x73\x28\x39\x4c\xab\x9a\xd4\xea\xa3\x13\x15\xda\x5f\x4e\x2f\x0b\x09\xf1\x3f\x2c\x84\xab\xce\xcc\x87\x1f\x15\xc1\xd9\x28\x3d\x99\x00\xce\x46\xba\x95\xca\x38\xcd\x35\xfe\xa1\x12\x2e\x4b\x79\x86\x1f\x29\xdf\xca\x22\x35\x8f\x57\xba\x06\xe5\x56\xd1\x7e\x4b\x07\xdf\x68\x0d\x24\x59\x51\x68\xd5\x8c\x94\xf9\x05\xdc\x2c\xa0\x34\x98\x50\x1e\x48\x91\x9c\x9c\x37\x37\x8a\xd0\x81\x4f\x91\xf3\x59\xcd\xe0\xb5\xaa\x07\xad\xc5\x8e\xb0\x66\x48\x6c\x5d\x50\x72\x1d\x62\x20\x2e\xa6\x92\x8c\x09\x4e\x6b\x6f\x9a\x4f\x2f\x04\xee\x12\x11\x78\x68\x3e\xac\x1f\x82\x8e\xad\xe1\x27\x17\x0c\xa8\xf0\x25\x02\x02\x41\xc8\x03\x26\x70\x03\xe7\x5e\xff\xb9\x77\xa1\x8f\x28\x8c\x39\xc1\xd4\xf5\xe6\x25\xd4\x65\x71\x58\xd3\x48\xc4\xcb\x66\x97\xe8\x46\x5c\x2e\xc6\x00\x53\x34\xf2\x70\x0d\x6b\x3f\x45\xa1\x61\x09\xcd\x44\xc4\xdd\x0d\xf9\x7a\xf1\x8e\xd0\x89\x1a\x18\x3f\x9e\x1d\xc4\x83\x4e\x09\x12\xd9\x91\xbf\x2c\x90\x8b\x00\xe7\x5d\x54\xb9\x12\x1f\xa4\xbf\x14\x6b\x50\x3c\x22\xea\x7f\x3b\x3f\x4c\xc3\x0d\xca\xab\x4f\x4e\xb5\x23\xee\x95\xa9\x74\x4e\xc7\x8e\x3b\xf0\x1b\xe1\x13\x42\x09\xfa\xd6\xba\x16\x21\xf1\xad\x74\xcc\x7c\x6c\x8c\x42\x4f\x0e\x60\x8c\x3c\x91\x06\xc4\x49\xa2\xfc\x30\xb3\x68\x56\x3d\xed\xd3\xa1\x68\x31\xc6\x8a\x7b\xeb\xef\x0b\x2b\xff\x3e\x2e\x0f\x63\x48\x2a\x41\x35\x3f\x34\x94\x0c\x0b\x25\x0c\x5d\x64\x36\xe6\x49\x15\x75\xba\xc9\x8b\x4c\x6a\x74\x9c\x5f\x12\xa7\x48\xbf\xd0\x6d\x4a\xf3\x6a\x2b\xc3\x84\x3b\x0c\xfd\x0b\x12\x77\x21\x5e\xba\xe9\xd1\x51\x70\xb6\xd3\x7d\xe7\x86\x27\x78\xd3\xeb\x4a\xb6\xfb\xe5\x6c\xd2\x7f\xfd\xfe\xeb\x38\x2c\x8e\xf5\x85\x51\xb5\x76\xb0\x2f\xa0\xb0\xc4\x90\x9f\x77\x1a\x15\xd2\x4a\x08\x69\xdc\xf4\x47\x86\x12\x29\x27\x0c\x0b\xd2\xdf\x4b\x6e\x77\x1b\x9d\x2a\xee\xc2\x16\x34\x04\xb9\x2e\x51\xe6\x85\xbc\x93\x0a\x46\x97\x72\x6a\x66\xb6\xbb\xee\x62\x52\x75\xf4\x1b\xb0\x86\xf6\xec\x27\x1a\xd2\xad\x13\xfe\x25\xf2\x83\xc5\xfb\xd4\xe9\x5e\x02\xa1\x72\x7b\x33\x4b\x5a\xb1\xbb\x29\x4a\x55\xd2\xdb\x65\xe1\xc8\xc3\x35\xce\x41\x03\xb4\x6d\x3a\x9f\x39\xfa\x00\x56\x5d\x9d\x9c\x0a\xdf\xcf\xae\x6d\x24\xfe\xee\x96\x6d\xf3\xa2\x65\x2b\xc3\x1b\x93\xda\x48\x18\x3d\xc5\x42\x0d\x93\x2b\x15\x64\xd8\x10\x1e\x99\x37\x78\xdc\x56\x57\x38\xfd\xb6\x24\xf7\x1c\xbb\xff\x9d\x5c\x5e\xa9\xce\x34\x98\x54\x46\x1f\x6d\x15\xc8\xb8\x07\x05\x47\x8b\xb3\x81\x1c\x7b\x9e\x58\xd3\x7e\xa5\x98\xe9\x95\x9a\xa3\xa9\x08\x4c\x2a\xae\x75\xc2\x70\x74\x60\xee\xa9\x72\x18\x4f\x6a\x3f\xe7\xd2\xdc\x4a\x90\x23\x74\x00\x01\x92\xd3\xbc\xe0\xd3\x6d\x86\xf8\x08\x47\x16\x8f\xf8\xa9\x05\xc6\x2e\x61\x5c\xc0\xce\xc3\x74\x22\xa7\x3a\x32\x27\x3e\x06\x42\xc1\x27\x34\x54\x93\x10\x15\x0e\x9b\x93\xa9\x92\x45\x95\xbd\x4c\xf1\xc2\x4c\x6a\x72\x69\xe5\xdb\x72\xfa\xf2\x16\x52\x6e\x1f\x49\x10\xbd\x95\x5a\x35\xa1\xc4\x0f\xfd\x01\xf4\xd2\x47\x66\x23\x61\x00\x9b\x1b\xfd\x6e\xf4\xb4\x98\xf3\x97\x67\x11\x24\xf6\x17\x41\x8f\xcf\xb4\xe4\x64\x19\x3d\x6d\xca\xc3\xb8\xbd\x4e\xfe\xc6\x0e\xa3\xae\x80\x11\x96\x37\xba\x58\x1e\x92\x08\x92\x83\x80\x0f\xcb\xb1\x8d\x6e\x23\x96\xf5\xba\xbb\xdd\x6a\x9e\xe5\x59\x62\xf1\x2c\x82\x1f\xe5\xd1\x67\x79\x16\x3d\x6c\xc2\xb2\xf8\xba\xc1\x78\x3a\x20\x19\x8c\xb1\x74\xa6\x1d\x78\xa3\xfe\x97\x49\xa7\xbf\x99\x62\x0a\xd8\x0f\xe4\xbc\x63\xfa\xa9\x59\x11\xc1\x42\x1f\xbd\x8c\xa7\x48\x1a\x65\x9a\x24\xb0\x6b\x8c\x44\xa7\x96\xb3\x59\x5f\x56\xf0\x64\xe5\x13\xdd\x98\xcf\x49\xbd\xf5\x34\x97\xd0\x30\xc1\xca\x71\xac\xe5\xc0\x89\xb9\x54\xd6\xc5\xb7\x05\x9d\xb0\xa7\x8e\x0d\xdc\x44\x51\x7e\xf9\x0c\xc7\x48\x76\xf1\x7a\xa5\x9d\xda\x68\x90\xb6\x32\x31\x6b\x91\x3e\x4e\x8b\x95\x2a\x76\x29\x65\xc7\xc8\x99\xda\x44\x7f\x43\x32\xf2\x29\x98\x09\x19\xdd\xae\x21\x24\x2a\x86\x54\xba\x60\xf3\x9f\x76\xd2\xf3\x2c\xba\xb5\x20\xba\x1b\x4f\x75\x52\xf3\x65\x87\x13\x89\x39\x41\x1d\x6d\xc0\x62\x4e\x25\xba\x4d\x56\x5b\x12\x5f\x0f\x44\x58\x08\xf9\xc4\x43\x3c\xde\xfa\xb2\xbb\x60\xb8\x8c\x01\x5f\x82\xe3\xe9\x32\xaf\x6c\x0c\x88\xc2\xd9\xaf\xef\xf5\x6e\x2d\x36\x97\x36\xc7\xb0\x74\x69\x7c\x73\x62\x2d\xaa\xf4\xaa\xfb\x9b\xa9\x3c\xa2\xf3\x18\xec\x98\x79\x1e\xbb\x51\x53\xe7\x4b\x27\xb3\xdf\x29\x2e\x61\x4c\xb0\xe7\x8a\xc1\x4a\x02\xf4\xe7\x4c\x2e\x54\xf1\x71\x94\xed\x64\xbf\xc8\x6c\x4d\x66\x5e\xe8\x45\x8f\xa1\x75\x3a\xe0\x67\x2b\xfb\xc9\x7a\x38\xe5\x78\x6c\xfd\xcc\x74\xc8\xac\x07\x58\xcf\x0b\x09\x89\x3f\xdb\xdb\xaa\xea\xa7\x5d\x1a\x32\x8b\x84\xce\x24\xb3\x7e\x9b\x25\x0f\xeb\x41\x6e\x6f\xfc\x67\x2b\xc3\xca\x7a\x18\x65\x3b\xa5\xcc\xb3\x12\xdd\xd6\xac\xf1\x4e\xb9\xa2\xd4\xcb\x24\x97\x40\xa7\xc2\x92\x53\x4c\xb8\x46\x7f\x0d\xe2\xea\xbe\xa9\xd4\x8c\x92\x58\x32\xba\xbc\xbc\x14\xd7\x69\x9e\xb3\xde\x6e\x44\xc2\xb1\xdf\xa7\x8d\xcf\xef\x82\x06\x0c\x11\x75\x87\xc9\xfe\x9b\xa2\xfd\x3e\x98\xad\x59\x62\xaf\xc6\xd4\x5c\x26\x9e\xb1\x1b\xba\x2a\xe3\x35\x51\x77\x0d\x18\x07\x62\xda\x68\x3b\xd6\xab\x6e\xca\xa9\xaf\xa9\x67\xa9\xf8\xcc\xba\x9c\x9a\x1c\x18\x07\x6f\x51\xa8\x10\xea\x24\xde\x22\xf0\x98\x8b\x33\x03\x68\xd1\x83\xe4\x1c\x04\x58\x4e\x24\xa6\xae\x55\xe1\xf7\x8c\x63\x8c\x00\xdc\xd7\xb7\x09\x39\xf7\xd4\x00\xc9\xb8\x39\xc4\x69\x6a\xb2\x95\xfb\xad\xd4\x6d\xe9\x46\xa9\x9b\xb2\xb4\xa2\xde\x5f\x2d\xf0\x53\x7a\x0f\x37\xeb\xa4\xd2\x6f\x66\x9c\x15\x44\xf5\xba\x23\x47\x93\x5c\x3b\x6a\x10\x53\xd2\xb9\xcc\xfa\x8f\xcb\x35\xb8\x54\x8c\x53\xff\xd7\x66\xaa\xfe\x61\xec\xf3\xd2\x6c\x58\x5f\x1a\xe3\xbc\x4c\x61\xab\xf9\x00\xd2\x97\x99\x19\x81\x5f\xfe\xd7\x7f\xab\x5e\x2f\x2f\xb5\xca\x5c\xbe\x3f\xfa\xd7\xe1\x65\xea\x36\xe3\x5e\x5f\x18\xa1\x51\xfb\xfd\xe3\x83\x4b\x03\xfb\xe3\xe9\x65\x07\xde\xb1\x1b\x3c\xc3\x7c\x0d\xe6\x2c\xd4\xae\x55\x51\x89\x92\xb4\x13\x36\x86\x5e\x37\xea\xae\x0f\xb9\x45\xd4\x68\xd9\x5b\x3c\x3e\x4c\x94\xa9\xcc\x18\x0b\xa6\x18\x95\x60\x88\xf3\x07\x2e\xfd\x79\x3b\xf2\xb9\x06\x37\x6b\xb9\x59\xef\x9a\x34\x35\xc8\xac\x35\xbe\x84\x14\xae\xd9\xff\xcf\xb0\x1f\x5e\x02\xba\x11\x76\xf7\x3f\x83\xf6\xbf\x97\x21\x00\x99\xef\xe8\x54\x0f\x9d\xab\x10\x1d\xb1\xbe\xf4\xe7\x77\x44\xd9\x23\x57\x18\xfc\xf9\x3f\xfa\x5b\x0f\xe2\x37\xb4\x5f\xb4\xf3\x11\x12\xdf\x68\x79\x14\x24\xd3\xca\xc2\x53\x24\x20\xc0\xdc\x27\x42\xdf\xbf\x2e\x19\x08\x6c\xaa\x78\xf0\xe8\x2c\xa4\xa5\x04\xc7\x4c\xe2\x4e\x8c\xa2\x19\xac\xd3\x53\x73\x4a\xa1\xa3\xb3\x4f\x7a\xe1\x3d\xee\x5d\xed\xa0\xa2\x60\x4b\x2b\x5c\x85\xdb\x29\x77\x31\x25\xb1\x51\xc6\x83\x40\xde\xb1\x35\x52\x94\xd6\xdd\x1d\x58\x69\xea\x6f\x3c\x73\x2a\x0e\xf9\x85\xe9\x52\x41\xfb\xf4\x56\x97\x9a\x05\xe8\x39\x44\x66\x14\x18\xcd\x2b\x78\xd5\x00\xef\xa6\xec\xc4\x33\xe4\x0d\x2b\xf3\x99\x63\xd6\xe2\x4c\xe9\x03\xd5\xd8\x45\xdc\x5d\xdc\x2f\x6e\xa9\xfa\xc6\xe7\x78\x75\x4a\x5a\x8c\x42\x74\x90\xd7\xa6\x0b\x0f\x60\xa4\x9f\x46\x0f\xcd\x8f\x37\xd1\xec\xef\x97\x4f\x71\x86\x9a\x21\x7a\x2a\x65\xb0\x92\x27\x2c\x77\x01\x4e\x0c\x3e\xb7\xfa\x14\x25\xff\x40\x2b\xc9\xed\x4f\x49\xcc\x25\xae\x41\xcb\xd2\x9a\x58\xde\xad\x28\x91\x0f\x05\x44\x26\x19\xbb\xb9\x5b\x72\x16\x7d\x1a\x87\xed\x1b\xfc\x8d\x3e\x5d\x9a\xf6\x5c\x81\x80\x5e\x1b\x46\x1b\x68\xcf\xd9\x1a\xed\xb5\xbb\xfd\xdd\x8d\xf6\xe6\x78\xbc\xdb\xde\x1b\xed\xe1\xb6\x8b\xfa\xfd\xee\x9e\x8b\x7a\x3b\xce\x46\xfa\xe5\x68\xe9\x39\xb2\xad\xf4\x79\x6d\x1a\xee\x7a\xa3\x6f\xc0\x0b\x08\x38\x9a\xf8\x68\xa0\xbc\x1a\xbb\xd1\x55\xb6\x04\x76\x38\x96\xb6\xd2\xc9\x50\x0c\xa0\xa5\xcf\xd5\x34\x65\x57\x92\x78\x67\x7b\xa3\x7a\xd1\x9b\xf3\x1a\xd0\x42\x01\x19\x46\x64\x0c\x23\x76\xd7\x88\xc1\x42\xc8\x3e\x94\x01\x2d\xa5\xa0\x62\xb0\x6e\x58\xd3\x6e\xc2\x8e\x4e\xa4\xcc\x1d\xdd\xa5\xe3\x30\xbf\x00\x3c\x3e\xbc\x91\x07\xef\x22\x89\xee\xff\x8d\xf4\xa4\x87\xbe\xb3\xa9\xdb\xee\x75\xdb\xdd\xad\xf3\x5e\x7f\xb0\xd5\x1b\xf4\x37\x3b\xdd\xad\x8d\xde\x66\xff\x8f\xb4\x87\x75\x90\xa3\xd0\x63\x7b\xb0\xb1\xdd\xd9\xd8\xee\xf7\xbb\xbb\x56\x8f\xf8\xc4\x05\xb4\xfa\x9d\xed\x4e\x37\x7d\x91\x75\x29\x89\xab\x29\x51\xf0\x06\xb7\x8b\xff\x75\x94\xde\x9c\x6b\x79\xd6\xfa\xa7\xad\xf5\xd9\xd3\x49\xd0\x42\xd1\x91\xd3\xb2\x0b\x2f\xd2\x9b\x45\xf2\xb2\x6f\x6e\x22\x25\x57\x1b\xe4\x4c\xa2\xc1\x29\x9e\x62\x26\x60\x31\x63\xb0\x24\x2f\xb0\xb0\xac\xd8\xbe\x8b\xfd\xd5\xd9\xe0\x77\xb4\x43\xa8\x19\x80\x16\x9b\x63\x8d\x49\xc2\x02\xb3\x04\xdb\x34\xbd\x8c\x31\x42\xbd\x41\xc2\x43\x1b\x25\x7c\x27\xc3\x84\x3b\x19\x27\xdc\xc9\x40\xa1\x6e\x68\x82\x45\xb6\x57\x92\xb4\xbc\xc0\xec\x8a\x19\xc3\x90\x8c\x53\x25\x51\x5f\xe6\x59\x26\xf5\x0c\x5a\xfb\x3e\xfa\xca\x28\x7c\xc2\xa3\xf8\x6c\x90\xd5\x36\x4e\x0e\x4b\x95\xaf\x98\x81\xdb\x00\x55\x3b\xfd\x35\x41\xb4\x44\x6b\x73\xa8\x5d\x9c\xc1\x21\x12\x72\x0d\xac\x8c\xb6\x3a\xdc\xa0\x2e\x6f\x0c\xfe\x4c\x67\x15\x6b\xd1\xcc\xc4\x6c\x49\x54\xe5\x19\x55\x10\x56\xdc\x2e\x1f\x6a\x84\x87\xc3\x01\xd8\x23\x20\xe6\xc3\x11\x67\x57\x98\x4b\x16\x10\x27\xda\x9b\x19\x8e\xe6\x12\x8b\x21\xa1\xc3\x6c\xf1\x86\xc4\x24\x86\xa6\x3a\x00\xe3\x43\xc2\x86\xd1\x92\x72\x02\xb7\x9d\xbf\x96\x42\x79\xd0\x80\x38\x03\x18\x0e\x1d\x46\x45\xe8\x63\x3e\x64\xe3\xb1\xc0\xd6\xe5\x3a\xc5\x64\x9c\xb6\xb5\x25\x0f\xbd\xed\x5e\x6f\x7b\xa7\xdb\xdf\xe8\x76\xbb\xdd\xac\x42\x9b\xc9\xd8\xee\x66\x6f\x6b\x73\x51\xef\xed\xca\xde\x5b\xbb\xbb\xbb\x8b\x7a\xef\x55\xf6\xde\xd9\xee\xf7\x6d\x21\x95\x24\x8d\xfc\x45\xc4\xb4\x50\x24\x05\x71\x54\x66\x2e\xe4\x38\x51\x99\xa1\xd0\xce\x6f\xfd\x43\x2b\xfb\xa0\x64\xb0\xb2\x36\xfe\xa3\xd6\xe9\x13\xd3\xbc\xfa\x32\xfc\xb2\xb0\xba\xd7\x2d\x46\xcd\xb9\xe2\x34\xa5\x63\xb5\xb9\xaf\x73\x3d\xd3\x5d\x17\xed\x80\x96\x3e\xfc\xd7\xfe\xf0\xf6\xc3\x79\x3b\xf3\x3a\x09\x9f\xce\xac\x1b\x85\xe3\xbb\x86\xcd\x9d\x84\x89\xf7\x30\x4b\x77\xfa\xee\xe1\x97\xfa\x5c\x55\xb2\xdc\x66\x85\xbe\x76\x1d\x0f\x68\xf5\xc8\xa7\x23\xe2\x5f\xbf\x75\xf8\x41\xf8\x7e\xbb\x87\x2e\x6e\x8f\xfe\xb8\x7e\x75\x7e\x7d\x7c\x8a\x12\xc6\x54\xdc\x6d\xfa\xcc\x98\x9a\x1b\xa2\xca\x98\xd3\xbf\x17\x6f\xfa\xb5\xac\xe9\x97\x71\xc6\x4c\x1a\x41\x32\x45\xaf\xc0\x99\x35\xf0\x01\x5c\xe8\xa1\x48\xbd\xd5\x41\x60\xfe\x9e\x33\x53\xca\xae\x38\x41\x1a\x40\xe6\xb3\x03\x58\xf4\x15\xab\x7a\x38\xf3\x42\x9f\x9a\x05\x63\x05\x3d\x5a\xdd\x84\x55\xe2\xae\x76\xe0\xac\xac\x9d\x5e\xfc\x1f\x44\x51\xe3\x5a\xb4\xfd\x96\x0d\x40\xe3\xa7\x26\x64\xed\xc0\xaf\x66\x01\xd7\xc8\x66\x00\xc4\x85\x97\xd0\xb3\xf9\x93\x97\xb4\xf7\xe9\xe0\x6d\x38\x1f\x1d\xf1\x43\x7a\xcb\xf7\xb1\xbf\xd3\xdf\x9c\x5c\x5f\x5d\x91\x83\x59\x22\xe9\x05\x95\xdd\x4a\xa5\xdd\xbb\x97\xb4\x7b\xb5\xd2\xee\x95\x48\xdb\x37\x38\xea\x5c\xa2\x54\xc1\x13\xff\x0e\x76\x05\xc5\xe5\x59\x90\xaf\x39\x56\x46\xf2\xce\x7d\x28\xde\xa9\x23\x78\xa7\x84\xde\x26\x97\x7f\x26\xd8\x67\x6e\xf2\x7f\x3c\x34\x24\x53\xd1\x08\x79\x53\xe8\xd6\x7d\xb9\xda\x23\xff\xda\x70\xc3\xdf\x3e\x1f\xcd\x66\x5b\x9f\x67\xef\xbd\xf9\xd7\x9e\xff\xf6\x74\xe3\x97\xf9\xf5\xf1\x6a\x5a\xad\xae\xc6\x7b\x7d\xfe\xb8\x33\xe9\x4f\xb6\xdf\x9d\xbb\x17\xff\xba\x40\xfd\x2b\xf1\x6e\xb7\x7f\xf5\xeb\xc1\xc6\x3c\x66\x49\xbe\xd0\x5e\xa9\x3b\xbf\x97\x0e\xf7\x6a\x75\xb8\x57\xa6\xc3\xa9\x4f\x9a\x61\x4e\xc6\x73\xf8\xe5\xd3\xb9\xa9\x63\x38\x80\xd3\x68\x91\x3f\xb9\xff\xcc\x2c\x18\x98\x2a\x87\x8d\x58\xb2\x71\x31\x3d\x9c\xde\xf8\xbf\xbf\x0a\x3e\x9d\x8c\x8f\xfa\xde\x31\xbe\x0a\xdc\xcd\x3f\x0e\x62\x96\xe4\x6f\x6f\x2b\x63\xc9\xe6\x7d\x38\xb2\x59\xc7\x90\xcd\x32\x7e\x08\xcc\x61\x75\xcc\x58\x7b\x84\xf8\x6a\xd3\x4b\x88\x3b\x35\x86\xfe\x79\xe3\x82\x1c\x4e\xbf\x52\x8b\x09\x5f\x02\x77\xf3\xf3\xeb\x84\x09\x4d\x2f\x85\x2e\xe3\xce\xd6\x7d\xb8\xb3\x55\xc7\x9d\xad\xc5\xdc\x99\x22\x11\x17\x15\xb0\x76\x82\xd3\x9b\x97\xb7\xcd\x92\x87\x3e\xab\x1c\xed\x1e\x2e\xe4\xd4\xd5\xad\xe2\xd4\x6f\x27\xf8\xa8\xcf\x8e\xf1\x17\x77\xe3\xf7\x57\x09\xa3\x16\x5c\x5a\x5d\x6a\x50\xfd\x7b\x19\x54\xbf\xd6\xa0\xfa\x25\x2c\x4a\x8c\x46\x2a\x64\x61\x8a\x66\x38\x3a\x49\x8e\x29\xc4\x75\xbd\x2a\x99\x70\xf5\xfb\xeb\xaf\x9f\x34\xed\x31\x13\xde\xcf\xde\xec\x7d\xf9\xf0\xeb\xe7\x98\x09\x75\x37\x15\x97\x31\x60\x63\xfb\x3e\x0c\xb0\x7b\x17\x19\x60\xbf\xcd\x78\x58\xe4\x99\x98\x83\x08\x40\x9e\x5e\xd0\xd2\x65\xc2\x2a\xc9\xde\xbe\xfa\xdc\x55\xb2\xff\x9a\xd2\xff\x19\x4f\xdd\x8d\xc3\xc8\x53\x14\x0b\x4b\x96\x91\xba\x77\x1f\x4a\xf7\xea\x08\xdd\x2b\xf5\x9c\x51\x69\xaf\xb8\x52\x67\x8d\x23\xc4\x87\xb1\x18\xb7\x3f\x4f\xa6\xe3\x0f\x7b\x93\xb7\xa7\xe2\xdd\xec\xf0\x53\x42\x5e\xe3\xe1\xf2\x7b\x12\x69\xcd\xeb\x5a\x66\x43\x3e\xae\x2c\x07\x2a\xb2\x17\x58\x0e\xe0\xe3\xeb\x0f\xed\xc3\xdf\xdb\x7b\x83\x68\x21\xd9\x94\x82\x53\xc4\xa4\x6d\xf0\xad\x6c\xa7\x8b\x88\xed\x1e\xb9\xed\x6e\x78\xd4\xf5\xfc\xeb\xee\xf5\xd8\xd9\x11\x44\xa2\x2d\xe1\x7d\x99\xed\xda\x73\x61\x15\xaf\xc6\xa5\x0f\x14\xe5\xbd\xc9\x96\xbb\xbb\x7b\xdd\xf5\xb8\xe3\xce\x36\x27\x3b\xc8\x1b\xed\x08\x6f\x3c\xa1\x5f\x36\xdc\xe9\x48\x7c\xf9\xc7\xff\xfb\xe7\xe1\xef\xe7\xa7\xfb\xf0\xb3\x21\xb6\xa3\xf9\xf2\x32\x3d\x7c\x69\xc1\x26\x02\x56\x37\xbb\x9b\xab\x6b\x9a\x0d\xfa\xe7\xeb\xf7\x17\x67\xe7\x87\xa7\xf1\xd0\xd0\xdd\x5c\xd5\xfb\xfb\x89\x28\xed\x53\x9c\xaa\x7d\x6f\xb2\xc5\xf8\x56\x77\x46\xc2\xee\x0e\xc3\x4a\x50\x53\x7e\xe5\xf4\xb7\xdd\xc9\x58\x7e\xe9\x21\x67\xd5\xe6\xde\xeb\x88\x8e\xd5\x45\x44\x58\xa1\xc6\x4f\x75\x03\xeb\xb9\xf8\xc4\xe7\xdb\x54\x5c\x8f\xfa\xe2\xd8\x7f\xf3\x65\x6b\xf4\x7b\x70\xb0\xf3\x1a\xb5\x56\xfe\x2f\x00\x00\xff\xff\xd4\x33\x65\x8f\x1e\xa3\x00\x00") func fleetManagerYamlBytes() ([]byte, error) { return bindataRead( @@ -94,7 +94,7 @@ func fleetManagerYaml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "fleet-manager.yaml", size: 43159, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "fleet-manager.yaml", size: 41758, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/internal/dinosaur/pkg/handlers/admin_dinosaur.go b/internal/dinosaur/pkg/handlers/admin_dinosaur.go index f9d3b499b2..68b92cfe50 100644 --- a/internal/dinosaur/pkg/handlers/admin_dinosaur.go +++ b/internal/dinosaur/pkg/handlers/admin_dinosaur.go @@ -12,8 +12,6 @@ import ( "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/dbapi" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/public" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/config" - "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/converters" - "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/defaults" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/presenters" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/services" "github.com/stackrox/acs-fleet-manager/pkg/errors" @@ -21,7 +19,6 @@ import ( coreServices "github.com/stackrox/acs-fleet-manager/pkg/services" "github.com/stackrox/acs-fleet-manager/pkg/services/account" corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/strategicpatch" ) // AdminCentralHandler is the interface for the admin central handler @@ -32,16 +29,10 @@ type AdminCentralHandler interface { Get(w http.ResponseWriter, r *http.Request) // List all centrals List(w http.ResponseWriter, r *http.Request) - // Update a central - Update(w http.ResponseWriter, r *http.Request) // Delete a central Delete(w http.ResponseWriter, r *http.Request) // DbDelete deletes a central from the database DbDelete(w http.ResponseWriter, r *http.Request) - // SetCentralDefaultVersion sets the default version for a central - SetCentralDefaultVersion(w http.ResponseWriter, r *http.Request) - // GetCentralDefaultVersion gets the default version for a central - GetCentralDefaultVersion(w http.ResponseWriter, r *http.Request) // Restore restores a tenant that was already marked as deleted Restore(w http.ResponseWriter, r *http.Request) // RotateSecrets rotates secrets within central @@ -49,11 +40,10 @@ type AdminCentralHandler interface { } type adminCentralHandler struct { - service services.DinosaurService - accountService account.AccountService - providerConfig *config.ProviderConfig - telemetry *services.Telemetry - centralDefaultVersionService services.CentralDefaultVersionService + service services.DinosaurService + accountService account.AccountService + providerConfig *config.ProviderConfig + telemetry *services.Telemetry } var _ AdminCentralHandler = (*adminCentralHandler)(nil) @@ -64,32 +54,18 @@ func NewAdminCentralHandler( accountService account.AccountService, providerConfig *config.ProviderConfig, telemetry *services.Telemetry, - centralDefaultVersionService services.CentralDefaultVersionService) AdminCentralHandler { +) AdminCentralHandler { return &adminCentralHandler{ - service: service, - accountService: accountService, - providerConfig: providerConfig, - telemetry: telemetry, - centralDefaultVersionService: centralDefaultVersionService, + service: service, + accountService: accountService, + providerConfig: providerConfig, + telemetry: telemetry, } } // Create ... func (h adminCentralHandler) Create(w http.ResponseWriter, r *http.Request) { - centralRequest := public.CentralRequestPayload{ - Central: public.CentralSpec{ - Resources: converters.ConvertCoreV1ResourceRequirementsToPublic(&defaults.CentralResources), - }, - Scanner: public.ScannerSpec{ - Analyzer: public.ScannerSpecAnalyzer{ - Resources: converters.ConvertCoreV1ResourceRequirementsToPublic(&defaults.ScannerAnalyzerResources), - Scaling: converters.ConvertScalingToPublic(&dbapi.DefaultScannerAnalyzerScaling), - }, - Db: public.ScannerSpecDb{ - Resources: converters.ConvertCoreV1ResourceRequirementsToPublic(&defaults.ScannerDbResources), - }, - }, - } + centralRequest := public.CentralRequestPayload{} ctx := r.Context() convCentral := dbapi.CentralRequest{} @@ -103,8 +79,6 @@ func (h adminCentralHandler) Create(w http.ResponseWriter, r *http.Request) { ValidateDinosaurClaims(ctx, ¢ralRequest, &convCentral), ValidateCloudProvider(&h.service, &convCentral, h.providerConfig, "creating central requests"), handlers.ValidateMultiAZEnabled(¢ralRequest.MultiAz, "creating central requests"), - ValidateCentralSpec(ctx, ¢ralRequest, &convCentral), - ValidateScannerSpec(ctx, ¢ralRequest, &convCentral), }, Action: func() (interface{}, *errors.ServiceError) { svcErr := h.service.RegisterDinosaurJob(ctx, &convCentral) @@ -281,149 +255,6 @@ func validateScannerSpec(s *dbapi.ScannerSpec) error { return nil } -func updateCentralRequest(request *dbapi.CentralRequest, strategicPatch []byte) error { - - var patchMap map[string]interface{} - err := json.Unmarshal(strategicPatch, &patchMap) - if err != nil { - return fmt.Errorf("unmarshalling strategic merge patch: %w", err) - } - - patchBytes, err := json.Marshal(patchMap) - if err != nil { - return fmt.Errorf("marshalling strategic merge patch: %w", err) - } - - var centralBytes = "{}" - if len(request.Central) > 0 { - centralBytes = string(request.Central) - } - var scannerBytes = "{}" - if len(request.Scanner) > 0 { - scannerBytes = string(request.Scanner) - } - - var originalBytes = fmt.Sprintf("{\"central\":%s,\"scanner\":%s,\"force_reconcile\":\"%s\"}", centralBytes, scannerBytes, request.ForceReconcile) - - type Original struct { - Central *dbapi.CentralSpec `json:"central,omitempty"` - Scanner *dbapi.ScannerSpec `json:"scanner,omitempty"` - ForceReconcile string `json:"force_reconcile,omitempty"` - } - - // apply the patch - mergedBytes, err := strategicpatch.StrategicMergePatch([]byte(originalBytes), patchBytes, Original{}) - if err != nil { - return fmt.Errorf("applying strategic merge patch: %w", err) - } - var merged Original - if err := json.Unmarshal(mergedBytes, &merged); err != nil { - return fmt.Errorf("unmarshalling merged CentralRequest: %w", err) - } - - if merged.Central == nil { - merged.Central = &dbapi.CentralSpec{} - } - - if merged.Scanner == nil { - merged.Scanner = &dbapi.ScannerSpec{} - } - - err = validateCentralSpec(merged.Central) - if err != nil { - return fmt.Errorf("updating CentralSpec from CentralUpdateRequest: %w", err) - } - err = validateScannerSpec(merged.Scanner) - if err != nil { - return fmt.Errorf("updating ScannerSpec from CentralUpdateRequest: %w", err) - } - - newCentralBytes, err := json.Marshal(merged.Central) - if err != nil { - return fmt.Errorf("marshalling CentralSpec: %w", err) - } - newScannerBytes, err := json.Marshal(merged.Scanner) - if err != nil { - return fmt.Errorf("marshalling ScannerSpec: %w", err) - } - - request.Central = newCentralBytes - request.Scanner = newScannerBytes - request.ForceReconcile = merged.ForceReconcile - - return nil - -} - -// Update a Central instance. -func (h adminCentralHandler) Update(w http.ResponseWriter, r *http.Request) { - cfg := &handlers.HandlerConfig{ - Action: func() (i interface{}, serviceError *errors.ServiceError) { - id := mux.Vars(r)["id"] - ctx := r.Context() - centralRequest, svcErr := h.service.Get(ctx, id) - if svcErr != nil { - return nil, svcErr - } - - updateBytes, err := io.ReadAll(r.Body) - if err != nil { - return nil, errors.NewWithCause(errors.ErrorBadRequest, err, "Reading request body: %s", err.Error()) - } - - // unmarshal the update into a private.CentralUpdateRequest to ensure that it is well-formed - if err := json.Unmarshal(updateBytes, &private.CentralUpdateRequest{}); err != nil { - return nil, errors.NewWithCause(errors.ErrorBadRequest, err, "Unmarshalling request body: %s", err.Error()) - } - - err = updateCentralRequest(centralRequest, updateBytes) - if err != nil { - return nil, errors.NewWithCause(errors.ErrorBadRequest, err, "Updating CentralRequest: %s", err.Error()) - } - - svcErr = h.service.VerifyAndUpdateDinosaurAdmin(ctx, centralRequest) - if svcErr != nil { - return nil, svcErr - } - return presenters.PresentDinosaurRequestAdminEndpoint(centralRequest, h.accountService) - }, - } - handlers.Handle(w, r, cfg, http.StatusOK) -} - -func (h adminCentralHandler) SetCentralDefaultVersion(w http.ResponseWriter, r *http.Request) { - centralDefaultVersion := &private.CentralDefaultVersion{} - cfg := &handlers.HandlerConfig{ - MarshalInto: centralDefaultVersion, - Validate: []handlers.Validate{ - ValidateCentralDefaultVersion(centralDefaultVersion), - }, - Action: func() (interface{}, *errors.ServiceError) { - if err := h.centralDefaultVersionService.SetDefaultVersion(centralDefaultVersion.Version); err != nil { - return nil, errors.NewWithCause(errors.ErrorGeneral, err, "Set CentralDefaultVersion requests: %s", err.Error()) - } - - return nil, nil - }, - } - - handlers.Handle(w, r, cfg, http.StatusOK) -} - -func (h adminCentralHandler) GetCentralDefaultVersion(w http.ResponseWriter, r *http.Request) { - cfg := &handlers.HandlerConfig{ - Action: func() (interface{}, *errors.ServiceError) { - version, err := h.centralDefaultVersionService.GetDefaultVersion() - if err != nil { - return nil, errors.NewWithCause(errors.ErrorGeneral, err, "Get CentralDefaultVersion requests: %s", err.Error()) - } - return &private.CentralDefaultVersion{Version: version}, nil - }, - } - - handlers.Handle(w, r, cfg, http.StatusOK) -} - func (h adminCentralHandler) RotateSecrets(w http.ResponseWriter, r *http.Request) { cfg := &handlers.HandlerConfig{ Action: func() (i interface{}, serviceError *errors.ServiceError) { diff --git a/internal/dinosaur/pkg/handlers/admin_dinosaur_test.go b/internal/dinosaur/pkg/handlers/admin_dinosaur_test.go deleted file mode 100644 index 91ff0acd8f..0000000000 --- a/internal/dinosaur/pkg/handlers/admin_dinosaur_test.go +++ /dev/null @@ -1,225 +0,0 @@ -package handlers - -import ( - "encoding/json" - "testing" - - "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/dbapi" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func Test_updateCentralRequest(t *testing.T) { - tests := []struct { - name string - state string - patch string - wantCentral string - wantScanner string - wantForceReconcile string - wantErr func(t *testing.T, err error) - }{ - { - name: "empty update on empty central should have no effect", - state: `{}`, - patch: `{}`, - wantCentral: `{"resources":{}}`, - }, { - name: "empty update on defined central should have no effect", - state: `{"central":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}`, - patch: `{}`, - wantCentral: `{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}`, - }, { - name: "replacing central limits", - state: `{"central":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}`, - patch: `{"central":{"resources":{"limits":{"cpu":"2","memory":"2"}}}}`, - wantCentral: `{"resources":{"limits":{"cpu":"2","memory":"2"},"requests":{"cpu":"1","memory":"1"}}}`, - }, { - name: "replacing central limits when requests are not set", - state: `{"central":{"resources":{"limits":{"cpu":"1","memory":"1"}}}}`, - patch: `{"central":{"resources":{"limits":{"cpu":"2","memory":"2"}}}}`, - wantCentral: `{"resources":{"limits":{"cpu":"2","memory":"2"}}}`, - }, { - name: "replacing central CPU limits", - state: `{"central":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}`, - patch: `{"central":{"resources":{"limits":{"cpu":"2"}}}}`, - wantCentral: `{"resources":{"limits":{"cpu":"2","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}`, - }, { - name: "unsetting central CPU limits", - state: `{"central":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}`, - patch: `{"central":{"resources":{"limits":{"cpu":null}}}}`, - wantCentral: `{"resources":{"limits":{"memory":"1"},"requests":{"cpu":"1","memory":"1"}}}`, - }, { - name: "unsetting central limits", - state: `{"central":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}`, - patch: `{"central":{"resources":{"limits":null}}}`, - wantCentral: `{"resources":{"requests":{"cpu":"1","memory":"1"}}}`, - }, { - name: "unsetting central resources", - state: `{"central":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}`, - patch: `{"central":{"resources":null}}`, - wantCentral: `{"resources":{}}`, - }, { - name: "unsetting central altogether", - state: `{"central":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}`, - patch: `{"central":null}`, - wantCentral: `{"resources":{}}`, - }, { - name: "replacing central CPU limits when memory is not set", - state: `{"central":{"resources":{"limits":{"cpu":"1"}}}}`, - patch: `{"central":{"resources":{"limits":{"cpu":"2"}}}}`, - wantCentral: `{"resources":{"limits":{"cpu":"2"}}}`, - }, { - name: "replacing central CPU limits when CPU is not set", - state: `{"central":{"resources":{"limits":{"memory":"1"}}}}`, - patch: `{"central":{"resources":{"limits":{"cpu":"2"}}}}`, - wantCentral: `{"resources":{"limits":{"cpu":"2","memory":"1"}}}`, - }, { - name: "update with existing central", - state: `{"central":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}`, - patch: `{"central":{"resources":{"requests":{"cpu":"2","memory":"2"}}}}`, - wantCentral: `{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"2","memory":"2"}}}`, - }, { - name: "should ignore unknown fields", - state: `{"central":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}`, - patch: `{"central":{"resources":{"requests":{"cpu":"2","memory":"2"}},"unknown":{"foo":"bar"}}}`, - wantCentral: `{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"2","memory":"2"}}}`, - }, { - name: "empty update on empty scanner should have no effect", - state: `{"scanner":{}}`, - patch: `{}`, - wantScanner: `{"analyzer":{"resources":{},"scaling":{}},"db":{"resources":{}}}`, - }, { - name: "empty update on defined scanner should have no effect", - state: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}},"scaling":{"autoScaling":"Enabled","replicas":1,"minReplicas":1,"maxReplicas":1}},"db":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{}`, - wantScanner: `{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}},"scaling":{"autoScaling":"Enabled","replicas":1,"minReplicas":1,"maxReplicas":1}},"db":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}`, - }, { - name: "replacing scanner analyzer resources", - state: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":"2","memory":"2"}}}}}`, - wantScanner: `{"analyzer":{"resources":{"limits":{"cpu":"2","memory":"2"},"requests":{"cpu":"1","memory":"1"}},"scaling":{}},"db":{"resources":{}}}`, - }, { - name: "replacing scanner analyzer CPU resources", - state: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":"2"}}}}}`, - wantScanner: `{"analyzer":{"resources":{"limits":{"cpu":"2","memory":"1"},"requests":{"cpu":"1","memory":"1"}},"scaling":{}},"db":{"resources":{}}}`, - }, { - name: "replacing scanner analyzer memory resources", - state: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{"scanner":{"analyzer":{"resources":{"limits":{"memory":"2"}}}}}`, - wantScanner: `{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"2"},"requests":{"cpu":"1","memory":"1"}},"scaling":{}},"db":{"resources":{}}}`, - }, { - name: "replacing scanner analyzer requests", - state: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{"scanner":{"analyzer":{"resources":{"requests":{"cpu":"2","memory":"2"}}}}}`, - wantScanner: `{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"2","memory":"2"}},"scaling":{}},"db":{"resources":{}}}`, - }, { - name: "replacing scanner analyzer CPU requests", - state: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{"scanner":{"analyzer":{"resources":{"requests":{"cpu":"2"}}}}}`, - wantScanner: `{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"2","memory":"1"}},"scaling":{}},"db":{"resources":{}}}`, - }, { - name: "replacing scanner analyzer scaling", - state: `{"scanner":{"analyzer":{"scaling":{"autoScaling":"Enabled","replicas":1,"minReplicas":1,"maxReplicas":1}}}}`, - patch: `{"scanner":{"analyzer":{"scaling":{"autoScaling":"Disabled","replicas":2,"minReplicas":2,"maxReplicas":2}}}}`, - wantScanner: `{"analyzer":{"resources":{},"scaling":{"autoScaling":"Disabled","replicas":2,"minReplicas":2,"maxReplicas":2}},"db":{"resources":{}}}`, - }, { - name: "replacing scanner analyzer scaling replicas", - state: `{"scanner":{"analyzer":{"scaling":{"autoScaling":"Enabled","replicas":1,"minReplicas":1,"maxReplicas":1}}}}`, - patch: `{"scanner":{"analyzer":{"scaling":{"replicas":2}}}}`, - wantScanner: `{"analyzer":{"resources":{},"scaling":{"autoScaling":"Enabled","replicas":2,"minReplicas":1,"maxReplicas":1}},"db":{"resources":{}}}`, - }, { - name: "replacing scanner db", - state: `{"scanner":{"db":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{"scanner":{"db":{"resources":{"limits":{"cpu":"2","memory":"2"},"requests":{"cpu":"2","memory":"2"}}}}}`, - wantScanner: `{"analyzer":{"resources":{},"scaling":{}},"db":{"resources":{"limits":{"cpu":"2","memory":"2"},"requests":{"cpu":"2","memory":"2"}}}}`, - }, { - name: "replacing scanner db CPU request", - state: `{"scanner":{"db":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{"scanner":{"db":{"resources":{"limits":{"cpu":"2"}}}}}`, - wantScanner: `{"analyzer":{"resources":{},"scaling":{}},"db":{"resources":{"limits":{"cpu":"2","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}`, - }, { - name: "replacing scanner db requests", - state: `{"scanner":{"db":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{"scanner":{"db":{"resources":{"requests":{"cpu":"2","memory":"2"}}}}}`, - wantScanner: `{"analyzer":{"resources":{},"scaling":{}},"db":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"2","memory":"2"}}}}`, - }, { - name: "unset scanner analyzer resources", - state: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{"scanner":{"analyzer":{"resources":null}}}`, - wantScanner: `{"analyzer":{"resources":{},"scaling":{}},"db":{"resources":{}}}`, - }, { - name: "unset scanner analyzer scaling", - state: `{"scanner":{"analyzer":{"scaling":{"autoScaling":"Enabled","replicas":1,"minReplicas":1,"maxReplicas":1}}}}`, - patch: `{"scanner":{"analyzer":{"scaling":null}}}`, - wantScanner: `{"analyzer":{"resources":{},"scaling":{}},"db":{"resources":{}}}`, - }, { - name: "unset scanner db resources", - state: `{"scanner":{"db":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{"scanner":{"db":{"resources":null}}}`, - wantScanner: `{"analyzer":{"resources":{},"scaling":{}},"db":{"resources":{}}}`, - }, { - name: "unset scanner analyzer resources limits", - state: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{"scanner":{"analyzer":{"resources":{"limits":null}}}}`, - wantScanner: `{"analyzer":{"resources":{"requests":{"cpu":"1","memory":"1"}},"scaling":{}},"db":{"resources":{}}}`, - }, { - name: "replacing force_reconcile", - state: `{"force_reconcile":"foo"}`, - patch: `{"force_reconcile":"bar"}`, - wantForceReconcile: "bar", - }, { - name: "unsetting force_reconcile", - state: `{"force_reconcile":"foo"}`, - patch: `{"force_reconcile":null}`, - wantForceReconcile: "", - }, { - name: "setting force_reconcile to empty string", - state: `{"force_reconcile":"foo"}`, - patch: `{"force_reconcile":""}`, - wantForceReconcile: "", - }, { - name: "should fail if the patch is invalid json", - state: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `foo`, - wantErr: func(t *testing.T, err error) { - assert.Error(t, err) - }, - }, { - name: "should fail if the resource name is not cpu or memory", - state: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{"scanner":{"analyzer":{"resources":{"limits":{"foo":"1"}}}}}`, - wantErr: func(t *testing.T, err error) { - assert.Error(t, err) - }, - }, { - name: "should fail if the resource value is invalid", - state: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":"1","memory":"1"},"requests":{"cpu":"1","memory":"1"}}}}}`, - patch: `{"scanner":{"analyzer":{"resources":{"limits":{"cpu":foo}}}}}`, - wantErr: func(t *testing.T, err error) { - assert.Error(t, err) - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - var request *dbapi.CentralRequest - require.NoError(t, json.Unmarshal([]byte(tt.state), &request)) - err := updateCentralRequest(request, []byte(tt.patch)) - if tt.wantErr != nil { - tt.wantErr(t, err) - } else { - require.NoError(t, err) - if len(tt.wantScanner) > 0 { - assert.Equal(t, string(tt.wantScanner), string(request.Scanner)) - } - if len(tt.wantCentral) > 0 { - assert.Equal(t, string(tt.wantCentral), string(request.Central)) - } - - assert.Equal(t, tt.wantForceReconcile, request.ForceReconcile) - } - }) - } -} diff --git a/internal/dinosaur/pkg/handlers/dinosaur.go b/internal/dinosaur/pkg/handlers/dinosaur.go index 37f022dd51..4dd5a6b0a3 100644 --- a/internal/dinosaur/pkg/handlers/dinosaur.go +++ b/internal/dinosaur/pkg/handlers/dinosaur.go @@ -40,30 +40,6 @@ func NewDinosaurHandler(service services.DinosaurService, providerConfig *config } } -func validateCentralResourcesUnspecified(dinosaurRequest *public.CentralRequestPayload) handlers.Validate { - return func() *errors.ServiceError { - if len(dinosaurRequest.Central.Resources.Limits) > 0 || - len(dinosaurRequest.Central.Resources.Requests) > 0 { - return errors.Forbidden("not allowed to specify central resources") - } - return nil - } -} - -func validateScannerResourcesUnspecified(dinosaurRequest *public.CentralRequestPayload) handlers.Validate { - return func() *errors.ServiceError { - if len(dinosaurRequest.Scanner.Analyzer.Resources.Limits) > 0 || - len(dinosaurRequest.Scanner.Analyzer.Resources.Requests) > 0 { - return errors.Forbidden("not allowed to specify scanner analyzer resources") - } - if len(dinosaurRequest.Scanner.Db.Resources.Limits) > 0 || - len(dinosaurRequest.Scanner.Db.Resources.Requests) > 0 { - return errors.Forbidden("not allowed to specify scanner db resources") - } - return nil - } -} - // Create ... func (h dinosaurHandler) Create(w http.ResponseWriter, r *http.Request) { var centralRequest public.CentralRequestPayload @@ -80,8 +56,6 @@ func (h dinosaurHandler) Create(w http.ResponseWriter, r *http.Request) { ValidateDinosaurClaims(ctx, ¢ralRequest, convCentral), ValidateCloudProvider(&h.service, convCentral, h.providerConfig, "creating central requests"), handlers.ValidateMultiAZEnabled(¢ralRequest.MultiAz, "creating central requests"), - validateCentralResourcesUnspecified(¢ralRequest), - validateScannerResourcesUnspecified(¢ralRequest), }, Action: func() (interface{}, *errors.ServiceError) { // Set the central request as internal, **iff** the user agent used within the creation request is contained diff --git a/internal/dinosaur/pkg/handlers/validation.go b/internal/dinosaur/pkg/handlers/validation.go index cf068d6332..595cc31395 100644 --- a/internal/dinosaur/pkg/handlers/validation.go +++ b/internal/dinosaur/pkg/handlers/validation.go @@ -2,22 +2,18 @@ package handlers import ( "context" - "encoding/json" "fmt" "regexp" - "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/admin/private" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/dbapi" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/public" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/config" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/services" "github.com/stackrox/acs-fleet-manager/pkg/auth" "github.com/stackrox/acs-fleet-manager/pkg/errors" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - "github.com/stackrox/acs-fleet-manager/pkg/handlers" coreServices "github.com/stackrox/acs-fleet-manager/pkg/services" + corev1 "k8s.io/api/core/v1" ) var ( @@ -119,133 +115,6 @@ func ValidateDinosaurClaims(ctx context.Context, dinosaurRequestPayload *public. } } -func validateQuantity(qty string, path string) *errors.ServiceError { - if qty == "" { - return nil - } - _, err := resource.ParseQuantity(qty) - if err != nil { - return errors.Validation("invalid resources: failed to parse quantity %q at %s due to: %v", qty, path, err) - } - return nil -} - -// ValidateCentralSpec ... -func ValidateCentralSpec(ctx context.Context, centralRequestPayload *public.CentralRequestPayload, dbCentral *dbapi.CentralRequest) handlers.Validate { - return func() *errors.ServiceError { - // Validate Central resources. - err := validateResourceList(centralRequestPayload.Central.Resources.Requests, "central.resources.requests") - if err != nil { - return errors.Validation("invalid resource requests for Central: %v", err) - } - err = validateResourceList(centralRequestPayload.Central.Resources.Limits, "central.resources.limits") - if err != nil { - return errors.Validation("invalid resource limits for Central: %v", err) - } - - central, err := json.Marshal(centralRequestPayload.Central) - if err != nil { - return errors.Validation("marshaling Central spec failed: %v", err) - } - - if err := json.Unmarshal(central, &dbapi.CentralSpec{}); err != nil { - return errors.Validation("invalid value as Central spec: %v", err) - } - - dbCentral.Central = central - return nil - } -} - -func validateResourceList(resources map[string]string, path string) error { - for name, qty := range resources { - resourceName := corev1.ResourceName(name) - if resourceName != corev1.ResourceCPU && resourceName != corev1.ResourceMemory { - return errors.Validation("unsupported resource type %q in %s", name, path) - } - if qty == "" { - continue - } - _, err := resource.ParseQuantity(qty) - if err != nil { - return errors.Validation("invalid resources: failed to parse quantity %q at %s.%s due to: %v", qty, path, name, err) - } - } - return nil -} - -// ValidateScannerSpec ... -func ValidateScannerSpec(ctx context.Context, centralRequestPayload *public.CentralRequestPayload, dbCentral *dbapi.CentralRequest) handlers.Validate { - return func() *errors.ServiceError { - // Validate Scanner Analyzer resources and scaling settings. - err := validateResourceList(centralRequestPayload.Scanner.Analyzer.Resources.Requests, "scanner.analyzer.resources.requests") - if err != nil { - return errors.Validation("invalid resource requests for Scanner Analyzer: %v", err) - } - err = validateResourceList(centralRequestPayload.Scanner.Analyzer.Resources.Limits, "scanner.analyzer.resources.limits") - if err != nil { - return errors.Validation("invalid resource limits for Scanner Analyzer: %v", err) - } - - if centralRequestPayload.Scanner.Analyzer.Scaling.AutoScaling != "" && - centralRequestPayload.Scanner.Analyzer.Scaling.AutoScaling != "Enabled" && - centralRequestPayload.Scanner.Analyzer.Scaling.AutoScaling != "Disabled" { - return errors.Validation("invalid AutoScaling setting at Scanner.Analyzer.Scaling.AutoScaling, expected 'Enabled' or 'Disabled'") - } - - // Validate Scanner DB resources. - err = validateResourceList(centralRequestPayload.Scanner.Db.Resources.Requests, "scanner.db.resources.requests") - if err != nil { - return errors.Validation("invalid resource requests for Scanner DB: %v", err) - } - err = validateResourceList(centralRequestPayload.Scanner.Analyzer.Resources.Limits, "scanner.db.resources.limits") - if err != nil { - return errors.Validation("invalid resource limits for Scanner DB: %v", err) - } - - // Marshal ScannerSpec into byte string. - scanner, err := json.Marshal(centralRequestPayload.Scanner) - if err != nil { - return errors.Validation("marshaling Scanner spec failed: %v", err) - } - - if err := json.Unmarshal(scanner, &dbapi.ScannerSpec{}); err != nil { - return errors.Validation("invalid value as Scanner spec: %v", err) - } - - dbCentral.Scanner = scanner - return nil - } -} - -// ValidateScannerAnalyzerScaling validates the provided Scanner Analyzer Scaling configuration. -func ValidateScannerAnalyzerScaling(scaling *dbapi.ScannerAnalyzerScaling) error { - if scaling == nil { - return nil - } - - if scaling.AutoScaling != "Enabled" && scaling.AutoScaling != "Disabled" { - return fmt.Errorf("invalid scaling configuration: unknown AutoScaling %q, must be 'Enabled' or 'Disabled'", scaling.AutoScaling) - } - if scaling.MinReplicas <= 0 { - return fmt.Errorf("invalid scaling configuration: MinReplicas (%v) must be positive", scaling.MinReplicas) - } - if scaling.Replicas <= 0 { - return fmt.Errorf("invalid scaling configuration: Replicas (%v) must be positive", scaling.Replicas) - } - if scaling.MaxReplicas <= 0 { - return fmt.Errorf("invalid scaling configuration: MaxReplicas (%v) must be positive", scaling.MaxReplicas) - } - if scaling.Replicas < scaling.MinReplicas { - return fmt.Errorf("invalid scaling configuration: Replicas (%v) < MinReplicas (%v)", scaling.Replicas, scaling.MinReplicas) - } - if scaling.Replicas > scaling.MaxReplicas { - return fmt.Errorf("invalid scaling configuration: Replicas (%v) > MaxReplicas (%v)", scaling.Replicas, scaling.MaxReplicas) - } - - return nil -} - // validateResourceName checks if the given name denotes a supported resource. func validateResourceName(name corev1.ResourceName) (corev1.ResourceName, bool) { resourceName := name @@ -256,21 +125,3 @@ func validateResourceName(name corev1.ResourceName) (corev1.ResourceName, bool) } return "", false } - -// ValidateCentralDefaultVersion validates the given version -func ValidateCentralDefaultVersion(version *private.CentralDefaultVersion) handlers.Validate { - return validateCentralVersionString(version.Version) -} - -func validateCentralVersionString(version string) handlers.Validate { - return func() *errors.ServiceError { - - err := services.ValidateCentralVersionString(version) - if err != nil { - return errors.Validation("validating central version string: %s", err) - } - - return nil - } - -} diff --git a/internal/dinosaur/pkg/migrations/20230616000000_add_acs_operator_version.go b/internal/dinosaur/pkg/migrations/20230616000000_add_acs_operator_version.go index ecec020d7d..722767e0ad 100644 --- a/internal/dinosaur/pkg/migrations/20230616000000_add_acs_operator_version.go +++ b/internal/dinosaur/pkg/migrations/20230616000000_add_acs_operator_version.go @@ -8,7 +8,6 @@ package migrations import ( "fmt" "github.com/go-gormigrate/gormigrate/v2" - "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/dbapi" "github.com/stackrox/acs-fleet-manager/pkg/api" "github.com/stackrox/acs-fleet-manager/pkg/db" "gorm.io/gorm" @@ -52,6 +51,11 @@ func addOperatorImageFields() *gormigrate.Migration { Scanner api.JSON `json:"scanner"` OperatorImage string `json:"operator_image"` } + type CentralDefaultVersion struct { + ID uint64 + CreatedAt time.Time + Version string `json:"version"` + } migrationID := "20230616000000" return &gormigrate.Migration{ @@ -79,8 +83,7 @@ func addOperatorImageFields() *gormigrate.Migration { if err := dropIfColumnExists(tx, &CentralRequest{}, "central_upgrading"); err != nil { return err } - - if err := tx.Create(&dbapi.CentralDefaultVersion{Version: updatedDefaultVersion}).Error; err != nil { + if err := tx.Create(&CentralDefaultVersion{Version: updatedDefaultVersion}).Error; err != nil { return fmt.Errorf("migrating %s: %w", migrationID, err) } diff --git a/internal/dinosaur/pkg/migrations/20231026000000_remove_overrides.go b/internal/dinosaur/pkg/migrations/20231026000000_remove_overrides.go new file mode 100644 index 0000000000..5ab6c989cd --- /dev/null +++ b/internal/dinosaur/pkg/migrations/20231026000000_remove_overrides.go @@ -0,0 +1,52 @@ +package migrations + +// Migrations should NEVER use types from other packages. Types can change +// and then migrations run on a _new_ database will fail or behave unexpectedly. +// Instead of importing types, always re-create the type in the migration, as +// is done here, even though the same type is defined in pkg/api + +import ( + "github.com/go-gormigrate/gormigrate/v2" + "github.com/stackrox/acs-fleet-manager/pkg/api" + "gorm.io/gorm" +) + +func removeCentralAndScannerOverrides() *gormigrate.Migration { + type CentralRequest struct { + api.Meta + ForceReconcile string `json:"force_reconcile"` + Central api.JSON `json:"central"` + Scanner api.JSON `json:"scanner"` + OperatorImage string `json:"operator_image"` + } + + migrationID := "20231026000000" + + return &gormigrate.Migration{ + ID: migrationID, + Migrate: func(tx *gorm.DB) error { + if err := dropIfColumnExists(tx, &CentralRequest{}, "force_reconcile"); err != nil { + return err + } + if err := dropIfColumnExists(tx, &CentralRequest{}, "central"); err != nil { + return err + } + if err := dropIfColumnExists(tx, &CentralRequest{}, "scanner"); err != nil { + return err + } + return dropIfColumnExists(tx, &CentralRequest{}, "operator_image") + }, + Rollback: func(tx *gorm.DB) error { + if err := addColumnIfNotExists(tx, &CentralRequest{}, "force_reconcile"); err != nil { + return err + } + if err := addColumnIfNotExists(tx, &CentralRequest{}, "central"); err != nil { + return err + } + if err := addColumnIfNotExists(tx, &CentralRequest{}, "scanner"); err != nil { + return err + } + return addColumnIfNotExists(tx, &CentralRequest{}, "operator_image") + }, + } +} diff --git a/internal/dinosaur/pkg/migrations/migrations.go b/internal/dinosaur/pkg/migrations/migrations.go index fff67c8476..f37a2d6ac3 100644 --- a/internal/dinosaur/pkg/migrations/migrations.go +++ b/internal/dinosaur/pkg/migrations/migrations.go @@ -48,6 +48,7 @@ func getMigrations() []*gormigrate.Migration { addOperatorImageFields(), removeAvailableOperatorField(), addSecretFieldToCentralRequests(), + removeCentralAndScannerOverrides(), } } diff --git a/internal/dinosaur/pkg/presenters/admin_dinosaur.go b/internal/dinosaur/pkg/presenters/admin_dinosaur.go index f114f84bde..6f8a42333f 100644 --- a/internal/dinosaur/pkg/presenters/admin_dinosaur.go +++ b/internal/dinosaur/pkg/presenters/admin_dinosaur.go @@ -2,67 +2,30 @@ package presenters import ( - "encoding/json" "fmt" - "github.com/golang/glog" admin "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/admin/private" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/api/dbapi" - "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/converters" "github.com/stackrox/acs-fleet-manager/pkg/errors" "github.com/stackrox/acs-fleet-manager/pkg/services/account" ) // PresentDinosaurRequestAdminEndpoint presents a dbapi.CentralRequest as an admin.Dinosaur. func PresentDinosaurRequestAdminEndpoint(request *dbapi.CentralRequest, _ account.AccountService) (*admin.Central, *errors.ServiceError) { - var adminCentral admin.CentralSpec - var adminScanner admin.ScannerSpec - - if len(request.Central) > 0 { - var central dbapi.CentralSpec - if err := json.Unmarshal(request.Central, ¢ral); err != nil { - // Assuming here that what is in the DB is guaranteed to conform to the expected schema. - glog.Errorf("Failed to unmarshal Central spec %q: %v", request.Central, err) - } - adminCentral = admin.CentralSpec{ - Resources: converters.ConvertCoreV1ResourceRequirementsToAdmin(¢ral.Resources), - } - } - - if len(request.Scanner) > 0 { - var scanner dbapi.ScannerSpec - if err := json.Unmarshal(request.Scanner, &scanner); err != nil { - // Assuming here that what is in the DB is guaranteed to conform to the expected schema. - glog.Errorf("Failed to unmarshal Scanner spec %q: %v", request.Scanner, err) - } - adminScanner = admin.ScannerSpec{ - Analyzer: admin.ScannerSpecAnalyzer{ - Resources: converters.ConvertCoreV1ResourceRequirementsToAdmin(&scanner.Analyzer.Resources), - Scaling: admin.ScannerSpecAnalyzerScaling(scanner.Analyzer.Scaling), - }, - Db: admin.ScannerSpecDb{ - Resources: converters.ConvertCoreV1ResourceRequirementsToAdmin(&scanner.Db.Resources), - }, - } - } - return &admin.Central{ - Id: request.ID, - Kind: "CentralRequest", - Href: fmt.Sprintf("/api/rhacs/v1/centrals/%s", request.ID), - Status: request.Status, - CloudProvider: request.CloudProvider, - MultiAz: request.MultiAZ, - Region: request.Region, - Owner: request.Owner, - Name: request.Name, - Host: request.GetUIHost(), // TODO(ROX-11990): Split the Host in Fleet Manager Public API to UI and Data hosts - CreatedAt: request.CreatedAt, - UpdatedAt: request.UpdatedAt, - FailedReason: request.FailedReason, - InstanceType: request.InstanceType, - Central: adminCentral, - Scanner: adminScanner, - ForceReconcile: request.ForceReconcile, + Id: request.ID, + Kind: "CentralRequest", + Href: fmt.Sprintf("/api/rhacs/v1/centrals/%s", request.ID), + Status: request.Status, + CloudProvider: request.CloudProvider, + MultiAz: request.MultiAZ, + Region: request.Region, + Owner: request.Owner, + Name: request.Name, + Host: request.GetUIHost(), // TODO(ROX-11990): Split the Host in Fleet Manager Public API to UI and Data hosts + CreatedAt: request.CreatedAt, + UpdatedAt: request.UpdatedAt, + FailedReason: request.FailedReason, + InstanceType: request.InstanceType, }, nil } diff --git a/internal/dinosaur/pkg/presenters/managedcentral.go b/internal/dinosaur/pkg/presenters/managedcentral.go index f5e5b6e21b..836150c2fd 100644 --- a/internal/dinosaur/pkg/presenters/managedcentral.go +++ b/internal/dinosaur/pkg/presenters/managedcentral.go @@ -1,7 +1,6 @@ package presenters import ( - "encoding/json" "fmt" "sort" "time" @@ -11,9 +10,7 @@ import ( "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/pkg/config" - "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/defaults" "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/gitops" - corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" "sigs.k8s.io/yaml" ) @@ -34,29 +31,6 @@ func NewManagedCentralPresenter(config *config.CentralConfig, gitopsService gito // PresentManagedCentral converts DB representation of Central to the private API representation func (c *ManagedCentralPresenter) PresentManagedCentral(from *dbapi.CentralRequest) (private.ManagedCentral, error) { - var central dbapi.CentralSpec - var scanner dbapi.ScannerSpec - - if len(from.Central) > 0 { - err := json.Unmarshal(from.Central, ¢ral) - if err != nil { - // In case of a JSON unmarshaling problem we don't interrupt the complete workflow, instead we drop the resources - // specification as a way of defensive programing. - // TOOD: return error? - glog.Errorf("Failed to unmarshal Central specification for Central request %q/%s: %v", from.Name, from.ClusterID, err) - glog.Errorf("Ignoring Central specification for Central request %q/%s", from.Name, from.ClusterID) - } - } - if len(from.Scanner) > 0 { - err := json.Unmarshal(from.Scanner, &scanner) - if err != nil { - // In case of a JSON unmarshaling problem we don't interrupt the complete workflow, instead we drop the resources - // specification as a way of defensive programing. - // TOOD: return error? - glog.Errorf("Failed to unmarshal Scanner specification for Central request %q/%s: %v", from.Name, from.ClusterID, err) - glog.Errorf("Ignoring Scanner specification for Central request %q/%s", from.Name, from.ClusterID) - } - } centralCR, err := c.gitopsService.GetCentral(centralParamsFromRequest(from)) if err != nil { @@ -104,57 +78,10 @@ func (c *ManagedCentralPresenter) PresentManagedCentral(from *dbapi.CentralReque DataEndpoint: private.ManagedCentralAllOfSpecDataEndpoint{ Host: from.GetDataHost(), }, - OperatorImage: from.OperatorImage, - Central: private.ManagedCentralAllOfSpecCentral{ - InstanceType: from.InstanceType, - Resources: private.ResourceRequirements{ - Requests: map[string]string{ - corev1.ResourceCPU.String(): orDefaultQty(central.Resources.Requests[corev1.ResourceCPU], defaults.Central.CPURequest).String(), - corev1.ResourceMemory.String(): orDefaultQty(central.Resources.Requests[corev1.ResourceMemory], defaults.Central.MemoryRequest).String(), - }, - Limits: map[string]string{ - corev1.ResourceCPU.String(): orDefaultQty(central.Resources.Limits[corev1.ResourceCPU], defaults.Central.CPULimit).String(), - corev1.ResourceMemory.String(): orDefaultQty(central.Resources.Limits[corev1.ResourceMemory], defaults.Central.MemoryLimit).String(), - }, - }, - }, - Scanner: private.ManagedCentralAllOfSpecScanner{ - Analyzer: private.ManagedCentralAllOfSpecScannerAnalyzer{ - Scaling: private.ManagedCentralAllOfSpecScannerAnalyzerScaling{ - AutoScaling: orDefaultString(scanner.Analyzer.Scaling.AutoScaling, defaults.Scanner.Analyzer.AutoScaling), - Replicas: orDefaultInt32(scanner.Analyzer.Scaling.Replicas, defaults.Scanner.Analyzer.Replicas), - MinReplicas: orDefaultInt32(scanner.Analyzer.Scaling.MinReplicas, defaults.Scanner.Analyzer.MinReplicas), - MaxReplicas: orDefaultInt32(scanner.Analyzer.Scaling.MaxReplicas, defaults.Scanner.Analyzer.MaxReplicas), - }, - Resources: private.ResourceRequirements{ - Requests: map[string]string{ - corev1.ResourceCPU.String(): orDefaultQty(scanner.Analyzer.Resources.Requests[corev1.ResourceCPU], defaults.Scanner.Analyzer.CPURequest).String(), - corev1.ResourceMemory.String(): orDefaultQty(scanner.Analyzer.Resources.Requests[corev1.ResourceMemory], defaults.Scanner.Analyzer.MemoryRequest).String(), - }, - Limits: map[string]string{ - corev1.ResourceCPU.String(): orDefaultQty(scanner.Analyzer.Resources.Limits[corev1.ResourceCPU], defaults.Scanner.Analyzer.CPULimit).String(), - corev1.ResourceMemory.String(): orDefaultQty(scanner.Analyzer.Resources.Limits[corev1.ResourceMemory], defaults.Scanner.Analyzer.MemoryLimit).String(), - }, - }, - }, - Db: private.ManagedCentralAllOfSpecScannerDb{ - Host: "dbhost.rhacs-psql-instance", - Resources: private.ResourceRequirements{ - Requests: map[string]string{ - corev1.ResourceCPU.String(): orDefaultQty(scanner.Db.Resources.Requests[corev1.ResourceCPU], defaults.Scanner.Db.CPURequest).String(), - corev1.ResourceMemory.String(): orDefaultQty(scanner.Db.Resources.Requests[corev1.ResourceMemory], defaults.Scanner.Db.MemoryRequest).String(), - }, - Limits: map[string]string{ - corev1.ResourceCPU.String(): orDefaultQty(scanner.Db.Resources.Limits[corev1.ResourceCPU], defaults.Scanner.Db.CPULimit).String(), - corev1.ResourceMemory.String(): orDefaultQty(scanner.Db.Resources.Limits[corev1.ResourceMemory], defaults.Scanner.Db.MemoryLimit).String(), - }, - }, - }, - }, CentralCRYAML: string(centralYaml), + InstanceType: from.InstanceType, }, - RequestStatus: from.Status, - ForceReconcile: from.ForceReconcile, + RequestStatus: from.Status, } if from.DeletionTimestamp != nil { diff --git a/internal/dinosaur/pkg/routes/route_loader.go b/internal/dinosaur/pkg/routes/route_loader.go index 747254d63b..71a1a31981 100644 --- a/internal/dinosaur/pkg/routes/route_loader.go +++ b/internal/dinosaur/pkg/routes/route_loader.go @@ -41,18 +41,17 @@ type options struct { IAMConfig *iam.IAMConfig CentralRequestConfig *config.CentralRequestConfig - AMSClient ocm.AMSClient - Central services.DinosaurService - CentralDefaultVersionService services.CentralDefaultVersionService - CloudProviders services.CloudProvidersService - Observatorium services.ObservatoriumService - IAM sso.IAMService - DataPlaneCluster services.DataPlaneClusterService - DataPlaneCentralService services.DataPlaneCentralService - AccountService account.AccountService - AuthService authorization.Authorization - DB *db.ConnectionFactory - Telemetry *services.Telemetry + AMSClient ocm.AMSClient + Central services.DinosaurService + CloudProviders services.CloudProvidersService + Observatorium services.ObservatoriumService + IAM sso.IAMService + DataPlaneCluster services.DataPlaneClusterService + DataPlaneCentralService services.DataPlaneCentralService + AccountService account.AccountService + AuthService authorization.Authorization + DB *db.ConnectionFactory + Telemetry *services.Telemetry AccessControlListMiddleware *acl.AccessControlListMiddleware AccessControlListConfig *acl.AccessControlListConfig @@ -227,7 +226,7 @@ func (s *options) buildAPIBaseRouter(mainRouter *mux.Router, basePath string, op auth.UseFleetShardAuthorizationMiddleware(apiV1DataPlaneRequestsRouter, s.IAMConfig.RedhatSSORealm.ValidIssuerURI, s.FleetShardAuthZConfig) - adminCentralHandler := handlers.NewAdminCentralHandler(s.Central, s.AccountService, s.ProviderConfig, s.Telemetry, s.CentralDefaultVersionService) + adminCentralHandler := handlers.NewAdminCentralHandler(s.Central, s.AccountService, s.ProviderConfig, s.Telemetry) adminRouter := apiV1Router.PathPrefix("/admin").Subrouter() adminRouter.Use(auth.NewRequireIssuerMiddleware().RequireIssuer( @@ -241,13 +240,6 @@ func (s *options) buildAPIBaseRouter(mainRouter *mux.Router, basePath string, op Name(logger.NewLogEvent("admin-db-delete-central", "[admin] delete central by id").ToString()). Methods(http.MethodDelete) - adminCentralsRouter.HandleFunc("/default-version", adminCentralHandler.SetCentralDefaultVersion). - Name(logger.NewLogEvent("admin-set-centrals-default-version", "[admin] set centrals default version").ToString()). - Methods(http.MethodPost) - adminCentralsRouter.HandleFunc("/default-version", adminCentralHandler.GetCentralDefaultVersion). - Name(logger.NewLogEvent("admin-get-centrals-default-version", "[admin] get centrals default version").ToString()). - Methods(http.MethodGet) - adminCentralsRouter.HandleFunc("", adminCentralHandler.List). Name(logger.NewLogEvent("admin-list-centrals", "[admin] list all centrals").ToString()). Methods(http.MethodGet) @@ -257,9 +249,6 @@ func (s *options) buildAPIBaseRouter(mainRouter *mux.Router, basePath string, op adminCentralsRouter.HandleFunc("/{id}", adminCentralHandler.Delete). Name(logger.NewLogEvent("admin-delete-central", "[admin] delete central by id").ToString()). Methods(http.MethodDelete) - adminCentralsRouter.HandleFunc("/{id}", adminCentralHandler.Update). - Name(logger.NewLogEvent("admin-update-central", "[admin] update central by id").ToString()). - Methods(http.MethodPatch) adminCentralsRouter.HandleFunc("/{id}/restore", adminCentralHandler.Restore). Name(logger.NewLogEvent("admin-restore-central", "[admin] restore central by id").ToString()). Methods(http.MethodPost) diff --git a/internal/dinosaur/pkg/services/central_default_version.go b/internal/dinosaur/pkg/services/central_default_version.go deleted file mode 100644 index f870668bd9..0000000000 --- a/internal/dinosaur/pkg/services/central_default_version.go +++ /dev/null @@ -1,126 +0,0 @@ -package services - -import ( - "fmt" - "os" - "strings" - - "github.com/golang/glog" - "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/db" - "github.com/stackrox/acs-fleet-manager/pkg/environments" - "gorm.io/gorm" -) - -var allowedVersionPrefixes = []string{ - "quay.io/rhacs-eng", - "registry.redhat.io/advanced-cluster-security", - "quay.io/stackrox-io", -} - -var osExit = func(code int) { - os.Exit(code) -} - -// CentralDefaultVersionService defines methods for managing -// CentralDefaultVersion values through API and on startup of fleet-manager -// -//go:generate moq -out central_default_version_moq.go . CentralDefaultVersionService -type CentralDefaultVersionService interface { - environments.BootService - SetDefaultVersion(string) error - GetDefaultVersion() (string, error) -} - -type centralDefaultVersionService struct { - connectionFactory *db.ConnectionFactory - centralConfig *config.CentralConfig -} - -// Start sets the central default version in the database -// to the version string specified by the configuration -func (c *centralDefaultVersionService) Start() { - if c.centralConfig.CentralDefaultVersion == "" { - return - } - - if err := ValidateCentralVersionString(c.centralConfig.CentralDefaultVersion); err != nil { - glog.Errorf("validating central default version: %s with error: %s, shutting down...", c.centralConfig.CentralDefaultVersion, err) - osExit(1) - return - } - - if err := c.SetDefaultVersion(c.centralConfig.CentralDefaultVersion); err != nil { - glog.Errorf("setting central default version to: %s: %s, shutting down...", c.centralConfig.CentralDefaultVersion, err) - osExit(1) - } - - glog.Info("set central default version to: ", c.centralConfig.CentralDefaultVersion) - -} - -// Stop is a noop function implemented to satisfy environments.BootService interface -func (c *centralDefaultVersionService) Stop() {} - -func (c *centralDefaultVersionService) SetDefaultVersion(version string) error { - dbConn := c.connectionFactory.New() - - versionEntry := &dbapi.CentralDefaultVersion{Version: version} - - currentVersion, err := queryCurrentDefaultVersion(dbConn) - if err != nil { - return err - } - - if currentVersion == version { - return nil - } - - if err := dbConn.Create(versionEntry).Error; err != nil { - return fmt.Errorf("failed creating central default version entry: %s", err) - } - - return nil -} - -func (c *centralDefaultVersionService) GetDefaultVersion() (string, error) { - dbConn := c.connectionFactory.New() - return queryCurrentDefaultVersion(dbConn) -} - -func queryCurrentDefaultVersion(dbConn *gorm.DB) (string, error) { - defaultVersion := &dbapi.CentralDefaultVersion{} - if err := dbConn.Order("id DESC").First(defaultVersion).Error; err != nil { - return "", fmt.Errorf("failed getting central default version: %s", err) - } - - return defaultVersion.Version, nil -} - -// ValidateCentralVersionString validates if the given version is allowed to be stored -func ValidateCentralVersionString(version string) error { - if !isAllowedVersion(version) { - return fmt.Errorf("version: %s does not match one of the allowed version prefixes: %s", version, allowedVersionPrefixes) - } - - return nil -} - -func isAllowedVersion(version string) bool { - for _, v := range allowedVersionPrefixes { - if strings.HasPrefix(version, v) { - return true - } - } - - return false -} - -// NewCentralDefaultVersionService return a new instance of a CentralDefaultVersionService -func NewCentralDefaultVersionService(connectionFactory *db.ConnectionFactory, centralConfig *config.CentralConfig) CentralDefaultVersionService { - return ¢ralDefaultVersionService{ - connectionFactory: connectionFactory, - centralConfig: centralConfig, - } -} diff --git a/internal/dinosaur/pkg/services/central_default_version_moq.go b/internal/dinosaur/pkg/services/central_default_version_moq.go deleted file mode 100644 index a61de0ab0c..0000000000 --- a/internal/dinosaur/pkg/services/central_default_version_moq.go +++ /dev/null @@ -1,185 +0,0 @@ -// Code generated by moq; DO NOT EDIT. -// github.com/matryer/moq - -package services - -import ( - "sync" -) - -// Ensure, that CentralDefaultVersionServiceMock does implement CentralDefaultVersionService. -// If this is not the case, regenerate this file with moq. -var _ CentralDefaultVersionService = &CentralDefaultVersionServiceMock{} - -// CentralDefaultVersionServiceMock is a mock implementation of CentralDefaultVersionService. -// -// func TestSomethingThatUsesCentralDefaultVersionService(t *testing.T) { -// -// // make and configure a mocked CentralDefaultVersionService -// mockedCentralDefaultVersionService := &CentralDefaultVersionServiceMock{ -// GetDefaultVersionFunc: func() (string, error) { -// panic("mock out the GetDefaultVersion method") -// }, -// SetDefaultVersionFunc: func(s string) error { -// panic("mock out the SetDefaultVersion method") -// }, -// StartFunc: func() { -// panic("mock out the Start method") -// }, -// StopFunc: func() { -// panic("mock out the Stop method") -// }, -// } -// -// // use mockedCentralDefaultVersionService in code that requires CentralDefaultVersionService -// // and then make assertions. -// -// } -type CentralDefaultVersionServiceMock struct { - // GetDefaultVersionFunc mocks the GetDefaultVersion method. - GetDefaultVersionFunc func() (string, error) - - // SetDefaultVersionFunc mocks the SetDefaultVersion method. - SetDefaultVersionFunc func(s string) error - - // StartFunc mocks the Start method. - StartFunc func() - - // StopFunc mocks the Stop method. - StopFunc func() - - // calls tracks calls to the methods. - calls struct { - // GetDefaultVersion holds details about calls to the GetDefaultVersion method. - GetDefaultVersion []struct { - } - // SetDefaultVersion holds details about calls to the SetDefaultVersion method. - SetDefaultVersion []struct { - // S is the s argument value. - S string - } - // Start holds details about calls to the Start method. - Start []struct { - } - // Stop holds details about calls to the Stop method. - Stop []struct { - } - } - lockGetDefaultVersion sync.RWMutex - lockSetDefaultVersion sync.RWMutex - lockStart sync.RWMutex - lockStop sync.RWMutex -} - -// GetDefaultVersion calls GetDefaultVersionFunc. -func (mock *CentralDefaultVersionServiceMock) GetDefaultVersion() (string, error) { - if mock.GetDefaultVersionFunc == nil { - panic("CentralDefaultVersionServiceMock.GetDefaultVersionFunc: method is nil but CentralDefaultVersionService.GetDefaultVersion was just called") - } - callInfo := struct { - }{} - mock.lockGetDefaultVersion.Lock() - mock.calls.GetDefaultVersion = append(mock.calls.GetDefaultVersion, callInfo) - mock.lockGetDefaultVersion.Unlock() - return mock.GetDefaultVersionFunc() -} - -// GetDefaultVersionCalls gets all the calls that were made to GetDefaultVersion. -// Check the length with: -// -// len(mockedCentralDefaultVersionService.GetDefaultVersionCalls()) -func (mock *CentralDefaultVersionServiceMock) GetDefaultVersionCalls() []struct { -} { - var calls []struct { - } - mock.lockGetDefaultVersion.RLock() - calls = mock.calls.GetDefaultVersion - mock.lockGetDefaultVersion.RUnlock() - return calls -} - -// SetDefaultVersion calls SetDefaultVersionFunc. -func (mock *CentralDefaultVersionServiceMock) SetDefaultVersion(s string) error { - if mock.SetDefaultVersionFunc == nil { - panic("CentralDefaultVersionServiceMock.SetDefaultVersionFunc: method is nil but CentralDefaultVersionService.SetDefaultVersion was just called") - } - callInfo := struct { - S string - }{ - S: s, - } - mock.lockSetDefaultVersion.Lock() - mock.calls.SetDefaultVersion = append(mock.calls.SetDefaultVersion, callInfo) - mock.lockSetDefaultVersion.Unlock() - return mock.SetDefaultVersionFunc(s) -} - -// SetDefaultVersionCalls gets all the calls that were made to SetDefaultVersion. -// Check the length with: -// -// len(mockedCentralDefaultVersionService.SetDefaultVersionCalls()) -func (mock *CentralDefaultVersionServiceMock) SetDefaultVersionCalls() []struct { - S string -} { - var calls []struct { - S string - } - mock.lockSetDefaultVersion.RLock() - calls = mock.calls.SetDefaultVersion - mock.lockSetDefaultVersion.RUnlock() - return calls -} - -// Start calls StartFunc. -func (mock *CentralDefaultVersionServiceMock) Start() { - if mock.StartFunc == nil { - panic("CentralDefaultVersionServiceMock.StartFunc: method is nil but CentralDefaultVersionService.Start was just called") - } - callInfo := struct { - }{} - mock.lockStart.Lock() - mock.calls.Start = append(mock.calls.Start, callInfo) - mock.lockStart.Unlock() - mock.StartFunc() -} - -// StartCalls gets all the calls that were made to Start. -// Check the length with: -// -// len(mockedCentralDefaultVersionService.StartCalls()) -func (mock *CentralDefaultVersionServiceMock) StartCalls() []struct { -} { - var calls []struct { - } - mock.lockStart.RLock() - calls = mock.calls.Start - mock.lockStart.RUnlock() - return calls -} - -// Stop calls StopFunc. -func (mock *CentralDefaultVersionServiceMock) Stop() { - if mock.StopFunc == nil { - panic("CentralDefaultVersionServiceMock.StopFunc: method is nil but CentralDefaultVersionService.Stop was just called") - } - callInfo := struct { - }{} - mock.lockStop.Lock() - mock.calls.Stop = append(mock.calls.Stop, callInfo) - mock.lockStop.Unlock() - mock.StopFunc() -} - -// StopCalls gets all the calls that were made to Stop. -// Check the length with: -// -// len(mockedCentralDefaultVersionService.StopCalls()) -func (mock *CentralDefaultVersionServiceMock) StopCalls() []struct { -} { - var calls []struct { - } - mock.lockStop.RLock() - calls = mock.calls.Stop - mock.lockStop.RUnlock() - return calls -} diff --git a/internal/dinosaur/pkg/services/central_default_version_test.go b/internal/dinosaur/pkg/services/central_default_version_test.go deleted file mode 100644 index 2e0e4bc924..0000000000 --- a/internal/dinosaur/pkg/services/central_default_version_test.go +++ /dev/null @@ -1,268 +0,0 @@ -package services - -import ( - "fmt" - "testing" - - gomocket "github.com/selvatico/go-mocket" - "github.com/stackrox/acs-fleet-manager/internal/dinosaur/pkg/config" - "github.com/stackrox/acs-fleet-manager/pkg/db" -) - -// dbMock is a function that sets up db mocks and return a function to validate if the mocks were called properly -type dbMock func() (validate func() error) - -func TestSetDefaultVersion(t *testing.T) { - connectionFactory := db.NewMockConnectionFactory(nil) - - tests := []struct { - name string - versionInput string - setupdbMock dbMock - wantErr bool - }{ - { - name: "returns select errors", - versionInput: "quay.io/rhacs-eng/stackrox-operator:3.73.3", - setupdbMock: func() (validate func() error) { - gomocket.Catcher.Reset().NewMock().WithQuery(`SELECT`).WithError(fmt.Errorf("database error")) - return nil - }, - wantErr: true, - }, - { - name: "return no error and does not call create for version string equals returned version string", - versionInput: "quay.io/rhacs-eng/stackrox-operator:3.73.3", - setupdbMock: func() (validate func() error) { - res := []map[string]interface{}{ - { - "id": 2, - "version": "quay.io/rhacs-eng/stackrox-operator:3.73.3", - }, - } - gomocket.Catcher.Reset().NewMock().WithQuery(`SELECT`).WithReply(res) - createMock := gomocket.Catcher.NewMock().WithQuery(`INSERT INTO "central_default_versions`) - return func() error { - if createMock.Triggered == true { - return fmt.Errorf("expected Create to not be triggered, but it was") - } - return nil - } - }, - wantErr: false, - }, - { - name: "returns Create errors", - versionInput: "quay.io/rhacs-eng/stackrox-operator:3.73.3", - setupdbMock: func() (validate func() error) { - res := []map[string]interface{}{ - { - "id": 2, - "version": "quay.io/rhacs-eng/stackrox-operator:3.73.2", - }, - } - gomocket.Catcher.Reset().NewMock().WithQuery(`SELECT`).WithReply(res) - gomocket.Catcher.NewMock().WithQuery(`INSERT INTO "central_default_versions"`).WithError(fmt.Errorf("database error")) - return nil - }, - wantErr: true, - }, - { - name: "calls Create for new version string", - versionInput: "quay.io/rhacs-eng/stackrox-operator:3.73.3", - setupdbMock: func() (validate func() error) { - res := []map[string]interface{}{ - { - "id": 2, - "version": "quay.io/rhacs-eng/stackrox-operator:3.73.2", - }, - } - gomocket.Catcher.Reset().NewMock().WithQuery(`SELECT`).WithReply(res) - createMock := gomocket.Catcher.NewMock().WithQuery(`INSERT INTO "central_default_versions"`) - return func() error { - if createMock.Triggered == false { - return fmt.Errorf("expected Create to be called, but was not") - } - return nil - } - }, - wantErr: false, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - var validateDbQueries func() error - if tc.setupdbMock != nil { - validateDbQueries = tc.setupdbMock() - } - - versionService := NewCentralDefaultVersionService(connectionFactory, nil) - - err := versionService.SetDefaultVersion(tc.versionInput) - - if (err != nil) != tc.wantErr { - t.Fatalf("SetDefaultVersion error = %v, wantErr = %v", err, tc.wantErr) - return - } - - if validateDbQueries != nil { - err := validateDbQueries() - if err != nil { - t.Fatalf("error validating db queries: %s", err) - } - } - }) - } -} - -func TestGetDefaultVersion(t *testing.T) { - connectionFactory := db.NewMockConnectionFactory(nil) - - tests := []struct { - name string - expectedVersion string - setupdbMock dbMock - wantErr bool - }{ - { - name: "returns select errors", - expectedVersion: "", - setupdbMock: func() (validate func() error) { - gomocket.Catcher.Reset().NewMock().WithQuery(`SELECT`).WithError(fmt.Errorf("database error")) - return nil - }, - wantErr: true, - }, - { - name: "returns version returned by db", - expectedVersion: "quay.io/rhacs-eng/stackrox-operator:3.73.3", - setupdbMock: func() (validate func() error) { - res := []map[string]interface{}{ - { - "id": 2, - "version": "quay.io/rhacs-eng/stackrox-operator:3.73.3", - }, - } - gomocket.Catcher.Reset().NewMock().WithQuery(`SELECT`).WithReply(res) - return nil - }, - wantErr: false, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - var validateDbQueries func() error - if tc.setupdbMock != nil { - validateDbQueries = tc.setupdbMock() - } - - versionService := NewCentralDefaultVersionService(connectionFactory, nil) - - version, err := versionService.GetDefaultVersion() - - if (err != nil) != tc.wantErr { - t.Fatalf("GetDefaultVersion error = %v, wantErr = %v", err, tc.wantErr) - return - } - - if tc.expectedVersion != version { - t.Fatalf("expected GetDefaultVersion to return %s, got %s", tc.expectedVersion, version) - } - - if validateDbQueries != nil { - err := validateDbQueries() - if err != nil { - t.Fatalf("error validating db queries: %s", err) - } - } - }) - } -} - -func TestServiceStart(t *testing.T) { - connectionFactory := db.NewMockConnectionFactory(nil) - - tests := []struct { - name string - inputConfig config.CentralConfig - setupdbMock dbMock - wantExit bool - }{ - { - name: "exit for validation error", - inputConfig: config.CentralConfig{ - CentralDefaultVersion: "wrong.registry/rhacs-eng/stackrox-operator:3.73.3", - }, - wantExit: true, - }, - { - name: "exit for db errors", - inputConfig: config.CentralConfig{ - CentralDefaultVersion: "quay.io/rhacs-eng/stackrox-operator:3.73.3", - }, - setupdbMock: func() (validate func() error) { - gomocket.Catcher.Reset().NewMock().WithQuery("SELECT").WithError(fmt.Errorf("database error")) - return nil - }, - wantExit: true, - }, - { - name: "calls Create for valid version", - inputConfig: config.CentralConfig{ - CentralDefaultVersion: "quay.io/rhacs-eng/stackrox-operator:3.73.3", - }, - setupdbMock: func() (validate func() error) { - res := []map[string]interface{}{ - { - "id": 2, - "version": "quay.io/rhacs-eng/stackrox-operator:3.73.2", - }, - } - gomocket.Catcher.Reset().NewMock().WithQuery("SELECT").WithReply(res) - createMock := gomocket.Catcher.NewMock().WithQuery("INSERT INTO") - return func() error { - if !createMock.Triggered { - return fmt.Errorf("expected Create to be triggered, but was not") - } - return nil - } - }, - wantExit: false, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - exitCalled := false - oldOsExit := osExit - osExit = func(code int) { - exitCalled = true - } - defer func() { - osExit = oldOsExit - }() - - var validateDbQueries func() error - if tc.setupdbMock != nil { - validateDbQueries = tc.setupdbMock() - } - - versionService := NewCentralDefaultVersionService(connectionFactory, &tc.inputConfig) - versionService.Start() - - if tc.wantExit != exitCalled { - t.Fatalf("osExit called: %v, wanted: %v", exitCalled, tc.wantExit) - } - - if validateDbQueries != nil { - err := validateDbQueries() - if err != nil { - t.Fatalf("error validating db queries: %s", err) - } - } - }) - } - -} diff --git a/internal/dinosaur/pkg/services/dinosaur.go b/internal/dinosaur/pkg/services/dinosaur.go index f1dd3ab4ce..9e2a78f40a 100644 --- a/internal/dinosaur/pkg/services/dinosaur.go +++ b/internal/dinosaur/pkg/services/dinosaur.go @@ -27,7 +27,6 @@ import ( "github.com/stackrox/acs-fleet-manager/pkg/client/ocm" "github.com/stackrox/acs-fleet-manager/pkg/db" "github.com/stackrox/acs-fleet-manager/pkg/errors" - "github.com/stackrox/acs-fleet-manager/pkg/features" "github.com/stackrox/acs-fleet-manager/pkg/logger" "github.com/stackrox/acs-fleet-manager/pkg/metrics" ) @@ -113,39 +112,37 @@ type DinosaurService interface { var _ DinosaurService = &dinosaurService{} type dinosaurService struct { - connectionFactory *db.ConnectionFactory - clusterService ClusterService - dinosaurConfig *config.CentralConfig - awsConfig *config.AWSConfig - quotaServiceFactory QuotaServiceFactory - mu sync.Mutex - awsClientFactory aws.ClientFactory - dataplaneClusterConfig *config.DataplaneClusterConfig - clusterPlacementStrategy ClusterPlacementStrategy - amsClient ocm.AMSClient - centralDefaultVersionService CentralDefaultVersionService - iamConfig *iam.IAMConfig - rhSSODynamicClientsAPI *dynamicClientAPI.AcsTenantsApiService + connectionFactory *db.ConnectionFactory + clusterService ClusterService + dinosaurConfig *config.CentralConfig + awsConfig *config.AWSConfig + quotaServiceFactory QuotaServiceFactory + mu sync.Mutex + awsClientFactory aws.ClientFactory + dataplaneClusterConfig *config.DataplaneClusterConfig + clusterPlacementStrategy ClusterPlacementStrategy + amsClient ocm.AMSClient + iamConfig *iam.IAMConfig + rhSSODynamicClientsAPI *dynamicClientAPI.AcsTenantsApiService } // NewDinosaurService ... func NewDinosaurService(connectionFactory *db.ConnectionFactory, clusterService ClusterService, iamConfig *iam.IAMConfig, dinosaurConfig *config.CentralConfig, dataplaneClusterConfig *config.DataplaneClusterConfig, awsConfig *config.AWSConfig, quotaServiceFactory QuotaServiceFactory, awsClientFactory aws.ClientFactory, - clusterPlacementStrategy ClusterPlacementStrategy, amsClient ocm.AMSClient, centralDefaultVersionService CentralDefaultVersionService) DinosaurService { + clusterPlacementStrategy ClusterPlacementStrategy, amsClient ocm.AMSClient) DinosaurService { return &dinosaurService{ - connectionFactory: connectionFactory, - clusterService: clusterService, - iamConfig: iamConfig, - dinosaurConfig: dinosaurConfig, - awsConfig: awsConfig, - quotaServiceFactory: quotaServiceFactory, - awsClientFactory: awsClientFactory, - dataplaneClusterConfig: dataplaneClusterConfig, - clusterPlacementStrategy: clusterPlacementStrategy, - amsClient: amsClient, - centralDefaultVersionService: centralDefaultVersionService, - rhSSODynamicClientsAPI: dynamicclients.NewDynamicClientsAPI(iamConfig.RedhatSSORealm), + connectionFactory: connectionFactory, + clusterService: clusterService, + iamConfig: iamConfig, + dinosaurConfig: dinosaurConfig, + awsConfig: awsConfig, + quotaServiceFactory: quotaServiceFactory, + awsClientFactory: awsClientFactory, + dataplaneClusterConfig: dataplaneClusterConfig, + clusterPlacementStrategy: clusterPlacementStrategy, + amsClient: amsClient, + rhSSODynamicClientsAPI: dynamicclients.NewDynamicClientsAPI(iamConfig.RedhatSSORealm), } } @@ -276,14 +273,6 @@ func (k *dinosaurService) RegisterDinosaurJob(ctx context.Context, dinosaurReque return err } - if features.TargetedOperatorUpgrades.Enabled() { - defaultVersion, serviceErr := k.centralDefaultVersionService.GetDefaultVersion() - if serviceErr != nil { - return err - } - dinosaurRequest.OperatorImage = defaultVersion - } - dbConn := k.connectionFactory.New() dinosaurRequest.Status = dinosaurConstants.CentralRequestStatusAccepted.String() dinosaurRequest.SubscriptionID = subscriptionID diff --git a/openapi/fleet-manager-private-admin.yaml b/openapi/fleet-manager-private-admin.yaml index e8e94cbcc6..0eb3b7868d 100644 --- a/openapi/fleet-manager-private-admin.yaml +++ b/openapi/fleet-manager-private-admin.yaml @@ -164,57 +164,6 @@ paths: application/json: schema: $ref: 'fleet-manager.yaml#/components/schemas/Error' - patch: - summary: Update a Central instance by ID - parameters: - - $ref: "fleet-manager.yaml#/components/parameters/id" - security: - - Bearer: [] - operationId: updateCentralById - requestBody: - description: Central update data - content: - application/json: - schema: - $ref: '#/components/schemas/CentralUpdateRequest' - required: true - responses: - "200": - description: Central updated by ID - content: - application/json: - schema: - $ref: '#/components/schemas/Central' - "400": - description: Bad request - content: - application/json: - schema: - $ref: 'fleet-manager.yaml#/components/schemas/Error' - "401": - description: Auth token is invalid - content: - application/json: - schema: - $ref: 'fleet-manager.yaml#/components/schemas/Error' - "403": - description: User is not authorised to access the service - content: - application/json: - schema: - $ref: 'fleet-manager.yaml#/components/schemas/Error' - "404": - description: No Central found with the specified ID - content: - application/json: - schema: - $ref: 'fleet-manager.yaml#/components/schemas/Error' - "500": - description: Unexpected error occurred - content: - application/json: - schema: - $ref: 'fleet-manager.yaml#/components/schemas/Error' delete: summary: Delete a Central by ID parameters: @@ -372,70 +321,6 @@ paths: application/json: schema: $ref: 'fleet-manager.yaml#/components/schemas/Error' - '/api/rhacs/v1/admin/centrals/default-version': - post: - summary: Set the central default version - operationId: setCentralDefaultVersion - security: - - Bearer: [] - requestBody: - description: Central version data - content: - application/json: - schema: - $ref: "#/components/schemas/CentralDefaultVersion" - required: true - responses: - "200": - description: Central default version set to new value - "401": - description: Auth token is invalid - content: - application/json: - schema: - $ref: 'fleet-manager.yaml#/components/schemas/Error' - "403": - description: User is not authorised to access the service - content: - application/json: - schema: - $ref: 'fleet-manager.yaml#/components/schemas/Error' - "500": - description: Unexpected error occurred - content: - application/json: - schema: - $ref: 'fleet-manager.yaml#/components/schemas/Error' - get: - summary: Get the current central default version - operationId: getCentralDefaultVersion - security: - - Bearer: [] - responses: - "200": - description: Return current central default version - content: - application/json: - schema: - $ref: '#/components/schemas/CentralDefaultVersion' - "401": - description: Auth token is invalid - content: - application/json: - schema: - $ref: 'fleet-manager.yaml#/components/schemas/Error' - "403": - description: User is not authorised to access the service - content: - application/json: - schema: - $ref: 'fleet-manager.yaml#/components/schemas/Error' - "500": - description: Unexpected error occurred - content: - application/json: - schema: - $ref: 'fleet-manager.yaml#/components/schemas/Error' components: schemas: @@ -500,12 +385,6 @@ components: type: string namespace: type: string - central: - $ref: "fleet-manager.yaml#/components/schemas/CentralSpec" - scanner: - $ref: "fleet-manager.yaml#/components/schemas/ScannerSpec" - force_reconcile: - type: string CentralList: allOf: - $ref: "fleet-manager.yaml#/components/schemas/List" @@ -517,24 +396,6 @@ components: allOf: - $ref: "#/components/schemas/Central" - CentralUpdateRequest: - type: object - properties: - # for now only support updating the following fields. May add more when use cases arise. - central: - $ref: "fleet-manager.yaml#/components/schemas/CentralSpec" - scanner: - $ref: "fleet-manager.yaml#/components/schemas/ScannerSpec" - force_reconcile: - type: string - - CentralDefaultVersion: - type: object - properties: - version: - type: string - example: "quay.io/rhacs-eng/stackrox-operator:3.74.1" - CentralRotateSecretsRequest: type: object properties: diff --git a/openapi/fleet-manager-private.yaml b/openapi/fleet-manager-private.yaml index 26b2ccaa2f..93e88dd8ac 100644 --- a/openapi/fleet-manager-private.yaml +++ b/openapi/fleet-manager-private.yaml @@ -232,19 +232,6 @@ components: kind: type: string - ResourceList: - type: object - additionalProperties: - type: string - - ResourceRequirements: - type: object - properties: - requests: - $ref: "#/components/schemas/ResourceList" - limits: - $ref: "#/components/schemas/ResourceList" - ManagedCentral: allOf: - $ref: "#/components/schemas/PrivateObjectReference" @@ -285,6 +272,9 @@ components: spec: type: object properties: + instanceType: + type: string + enum: [ eval, standard ] centralCRYAML: type: string owners: @@ -327,52 +317,8 @@ components: properties: host: type: string - operatorImage: - type: string - central: - type: object - properties: - instanceType: - type: string - enum: [eval, standard] - resources: - $ref: "#/components/schemas/ResourceRequirements" - scanner: - type: object - properties: - analyzer: - type: object - properties: - scaling: - type: object - properties: - autoScaling: - type: string - replicas: - type: integer - format: int32 - minimum: 1 - minReplicas: - type: integer - format: int32 - minimum: 1 - maxReplicas: - type: integer - format: int32 - minimum: 1 - resources: - $ref: "#/components/schemas/ResourceRequirements" - db: - type: object - properties: - host: - type: string - resources: - $ref: "#/components/schemas/ResourceRequirements" requestStatus: type: string - forceReconcile: - type: string ManagedCentralList: description: >- diff --git a/openapi/fleet-manager.yaml b/openapi/fleet-manager.yaml index f24c4d0b49..53fa3eb0df 100644 --- a/openapi/fleet-manager.yaml +++ b/openapi/fleet-manager.yaml @@ -624,17 +624,6 @@ components: type: array items: $ref: "#/components/schemas/Error" - ResourceList: - type: object - additionalProperties: - type: string - ResourceRequirements: - type: object - properties: - requests: - $ref: "#/components/schemas/ResourceList" - limits: - $ref: "#/components/schemas/ResourceList" CentralRequest: allOf: - $ref: "#/components/schemas/ObjectReference" @@ -695,41 +684,6 @@ components: items: allOf: - $ref: "#/components/schemas/CentralRequest" - CentralSpec: - type: object - properties: - resources: - $ref: "#/components/schemas/ResourceRequirements" - ScannerSpec: - type: object - properties: - analyzer: - type: object - properties: - resources: - $ref: "#/components/schemas/ResourceRequirements" - scaling: - type: object - properties: - autoScaling: - type: string - replicas: - type: integer - format: int32 - minimum: 1 - minReplicas: - type: integer - format: int32 - minimum: 1 - maxReplicas: - type: integer - format: int32 - minimum: 1 - db: - type: object - properties: - resources: - $ref: "#/components/schemas/ResourceRequirements" VersionMetadata: allOf: - $ref: "#/components/schemas/ObjectReference" @@ -785,10 +739,6 @@ components: region: description: The region where the Central component cluster will be created in type: string - central: - $ref: "#/components/schemas/CentralSpec" - scanner: - $ref: "#/components/schemas/ScannerSpec" CloudProviderList: allOf: - $ref: "#/components/schemas/List" diff --git a/pkg/client/fleetmanager/api_moq.go b/pkg/client/fleetmanager/api_moq.go index 4ea2600e9a..0bac3fa350 100644 --- a/pkg/client/fleetmanager/api_moq.go +++ b/pkg/client/fleetmanager/api_moq.go @@ -493,9 +493,6 @@ var _ AdminAPI = &AdminAPIMock{} // GetCentralsFunc: func(ctx context.Context, localVarOptionals *admin.GetCentralsOpts) (admin.CentralList, *http.Response, error) { // panic("mock out the GetCentrals method") // }, -// UpdateCentralByIdFunc: func(ctx context.Context, id string, centralUpdateRequest admin.CentralUpdateRequest) (admin.Central, *http.Response, error) { -// panic("mock out the UpdateCentralById method") -// }, // } // // // use mockedAdminAPI in code that requires AdminAPI @@ -512,9 +509,6 @@ type AdminAPIMock struct { // GetCentralsFunc mocks the GetCentrals method. GetCentralsFunc func(ctx context.Context, localVarOptionals *admin.GetCentralsOpts) (admin.CentralList, *http.Response, error) - // UpdateCentralByIdFunc mocks the UpdateCentralById method. - UpdateCentralByIdFunc func(ctx context.Context, id string, centralUpdateRequest admin.CentralUpdateRequest) (admin.Central, *http.Response, error) - // calls tracks calls to the methods. calls struct { // CreateCentral holds details about calls to the CreateCentral method. @@ -540,20 +534,10 @@ type AdminAPIMock struct { // LocalVarOptionals is the localVarOptionals argument value. LocalVarOptionals *admin.GetCentralsOpts } - // UpdateCentralById holds details about calls to the UpdateCentralById method. - UpdateCentralById []struct { - // Ctx is the ctx argument value. - Ctx context.Context - // ID is the id argument value. - ID string - // CentralUpdateRequest is the centralUpdateRequest argument value. - CentralUpdateRequest admin.CentralUpdateRequest - } } lockCreateCentral sync.RWMutex lockDeleteDbCentralById sync.RWMutex lockGetCentrals sync.RWMutex - lockUpdateCentralById sync.RWMutex } // CreateCentral calls CreateCentralFunc. @@ -667,43 +651,3 @@ func (mock *AdminAPIMock) GetCentralsCalls() []struct { mock.lockGetCentrals.RUnlock() return calls } - -// UpdateCentralById calls UpdateCentralByIdFunc. -func (mock *AdminAPIMock) UpdateCentralById(ctx context.Context, id string, centralUpdateRequest admin.CentralUpdateRequest) (admin.Central, *http.Response, error) { - if mock.UpdateCentralByIdFunc == nil { - panic("AdminAPIMock.UpdateCentralByIdFunc: method is nil but AdminAPI.UpdateCentralById was just called") - } - callInfo := struct { - Ctx context.Context - ID string - CentralUpdateRequest admin.CentralUpdateRequest - }{ - Ctx: ctx, - ID: id, - CentralUpdateRequest: centralUpdateRequest, - } - mock.lockUpdateCentralById.Lock() - mock.calls.UpdateCentralById = append(mock.calls.UpdateCentralById, callInfo) - mock.lockUpdateCentralById.Unlock() - return mock.UpdateCentralByIdFunc(ctx, id, centralUpdateRequest) -} - -// UpdateCentralByIdCalls gets all the calls that were made to UpdateCentralById. -// Check the length with: -// -// len(mockedAdminAPI.UpdateCentralByIdCalls()) -func (mock *AdminAPIMock) UpdateCentralByIdCalls() []struct { - Ctx context.Context - ID string - CentralUpdateRequest admin.CentralUpdateRequest -} { - var calls []struct { - Ctx context.Context - ID string - CentralUpdateRequest admin.CentralUpdateRequest - } - mock.lockUpdateCentralById.RLock() - calls = mock.calls.UpdateCentralById - mock.lockUpdateCentralById.RUnlock() - return calls -} diff --git a/pkg/client/fleetmanager/client.go b/pkg/client/fleetmanager/client.go index b7bdbded10..23b343bc4a 100644 --- a/pkg/client/fleetmanager/client.go +++ b/pkg/client/fleetmanager/client.go @@ -33,7 +33,6 @@ type PrivateAPI interface { type AdminAPI interface { GetCentrals(ctx context.Context, localVarOptionals *admin.GetCentralsOpts) (admin.CentralList, *http.Response, error) CreateCentral(ctx context.Context, async bool, centralRequestPayload admin.CentralRequestPayload) (admin.CentralRequest, *http.Response, error) - UpdateCentralById(ctx context.Context, id string, centralUpdateRequest admin.CentralUpdateRequest) (admin.Central, *http.Response, error) DeleteDbCentralById(ctx context.Context, id string) (*http.Response, error) } diff --git a/pkg/providers/core.go b/pkg/providers/core.go index 95bca43997..7ab367c747 100644 --- a/pkg/providers/core.go +++ b/pkg/providers/core.go @@ -102,6 +102,5 @@ func ServiceProviders() di.Option { di.Provide(workers.NewLeaderElectionManager, di.As(new(environments.BootService))), di.Provide(services.NewTelemetry, di.As(new(environments.BootService))), di.Provide(services.NewDataMigration, di.As(new(environments.BootService))), - di.Provide(services.NewCentralDefaultVersionService, di.As(new(environments.BootService))), ) }