Skip to content
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-16507: Download ACS Operator CRDs dynamically #1010

Merged
merged 8 commits into from
Jun 5, 2023

Conversation

kurlov
Copy link
Member

@kurlov kurlov commented May 4, 2023

Description

Make Fleetshard-sync download the latest Central and SecuredCluster CRDs version from the main stackrox repository.
CRDs download in memory to avoid creating them in the embed.FS. Because of that the load chart functions had to be adjusted to support both static and dynamic chart file sources

Checklist (Definition of Done)

  • Unit and integration tests added
  • Added test description under Test manual
    - [ ] Documentation added if necessary (i.e. changes to dev setup, test execution, ...)
  • CI and all relevant tests are passing
  • Add the ticket number to the PR title if available, i.e. ROX-12345: ...
    - [ ] Discussed security and business related topics privately. Will move any security and business related topics that arise to private communication channel.
    - [ ] Add secret to app-interface Vault or Secrets Manager if necessary

Test manual

# Build and run locally:
make deploy/dev

@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 4, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kurlov kurlov temporarily deployed to development May 4, 2023 09:37 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 4, 2023 09:37 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 4, 2023 09:37 — with GitHub Actions Inactive
@openshift-ci openshift-ci bot added the approved label May 4, 2023
@kurlov kurlov marked this pull request as ready for review May 4, 2023 09:38
@kurlov kurlov temporarily deployed to development May 4, 2023 09:38 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 4, 2023 09:38 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 4, 2023 09:38 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 8, 2023 14:53 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 8, 2023 14:53 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 8, 2023 14:53 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 9, 2023 14:46 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 9, 2023 14:46 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 9, 2023 14:46 — with GitHub Actions Inactive
@kurlov kurlov requested review from SimonBaeumer and johannes94 and removed request for johannes94 May 9, 2023 16:29
@kurlov kurlov temporarily deployed to development May 9, 2023 16:50 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 9, 2023 16:50 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 9, 2023 16:50 — with GitHub Actions Inactive
@kurlov kurlov requested review from ludydoo and johannes94 May 9, 2023 16:55
@@ -92,3 +97,12 @@ func TestInstallOrUpdateChartUpdateExisting(t *testing.T) {
assert.NotEmpty(t, res.GetLabels())
assert.Equal(t, "baz", res.GetLabels()["foo"])
}

func TestGetChartWithDynamicTemplate(t *testing.T) {
crdURL := "https://raw.githubusercontent.com/stackrox/stackrox/master/operator/bundle/manifests/platform.stackrox.io_securedclusters.yaml"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make the URL configurable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URL will be dynamic (containing release tag)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URL should be configurable so that we don't need to rebuild fleetshard to change the download source.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved URL to the config

fleetshard/pkg/central/operator/upgrade.go Outdated Show resolved Hide resolved
@kurlov kurlov temporarily deployed to development May 22, 2023 21:33 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 22, 2023 21:33 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 22, 2023 21:33 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 23, 2023 08:40 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 23, 2023 08:40 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 23, 2023 08:40 — with GitHub Actions Inactive
@kurlov kurlov requested a review from SimonBaeumer May 24, 2023 08:35
Copy link
Member

@SimonBaeumer SimonBaeumer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, only some smaller remarks.

fleetshard/pkg/central/charts/charts.go Show resolved Hide resolved
fleetshard/pkg/central/charts/charts.go Show resolved Hide resolved
@@ -92,3 +97,12 @@ func TestInstallOrUpdateChartUpdateExisting(t *testing.T) {
assert.NotEmpty(t, res.GetLabels())
assert.Equal(t, "baz", res.GetLabels()["foo"])
}

func TestGetChartWithDynamicTemplate(t *testing.T) {
crdURL := "https://raw.githubusercontent.com/stackrox/stackrox/master/operator/bundle/manifests/platform.stackrox.io_securedclusters.yaml"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URL should be configurable so that we don't need to rebuild fleetshard to change the download source.

@kurlov kurlov temporarily deployed to development May 31, 2023 08:37 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 31, 2023 08:37 — with GitHub Actions Inactive
@kurlov kurlov temporarily deployed to development May 31, 2023 08:37 — with GitHub Actions Inactive
@kurlov kurlov requested a review from SimonBaeumer May 31, 2023 09:13
@openshift-ci openshift-ci bot added the lgtm label Jun 1, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 1, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kurlov, 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:
  • OWNERS [SimonBaeumer,kurlov]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kurlov kurlov merged commit 337217e into main Jun 5, 2023
@kurlov kurlov deleted the akurlov/ROX-16507-download-crd-dynamically branch June 5, 2023 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants