Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(develop): outbound-only new service flow #1050

Draft
wants to merge 87 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 77 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
ff628f3
chore: removes unneeded if statement
bartoszmajsak Jul 13, 2022
05085f1
chore: rewords some godoc
bartoszmajsak Jul 13, 2022
aba7f0c
chore: renames alphanumeric string generation func
bartoszmajsak Jul 13, 2022
35f5141
chore: rewords e2e scenarios
bartoszmajsak Jul 14, 2022
d6e93d4
chore: restructured e2e test cases
bartoszmajsak Jul 14, 2022
17bf2a2
chore(e2e): restructures e2e tests
bartoszmajsak Jul 14, 2022
0c4cfad
feat: simple web service to use in new service scenario
bartoszmajsak Jul 15, 2022
155e043
chore(test): disables ginkgo verbose output
bartoszmajsak Jul 15, 2022
7cc3db9
chore: adds error handling to new-service
bartoszmajsak Jul 15, 2022
ea209cc
chore: handles error from bar.Add call
bartoszmajsak Jul 15, 2022
93f7c6a
chore: moves generator code to main pkg/
bartoszmajsak Jul 19, 2022
c78c9df
chore(make): bumps Kustomize to latest release
bartoszmajsak Jul 20, 2022
5e62d9c
chore: removes gomega dependency from non-test deployment.go
bartoszmajsak Jul 20, 2022
5a75473
feat(test): first cut on new-service test
bartoszmajsak Jul 20, 2022
e5cefa3
chore: attempts to limit cobra deps in session logic
bartoszmajsak Jul 20, 2022
e6d9ba6
chore: renames TODO to FIX to make linter happy ;)
bartoszmajsak Jul 20, 2022
76854f3
feat(new-service): crufty version of ike develop new
bartoszmajsak Jul 20, 2022
d02790a
chore(generator): uses entry ports instead of hardcoded ones
bartoszmajsak Jul 20, 2022
44c3b23
chore(generator): renames Entry to ServiceEntry
bartoszmajsak Jul 20, 2022
9505818
fix(completion): scans all flags to build bash completion for custom …
bartoszmajsak Jul 20, 2022
ecce119
chore: gofmt
bartoszmajsak Jul 20, 2022
23bef0a
chore(e2e): deploys completion project right before ordered tests
bartoszmajsak Jul 20, 2022
f221664
fix(completion): validates argument
bartoszmajsak Jul 20, 2022
0c66c30
chore: gofmt
bartoszmajsak Jul 21, 2022
30123da
fix(rebase): removes left-over old test file
bartoszmajsak Jul 21, 2022
4efb30f
fix(cmd): ike develop new should work with tp translation
bartoszmajsak Jul 22, 2022
250991c
chore: cleans up dev cmd code
bartoszmajsak Jul 22, 2022
0207b97
chore: test-scenario prints available scenarios when no arg passed
bartoszmajsak Jul 22, 2022
d7f16a8
feat(generator): creates Printer func to abstract away how runtime.Ob…
bartoszmajsak Jul 22, 2022
44eb0b9
stub: collects generated objects instead of printing to file
bartoszmajsak Jul 22, 2022
8b1d777
feat(k8s): brings back dynamic client
bartoszmajsak Jul 22, 2022
38a04b5
feat(new-service): creates needed resources using client-go instead o…
bartoszmajsak Jul 22, 2022
4096653
chore: makes printer the last arguments in all scenarios
bartoszmajsak Jul 22, 2022
feb2980
chore: moves new service generator out of test code
bartoszmajsak Jul 22, 2022
f406e0e
fix: restores PROJECT file
bartoszmajsak Jul 22, 2022
136b276
feat(e2e): implements new service test using go:embed
bartoszmajsak Jul 22, 2022
f417c9f
fix(lint): fixes TODOs
bartoszmajsak Jul 22, 2022
2916229
fix: reverts controller image
bartoszmajsak Jul 22, 2022
cc2a369
chore: adds comment about tp annotation
bartoszmajsak Jul 22, 2022
26aeb9b
chore: removes unused new-service
bartoszmajsak Jul 22, 2022
22ac5a4
chore: cleanup
bartoszmajsak Jul 22, 2022
3204e41
chore: makes image part of service entry
bartoszmajsak Jul 26, 2022
471e0bf
chore: adds extra lines between test cases
bartoszmajsak Jul 26, 2022
f7af4dc
chore: cleans up telepresence logic from develop cmd
bartoszmajsak Jul 27, 2022
0835822
chore: makes sleep in seconds for better readability
bartoszmajsak Jul 27, 2022
744eadd
chore: renames istiov1alpha1 import aliast to workspacev1alpha1
bartoszmajsak Jul 27, 2022
0dbf49f
chore: renames WrapInPrinter to have Yaml in the name
bartoszmajsak Jul 28, 2022
7b578c4
feat(flag): enables limited-choice flags
bartoszmajsak Jul 29, 2022
bf7471e
chore: changes test cases description
bartoszmajsak Jul 29, 2022
5bcd055
fix: makes completion tests run!
bartoszmajsak Jul 29, 2022
fb5a2da
fix: creates gateway once for ns
bartoszmajsak Jul 29, 2022
4b14f5c
chore: enables tmpFs cleanup after test
bartoszmajsak Jul 29, 2022
005f6e4
feat: generates service name if not defined
bartoszmajsak Jul 29, 2022
ce054a7
docs: adds cli reference
bartoszmajsak Aug 2, 2022
c7816c1
Merge branch 'master' into new_service
bartoszmajsak Aug 2, 2022
97f5b44
chore: rewords test scenario names
bartoszmajsak Aug 2, 2022
02d917f
docs: documents how to use `ike develop new`
bartoszmajsak Aug 2, 2022
147440f
fix: populates deployment type to new service
bartoszmajsak Aug 2, 2022
7972267
fix: type values should be uppercase
bartoszmajsak Aug 2, 2022
b0d5bb5
chore: removes fixed // FIX
bartoszmajsak Aug 2, 2022
c9b88fa
Merge branch 'master' into new_service
bartoszmajsak Aug 2, 2022
c188520
chore: moves scenario names to consts
bartoszmajsak Aug 3, 2022
444c980
fix(e2e): ensures correct order of before hooks
bartoszmajsak Aug 3, 2022
9cac73f
chore: moves test services to their own folders
bartoszmajsak Aug 4, 2022
885e5c7
chore(make): pushes tagged and latest bundle
bartoszmajsak Aug 4, 2022
bcb872c
chore: renames model.Flip to Undo as it better explains the purpose
bartoszmajsak Aug 4, 2022
4e29b33
chore: prints available scenarios on failure
bartoszmajsak Aug 4, 2022
0072e11
chore(e2e): do not stop already finished command
bartoszmajsak Aug 4, 2022
c4c5f09
chore(e2e): do not stop already finished command
bartoszmajsak Aug 4, 2022
5273fe6
chore: fixes typos in gw locators
bartoszmajsak Aug 4, 2022
8b38d46
chore: enables gateway host definition for new service
bartoszmajsak Aug 4, 2022
4b24bff
chore: skips random suffix in service name generation
bartoszmajsak Aug 4, 2022
8c90dc8
Merge branch 'master' into new_service
bartoszmajsak Aug 8, 2022
c778a9d
Merge branch 'master' into new_service
bartoszmajsak Aug 11, 2022
d984504
fix: do not panic on SIGINT
bartoszmajsak Aug 24, 2022
c4e5d0e
feat: cleans up created resources on exit
bartoszmajsak Aug 26, 2022
4edbee2
fix: creates gateway for new deployment with single service
bartoszmajsak Aug 30, 2022
d23b1c3
Merge branch 'master' into new_service
bartoszmajsak Sep 14, 2022
f31d18c
chore: rewords test cases of ike develop
bartoszmajsak Sep 14, 2022
45a1d9b
Merge branch 'master' into new_service
bartoszmajsak Sep 16, 2022
6fe4d7f
fix: resolves merge issues
bartoszmajsak Sep 16, 2022
971566e
fix: cleans up resources on error
bartoszmajsak Sep 23, 2022
b99e2bb
fix: naming generator test has proper len
bartoszmajsak Oct 5, 2022
c5214c6
fix: avoids leaking hook goroutine
bartoszmajsak Oct 5, 2022
c3b4045
fix: extends timeouts in cmd tests
bartoszmajsak Oct 6, 2022
728c87f
Merge branch 'master' into new_service
bartoszmajsak Oct 7, 2022
afa2e6d
Merge branch 'master' into new_service
bartoszmajsak Oct 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,15 @@ issues:
exclude-rules:
- path: e2e/
linters:
- goconst
- gocyclo
- golint
- errcheck
- dupl
- gosec
- revive
- stylecheck
- wrapcheck
- path: test/
linters:
- revive
Expand Down
24 changes: 17 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ compile: deps generate format $(DIST_DIR)/$(BINARY_NAME) ## Compiles binaries
.PHONY: test
test: generate ## Runs tests
$(call header,"Running tests")
ginkgo -r -v -progress -vet=off -trace --skip-package=e2e --junit-report=ginkgo-test-results.xml ${args}
ginkgo -r -progress -vet=off -trace --skip-package=e2e --junit-report=ginkgo-test-results.xml ${args}

.PHONY: test-e2e
test-e2e: compile ## Runs end-to-end tests
$(call header,"Running end-to-end tests")
ginkgo e2e/ -r -v -progress -vet=off -trace --junit-report=ginkgo-test-results.xml ${args}
ginkgo e2e/ -r -progress -vet=off -trace --junit-report=ginkgo-test-results.xml ${args}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we add the -v to avoid the circle job to timeout with no output? Don't remember if that was successful or not

Copy link
Contributor Author

@bartoszmajsak bartoszmajsak Sep 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was verbose mode and it resulted in very noisy output. For seeing what's going on -progress is enough. See latest build https://app.circleci.com/pipelines/github/maistra/istio-workspace/3476/workflows/9bd1b0db-2859-45d0-9cb5-bdc1975663b2/jobs/8767?invite=true#step-108-820


.PHONY: clean
clean: ## Removes build artifacts
Expand Down Expand Up @@ -227,7 +227,7 @@ $(PROJECT_DIR)/bin/controller-gen:
$(call header,"Installing controller-gen")
$(call go-get-tool,$(PROJECT_DIR)/bin/controller-gen,sigs.k8s.io/controller-tools/cmd/controller-gen@$(shell go mod graph | grep controller-tools | head -n 1 | cut -d'@' -f 2))

