Skip to content

Commit 28ecd45

Browse files
committed
explain nolints
On-behalf-of: @SAP [email protected]
1 parent 18756a0 commit 28ecd45

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

internal/projection/projection.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func ProjectCRD(crd *apiextensionsv1.CustomResourceDefinition, pubRes *syncagent
116116
func stripUnwantedVersions(crd *apiextensionsv1.CustomResourceDefinition, pubRes *syncagentv1alpha1.PublishedResource) (*apiextensionsv1.CustomResourceDefinition, error) {
117117
src := pubRes.Spec.Resource
118118

119-
//nolint:staticcheck
119+
//nolint:staticcheck // .Version is deprecated, but we still support it for now.
120120
if src.Version != "" && len(src.Versions) > 0 {
121121
return nil, errors.New("cannot configure both .version and .versions in as the source of a PublishedResource")
122122
}
@@ -181,7 +181,7 @@ func projectCRDVersions(crd *apiextensionsv1.CustomResourceDefinition, pubRes *s
181181

182182
// We already validated that Version and Versions can be set at the same time.
183183

184-
//nolint:staticcheck
184+
//nolint:staticcheck // .Version is deprecated, but we still support it for now.
185185
if projection.Version != "" {
186186
if size := len(crd.Spec.Versions); size != 1 {
187187
return nil, fmt.Errorf("cannot project CRD version to a single version %q because it contains %d versions", projection.Version, size)

internal/sync/syncer_related.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func resolveRelatedResourceObjects(relatedOrigin, relatedDest syncSide, relRes s
251251

252252
func resolveRelatedResourceOriginNamespaces(relatedOrigin, relatedDest syncSide, origin syncagentv1alpha1.RelatedResourceOrigin, spec syncagentv1alpha1.RelatedResourceObjectSpec) (map[string]string, error) {
253253
switch {
254-
//nolint:staticcheck
254+
//nolint:staticcheck // .Reference is deprecated, but we still support it for now.
255255
case spec.Reference != nil:
256256
originNamespace, err := resolveObjectReference(relatedOrigin.object, *spec.Reference) //nolint:staticcheck
257257
if err != nil {

internal/sync/templating/naming.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ func generateLocalObjectIdentifier(pattern string, object *unstructured.Unstruct
9292
return Render(pattern, newLocalObjectNamingContext(object, clusterName, clusterPath))
9393
}
9494

95-
// legacy $variable style, does also not support clusterPath
95+
// Legacy $variable style, does also not support clusterPath;
96+
// note that all of these constants are deprecated already.
9697
replacer := strings.NewReplacer(
9798
// order of elements is important here, "$fooHash" needs to be defined before "$foo"
9899
syncagentv1alpha1.PlaceholderRemoteClusterName, clusterName.String(), //nolint:staticcheck

0 commit comments

Comments
 (0)