Skip to content

Commit

Permalink
Add operator to gitops config
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBaeumer committed Sep 18, 2023
1 parent 77b5bcf commit 4e7d6c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/dinosaur/pkg/gitops/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
package gitops

import (
"github.com/stackrox/acs-fleet-manager/fleetshard/pkg/central/operator"
"github.com/stackrox/rox/operator/apis/platform/v1alpha1"
"k8s.io/apimachinery/pkg/util/validation/field"
"sigs.k8s.io/yaml"
)

// Config represents the gitops configuration
type Config struct {
Centrals CentralsConfig `json:"centrals"`
Centrals CentralsConfig `json:"centrals"`
RHACSOperators operator.OperatorConfigs `json:rhacsOperators`
}

// CentralsConfig represents the declarative configuration for Central instances defaults and overrides.
Expand All @@ -32,6 +34,7 @@ type CentralOverride struct {
func ValidateConfig(config Config) field.ErrorList {
var errs field.ErrorList
errs = append(errs, validateCentralsConfig(field.NewPath("centrals"), config.Centrals)...)
errs = append(errs, operator.Validate(field.NewPath("rhacsOperators"), config.RHACSOperators))
return errs
}

Expand Down
7 changes: 7 additions & 0 deletions internal/dinosaur/pkg/gitops/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ func TestValidateGitOpsConfig(t *testing.T) {
require.Empty(t, err)
},
yaml: `
rhacsOperators:
crd:
baseURL: https://raw.githubusercontent.com/stackrox/stackrox/{{ .GitRef }}/operator/bundle/manifests/
gitRef: 4.1.1
operators:
- gitRef: 4.1.1
image: "quay.io/rhacs-eng/stackrox-operator:4.1.1"
centrals:
overrides:
- instanceIds:
Expand Down

0 comments on commit 4e7d6c1

Please sign in to comment.