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

Add SecretKeyReference comparison functions to pkg/compare #84

Merged

Conversation

a-hilaly
Copy link
Member

@a-hilaly a-hilaly commented Apr 22, 2022

Issue aws-controllers-k8s/community#1239

Currently, the code generator doesn't correctly generate delta comparison
functions for secret fields, because the runtime doesn't contain any
helper functions that can help in computing the delta of
SecretKeyReference and SecretKeyReference slices.

This patch adds two functions to help compare two instances or slices
of SecretKeyReference.

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.

Copy link
Collaborator

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

@a-hilaly very cool! I have a few changes to request inline but this is a great start!

pkg/compare/secret_key_reference.go Outdated Show resolved Hide resolved
pkg/compare/secret_key_reference.go Outdated Show resolved Hide resolved
pkg/compare/secret_key_reference.go Outdated Show resolved Hide resolved
pkg/compare/secret_key_reference.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

How are we doing on this one, @a-hilaly?

pkg/compare/secret_key_reference.go Outdated Show resolved Hide resolved
@a-hilaly a-hilaly requested a review from jaypipes June 17, 2022 15:35
@@ -0,0 +1,103 @@
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Rename this file. Maybe we could move it under pkg/compare/secrets/reference.go? Then when we do value comparison that can go under value.go?

Copy link
Contributor

Choose a reason for hiding this comment

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

This comment still stands. The file is named pkg/compare/reference.go, it is not clear that it involves secrets.

pkg/compare/secret_key_reference.go Outdated Show resolved Hide resolved
pkg/compare/secret_key_reference.go Outdated Show resolved Hide resolved
@jaypipes
Copy link
Collaborator

@a-hilaly how we doing on this one?

@a-hilaly
Copy link
Member Author

@RedbackThomson @jaypipes updated the PR pleasr retake a look

Issue aws-controllers-k8s/community#1239

Currently the code generator doesn't correctly generate delta comparison
functions for secret fields, because the runtime doesn't contain any
helper functions that can help in computing the delta of
`SecretKeyReference` and `SecretKeyReference` slices.

This patch adds two functions to help comparing two instance or slices
of `SecretKeyReference`. `SliceSecretKeyReferenceEqual` also return two
arrays containing the added and removed list of secret key references.
Copy link
Contributor

@RedbackThomson RedbackThomson left a comment

Choose a reason for hiding this comment

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

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 29, 2022
@ack-bot
Copy link
Collaborator

ack-bot commented Jun 29, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: A-Hilaly, RedbackThomson

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:
  • OWNERS [A-Hilaly,RedbackThomson]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-bot ack-bot merged commit 6dd4a27 into aws-controllers-k8s:main Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
4 participants