-
Notifications
You must be signed in to change notification settings - Fork 503
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
opt(br): resolve TODOs & add IT cases #6100
Conversation
* Add RetriableJob interface * Add more usable method to Job interface * Implement JobLifecycleManager with Retry supported
/run-pull-e2e-kind-v2 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/v2 #6100 +/- ##
==============================================
- Coverage 54.56% 53.31% -1.25%
==============================================
Files 224 225 +1
Lines 15440 15818 +378
==============================================
+ Hits 8425 8434 +9
- Misses 7015 7384 +369
Flags with carried forward coverage won't be shown. Click here to find out more. |
/run-pull-e2e-kind-v2 |
1 similar comment
/run-pull-e2e-kind-v2 |
manifests/rbac/role.yaml
Outdated
- apiGroups: | ||
- "batch" | ||
resources: | ||
- jobs | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you generate this or add this manually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. f4d2fc5
// ForwardOnePort provide a helper to forward only one port | ||
// and return local endpoint | ||
func ForwardOnePort(ctx context.Context, fw PortForwarder, ns, resourceName string, port int) (string, error) { | ||
ports, err := fw.Forward(ctx, ns, resourceName, []int{port}) | ||
if err != nil { | ||
return "", err | ||
} | ||
if len(ports) != 1 { | ||
return "", fmt.Errorf("portforward expect only one port, but now %v", len(ports)) | ||
} | ||
localPort := int(ports[0].Local) | ||
return "localhost:" + strconv.Itoa(localPort), nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we already have functions like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. 0edbd54
// PortForwarder represents an interface which can forward local ports to a pod. | ||
type PortForwarder interface { | ||
Forward(ctx context.Context, namespace, resourceName string, remotePorts []int) ([]portforward.ForwardedPort, error) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. 0edbd54
tests/e2e/utils/k8s/k8s.go
Outdated
// ContainsString checks if a given slice of strings contains the provided string. | ||
// If a modifier func is provided, it is called with the slice item before the comparation. | ||
func ContainsString(slice []string, s string, modifier func(s string) string) bool { | ||
for _, item := range slice { | ||
if item == s { | ||
return true | ||
} | ||
if modifier != nil && modifier(item) == s { | ||
return true | ||
} | ||
} | ||
return false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add UT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. 8d4b22f
/run-pull-e2e-kind-v2 |
/run-pull-e2e-kind-v2 |
/run-pull-e2e-kind-v2 |
/run-pull-e2e-kind-v2 |
1 similar comment
/run-pull-e2e-kind-v2 |
/lgtm |
/run-pull-e2e-kind-v2 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fgksgf The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
/run-pull-e2e-kind-v2 |
What problem does this PR solve?
This PR aims to port IT cases from operator v1 to v2 and also resolve the remaining TODOs.
What is changed and how does it work?
sigs.k8s.io/controller-runtime/pkg/log
and log thereconcilerID
in each log.ctx
to every needed functions.Code changes
Tests
Side effects
Related changes
Release Notes
Please refer to Release Notes Language Style Guide before writing the release note.