From 2017f6b96165b23be7491de6f17e7410c755f416 Mon Sep 17 00:00:00 2001 From: David Byron Date: Wed, 20 Nov 2024 08:53:49 -0800 Subject: [PATCH] chore(build): remove option to tag java 11 images now that everything builds for java 17 only --- .github/workflows/release.yml | 10 -------- dev/buildtool/__init__.py | 12 ---------- dev/buildtool/container_commands.py | 22 ------------------ dev/buildtool/spinnaker_commands.py | 8 ------- unittest/buildtool/container_commands_test.py | 23 +------------------ 5 files changed, 1 insertion(+), 74 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cab66c6..cd40d55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,14 +26,6 @@ on: - 'false' type: choice required: true - tagJava11: - description: 'Tag Java 11 variants of images. Only set to True for versions after 1.32.0.' - default: 'true' - options: - - 'true' - - 'false' - type: choice - required: true jobs: release: @@ -71,7 +63,6 @@ jobs: minimum Halyard version: ${{ inputs.minimumHalyardVersion }} latest Halyard version: ${{ inputs.latestHalyardVersion }} dry run enabled: ${{ inputs.dryRun }} - tag Java 11 variants: ${{ inputs.tagJava11 }}" - name: Login to GAR # This is required to tag docker images @@ -103,7 +94,6 @@ jobs: --github_owner "${{ steps.release_info.outputs.REPOSITORY_OWNER }}" \ --github_oauth_token "${{ secrets.SPINNAKERBOT_PERSONAL_ACCESS_TOKEN }}" \ --dry_run ${{ inputs.dryRun }} \ - --tag_java11 ${{ inputs.tagJava11 }} - name: Cat output files for review run: | diff --git a/dev/buildtool/__init__.py b/dev/buildtool/__init__.py index d024264..e2ce350 100644 --- a/dev/buildtool/__init__.py +++ b/dev/buildtool/__init__.py @@ -2,18 +2,6 @@ # pylint: disable=wrong-import-position -SPINNAKER_JAVA11_VARIANT_REPOSITORY_NAMES = [ - "clouddriver", - "echo", - "fiat", - "front50", - "gate", - "igor", - "kayenta", - "orca", - "rosco" -] - # These would be required if running from source code SPINNAKER_RUNNABLE_REPOSITORY_NAMES = [ "clouddriver", diff --git a/dev/buildtool/container_commands.py b/dev/buildtool/container_commands.py index c307518..f9f0c67 100644 --- a/dev/buildtool/container_commands.py +++ b/dev/buildtool/container_commands.py @@ -23,7 +23,6 @@ from buildtool import ( SPINNAKER_DOCKER_REGISTRY, SPINNAKER_RUNNABLE_REPOSITORY_NAMES, - SPINNAKER_JAVA11_VARIANT_REPOSITORY_NAMES, CommandFactory, CommandProcessor, check_options_set, @@ -74,15 +73,6 @@ def init_argparser(self, parser, defaults): help="Show proposed actions, don't actually do them. Default True.", ) - self.add_argument( - parser, - "tag_java11", - defaults, - True, - type=bool, - help="Tag JRE 11 variants of images for specified services. Default True.", - ) - class TagContainersCommand(CommandProcessor): """Implements tag_containers command.""" @@ -136,9 +126,6 @@ def _do_command(self): existing_image = ( f"{SPINNAKER_DOCKER_REGISTRY}/{service}:{version}-unvalidated" ) - existing_image_java11 = ( - f"{SPINNAKER_DOCKER_REGISTRY}/{service}:{version}-java11-unvalidated" - ) tag_permutations = [f"{version}", f"spinnaker-{options.spinnaker_version}"] @@ -152,8 +139,6 @@ def _do_command(self): continue logging.info("Tagging container: %s(-ubuntu)", existing_image) - if options.tag_java11 and service in SPINNAKER_JAVA11_VARIANT_REPOSITORY_NAMES: - logging.info("Tagging JRE 11 container variants: %s(-ubuntu)", existing_image_java11) for tag in tag_permutations: alpine_image = f"{SPINNAKER_DOCKER_REGISTRY}/{service}:{tag}" @@ -162,13 +147,6 @@ def _do_command(self): ubuntu_image = f"{SPINNAKER_DOCKER_REGISTRY}/{service}:{tag}-ubuntu" self.regctl_image_copy(f"{existing_image}-ubuntu", ubuntu_image) - if options.tag_java11 and service in SPINNAKER_JAVA11_VARIANT_REPOSITORY_NAMES: - alpine_image_java11 = f"{SPINNAKER_DOCKER_REGISTRY}/{service}:{tag}-java11" - self.regctl_image_copy(existing_image_java11, alpine_image_java11) - - ubuntu_image_java11 = f"{SPINNAKER_DOCKER_REGISTRY}/{service}:{tag}-java11-ubuntu" - self.regctl_image_copy(f"{existing_image_java11}-ubuntu", ubuntu_image_java11) - def register_commands(registry, subparsers, defaults): """Registers all the commands for this module.""" diff --git a/dev/buildtool/spinnaker_commands.py b/dev/buildtool/spinnaker_commands.py index 216629c..204cdc9 100644 --- a/dev/buildtool/spinnaker_commands.py +++ b/dev/buildtool/spinnaker_commands.py @@ -80,14 +80,6 @@ def init_argparser(self, parser, defaults): type=bool, help="Show proposed actions, don't actually do them. Default True.", ) - self.add_argument( - parser, - "tag_java11", - defaults, - True, - type=bool, - help="Tag JRE 11 variants of images for specified services. Default True.", - ) class PublishSpinnakerCommand(CommandProcessor): diff --git a/unittest/buildtool/container_commands_test.py b/unittest/buildtool/container_commands_test.py index 1b2eb44..59e0c6c 100644 --- a/unittest/buildtool/container_commands_test.py +++ b/unittest/buildtool/container_commands_test.py @@ -46,7 +46,6 @@ def test_default_tag_containers_options(self): option_dict = vars(options) self.assertEqual(True, options.dry_run) - self.assertEqual(True, options.tag_java11) self.assertIsNone(option_dict["bom_path"]) self.assertIsNone(option_dict["spinnaker_version"]) @@ -62,7 +61,6 @@ def test_tag_containers_dry_run(self): os.path.dirname(__file__), "standard_test_bom.yml" ) options.dry_run = True - options.tag_java11 = True mock_regctl_image_copy = self.patch_method( TagContainersCommand, "regctl_image_copy" @@ -91,7 +89,6 @@ def test_tag_containers(self): os.path.dirname(__file__), "standard_test_bom.yml" ) options.dry_run = False - options.tag_java11 = True mock_regctl_image_copy = self.patch_method( TagContainersCommand, "regctl_image_copy" @@ -111,7 +108,6 @@ def test_tag_containers(self): # without "-unvalidated" and with "spinnaker-{version}", 4 variations # each service (2 services), 8 permutations. # BOM service "monitoring-third-party" should be ignored. - # When tag_java11 flag set, extra 4 permutations per service calls = [ call( f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-unvalidated", @@ -121,14 +117,6 @@ def test_tag_containers(self): f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-unvalidated-ubuntu", f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-ubuntu", ), - call( - f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-java11-unvalidated", - f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-java11", - ), - call( - f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-java11-unvalidated-ubuntu", - f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-java11-ubuntu", - ), call( f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-unvalidated", f"{SPINNAKER_DOCKER_REGISTRY}/front50:spinnaker-1.2.3", @@ -137,14 +125,6 @@ def test_tag_containers(self): f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-unvalidated-ubuntu", f"{SPINNAKER_DOCKER_REGISTRY}/front50:spinnaker-1.2.3-ubuntu", ), - call( - f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-java11-unvalidated", - f"{SPINNAKER_DOCKER_REGISTRY}/front50:spinnaker-1.2.3-java11", - ), - call( - f"{SPINNAKER_DOCKER_REGISTRY}/front50:7.8.9-20180102030405-java11-unvalidated-ubuntu", - f"{SPINNAKER_DOCKER_REGISTRY}/front50:spinnaker-1.2.3-java11-ubuntu", - ), call( f"{SPINNAKER_DOCKER_REGISTRY}/monitoring-daemon:7.8.9-20180908070605-unvalidated", f"{SPINNAKER_DOCKER_REGISTRY}/monitoring-daemon:7.8.9-20180908070605", @@ -166,8 +146,7 @@ def test_tag_containers(self): mock_regctl_image_copy.assert_has_calls(calls) # Should only be eight permutations, no more (e.g: NOT monitoring-third-party) - # Should be 12 when tagging JRE 11 images for front50 only - self.assertEqual(mock_regctl_image_copy.call_count, 12) + self.assertEqual(mock_regctl_image_copy.call_count, 8) if __name__ == "__main__":