diff --git a/config/post-install/v0.15.0/storage-version-migration.yaml b/config/post-install/v0.15.0/storage-version-migration.yaml index b39392ace2a..3e6e337bfef 100644 --- a/config/post-install/v0.15.0/storage-version-migration.yaml +++ b/config/post-install/v0.15.0/storage-version-migration.yaml @@ -27,6 +27,8 @@ spec: metadata: labels: app: "storage-version-migration" + annotations: + sidecar.istio.io/inject: "false" spec: serviceAccountName: knative-eventing-post-install-job restartPolicy: OnFailure diff --git a/config/pre-install/v0.16.0/storage-version-migration.yaml b/config/pre-install/v0.16.0/storage-version-migration.yaml index 3b1bd08cc3a..e0af598e837 100644 --- a/config/pre-install/v0.16.0/storage-version-migration.yaml +++ b/config/pre-install/v0.16.0/storage-version-migration.yaml @@ -15,10 +15,10 @@ apiVersion: batch/v1 kind: Job metadata: - name: storage-version-migration-v016 + name: storage-version-migration-eventing namespace: knative-eventing labels: - app: "storage-version-migration" + app: "storage-version-migration-eventing" eventing.knative.dev/release: devel spec: ttlSecondsAfterFinished: 600 @@ -26,7 +26,9 @@ spec: template: metadata: labels: - app: "storage-version-migration" + app: "storage-version-migration-eventing" + annotations: + sidecar.istio.io/inject: "false" spec: serviceAccountName: knative-eventing-pre-install-job restartPolicy: OnFailure diff --git a/test/lib/duck/resource_inspectors.go b/test/lib/duck/resource_inspectors.go index 6df11cd6d5d..392b8a12b0e 100644 --- a/test/lib/duck/resource_inspectors.go +++ b/test/lib/duck/resource_inspectors.go @@ -39,6 +39,9 @@ func GetAddressableURI(dynamicClient dynamic.Interface, obj *resources.MetaResou at := untyped.(*duckv1alpha1.AddressableType) + if at.Status.Address == nil { + return url.URL{}, fmt.Errorf("addressable does not have an Address: %+v", at) + } au := at.Status.Address.GetURL() if au.Host == "" { return url.URL{}, fmt.Errorf("addressable's URL does not have a Host: %+v", at) diff --git a/test/upgrade/prober/configuration.go b/test/upgrade/prober/configuration.go index 7f498a8afab..f98f5f24978 100644 --- a/test/upgrade/prober/configuration.go +++ b/test/upgrade/prober/configuration.go @@ -19,13 +19,11 @@ import ( "bytes" "fmt" "io/ioutil" - "knative.dev/eventing/pkg/reconciler/sugar" "path" "runtime" "text/template" "github.com/wavesoftware/go-ensure" - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" eventingv1beta1 "knative.dev/eventing/pkg/apis/eventing/v1beta1" testlib "knative.dev/eventing/test/lib" @@ -48,22 +46,13 @@ var ( ) func (p *prober) deployConfiguration() { - p.annotateNamespace() + p.deployBroker() p.deployConfigMap() p.deployTriggers() } -func (p *prober) annotateNamespace() { - ns, err := p.client.Kube.Kube.CoreV1().Namespaces(). - Get(p.client.Namespace, metav1.GetOptions{}) - ensure.NoError(err) - ns.Labels = map[string]string{ - sugar.DeprecatedInjectionLabelKey: sugar.InjectionEnabledLabelValue, - sugar.InjectionLabelKey: sugar.InjectionEnabledLabelValue, - } - _, err = p.client.Kube.Kube.CoreV1().Namespaces(). - Update(ns) - ensure.NoError(err) +func (p *prober) deployBroker() { + p.client.CreateBrokerV1Beta1OrFail(brokerName) } func (p *prober) fetchBrokerUrl() (*apis.URL, error) { @@ -85,28 +74,11 @@ func (p *prober) fetchBrokerUrl() (*apis.URL, error) { func (p *prober) deployConfigMap() { name := configName - testlib.WaitFor(fmt.Sprintf("configmap be deployed: %v", name), func() error { - p.log.Infof("Deploying config map: %v", name) - - brokerUrl, err := p.fetchBrokerUrl() - if err != nil { - return err - } - configData := p.compileTemplate(configFilename, brokerUrl) - watholaConfigMap := &corev1.ConfigMap{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - }, - Data: map[string]string{ - configFilename: configData, - }, - } - _, err = p.client.Kube.Kube.CoreV1().ConfigMaps(p.config.Namespace).Create(watholaConfigMap) - if err != nil { - return err - } - return nil - }) + p.log.Infof("Deploying config map: \"%s/%s\"", p.config.Namespace, name) + brokerUrl, err := p.fetchBrokerUrl() + ensure.NoError(err) + configData := p.compileTemplate(configFilename, brokerUrl) + p.client.CreateConfigMapOrFail(name, p.config.Namespace, map[string]string{configFilename: configData}) } func (p *prober) deployTriggers() { @@ -117,25 +89,14 @@ func (p *prober) deployTriggers() { if p.config.Serving.Use { subscriberOption = resources.WithSubscriberKServiceRefForTrigger(forwarderName) } - trigger := resources.TriggerV1Beta1( - name, + p.client.CreateTriggerOrFailV1Beta1(name, resources.WithBrokerV1Beta1(brokerName), resources.WithAttributesTriggerFilterV1Beta1( eventingv1beta1.TriggerAnyFilter, fullType, map[string]interface{}{}, ), - subscriberOption, - ) - triggers := p.client.Eventing.EventingV1beta1().Triggers(p.config.Namespace) - p.log.Infof("Deploying trigger: %v", name) - // update trigger with the new reference - _, err := triggers.Create(trigger) - ensure.NoError(err) - testlib.WaitFor(fmt.Sprintf("trigger be ready: %v", name), func() error { - meta := resources.NewMetaResource(name, p.config.Namespace, testlib.TriggerTypeMeta) - return duck.WaitForResourceReady(p.client.Dynamic, meta) - }) + subscriberOption) } } diff --git a/test/upgrade/prober/prober.go b/test/upgrade/prober/prober.go index 79c7d6805f3..ea0a9f79b12 100644 --- a/test/upgrade/prober/prober.go +++ b/test/upgrade/prober/prober.go @@ -137,7 +137,7 @@ func (p *prober) deploy() { if p.config.Serving.Use { p.deployForwarder() } - ensure.NoError(testlib.AwaitForAll(p.log)) + p.client.WaitForAllTestResourcesReadyOrFail() p.deploySender() ensure.NoError(testlib.AwaitForAll(p.log)) @@ -151,8 +151,7 @@ func (p *prober) remove() { if p.config.Serving.Use { p.removeForwarder() } - p.removeReceiver() - p.removeConfiguration() + p.client.Tracker.Clean(true) } func newProber(log *zap.SugaredLogger, client *testlib.Client, config *Config) Prober {