Skip to content

Commit

Permalink
gofmt 1.20 updates (style-only changes) (#110)
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Pipes <jaypipes@gmail.com>

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • Loading branch information
jaypipes authored Feb 8, 2023
1 parent 3b2bc34 commit 79e7f41
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 32 deletions.
5 changes: 3 additions & 2 deletions apis/core/v1alpha1/identifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ type ResourceFieldSelector struct {
// type to provide more user friendly syntax for references using 'from' field
// Ex:
// APIIDRef:
// from:
// name: my-api
//
// from:
// name: my-api
type AWSResourceReferenceWrapper struct {
From *AWSResourceReference `json:"from,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion apis/core/v1alpha1/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ type SecretKeyReference struct {
k8scorev1.SecretReference `json:""`
// Key is the key within the secret
Key string `json:"key"`
}
}
21 changes: 11 additions & 10 deletions pkg/compare/delta.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,17 @@ func (d *Delta) DifferentAt(subject string) bool {
//
// For example, consider this code:
//
// if delta.DifferentAt("Spec.Tags") {
// if err = rm.SyncTags(ctx, desired, latest); err != nil {
// return nil, err
// }
// }
// if !delta.DifferentExcept("Spec.Tags") {
// // We don't want to proceed to call the ModifyDBInstance API since
// // no other resource fields have changed.
// return desired, nil
// }
// if delta.DifferentAt("Spec.Tags") {
// if err = rm.SyncTags(ctx, desired, latest); err != nil {
// return nil, err
// }
// }
//
// if !delta.DifferentExcept("Spec.Tags") {
// // We don't want to proceed to call the ModifyDBInstance API since
// // no other resource fields have changed.
// return desired, nil
// }
//
// might be placed in an sdk_update_pre_build_request custom code hook to
// prevent the ModifyDBInstance call from being executed if the DBInstance's
Expand Down
1 change: 0 additions & 1 deletion pkg/compare/nil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ func TestNilDifference(t *testing.T) {
require.True(compare.HasNilDifference(nullChan, nonNullChan))

}

17 changes: 9 additions & 8 deletions pkg/compare/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ func (p Path) Pop() {
}
}

// Contains returns true if the supplied string, delimited on ".", matches
// p.parts up to the length of the supplied string.
// e.g. if the Path p represents "A.B":
// subject "A" -> true
// subject "A.B" -> true
// subject "A.B.C" -> false
// subject "B" -> false
// subject "A.C" -> false
// Contains returns true if the supplied string, delimited on ".", matches
// p.parts up to the length of the supplied string.
//
// e.g. if the Path p represents "A.B":
// subject "A" -> true
// subject "A.B" -> true
// subject "A.B.C" -> false
// subject "B" -> false
// subject "A.C" -> false
func (p Path) Contains(subject string) bool {
subjectSplit := strings.Split(subject, ".")

Expand Down
2 changes: 1 addition & 1 deletion pkg/condition/condition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestConditionGetters(t *testing.T) {
assert.Equal(len(gotAll), 2)

conds = append(conds, &ackv1alpha1.Condition{
Type: ackv1alpha1.ConditionTypeReferencesResolved,
Type: ackv1alpha1.ConditionTypeReferencesResolved,
Status: corev1.ConditionTrue,
})
r = &ackmocks.AWSResource{}
Expand Down
18 changes: 9 additions & 9 deletions pkg/runtime/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1085,15 +1085,15 @@ func (r *resourceReconciler) getEndpointURL(
// getResyncPeriod returns the period of the recurring reconciler process which ensures the desired
// state of custom resources is maintained.
// It attempts to retrieve the duration from the following sources, in this order:
// 1. A resource-specific reconciliation resync period specified in the reconciliation resync
// configuration map (--reconcile-default-resync-seconds).
// 2. A resource-specific requeue on success period specified by the resource manager factory.
// The resource manager factory is controller-specific, and thus this period is to specified
// by controller authors (using ack-generate).
// 3. The default reconciliation resync period period specified in the controller binary flags.
// (--reconcile-resource-resync-seconds)
// 4. The default resync period defined in the ACK runtime package. Defined in defaultResyncPeriod
// within the same file
// 1. A resource-specific reconciliation resync period specified in the reconciliation resync
// configuration map (--reconcile-default-resync-seconds).
// 2. A resource-specific requeue on success period specified by the resource manager factory.
// The resource manager factory is controller-specific, and thus this period is to specified
// by controller authors (using ack-generate).
// 3. The default reconciliation resync period period specified in the controller binary flags.
// (--reconcile-resource-resync-seconds)
// 4. The default resync period defined in the ACK runtime package. Defined in defaultResyncPeriod
// within the same file
//
// Each reconciler has a unique value to use. This function should only be called during the
// instantiation of an AWSResourceReconciler and should not be called during the reconciliation
Expand Down

0 comments on commit 79e7f41

Please sign in to comment.