KUSTOMIZE_VERSION?=v4.2.0
KUSTOMIZE_VERSION?=v4.5.5
$(PROJECT_DIR)/bin/kustomize:
$(call header,"Installing kustomize")
wget -q -c https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F$(KUSTOMIZE_VERSION)/kustomize_$(KUSTOMIZE_VERSION)_$(GOOS)_$(GOARCH).tar.gz -O /tmp/kustomize.tar.gz
Expand Down Expand Up @@ -289,6 +289,12 @@ container-image: compile ## Builds the container image
$(IKE_CONTAINER_REGISTRY)/$(IKE_CONTAINER_REPOSITORY)/$(IKE_IMAGE_NAME):$(IKE_IMAGE_TAG) \
$(IKE_CONTAINER_REGISTRY)/$(IKE_CONTAINER_REPOSITORY)/$(IKE_IMAGE_NAME):latest

.PHONY: container-image-all
container-image-all: container-image container-image-test container-image-test-prepared
aslakknutsen marked this conversation as resolved.
Show resolved Hide resolved

.PHONY: container-push-all
container-push-all: container-push container-push-test container-push-test-prepared

.PHONY: container-push
container-push: container-push--latest container-push-versioned ## Pushes container images to the registry (latest and versioned)

Expand Down Expand Up @@ -366,7 +372,7 @@ BUNDLE_CHANNELS:=--channels=$(CHANNELS)
BUNDLE_DEFAULT_CHANNEL:=--default-channel=$(DEFAULT_CHANNEL)
BUNDLE_METADATA_OPTS?=$(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)

