-
Notifications
You must be signed in to change notification settings - Fork 277
Ftr logging link alpha #3181
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
Ftr logging link alpha #3181
Conversation
1b8855d
to
752fc03
Compare
ed24352
to
5b13a70
Compare
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.
Hi @tylerreidwaze , thank you so much for adding the resource.
before you addressing the comments, could you rebase to master HEAD and solve the conflict?
req := &loggingpb.DeleteLinkRequest{Name: a.id.External} | ||
op, err := a.gcpClient.DeleteLink(ctx, req) | ||
if err != nil { | ||
return false, fmt.Errorf("deleting Link %s: %w", a.id.External, err) |
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.
A special handling for NotFound error would be useful here.
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.
Just a note or something to implement here?
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.
Addressed in the new comment: #3181 (comment)
...logging/v1alpha1/logginglogginglink/basiclink/_generated_object_projectlogbucket.golden.yaml
Outdated
Show resolved
Hide resolved
apiVersion: logging.cnrm.cloud.google.com/v1alpha1 | ||
kind: LoggingLink | ||
metadata: | ||
name: logginglink${uniqueId} # no hyphen here as link ids can only have alphanumeric and underscores |
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.
If no hyphen is supported in Logging link resource, I suggest you use spec.resourceID
to specify the GCP resource ID, and add the hyphen back here. One reason we introduced spec.resourceID
was to solve the problem about inconsistent naming conventions between K8s objects and GCP resources.
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
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.
Now this is fixed, found a bug with this so good call :)
...est/resourcefixture/testdata/basic/logging/v1alpha1/logginglogginglink/basiclink/create.yaml
Outdated
Show resolved
Hide resolved
c0db853
to
67766fe
Compare
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.
Thank you for the addressing the comments, @tylerreidwaze !
You'll need to rebase against master HEAD again due to the new merge conflict.
Also, have you got the chance to run the tests locally against the real GCP API after you've made the change?
apis/logging/v1alpha1/link_types.go
Outdated
// LoggingLinkSpec defines the desired state of LoggingLink | ||
// +kcc:proto=google.logging.v2.Link | ||
type LoggingLinkSpec struct { | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable" |
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.
For the "incoming commit", did you mean a separate PR or did I miss anything?
apis/logging/v1alpha1/link_types.go
Outdated
// The maximum length of the description is 8000 characters. | ||
Description *string `json:"description,omitempty"` | ||
|
||
// Placeholder description |
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
...est/resourcefixture/testdata/basic/logging/v1alpha1/logginglogginglink/basiclink/create.yaml
Outdated
Show resolved
Hide resolved
a38fe82
to
7c7aeef
Compare
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 see the issue. I didn't save a few files in vscode and thus the changes werent uploaded
apis/logging/v1alpha1/link_types.go
Outdated
// The maximum length of the description is 8000 characters. | ||
Description *string `json:"description,omitempty"` | ||
|
||
// Placeholder description |
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.
Fix in most recent, not sure what happened here.
apis/logging/v1alpha1/link_types.go
Outdated
// LoggingLinkSpec defines the desired state of LoggingLink | ||
// +kcc:proto=google.logging.v2.Link | ||
type LoggingLinkSpec struct { | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="ResourceID field is immutable" |
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 am not sure what happened here. Somehow this wasnt added to a commit. Anywho, its fixed now
apis/logging/v1alpha1/link_types.go
Outdated
type LoggingLinkObservedState struct { | ||
|
||
// +optional | ||
// +kubebuilder:validation:Format=date-time |
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.
Another one that was lost, fixed.
5153394
to
ec8bd77
Compare
Tests have been run locally and are passing against real GCP. Rebase against master complete. Sorry for the issues and confusing commits I had in here |
ec8bd77
to
a0074b3
Compare
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.
LGTM except for a small issue.
Also the validations failed so could you rerun make ready-pr
?
a0074b3
to
98517d5
Compare
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
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.
Getting closer :)
98517d5
to
76b55f1
Compare
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maqiuyujoyce 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 |
Change description
This PR adds LoggingLinks as a KCC Resource
Tests you have done
make ready-pr
to ensure this PR is ready for review.