Rollback to 1.28/stable microk8s in functional testing

We use latest/stable by default which very recently updated to
1.29/stable. Unfortunately it appears there are issues [0] with this
version on Debian Bookworm which also happens to be the platform we test
on. Our jobs have been consistently failing in a manner that appears
related to this issue. Update the job to collect logs so that we can
better confirm this is the case and rollback to 1.28 which should be
working.

Also update the AWS tests to handle a recent moto release which
requires us to use mock_aws rather than individual mock_* classes.

[0] https://github.com/canonical/microk8s/issues/4361

Change-Id: I72310521bdabfc3e34a9f2e87ff80f6d7c27c180
Co-Authored-By: James E. Blair <jim@acmegating.com>
Co-Authored-By: Jeremy Stanley <fungi@yuggoth.org>
This commit is contained in:
Clark Boylan 2024-01-26 09:16:40 -08:00 committed by James E. Blair
parent 42f9100d82
commit e5c1790be7
4 changed files with 10 additions and 9 deletions

View File

@ -4,6 +4,7 @@
name: nodepool-functional-k8s name: nodepool-functional-k8s
pre-run: playbooks/nodepool-functional-k8s/pre.yaml pre-run: playbooks/nodepool-functional-k8s/pre.yaml
run: playbooks/nodepool-functional-k8s/run.yaml run: playbooks/nodepool-functional-k8s/run.yaml
post-run: playbooks/nodepool-functional-k8s/post.yaml
required-projects: required-projects:
- zuul/nodepool - zuul/nodepool
nodeset: debian-bookworm nodeset: debian-bookworm

View File

@ -21,7 +21,7 @@ import urllib.parse
import boto3 import boto3
import botocore.exceptions import botocore.exceptions
from moto import mock_ec2, mock_s3, mock_iam from moto import mock_aws
import testtools import testtools
from nodepool import config as nodepool_config from nodepool import config as nodepool_config
@ -122,9 +122,7 @@ def ebs_quotas(quotas):
class TestDriverAws(tests.DBTestCase): class TestDriverAws(tests.DBTestCase):
log = logging.getLogger("nodepool.TestDriverAws") log = logging.getLogger("nodepool.TestDriverAws")
mock_ec2 = mock_ec2() mock_aws = mock_aws()
mock_s3 = mock_s3()
mock_iam = mock_iam()
def setUp(self): def setUp(self):
super().setUp() super().setUp()
@ -144,9 +142,7 @@ class TestDriverAws(tests.DBTestCase):
fixtures.EnvironmentVariable('AWS_SECRET_ACCESS_KEY', aws_key)) fixtures.EnvironmentVariable('AWS_SECRET_ACCESS_KEY', aws_key))
self.fake_aws = FakeAws() self.fake_aws = FakeAws()
self.mock_ec2.start() self.mock_aws.start()
self.mock_s3.start()
self.mock_iam.start()
self.ec2 = boto3.resource('ec2', region_name='us-west-2') self.ec2 = boto3.resource('ec2', region_name='us-west-2')
self.ec2_client = boto3.client('ec2', region_name='us-west-2') self.ec2_client = boto3.client('ec2', region_name='us-west-2')
@ -197,8 +193,7 @@ class TestDriverAws(tests.DBTestCase):
ebs_quotas=getattr(test, '__aws_ebs_quotas__', None)) ebs_quotas=getattr(test, '__aws_ebs_quotas__', None))
def tearDown(self): def tearDown(self):
self.mock_ec2.stop() self.mock_aws.stop()
self.mock_s3.stop()
super().tearDown() super().tearDown()
def setup_config(self, *args, **kw): def setup_config(self, *args, **kw):

View File

@ -0,0 +1,4 @@
- hosts: all
roles:
- name: Collect k8s logs for debugging purposes
role: collect-kubernetes-logs

View File

@ -6,3 +6,4 @@
- role: ensure-nox - role: ensure-nox
- role: ensure-kubernetes - role: ensure-kubernetes
ensure_kubernetes_type: microk8s ensure_kubernetes_type: microk8s
ensure_kubernetes_microk8s_channel: '1.28/stable'