BUNDLE_IMG?=$(IKE_CONTAINER_REGISTRY)/$(IKE_CONTAINER_REPOSITORY)/istio-workspace-operator-bundle:$(IKE_IMAGE_TAG)
BUNDLE_IMG?=$(IKE_CONTAINER_REGISTRY)/$(IKE_CONTAINER_REPOSITORY)/istio-workspace-operator-bundle
DESC_FILE:=dist/operatorhub_description.md
CSV_FILE:=bundle/manifests/istio-workspace-operator.clusterserviceversion.yaml

Expand All @@ -390,15 +396,19 @@ bundle: $(PROJECT_DIR)/bin/operator-sdk $(PROJECT_DIR)/bin/kustomize $(DIST_DIR)
.PHONY: bundle-image
bundle-image: ## Build the bundle image
$(call header,"Building bundle image")
$(IMG_BUILDER) build -f build/bundle.Containerfile -t $(BUNDLE_IMG) bundle/
$(IMG_BUILDER) build -f build/bundle.Containerfile -t $(BUNDLE_IMG):$(IKE_IMAGE_TAG) bundle/
$(IMG_BUILDER) tag \
$(BUNDLE_IMG):$(IKE_IMAGE_TAG) \
$(BUNDLE_IMG):latest

.PHONY: bundle-push
bundle-push: ## Push the bundle image
$(call header,"Pushing bundle image")
$(IMG_BUILDER) push $(BUNDLE_IMG)
$(IMG_BUILDER) push $(BUNDLE_IMG):latest
$(IMG_BUILDER) push $(BUNDLE_IMG):$(IKE_IMAGE_TAG)

BUNDLE_TIMEOUT?=5m
bundle-run:=operator-sdk run bundle $(BUNDLE_IMG) -n $(OPERATOR_NAMESPACE) --timeout $(BUNDLE_TIMEOUT) --index-image quay.io/operator-framework/opm:$(OPERATOR_SDK_VERSION)
bundle-run:=operator-sdk run bundle $(BUNDLE_IMG):$(IKE_IMAGE_TAG) -n $(OPERATOR_NAMESPACE) --timeout $(BUNDLE_TIMEOUT) --index-image quay.io/operator-framework/opm:$(OPERATOR_SDK_VERSION)

.PHONY: bundle-run
bundle-run: ## Run the bundle image in OwnNamespace(OPERATOR_NAMESPACE) install mode
Expand Down
22 changes: 11 additions & 11 deletions controllers/session/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import (
"strconv"
"strings"

istiov1alpha1 "github.com/maistra/istio-workspace/api/maistra/v1alpha1"
workspacev1alpha1 "github.com/maistra/istio-workspace/api/maistra/v1alpha1"
"github.com/maistra/istio-workspace/pkg/model"
)

