-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ROX-19820: Address feedback from gitops meeting #1294
Conversation
Expect(err).To(BeNil()) | ||
|
||
It("should deploy operator with label selector 4.1.1", func() { | ||
Eventually(validateOperatorDeployment(ctx, "4.1.1", "quay.io/rhacs-eng/stackrox-operator:4.1.1")). | ||
It("should contain only two operator deployments", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved checking that 2 operators were deployed before asserting their properties
WithTimeout(waitTimeout). | ||
WithPolling(defaultPolling). | ||
Should(Succeed()) | ||
}) | ||
It("should contain only one operator deployments", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved checking that only 1 operator deployment is present before asserting its properties
Expect(err).To(BeNil()) | ||
|
||
It("should contain one operator deployment", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an assertion to check the presence of 1 operator deployment
@@ -82,9 +82,21 @@ spec: | |||
containerName: manager | |||
resource: limits.memory | |||
divisor: '0' | |||
{{- if .labelSelector }} | |||
{{- if .centralLabelSelector }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there will be both a centralLabelSelector
and securedClusterLabelSelector
hence the renaming
@@ -16,82 +24,82 @@ func parseConfig(content []byte) (OperatorConfigs, error) { | |||
return out, nil | |||
} | |||
|
|||
// Validate validates the operator configuration and can be used in different life-cycle stages like runtime and deploy time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to validation.go
with all validation methods
Image string `json:"image"` | ||
GitRef string `json:"gitRef"` | ||
HelmValues string `json:"helmValues,omitempty"` | ||
type OperatorConfig map[string]interface{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to map[string]interface{}
so that it is compatible with helm values
type OperatorConfig map[string]interface{} | ||
|
||
// GetDeploymentName returns the deployment name of the operator. | ||
func (o OperatorConfig) GetDeploymentName() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added getters to simplify accessing properties of the map[string]interface{}
with known keys
@@ -6,22 +6,31 @@ metadata: | |||
data: | |||
config.yaml: | | |||
rhacsOperators: | |||
crd: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per feedback that raw urls were preferrable
|
||
// CRDConfig represents the crd to be installed in the data-plane cluster. The CRD is downloaded automatically | ||
// from the base URL. It takes a GitRef to resolve a GitHub link to the CRD definition. | ||
type CRDConfig struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed as this is now a []string
assert.Equal(t, "quay.io/rhacs-eng/stackrox-operator:4.1.1", conf.Configs[0].Image) | ||
} | ||
|
||
func TestGetOperatorConfigFailsValidation(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to validation_test.go
) | ||
|
||
func parseOperatorConfigs(operators OperatorConfigs) ([]chartutil.Values, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved validation logic to validation.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice!
image: "quay.io/rhacs-eng/stackrox-operator:4.1.1" | ||
- gitRef: 4.1.0 | ||
|
||
- deploymentName: "rhacs-operator-4-2-0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: dots are allowed in deployment name if they are not in the end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waaat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that rhacs-operator-4.2.0
is a valid deployment name but rhacs-operator-4.2.0.
is not
fleetshard/pkg/central/charts/data/rhacs-operator/templates/rhacs-operator-deployment.yaml
Outdated
Show resolved
Hide resolved
// OperatorConfigs represents all operators and the CRD which should be installed in a data-plane cluster. | ||
type OperatorConfigs struct { | ||
CRD CRDConfig `json:"crd"` | ||
CRDURLs []string `json:"crdUrls"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought: Should we replace list of URLs with two values? CentralCRDURL and SecuredClusterCRDURL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind either way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though, this will get passed to helm directly. Its function is not to install CRDs per se, but it can install any yaml resource.
- Rename to
additionalResources
, and allow any yaml to be specified there. - Either keep CrdUrls or split into CentralCRDUrl or SecuredClusterCRDUrl, and validate that these files actually contain only 1 valid
kind: CustomResourceDefinition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image: "quay.io/rhacs-eng/stackrox-operator:4.1.0" | ||
centralLabelSelector: "rhacs.redhat.com/version-selector=4.1.0" | ||
disableSecuredClusterReconciler: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: instead of disableSecuredClusterReconciler
it should be securedClusterReconcilerEnabled: false
. Double-negations are often done wrong.
Fred and me had it yesterday where we wanted to enable delegated scanning but disabled it:
ROX_DELEGATED_SCANNING_DISABLED=true
.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kurlov, ludydoo, SimonBaeumer The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
ROX-19820
Addressing issues and feedback from the gitops meeting
Checklist (Definition of Done)
Test manual
ROX-12345: ...
Test manual
TODO: Add manual testing efforts