Skip to content

Commit

Permalink
ROX-21937: Remove stackrox.io references (stackrox#10265)
Browse files Browse the repository at this point in the history
Co-authored-by: Moritz Clasmeier <[email protected]>
  • Loading branch information
mclasmeier and Moritz Clasmeier authored Mar 12, 2024
1 parent f61a9e4 commit c0df026
Show file tree
Hide file tree
Showing 30 changed files with 68 additions and 197 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ endif

ROX_PRODUCT_BRANDING ?= STACKROX_BRANDING

# ROX_IMAGE_FLAVOR is an ARG used in Dockerfiles that defines the default registries for main, scaner, and collector images.
# ROX_IMAGE_FLAVOR valid values are: development_build, stackrox.io, rhacs, opensource.
# ROX_IMAGE_FLAVOR is an ARG used in Dockerfiles that defines the default registries for main, scanner, and collector images.
# ROX_IMAGE_FLAVOR valid values are: development_build, rhacs, opensource.
ROX_IMAGE_FLAVOR ?= $(shell \
if [[ "$(ROX_PRODUCT_BRANDING)" == "STACKROX_BRANDING" ]]; then \
echo "opensource"; \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ more info.
<details><summary>Kubernetes</summary>
```bash
docker run -i --rm stackrox.io/main:<tag> interactive > k8s.zip
docker run -i --rm quay.io/stackrox-io/main:<tag> central generate interactive > k8s.zip
```
This will run you through an installer and generate a `k8s.zip` file.
Expand Down Expand Up @@ -585,7 +585,7 @@ bash image-setup.sh
```
```bash
docker run -i --rm stackrox.io/main:<tag> interactive > openshift.zip
docker run -i --rm quay.io/stackrox-io/main:<tag> central generate interactive > openshift.zip
```
This will run you through an installer and generate a `openshift.zip` file.
Expand Down
1 change: 0 additions & 1 deletion central/clusters/deployer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ func testImageFlavorChartRepoSettings(s *deployerTestSuite, flavor defaults.Imag
func (s *deployerTestSuite) TestFieldsFromClusterAndRenderOpts() {
flavorCases := map[string]defaults.ImageFlavor{
"development": defaults.DevelopmentBuildImageFlavor(),
"stackrox": defaults.StackRoxIOReleaseImageFlavor(),
"rhacs": defaults.RHACSReleaseImageFlavor(),
"opensource": defaults.OpenSourceImageFlavor(),
}
Expand Down
1 change: 0 additions & 1 deletion image/embed_charts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func (s *embedTestSuite) TestLoadChartForFlavor() {
testCases := []defaults.ImageFlavor{
flavorUtils.MakeImageFlavorForTest(s.T()),
defaults.DevelopmentBuildImageFlavor(),
defaults.StackRoxIOReleaseImageFlavor(),
defaults.RHACSReleaseImageFlavor(),
defaults.OpenSourceImageFlavor(),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# # The registry relative to which all image references are resolved, unless
# # a specific registry is provided for particular workloads which takes precedence
# # (see `central.image`, `db.image`, `scanner.image`, and `scanner.dbImage` below).
# # This can be just a registry hostname such as `stackrox.io`, or a registry hostname with
# # This can be just a registry hostname such as `quay.io`, or a registry hostname with
# # a "remote" component such as `us.gcr.io/my-stackrox-mirror`.
# registry: us.gcr.io/my-stackrox-mirror
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
# registry: null # if set to null, use `image.registry`
# name: main # the final image name is composed of the registry and the name, plus the tag below
# tag: null # should be left as null - will get picked up from the Chart version.
# fullRef: null # you can set a full image reference such as stackrox.io/main:1.2.3.4 here, but this is not
# fullRef: null # you can set a full image reference such as quay.io/stackrox-io/main:1.2.3.4 here, but this is not
# # recommended.
# # The default pull policy for this image. Can be overridden for each individual service.
# pullPolicy: IfNotPresent
Expand Down
2 changes: 1 addition & 1 deletion operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ KUTTL_TEST_RUN_LABELS_ARGS ?= --test-run-labels openshift=$(TEST_E2E_ENV_IS_OPEN
ENABLE_WEBHOOKS ?= false

# ROX_IMAGE_FLAVOR is an ARG used in Dockerfiles that defines the default registries for main, scanner, and collector images.
# ROX_IMAGE_FLAVOR valid values are: development_build, stackrox.io, rhacs.
# ROX_IMAGE_FLAVOR valid values are: development_build, opensource, rhacs.
# Use the value figured in the parent directory Makefile, unless provided explicitly in the environment.
ROX_IMAGE_FLAVOR ?= $(shell $(MAKE) --quiet --no-print-directory -C .. image-flavor)

Expand Down
1 change: 0 additions & 1 deletion pkg/helm/charts/meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ func TestRequiredMetaValuesArePresent(t *testing.T) {

cases := []defaults.ImageFlavor{
defaults.DevelopmentBuildImageFlavor(),
defaults.StackRoxIOReleaseImageFlavor(),
defaults.RHACSReleaseImageFlavor(),
defaults.OpenSourceImageFlavor(),
}
Expand Down
5 changes: 2 additions & 3 deletions pkg/helm/charts/tests/centralservices/flavor/flavor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ func TestOverriddenTagsAreRenderedInTheChart(t *testing.T) {
func TestWithDifferentImageFlavors(t *testing.T) {
testutils.SetVersion(t, testutils.GetExampleVersion(t))
imageFlavorCases := map[string]defaults.ImageFlavor{
"stackrox": defaults.StackRoxIOReleaseImageFlavor(),
"rhacs": defaults.RHACSReleaseImageFlavor(),
"custom": customFlavor(t),
"rhacs": defaults.RHACSReleaseImageFlavor(),
"custom": customFlavor(t),
}
if buildinfo.ReleaseBuild {
imageFlavorCases["development_build-release"] = defaults.DevelopmentBuildImageFlavor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ func TestOverriddenTagsAreRenderedInTheChart(t *testing.T) {
func TestWithDifferentImageFlavors(t *testing.T) {
testutils.SetVersion(t, testutils.GetExampleVersion(t))
imageFlavorCases := map[string]defaults.ImageFlavor{
"stackrox": defaults.StackRoxIOReleaseImageFlavor(),
"rhacs": defaults.RHACSReleaseImageFlavor(),
"rhacs": defaults.RHACSReleaseImageFlavor(),
}
if buildinfo.ReleaseBuild {
imageFlavorCases["development_build-release"] = defaults.DevelopmentBuildImageFlavor()
Expand Down
2 changes: 0 additions & 2 deletions pkg/images/defaults/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ const (
// unrelated to the image flavor. It is possible that binaries compiled in release mode are packaged in images that
// have development_build image flavor.
ImageFlavorNameDevelopmentBuild = "development_build"
// ImageFlavorNameStackRoxIORelease is a name for image flavor (image defaults) for images released to stackrox.io.
ImageFlavorNameStackRoxIORelease = "stackrox.io"
// ImageFlavorNameRHACSRelease is a name for image flavor (image defaults) for images released to registry.redhat.io.
ImageFlavorNameRHACSRelease = "rhacs"
// ImageFlavorNameOpenSource is a name for image flavor (image defaults) for images released to quay.io/stackrox-io.
Expand Down
46 changes: 0 additions & 46 deletions pkg/images/defaults/flavor.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ var (
isVisibleInReleaseBuild: false,
constructorFunc: DevelopmentBuildImageFlavor,
},
{
// TODO(ROX-11642): This was just hidden in release builds but should go away completely.
imageFlavorName: ImageFlavorNameStackRoxIORelease,
isVisibleInReleaseBuild: false,
constructorFunc: StackRoxIOReleaseImageFlavor,
},
{
imageFlavorName: ImageFlavorNameRHACSRelease,
isVisibleInReleaseBuild: true,
Expand Down Expand Up @@ -81,7 +75,6 @@ type ImageFlavor struct {
CentralDBImageTag string
CentralDBImageName string

// CollectorRegistry may be different from MainRegistry in case of stackrox.io.
CollectorRegistry string
CollectorImageName string
CollectorImageTag string
Expand Down Expand Up @@ -152,45 +145,6 @@ func DevelopmentBuildImageFlavor() ImageFlavor {
}
}

// StackRoxIOReleaseImageFlavor returns image values for `stackrox.io` flavor.
// TODO(ROX-11642): remove stackrox.io flavor as stackrox.io image distribution is shut down.
func StackRoxIOReleaseImageFlavor() ImageFlavor {
v := version.GetAllVersionsUnified()
return ImageFlavor{
MainRegistry: "stackrox.io",
MainImageName: "main",
MainImageTag: v.MainVersion,
CentralDBImageTag: v.MainVersion,
CentralDBImageName: "central-db",

CollectorRegistry: "collector.stackrox.io",
CollectorImageName: "collector",
CollectorImageTag: v.CollectorVersion,
CollectorSlimImageName: "collector-slim",
CollectorSlimImageTag: v.CollectorVersion,

ScannerImageName: "scanner",
ScannerSlimImageName: "scanner-slim",
ScannerImageTag: v.ScannerVersion,
ScannerDBImageName: "scanner-db",
ScannerDBSlimImageName: "scanner-db-slim",

ScannerV4ImageName: "scanner-v4",
ScannerV4DBImageName: "scanner-v4-db",
// Scanner v4 is released along with the main image, so the tags are expected to be the same.
ScannerV4ImageTag: v.MainVersion,

ChartRepo: ChartRepo{
URL: "https://charts.stackrox.io",
IconURL: "https://raw.githubusercontent.com/stackrox/stackrox/master/image/templates/helm/shared/assets/Red_Hat-Hat_icon.png",
},
ImagePullSecrets: ImagePullSecrets{
AllowNone: false,
},
Versions: v,
}
}

// RHACSReleaseImageFlavor returns image values for `rhacs` flavor.
func RHACSReleaseImageFlavor() ImageFlavor {
v := version.GetAllVersionsUnified()
Expand Down
8 changes: 1 addition & 7 deletions pkg/images/defaults/flavor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ func (s *imageFlavorTestSuite) TestGetImageFlavorFromEnv() {
"development_build": {
expectedFlavor: DevelopmentBuildImageFlavor(),
},
"stackrox.io": {
expectedFlavor: StackRoxIOReleaseImageFlavor(),
},
"rhacs": {
expectedFlavor: RHACSReleaseImageFlavor(),
},
Expand Down Expand Up @@ -144,9 +141,6 @@ func (s *imageFlavorTestSuite) TestGetImageFlavorByName() {
"development_build": {
expectedFlavor: DevelopmentBuildImageFlavor(),
},
"stackrox.io": {
expectedFlavor: StackRoxIOReleaseImageFlavor(),
},
"rhacs": {
expectedFlavor: RHACSReleaseImageFlavor(),
},
Expand Down Expand Up @@ -185,7 +179,7 @@ func TestGetVisibleImageFlavorNames(t *testing.T) {
isRelease bool
want []string
}{
{"development", false, []string{"development_build", "stackrox.io", "rhacs", "opensource"}},
{"development", false, []string{"development_build", "rhacs", "opensource"}},
{"release", true, []string{"rhacs", "opensource"}},
}
for _, tt := range tests {
Expand Down
1 change: 0 additions & 1 deletion pkg/images/defaults/testutils/flavor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ func TestFlavorsDontHaveEmptyFields(t *testing.T) {

flavors := []defaults.ImageFlavor{
defaults.DevelopmentBuildImageFlavor(),
defaults.StackRoxIOReleaseImageFlavor(),
defaults.RHACSReleaseImageFlavor(),
defaults.OpenSourceImageFlavor(),
MakeImageFlavorForTest(t),
Expand Down
1 change: 1 addition & 0 deletions pkg/kubernetes/pull_secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func TestResolvedRegistry(t *testing.T) {
{image: "library/nginx", expected: "https://docker.io"},
{image: "docker.io/library/nginx:latest", expected: "https://docker.io"},
{image: "stackrox.io/main:1.10", expected: "https://stackrox.io"},
{image: "quay.io/stackrox-io/main:1.10", expected: "https://quay.io"},
{image: "gcr.io/project-name/main:1.2.3", expected: "https://gcr.io"},
{image: "dtr.example.com/stackrox/main:1.2.3", expected: "https://dtr.example.com"},
{image: "docker-default.registry.svc:5000/stackrox/main:1.2", expected: "https://docker-default.registry.svc:5000"},
Expand Down
8 changes: 4 additions & 4 deletions pkg/renderer/templates/public_values.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ central:
{{- if .K8sConfig.ImageOverrides.Main.Tag }}
# WARNING: You are using a non-default main image tag. Upgrades via 'helm upgrade'
# will not work as expected. To ensure a smooth upgrade experience, make sure
# StackRox images are mirrored with the same tags as in the stackrox.io registry.
# StackRox images are mirrored with the same tags as in the quay.io/stackrox-io registry.
tag: {{ .K8sConfig.ImageOverrides.Main.Tag }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -108,7 +108,7 @@ central:
{{- if .K8sConfig.ImageOverrides.CentralDB.Tag }}
# WARNING: You are using a non-default Central DB image tag. Upgrades via
# 'helm upgrade' will not work as expected. To ensure a smooth upgrade experience,
# make sure StackRox images are mirrored with the same tags as in the stackrox.io
# make sure StackRox images are mirrored with the same tags as in the quay.io/stackrox-io
# registry.
tag: {{ .K8sConfig.ImageOverrides.CentralDB.Tag }}
{{- end }}
Expand Down Expand Up @@ -143,7 +143,7 @@ scanner:
{{- if .K8sConfig.ImageOverrides.Scanner.Tag }}
# WARNING: You are using a non-default Scanner image tag. Upgrades via 'helm upgrade'
# will not work as expected. To ensure a smooth upgrade experience, make sure
# StackRox images are mirrored with the same tags as in the stackrox.io registry.
# StackRox images are mirrored with the same tags as in the quay.io/stackrox-io registry.
tag: {{ .K8sConfig.ImageOverrides.Scanner.Tag }}
{{- end }}
{{- end }}
Expand All @@ -159,7 +159,7 @@ scanner:
{{- if .K8sConfig.ImageOverrides.ScannerDB.Tag }}
# WARNING: You are using a non-default Scanner DB image tag. Upgrades via
# 'helm upgrade' will not work as expected. To ensure a smooth upgrade experience,
# make sure StackRox images are mirrored with the same tags as in the stackrox.io
# make sure StackRox images are mirrored with the same tags as in the quay.io/stackrox-io
# registry.
tag: {{ .K8sConfig.ImageOverrides.ScannerDB.Tag }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions roxctl/central/generate/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestRestoreKeysAndCerts(t *testing.T) {

flavorName := defaults.ImageFlavorNameDevelopmentBuild
if buildinfo.ReleaseBuild {
flavorName = defaults.ImageFlavorNameStackRoxIORelease
flavorName = defaults.ImageFlavorNameOpenSource
}
config := renderer.Config{
Version: version.GetMainVersion(),
Expand Down Expand Up @@ -129,7 +129,7 @@ func TestTelemetryConfiguration(t *testing.T) {

flavorName := defaults.ImageFlavorNameDevelopmentBuild
if buildinfo.ReleaseBuild {
flavorName = defaults.ImageFlavorNameStackRoxIORelease
flavorName = defaults.ImageFlavorNameOpenSource
}
config := renderer.Config{
Version: version.GetMainVersion(),
Expand Down Expand Up @@ -215,7 +215,7 @@ func TestMonitoringConfiguration(t *testing.T) {

flavorName := defaults.ImageFlavorNameDevelopmentBuild
if buildinfo.ReleaseBuild {
flavorName = defaults.ImageFlavorNameStackRoxIORelease
flavorName = defaults.ImageFlavorNameOpenSource
}
config := renderer.Config{
K8sConfig: &renderer.K8sConfig{
Expand Down
3 changes: 0 additions & 3 deletions roxctl/helm/output/output_lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ func (s *HelmChartTestSuite) TestOutputHelmChart() {

// Group: Valid --image-defaults, no --rhacs
{flavor: defaults.ImageFlavorNameDevelopmentBuild, rhacs: false},
{flavor: defaults.ImageFlavorNameStackRoxIORelease, rhacs: false},
{flavor: defaults.ImageFlavorNameRHACSRelease, rhacs: false},
{flavor: defaults.ImageFlavorNameOpenSource, rhacs: false},

Expand All @@ -72,7 +71,6 @@ func (s *HelmChartTestSuite) TestOutputHelmChart() {
{flavor: "", flavorProvided: true, rhacs: true, wantErr: true},
{flavor: "dummy", rhacs: true, wantErr: true},
{flavor: defaults.ImageFlavorNameDevelopmentBuild, rhacs: true, wantErr: true},
{flavor: defaults.ImageFlavorNameStackRoxIORelease, rhacs: true, wantErr: true},
{flavor: defaults.ImageFlavorNameRHACSRelease, rhacs: true, wantErr: true},
{flavor: defaults.ImageFlavorNameOpenSource, rhacs: true, wantErr: true},
}
Expand Down Expand Up @@ -102,7 +100,6 @@ func (s *HelmChartTestSuite) TestOutputHelmChart() {
func (s *HelmChartTestSuite) TestHelmLint() {
flavorsToTest := []string{
defaults.ImageFlavorNameDevelopmentBuild,
defaults.ImageFlavorNameStackRoxIORelease,
defaults.ImageFlavorNameRHACSRelease,
defaults.ImageFlavorNameOpenSource,
}
Expand Down
2 changes: 1 addition & 1 deletion sensor/kubernetes/listener/resources/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func (w *deploymentWrap) populateImageMetadata(localImages set.StringSet, pods .
image := w.Deployment.Containers[i].Image

// If there already is an image ID for the image then that implies that the name of the image was fully qualified
// with an image digest. e.g. stackrox.io/main@sha256:xyz
// with an image digest. e.g. quay.io/stackrox-io/main@sha256:xyz
// If the ID already exists, populate NotPullable and IsClusterLocal.
if image.GetId() != "" {
// Use the image ID from the pod's ContainerStatus.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ teardown() {
registry_from_flavor() {
case "$central_flavor" in
"development_build")
echo "docker\.io/stackrox"
echo "quay.io/rhacs-eng"
;;
"stackrox.io")
echo "stackrox\.io"
"opensource")
echo "quay.io/stackrox-io"
;;
esac
}
Expand All @@ -38,7 +38,7 @@ collector_full_from_flavor() {
"development_build")
echo "collector:$any_version_latest"
;;
"stackrox.io")
"opensource")
echo "collector:$any_version"
;;
esac
Expand All @@ -49,7 +49,7 @@ collector_slim_from_flavor() {
"development_build")
echo "collector:$any_version_slim"
;;
"stackrox.io")
"opensource")
echo "collector-slim:$any_version"
;;
esac
Expand Down
7 changes: 0 additions & 7 deletions tests/roxctl/bats-tests/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,6 @@ image_reference_regex() {
quay.io/stackrox-io)
echo "quay\.io/stackrox-io/$component:$version"
;;
stackrox.io)
if [[ "$component" == "collector" ]]; then
echo "collector.stackrox\.io/$component:$version"
else
echo "stackrox\.io/$component:$version"
fi
;;
registry.redhat.io)
echo "registry\.redhat\.io/advanced-cluster-security/rhacs-$component-rhel8:$version"
;;
Expand Down
Loading

0 comments on commit c0df026

Please sign in to comment.