func createConditionForLocatedRef(ref model.Ref, located model.LocatorStatus) istiov1alpha1.Condition {
func createConditionForLocatedRef(ref model.Ref, located model.LocatorStatus) workspacev1alpha1.Condition {
message := located.Kind + "/" + located.Name + " status " + ref.KindName.String() + ": "
reason := "Scheduled"
typeStr := createType(located.Action, located.Kind)
status := "true"

return istiov1alpha1.Condition{
Source: istiov1alpha1.Source{
return workspacev1alpha1.Condition{
Source: workspacev1alpha1.Source{
Kind: located.Kind,
Name: located.Name,
Ref: ref.KindName.String(),
Expand All @@ -27,16 +27,16 @@ func createConditionForLocatedRef(ref model.Ref, located model.LocatorStatus) is
}
}

func createConditionForModifiedRef(ref model.Ref, modified model.ModificatorStatus) istiov1alpha1.Condition {
func createConditionForModifiedRef(ref model.Ref, modified model.ModificatorStatus) workspacev1alpha1.Condition {
message := modified.Kind + "/" + modified.Name + " modified to satisfy " + ref.KindName.String() + ": "
if modified.Error != nil {
message += modified.Error.Error()
} else {
message += "ok"
}
var target *istiov1alpha1.Target
var target *workspacev1alpha1.Target
if modified.Target != nil {
target = &istiov1alpha1.Target{
target = &workspacev1alpha1.Target{
Kind: modified.Target.Kind,
Name: modified.Target.Name,
}
Expand All @@ -46,8 +46,8 @@ func createConditionForModifiedRef(ref model.Ref, modified model.ModificatorStat
reason := "Applied"
typeStr := createType(modified.Action, modified.Kind)

return istiov1alpha1.Condition{
Source: istiov1alpha1.Source{
return workspacev1alpha1.Condition{
Source: workspacev1alpha1.Source{
Kind: modified.Kind,
Name: modified.Name,
Ref: ref.KindName.String(),
Expand All @@ -64,9 +64,9 @@ func createType(action model.StatusAction, kindName string) string {
return strings.Title(string(action)) + strings.Title(kindName)
}

func cleanupRelatedConditionsOnRemoval(ref model.Ref, session *istiov1alpha1.Session) {
func cleanupRelatedConditionsOnRemoval(ref model.Ref, session *workspacev1alpha1.Session) {
if ref.Remove && refSuccessful(ref, session.Status.Conditions) {
var otherConditions []*istiov1alpha1.Condition
var otherConditions []*workspacev1alpha1.Condition
for i := range session.Status.Conditions {
condition := session.Status.Conditions[i]
if condition.Source.Ref != ref.KindName.String() {
Expand Down
10 changes: 5 additions & 5 deletions controllers/session/model_convert.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package session

import (
istiov1alpha1 "github.com/maistra/istio-workspace/api/maistra/v1alpha1"
workspacev1alpha1 "github.com/maistra/istio-workspace/api/maistra/v1alpha1"
"github.com/maistra/istio-workspace/pkg/model"
)

Expand All @@ -14,21 +14,21 @@ const (
)

// ConvertAPIRefToModelRef converts a Session.Spec.Ref to a model.Ref.
func ConvertAPIRefToModelRef(ref istiov1alpha1.Ref, namespace string) model.Ref {
func ConvertAPIRefToModelRef(ref workspacev1alpha1.Ref, namespace string) model.Ref {
return model.Ref{KindName: model.ParseRefKindName(ref.Name), Namespace: namespace, Strategy: ref.Strategy, Args: ref.Args}
}

// ConvertModelRouteToAPIRoute returns Model route as a session Route.
func ConvertModelRouteToAPIRoute(route model.Route) *istiov1alpha1.Route {
return &istiov1alpha1.Route{
func ConvertModelRouteToAPIRoute(route model.Route) *workspacev1alpha1.Route {
return &workspacev1alpha1.Route{
Type: route.Type,
Name: route.Name,
Value: route.Value,
}
}

// ConvertAPIRouteToModelRoute returns the defined route from the session or the Default.
func ConvertAPIRouteToModelRoute(session *istiov1alpha1.Session) model.Route {
func ConvertAPIRouteToModelRoute(session *workspacev1alpha1.Session) model.Route {
if session.Spec.Route.Type == "" {
return model.Route{
Type: RouteStrategyHeader,
Expand Down
30 changes: 15 additions & 15 deletions controllers/session/session_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"

istiov1alpha1 "github.com/maistra/istio-workspace/api/maistra/v1alpha1"
workspacev1alpha1 "github.com/maistra/istio-workspace/api/maistra/v1alpha1"
"github.com/maistra/istio-workspace/pkg/istio"
"github.com/maistra/istio-workspace/pkg/k8s"
"github.com/maistra/istio-workspace/pkg/log"
Expand Down Expand Up @@ -104,7 +104,7 @@ func add(mgr manager.Manager, r *ReconcileSession) error {
}

// Watch for changes to primary resource Session
err = c.Watch(&source.Kind{Type: &istiov1alpha1.Session{}}, &handler.InstrumentedEnqueueRequestForObject{}, predicate.GenerationChangedPredicate{})
err = c.Watch(&source.Kind{Type: &workspacev1alpha1.Session{}}, &handler.InstrumentedEnqueueRequestForObject{}, predicate.GenerationChangedPredicate{})
if err != nil {
return errors.Wrap(err, "failed creating session-controller")
}
Expand Down Expand Up @@ -181,7 +181,7 @@ func (r *ReconcileSession) Reconcile(orgCtx context.Context, request reconcile.R
c := NewInstrumentedClient(r.client)

// Fetch the Session instance
session := &istiov1alpha1.Session{}
session := &workspacev1alpha1.Session{}
err := c.Get(context.Background(), request.NamespacedName, session)
if err != nil {
if errorsK8s.IsNotFound(err) {
Expand All @@ -204,9 +204,9 @@ func (r *ReconcileSession) Reconcile(orgCtx context.Context, request reconcile.R
// update session.status.Route if it was not provided
session.Status.Route = ConvertModelRouteToAPIRoute(route)
session.Status.RouteExpression = session.Status.Route.String()
processing := istiov1alpha1.StateProcessing
processing := workspacev1alpha1.StateProcessing
session.Status.State = &processing
session.Status.Readiness = istiov1alpha1.StatusReadiness{Components: istiov1alpha1.StatusComponents{}}
session.Status.Readiness = workspacev1alpha1.StatusReadiness{Components: workspacev1alpha1.StatusComponents{}}

err = c.Status().Update(ctx, session)
if err != nil {
Expand All @@ -232,7 +232,7 @@ func (r *ReconcileSession) Reconcile(orgCtx context.Context, request reconcile.R

refs := calculateReferences(ctx, session)
sync := model.NewSync(r.manipulators.Locators, extractModificators(r.manipulators.Handlers))
session.Status.Conditions = []*istiov1alpha1.Condition{}
session.Status.Conditions = []*workspacev1alpha1.Condition{}
session.Status.Hosts = []string{}
session.Status.RefNames = []string{}
session.Status.Strategies = []string{}
Expand Down Expand Up @@ -299,10 +299,10 @@ func (r *ReconcileSession) Reconcile(orgCtx context.Context, request reconcile.R
return reconcile.Result{}, nil
}

func allConditionsSuccessful(conditions []*istiov1alpha1.Condition) bool {
func allConditionsSuccessful(conditions []*workspacev1alpha1.Condition) bool {
for i := range conditions {
condition := conditions[i]
conditionFailed := condition.Status != nil && *condition.Status == istiov1alpha1.StatusFailed
conditionFailed := condition.Status != nil && *condition.Status == workspacev1alpha1.StatusFailed
validation := condition.Reason != nil && *condition.Reason == ValidationReason
if conditionFailed && !validation {
return false
Expand All @@ -312,10 +312,10 @@ func allConditionsSuccessful(conditions []*istiov1alpha1.Condition) bool {
return true
}

func refSuccessful(ref model.Ref, conditions []*istiov1alpha1.Condition) bool {
func refSuccessful(ref model.Ref, conditions []*workspacev1alpha1.Condition) bool {
for i := range conditions {
condition := conditions[i]
conditionFailed := condition.Status != nil && *condition.Status == istiov1alpha1.StatusFailed
conditionFailed := condition.Status != nil && *condition.Status == workspacev1alpha1.StatusFailed
if condition.Source.Ref == ref.KindName.String() && conditionFailed {
return false
}
Expand All @@ -324,11 +324,11 @@ func refSuccessful(ref model.Ref, conditions []*istiov1alpha1.Condition) bool {
return true
}

func calculateSessionState(session *istiov1alpha1.Session) *istiov1alpha1.SessionState {
state := istiov1alpha1.StateSuccess
func calculateSessionState(session *workspacev1alpha1.Session) *workspacev1alpha1.SessionState {
state := workspacev1alpha1.StateSuccess
for _, con := range session.Status.Conditions {
if con.Status != nil && *con.Status == istiov1alpha1.StatusFailed {
state = istiov1alpha1.StateFailed
if con.Status != nil && *con.Status == workspacev1alpha1.StatusFailed {
state = workspacev1alpha1.StateFailed

break
}
Expand All @@ -337,7 +337,7 @@ func calculateSessionState(session *istiov1alpha1.Session) *istiov1alpha1.Sessio
return &state
}

func calculateReferences(ctx model.SessionContext, session *istiov1alpha1.Session) []model.Ref {
func calculateReferences(ctx model.SessionContext, session *workspacev1alpha1.Session) []model.Ref {
refs := []model.Ref{}
for _, ref := range session.Spec.Refs {
modelRef := ConvertAPIRefToModelRef(ref, ctx.Namespace)
Expand Down
Loading