Skip to content

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

Merged
merged 21 commits into from
Mar 21, 2025
Merged

Ftr logging link alpha #3181

merged 21 commits into from
Mar 21, 2025

Conversation

tylerreidwaze
Copy link
Collaborator

@tylerreidwaze tylerreidwaze commented Nov 14, 2024

Change description

This PR adds LoggingLinks as a KCC Resource

Tests you have done

  • Run make ready-pr to ensure this PR is ready for review.
  • Perform necessary E2E testing for changed resources.

@tylerreidwaze tylerreidwaze changed the title Ftr logging link alpha do-not-merge/work-in-progress - Ftr logging link alpha Nov 15, 2024
@tylerreidwaze tylerreidwaze force-pushed the ftr-logging-link-alpha branch from 1b8855d to 752fc03 Compare February 6, 2025 22:53
@tylerreidwaze tylerreidwaze changed the title do-not-merge/work-in-progress - Ftr logging link alpha Ftr logging link alpha Feb 7, 2025
@tylerreidwaze tylerreidwaze added the enhancement New feature or request label Feb 10, 2025
@tylerreidwaze tylerreidwaze force-pushed the ftr-logging-link-alpha branch 2 times, most recently from ed24352 to 5b13a70 Compare February 26, 2025 22:55
Copy link
Collaborator

@maqiuyujoyce maqiuyujoyce left a 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)
Copy link
Collaborator

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.

Copy link
Collaborator Author

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?

Copy link
Collaborator

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)

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
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator Author

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 :)

@tylerreidwaze tylerreidwaze force-pushed the ftr-logging-link-alpha branch 4 times, most recently from c0db853 to 67766fe Compare March 14, 2025 22:37
Copy link
Collaborator

@maqiuyujoyce maqiuyujoyce left a 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?

// 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"
Copy link
Collaborator

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?

// The maximum length of the description is 8000 characters.
Description *string `json:"description,omitempty"`

// Placeholder description
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

@tylerreidwaze tylerreidwaze force-pushed the ftr-logging-link-alpha branch from a38fe82 to 7c7aeef Compare March 20, 2025 15:14
Copy link
Collaborator Author

@tylerreidwaze tylerreidwaze left a 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

// The maximum length of the description is 8000 characters.
Description *string `json:"description,omitempty"`

// Placeholder description
Copy link
Collaborator Author

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.

// 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"
Copy link
Collaborator Author

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

type LoggingLinkObservedState struct {

// +optional
// +kubebuilder:validation:Format=date-time
Copy link
Collaborator Author

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.

@tylerreidwaze tylerreidwaze force-pushed the ftr-logging-link-alpha branch 5 times, most recently from 5153394 to ec8bd77 Compare March 20, 2025 21:19
@tylerreidwaze
Copy link
Collaborator Author

tylerreidwaze commented Mar 20, 2025

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

@tylerreidwaze tylerreidwaze force-pushed the ftr-logging-link-alpha branch from ec8bd77 to a0074b3 Compare March 20, 2025 21:21
Copy link
Collaborator

@maqiuyujoyce maqiuyujoyce left a 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?

@tylerreidwaze tylerreidwaze force-pushed the ftr-logging-link-alpha branch from a0074b3 to 98517d5 Compare March 21, 2025 17:17
@github-advanced-security
Copy link

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.

Copy link
Collaborator Author

@tylerreidwaze tylerreidwaze left a comment

Choose a reason for hiding this comment

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

Getting closer :)

@tylerreidwaze tylerreidwaze force-pushed the ftr-logging-link-alpha branch from 98517d5 to 76b55f1 Compare March 21, 2025 18:26
@tylerreidwaze tylerreidwaze enabled auto-merge March 21, 2025 20:55
Copy link
Collaborator

@maqiuyujoyce maqiuyujoyce left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit de12150 into master Mar 21, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved enhancement New feature or request lgtm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants