Skip to content

Commit

Permalink
V1.3.0 rallyhealth pr (#6)
Browse files Browse the repository at this point in the history
* feat: add support for influxdb as a metrics provider (argoproj#1839)

* feat: add InfluxDB metric provider implementation

Signed-off-by: Jayme Bird <jbird@influxdata.com>

* feat: add influx to metric provider util count, add missing graphite

Signed-off-by: Jayme Bird <jbird@influxdata.com>

* feat: add protobuf definitions for InfluxdbMetric

Signed-off-by: Jayme Bird <jbird@influxdata.com>

* feat: add docs for the Influxdb metrics provider

Signed-off-by: Jayme Bird <jbird@influxdata.com>

* feat: add tests for influxdb metrics provider

Signed-off-by: Jayme Bird <jbird@influxdata.com>

* feat: add go mod replace for version of moq due to security issue

Signed-off-by: Jayme Bird <jbird@influxdata.com>

* feat: update error message to distinguish failed cases - review feedback

Signed-off-by: Jayme Bird <jbird@influxdata.com>

* feat: update tests to simplify mocking of QueryTableResult

An upstream change to the influx go client makes it easier to mock
QueryTableResult in tests. This removes a lot of boilerplate duplication
in the tests.

Signed-off-by: Jayme Bird <jbird@influxdata.com>

* feat: re-run codegen

Signed-off-by: Jayme Bird <jbird@influxdata.com>

* feat: Adds support for Istio traffic mirroring (argoproj#2074)

* feat: Add support for istio traffic mirroring steps

Signed-off-by: zachaller <zachaller@hotmail.com>

* bump e2e timeout

Signed-off-by: zachaller <zachaller@hotmail.com>

* Remove unintended change

Signed-off-by: zachaller <zachaller@hotmail.com>

* Cleaner events

Signed-off-by: zachaller <zachaller@hotmail.com>

* Add docs for mirror and fix up header routing

Signed-off-by: zachaller <zachaller@hotmail.com>

* small doc changes

Signed-off-by: zachaller <zachaller@hotmail.com>

* Add example

Signed-off-by: zachaller <zachaller@hotmail.com>

* Fix types and change example

Signed-off-by: zachaller <zachaller@hotmail.com>

* Remove unused type

Signed-off-by: zachaller <zachaller@hotmail.com>

* Docs change

Signed-off-by: zachaller <zachaller@hotmail.com>

* Fix PR comments

Signed-off-by: zachaller <zachaller@hotmail.com>

* Check for >=

Signed-off-by: zachaller <zachaller@hotmail.com>

* Remove unused function

Signed-off-by: zachaller <zachaller@hotmail.com>

* codegen

Signed-off-by: zachaller <zachaller@hotmail.com>

* Add better error logging

Signed-off-by: zachaller <zachaller@hotmail.com>

* a few more error msgs

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix comments

Signed-off-by: zachaller <zachaller@hotmail.com>

* typo

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix logic error

Signed-off-by: zachaller <zachaller@hotmail.com>

* redo header logic

Signed-off-by: zachaller <zachaller@hotmail.com>

* cleanup

Signed-off-by: zachaller <zachaller@hotmail.com>

* Fix issue with keeping route weight updated when no routes
are defined in spec.strategy.canary.trafficRouting.istio.virtualService.routes
requiring only a single route

Signed-off-by: zachaller <zachaller@hotmail.com>

* cleanup routes when promiting with last step being a pause

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix bug with promote and last step is a pause

Signed-off-by: zachaller <zachaller@hotmail.com>

* Fix tests

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix typo

Signed-off-by: zachaller <zachaller@hotmail.com>

* chore: improve openapi schema (argoproj#2081)

* feat: include all CRDs to the OpenAPI schema

Signed-off-by: Mário Bezerra <mario.bezerra@incognia.com>

* feat: use kube-openapi naming convention in the OpenAPI schema

Signed-off-by: Mário Bezerra <mario.bezerra@incognia.com>

* chore: generate OpenAPI schema

Signed-off-by: Mário Bezerra <mario.bezerra@incognia.com>

* feat(grafana): Allow selecting datasource for grafana dashboard (argoproj#1988)

Signed-off-by: Jesse Antoszyk <22500761+jcantosz@users.noreply.github.com>

* feat: support /rollouts/:namespace?q=... and /rollout/:namespace/:name (argoproj#1902)

Signed-off-by: Simon Ninon <sninon@pagerduty.com>

* chore: Add e2e and unit test comment reports (argoproj#2123)

Signed-off-by: zachaller <zachaller@hotmail.com>

* chore: upgrade deps (argoproj#2136)

Signed-off-by: zachaller <zachaller@hotmail.com>

* fixes argoproj#2141 Added list and watch to clusterrole (argoproj#2145)

Signed-off-by: Martin Adler <1208749+EagleIJoe@users.noreply.github.com>

* fix: Update ro.Status.ALB when first creating rollout object (argoproj#1986)

* fix: make sure we update rollout.Status.ALB when first create Rollout object

This fixes the case when we first create a rollout the status.ALB field does not
get updated with valid information form the elb.

Signed-off-by: zachaller <zachaller@hotmail.com>

* Refactor check for if we should verify alb.

This creates a new rolloututil function ShouldVerifyWeight that verifies
that we should call aws because the rollout is in the middle of some update.

The reason I feel this should move into the ingress implmentation function VerifyWeight
is becuase in the future other ingresses might also need to verify weights and adding
ingress specific status checks in trafficrouting.go like a leak details where it should be
up to the ingress provider to determin if it should be careful of rate limiting do to say it
being a cloud provider call.

Signed-off-by: zachaller <zachaller@hotmail.com>

* lint

Signed-off-by: zachaller <zachaller@hotmail.com>

* Fix tests

Signed-off-by: zachaller <zachaller@hotmail.com>

* Add new test for ShouldVerifyWeight

Signed-off-by: zachaller <zachaller@hotmail.com>

* Fix logic

Signed-off-by: zachaller <zachaller@hotmail.com>

* Add test for where we do not need to verify weight and its already set

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix up review comments

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix tests

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix bad merge

Signed-off-by: zachaller <zachaller@hotmail.com>

* Fix test

Signed-off-by: zachaller <zachaller@hotmail.com>

* Fix test

Signed-off-by: zachaller <zachaller@hotmail.com>

* Clearer function name

Signed-off-by: zachaller <zachaller@hotmail.com>

* Clean up if logic

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix: remove metrics when objects are removed from cluster to prevent build up (argoproj#2115)

* fix: remove metrics on resource removal

Signed-off-by: zachaller <zachaller@hotmail.com>

* Add test

Signed-off-by: zachaller <zachaller@hotmail.com>

* More tests

Signed-off-by: zachaller <zachaller@hotmail.com>

* back off deps updates

Signed-off-by: zachaller <zachaller@hotmail.com>

* Fix dep change

Signed-off-by: zachaller <zachaller@hotmail.com>

* upgrade prom deps for new features

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix deps

Signed-off-by: zachaller <zachaller@hotmail.com>

* chore: use controler-gen for cluster analysis template scope (argoproj#2148)

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix(analysis): Fix Analysis Terminal Decision For Dry-Run Metrics (argoproj#2131)

Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>

* docs: update release doc with brew formula details (argoproj#2165)

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* fix(docs) Graphite metrics provider linked in docs sidebar. Fixes argoproj#2102. (argoproj#2094)

* Graphite metrics provider linked in docs sidebar

This fixes an issue wherein the Graphite metrics
provider has no sidebar link in the docs hosted
at https://argoproj.github.io/argo-rollouts/.

As a bonus, this also removes various trailing
whitespace from analysis docs.

Signed-off-by: Mike Ball <mikedball@gmail.com>

* build trigger

Signed-off-by: Mike Ball <mikedball@gmail.com>

* feat: emit rollout delete event (argoproj#1893)

Signed-off-by: Hui Kang <hui.kang@salesforce.com>

Co-authored-by: Hui Kang <hui.kang@salesforce.com>

* chore: Upgrade golang (argoproj#2160)

* Upgrade golang

Signed-off-by: zachaller <zachaller@hotmail.com>

* upgrade golang to 1.18 for e2e

Signed-off-by: zachaller <zachaller@hotmail.com>

* Fix deps

Signed-off-by: zachaller <zachaller@hotmail.com>

* Update build action

Signed-off-by: zachaller <zachaller@hotmail.com>

* Upgrade push action

Signed-off-by: zachaller <zachaller@hotmail.com>

* Update docker file

Signed-off-by: zachaller <zachaller@hotmail.com>

* Bump golang lint to match

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix go.mod

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix: Failed to process: Object 'Kind' is missing in Errors with rollouts notification (argoproj#2150)

* fix: update rolloutobject with gvk before writing to rollout informer

Signed-off-by: Ravi Hari <ravireliable@gmail.com>

* fix: controller schema linting

Signed-off-by: Ravi Hari <ravireliable@gmail.com>

* docs: comment the details on the change

Signed-off-by: Ravi Hari <ravireliable@gmail.com>

* docs: comment the details on the change

Signed-off-by: Ravi Hari <ravireliable@gmail.com>

* fix: rootPath support so that it uses the embedded files system (argoproj#2198)

* fix: rootPath support so that it uses the embeded files system

Signed-off-by: zachaller <zachaller@hotmail.com>

* Catch edge cases and make sure we always server index.html on not found

Signed-off-by: zachaller <zachaller@hotmail.com>

* turn path.Clean into var

Signed-off-by: zachaller <zachaller@hotmail.com>

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix: change completed condition so it only triggers on pod hash changes also adds an event for when it  does changes. (argoproj#2203)

* feat: add healthy event/condition and fix completed event/condition

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix unit tests

Signed-off-by: zachaller <zachaller@hotmail.com>

* rename vars to make more sense and remove healthy event becase it will never be consistent

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix unit tests

Signed-off-by: zachaller <zachaller@hotmail.com>

* possible fix for e2e

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix e2e

Signed-off-by: zachaller <zachaller@hotmail.com>

* unit test for complete function

Signed-off-by: zachaller <zachaller@hotmail.com>

* small cleanup and changes to not check generation

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix unit test and proper behavior

Signed-off-by: zachaller <zachaller@hotmail.com>

* Fix e2e

Signed-off-by: zachaller <zachaller@hotmail.com>

* rename and fix one unit test

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix unit tests

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix unit test

Signed-off-by: zachaller <zachaller@hotmail.com>

* add seperate test for TestRolloutComplete

Signed-off-by: zachaller <zachaller@hotmail.com>

* renames

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix e2e

Signed-off-by: zachaller <zachaller@hotmail.com>

* Set Completed to false

Signed-off-by: zachaller <zachaller@hotmail.com>

* Add event

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix e2e

Signed-off-by: zachaller <zachaller@hotmail.com>

* refactor

Signed-off-by: zachaller <zachaller@hotmail.com>

* Fix all but one unit test

Signed-off-by: zachaller <zachaller@hotmail.com>

* fix last unit test

Signed-off-by: zachaller <zachaller@hotmail.com>

* lint

Signed-off-by: zachaller <zachaller@hotmail.com>

* cleanup

Signed-off-by: zachaller <zachaller@hotmail.com>

* Rename

Signed-off-by: zachaller <zachaller@hotmail.com>

* More renames

Signed-off-by: zachaller <zachaller@hotmail.com>

* small comment change

Signed-off-by: zachaller <zachaller@hotmail.com>

Signed-off-by: zachaller <zachaller@hotmail.com>

* feat: Add support for spec.ingressClassName (argoproj#2178)

This change adds support for `spec.ingressClassName` while still supporting
`kubernetes.io/ingress.class` annotation for backwards compatibility.

Fixes argoproj#1277

Signed-off-by: Siavash Safi <git@hosted.run>

Signed-off-by: Siavash Safi <git@hosted.run>

* fix: enable notifications without when condition (argoproj#2231)

* fix: enable notifications without when condition

Signed-off-by: Ravi Hari <ravireliable@gmail.com>

* fix: use trigger action item from the list

Signed-off-by: Ravi Hari <ravireliable@gmail.com>

* fix: add emptycondition logic to make notifications work with/without conditions

Signed-off-by: Ravi Hari <ravireliable@gmail.com>

* fix: linting

Signed-off-by: Ravi Hari <ravireliable@gmail.com>

Signed-off-by: Ravi Hari <ravireliable@gmail.com>

* Use standard cli format for dashboard root path (argoproj#2244)

Signed-off-by: zachaller <zachaller@hotmail.com>

Signed-off-by: zachaller <zachaller@hotmail.com>

* merge conflict broke tests

Signed-off-by: Travis Perdue <travis.perdue@rallyhealth.com>

Signed-off-by: Jayme Bird <jbird@influxdata.com>
Signed-off-by: zachaller <zachaller@hotmail.com>
Signed-off-by: Mário Bezerra <mario.bezerra@incognia.com>
Signed-off-by: Jesse Antoszyk <22500761+jcantosz@users.noreply.github.com>
Signed-off-by: Simon Ninon <sninon@pagerduty.com>
Signed-off-by: Martin Adler <1208749+EagleIJoe@users.noreply.github.com>
Signed-off-by: Rohit Agrawal <rohit.agrawal@databricks.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Mike Ball <mikedball@gmail.com>
Signed-off-by: Ravi Hari <ravireliable@gmail.com>
Signed-off-by: Siavash Safi <git@hosted.run>
Signed-off-by: Travis Perdue <travis.perdue@rallyhealth.com>
Co-authored-by: jaymebrd <jaymeb.email@gmail.com>
Co-authored-by: Zach Aller <zachaller@users.noreply.github.com>
Co-authored-by: Mário Bezerra <mvgmb@cin.ufpe.br>
Co-authored-by: Jesse Antoszyk <22500761+jcantosz@users.noreply.github.com>
Co-authored-by: Simon Ninon <simon@ninon.me>
Co-authored-by: Martin Adler <1208749+EagleIJoe@users.noreply.github.com>
Co-authored-by: Rohit Agrawal <rohit.agrawal@databricks.com>
Co-authored-by: Leonardo Luz Almeida <leoluz@users.noreply.github.com>
Co-authored-by: Mike Ball <mikedball@gmail.com>
Co-authored-by: cskh <huikang209@gmail.com>
Co-authored-by: Hui Kang <hui.kang@salesforce.com>
Co-authored-by: RaviHari <ravireliable@gmail.com>
Co-authored-by: Siavash Safi <git@hosted.run>
  • Loading branch information
14 people authored and Travis Perdue committed Jan 12, 2023
1 parent 2d906b1 commit a9d8d72
Show file tree
Hide file tree
Showing 7 changed files with 278 additions and 5 deletions.
8 changes: 4 additions & 4 deletions analysis/analysis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ func TestAssessRunStatusErrorMessageAnalysisPhaseFail(t *testing.T) {

func TestAssessRunStatusErrorMessageAnalysisPhaseFailInDryRunMode(t *testing.T) {
status, message, dryRunSummary := StartAssessRunStatusErrorMessageAnalysisPhaseFail(t, true)
assert.Equal(t, v1alpha1.AnalysisPhaseSuccessful, status)
assert.Equal(t, v1alpha1.AnalysisPhaseRunning, status)
assert.Equal(t, "", message)
expectedDryRunSummary := v1alpha1.RunSummary{
Count: 2,
Expand Down Expand Up @@ -1545,7 +1545,7 @@ func TestAssessRunStatusErrorMessageFromProvider(t *testing.T) {
func TestAssessRunStatusErrorMessageFromProviderInDryRunMode(t *testing.T) {
providerMessage := "Provider Error"
status, message, dryRunSummary := StartAssessRunStatusErrorMessageFromProvider(t, providerMessage, true)
assert.Equal(t, v1alpha1.AnalysisPhaseSuccessful, status)
assert.Equal(t, v1alpha1.AnalysisPhaseRunning, status)
assert.Equal(t, "", message)
expectedDryRunSummary := v1alpha1.RunSummary{
Count: 2,
Expand Down Expand Up @@ -1587,7 +1587,7 @@ func TestAssessRunStatusMultipleFailures(t *testing.T) {

func TestAssessRunStatusMultipleFailuresInDryRunMode(t *testing.T) {
status, message, dryRunSummary := StartAssessRunStatusMultipleFailures(t, true)
assert.Equal(t, v1alpha1.AnalysisPhaseSuccessful, status)
assert.Equal(t, v1alpha1.AnalysisPhaseRunning, status)
assert.Equal(t, "", message)
expectedDryRunSummary := v1alpha1.RunSummary{
Count: 2,
Expand Down Expand Up @@ -1732,7 +1732,7 @@ func TestAssessRunStatusWorstMessageInReconcileAnalysisRun(t *testing.T) {

func TestAssessRunStatusWorstMessageInReconcileAnalysisRunInDryRunMode(t *testing.T) {
newRun := StartAssessRunStatusWorstMessageInReconcileAnalysisRun(t, true)
assert.Equal(t, v1alpha1.AnalysisPhaseSuccessful, newRun.Status.Phase)
assert.Equal(t, v1alpha1.AnalysisPhaseRunning, newRun.Status.Phase)
assert.Equal(t, "", newRun.Status.Message)
expectedDryRunSummary := v1alpha1.RunSummary{
Count: 2,
Expand Down
117 changes: 117 additions & 0 deletions examples/traffic-routing/istio-mirror.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
## This examples sets up istio mirroring if running locally using docker for destkop you can add
## istio-host-split.com to your /etc/hosts and point it to 127.0.0.1 to view demo.
apiVersion: v1
kind: Service
metadata:
name: istio-host-split-canary
spec:
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: istio-host-split

---
apiVersion: v1
kind: Service
metadata:
name: istio-host-split-stable
spec:
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app: istio-host-split

---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: istio-host-split-vsvc
spec:
hosts:
- istio-host-split.com
gateways:
- istio-host-split-gateway
http:
- name: primary
route:
- destination:
host: istio-host-split-stable
weight: 100
- destination:
host: istio-host-split-canary
weight: 0

---
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: istio-host-split
spec:
replicas: 4
strategy:
canary:
canaryService: istio-host-split-canary
stableService: istio-host-split-stable
trafficRouting:
managedRoutes:
- name: mirror-route
istio:
virtualService:
name: istio-host-split-vsvc
routes:
- primary
steps:
- setCanaryScale:
weight: 50
- setMirrorRoute:
name: mirror-route
percentage: 50
match:
- method:
exact: POST
path:
prefix: /color
- pause: {}
selector:
matchLabels:
app: istio-host-split
template:
metadata:
labels:
app: istio-host-split
spec:
containers:
- name: istio-host-split
image: argoproj/rollouts-demo:green
ports:
- name: http
containerPort: 8080
protocol: TCP
resources:
requests:
memory: 16Mi
cpu: 5m

---

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: istio-host-split-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "istio-host-split.com"

71 changes: 71 additions & 0 deletions ingress/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,77 @@ func TestSyncIngressReferencedByRollout(t *testing.T) {
assert.Equal(t, 1, enqueuedObjects["default/rollout"])
}

func TestSkipIngressWithNoClass(t *testing.T) {
ing := newNginxIngressWithAnnotation("test-stable-ingress", 80, "stable-service")
ing.Annotations = nil
rollout := &v1alpha1.Rollout{
ObjectMeta: metav1.ObjectMeta{
Name: "rollout",
Namespace: metav1.NamespaceDefault,
},
Spec: v1alpha1.RolloutSpec{
Strategy: v1alpha1.RolloutStrategy{
Canary: &v1alpha1.CanaryStrategy{
StableService: "stable-service",
CanaryService: "canary-service",
TrafficRouting: &v1alpha1.RolloutTrafficRouting{
Nginx: &v1alpha1.NginxTrafficRouting{
StableIngress: "test-stable-ingress",
},
},
},
},
},
}

ctrl, kubeclient, enqueuedObjects := newFakeIngressController(t, ing, rollout)

err := ctrl.syncIngress("default/test-stable-ingress")
assert.NoError(t, err)
actions := kubeclient.Actions()
assert.Len(t, actions, 0)
assert.Len(t, enqueuedObjects, 0)
}

func TestSkipIngressWithNoClassMultiIngress(t *testing.T) {
ings := []*extensionsv1beta1.Ingress{
newNginxIngressWithAnnotation("test-stable-ingress", 80, "stable-service"),
newNginxIngressWithAnnotation("test-stable-ingress-additional", 80, "stable-service"),
}
for _, i := range ings {
i.Annotations = nil
}

rollout := &v1alpha1.Rollout{
ObjectMeta: metav1.ObjectMeta{
Name: "rollout",
Namespace: metav1.NamespaceDefault,
},
Spec: v1alpha1.RolloutSpec{
Strategy: v1alpha1.RolloutStrategy{
Canary: &v1alpha1.CanaryStrategy{
StableService: "stable-service",
CanaryService: "canary-service",
TrafficRouting: &v1alpha1.RolloutTrafficRouting{
Nginx: &v1alpha1.NginxTrafficRouting{
StableIngress: "test-stable-ingress",
AdditionalStableIngresses: []string{"test-stable-ingress-additional"},
},
},
},
},
},
}

ctrl, kubeclient, enqueuedObjects := newFakeIngressControllerMultiIngress(t, ings, rollout)

err := ctrl.syncIngress("default/test-stable-ingress")
assert.NoError(t, err)
actions := kubeclient.Actions()
assert.Len(t, actions, 0)
assert.Len(t, enqueuedObjects, 0)
}

func TestSyncIngressReferencedByRolloutMultiIngress(t *testing.T) {
ings := []*extensionsv1beta1.Ingress{
newNginxIngress("test-stable-ingress", 80, "stable-service"),
Expand Down
39 changes: 39 additions & 0 deletions rollout/trafficrouting/nginx/nginx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,45 @@ func TestReconcileCanaryCreateErrorAlreadyExistsPatch(t *testing.T) {
}
}

func TestSetHeaderRoute(t *testing.T) {
r := Reconciler{
cfg: ReconcilerConfig{
Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"),
},
}
err := r.SetHeaderRoute(&v1alpha1.SetHeaderRoute{
Name: "set-header",
Match: []v1alpha1.HeaderRoutingMatch{{
HeaderName: "header-name",
HeaderValue: &v1alpha1.StringMatch{
Exact: "value",
},
}},
})
assert.Nil(t, err)

err = r.RemoveManagedRoutes()
assert.Nil(t, err)
}

func TestSetMirrorRoute(t *testing.T) {
r := Reconciler{
cfg: ReconcilerConfig{
Rollout: fakeRollout("stable-service", "canary-service", "stable-ingress"),
},
}
err := r.SetMirrorRoute(&v1alpha1.SetMirrorRoute{
Name: "mirror-route",
Match: []v1alpha1.RouteMatch{{
Method: &v1alpha1.StringMatch{Exact: "GET"},
}},
})
assert.Nil(t, err)

err = r.RemoveManagedRoutes()
assert.Nil(t, err)
}

func TestReconcileCanaryCreateErrorAlreadyExistsPatchMultiIngress(t *testing.T) {
rollout := fakeRolloutWithMultiIngress("stable-service", "canary-service", "stable-ingress", "additional-stable-ingress")
stableIngress := extensionsIngress("stable-ingress", 80, "stable-service")
Expand Down
31 changes: 31 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package server
import (
"context"
"fmt"
"io/fs"
"net"
"net/http"
"strings"
Expand Down Expand Up @@ -110,6 +111,36 @@ func (s *ArgoRolloutsServer) newHTTPServer(ctx context.Context, port int) *http.
return &httpS
}

func (s *ArgoRolloutsServer) readIndexHtml() ([]byte, error) {
file, err := static.Open("static/index.html")
if err != nil {
log.Errorf("Failed to open file %s: %v", "static/index.html", err)
return nil, err
}
defer func() {
if file != nil {
if err := file.Close(); err != nil {
log.Errorf("Error closing file: %v", err)
}
}
}()

stat, err := file.Stat()
if err != nil {
log.Errorf("Failed to stat file or dir %s: %v", "static/index.html", err)
return nil, err
}

fileBytes := make([]byte, stat.Size())
_, err = file.Read(fileBytes)
if err != nil {
log.Errorf("Failed to read file %s: %v", "static/index.html", err)
return nil, err
}

return withRootPath(fileBytes, s.Options.RootPath), nil
}

func (s *ArgoRolloutsServer) newGRPCServer() *grpc.Server {
grpcS := grpc.NewServer()
var rolloutsServer rollout.RolloutServiceServer = NewServer(s.Options)
Expand Down
13 changes: 13 additions & 0 deletions ui/src/models/rollout/generated/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,19 @@ export interface GithubComArgoprojArgoRolloutsPkgApisRolloutsV1alpha1MangedRoute
*/
name?: string;
}
/**
*
* @export
* @interface GithubComArgoprojArgoRolloutsPkgApisRolloutsV1alpha1MangedRoutes
*/
export interface GithubComArgoprojArgoRolloutsPkgApisRolloutsV1alpha1MangedRoutes {
/**
*
* @type {string}
* @memberof GithubComArgoprojArgoRolloutsPkgApisRolloutsV1alpha1MangedRoutes
*/
name?: string;
}
/**
* MeasurementRetention defines the settings for retaining the number of measurements during the analysis.
* @export
Expand Down
4 changes: 3 additions & 1 deletion utils/analysis/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ func IsTerminating(run *v1alpha1.AnalysisRun) bool {

switch res.Phase {
case v1alpha1.AnalysisPhaseFailed, v1alpha1.AnalysisPhaseError, v1alpha1.AnalysisPhaseInconclusive:
return true
// If this metric is running in the dryRun mode then we don't care about the failures and hence the terminal
// decision shouldn't be affected.
return !res.DryRun
}
}
return false
Expand Down

0 comments on commit a9d8d72

Please sign in to comment.