diff --git a/api/v1/artifact_types.go b/api/v1/artifact_types.go index e4dc00b8..9342ecfa 100644 --- a/api/v1/artifact_types.go +++ b/api/v1/artifact_types.go @@ -39,7 +39,7 @@ type Artifact struct { // Revision is a human-readable identifier traceable in the origin source // system. It can be a Git commit SHA, Git tag, a Helm chart version, etc. - // +optional + // +required Revision string `json:"revision"` // Digest is the digest of the file in the form of ':'. @@ -50,7 +50,7 @@ type Artifact struct { // LastUpdateTime is the timestamp corresponding to the last update of the // Artifact. // +required - LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"` + LastUpdateTime metav1.Time `json:"lastUpdateTime"` // Size is the number of bytes in the file. // +optional diff --git a/api/v1/gitrepository_types.go b/api/v1/gitrepository_types.go index 82353ee3..4475acba 100644 --- a/api/v1/gitrepository_types.go +++ b/api/v1/gitrepository_types.go @@ -96,6 +96,7 @@ type GitRepositorySpec struct { // Include specifies a list of GitRepository resources which Artifacts // should be included in the Artifact produced for this GitRepository. + // +optional Include []GitRepositoryInclude `json:"include,omitempty"` } @@ -104,17 +105,18 @@ type GitRepositorySpec struct { type GitRepositoryInclude struct { // GitRepositoryRef specifies the GitRepository which Artifact contents // must be included. + // +required GitRepositoryRef meta.LocalObjectReference `json:"repository"` // FromPath specifies the path to copy contents from, defaults to the root // of the Artifact. // +optional - FromPath string `json:"fromPath"` + FromPath string `json:"fromPath,omitempty"` // ToPath specifies the path to copy contents to, defaults to the name of // the GitRepositoryRef. // +optional - ToPath string `json:"toPath"` + ToPath string `json:"toPath,omitempty"` } // GetFromPath returns the specified FromPath. @@ -169,7 +171,8 @@ type GitRepositoryVerification struct { // SecretRef specifies the Secret containing the public keys of trusted Git // authors. - SecretRef meta.LocalObjectReference `json:"secretRef,omitempty"` + // +required + SecretRef meta.LocalObjectReference `json:"secretRef"` } // GitRepositoryStatus records the observed state of a Git repository. diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index 5718b2d5..0b0fde69 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2022 The Flux authors +Copyright 2023 The Flux authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go index 3fd54793..fd3252bf 100644 --- a/api/v1beta1/zz_generated.deepcopy.go +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2022 The Flux authors +Copyright 2023 The Flux authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/api/v1beta2/gitrepository_types.go b/api/v1beta2/gitrepository_types.go index fbfdd066..069d0339 100644 --- a/api/v1beta2/gitrepository_types.go +++ b/api/v1beta2/gitrepository_types.go @@ -23,6 +23,7 @@ import ( "github.com/fluxcd/pkg/apis/acl" "github.com/fluxcd/pkg/apis/meta" + apiv1 "github.com/fluxcd/source-controller/api/v1" ) @@ -191,7 +192,7 @@ type GitRepositoryVerification struct { // SecretRef specifies the Secret containing the public keys of trusted Git // authors. - SecretRef meta.LocalObjectReference `json:"secretRef,omitempty"` + SecretRef meta.LocalObjectReference `json:"secretRef"` } // GitRepositoryStatus records the observed state of a Git repository. diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index 7393ecbb..3a0850fd 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -2,7 +2,7 @@ // +build !ignore_autogenerated /* -Copyright 2022 The Flux authors +Copyright 2023 The Flux authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml b/config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml index 73f21a1b..39ff8edc 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_buckets.yaml @@ -411,7 +411,9 @@ spec: the Artifact contents. type: string required: + - lastUpdateTime - path + - revision - url type: object conditions: diff --git a/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml b/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml index 2a8c334e..60a6a4f5 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_gitrepositories.yaml @@ -174,6 +174,7 @@ spec: type: object required: - mode + - secretRef type: object required: - interval @@ -223,7 +224,9 @@ spec: the Artifact contents. type: string required: + - lastUpdateTime - path + - revision - url type: object conditions: @@ -339,7 +342,9 @@ spec: the Artifact contents. type: string required: + - lastUpdateTime - path + - revision - url type: object type: array @@ -926,6 +931,7 @@ spec: type: object required: - mode + - secretRef type: object required: - interval @@ -975,7 +981,9 @@ spec: the Artifact contents. type: string required: + - lastUpdateTime - path + - revision - url type: object conditions: @@ -1101,7 +1109,9 @@ spec: the Artifact contents. type: string required: + - lastUpdateTime - path + - revision - url type: object type: array diff --git a/config/crd/bases/source.toolkit.fluxcd.io_helmcharts.yaml b/config/crd/bases/source.toolkit.fluxcd.io_helmcharts.yaml index 6c7b468d..5df9916f 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_helmcharts.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_helmcharts.yaml @@ -486,7 +486,9 @@ spec: the Artifact contents. type: string required: + - lastUpdateTime - path + - revision - url type: object conditions: diff --git a/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml b/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml index cd8d5098..234495b9 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_helmrepositories.yaml @@ -403,7 +403,9 @@ spec: the Artifact contents. type: string required: + - lastUpdateTime - path + - revision - url type: object conditions: diff --git a/config/crd/bases/source.toolkit.fluxcd.io_ocirepositories.yaml b/config/crd/bases/source.toolkit.fluxcd.io_ocirepositories.yaml index 1cd95d67..e11a6609 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_ocirepositories.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_ocirepositories.yaml @@ -229,7 +229,9 @@ spec: the Artifact contents. type: string required: + - lastUpdateTime - path + - revision - url type: object conditions: diff --git a/docs/api/v1/source.md b/docs/api/v1/source.md index 1893dfdf..ed4862bb 100644 --- a/docs/api/v1/source.md +++ b/docs/api/v1/source.md @@ -205,6 +205,7 @@ the GitRepository as cloned from the URL, using their default settings.

+(Optional)

Include specifies a list of GitRepository resources which Artifacts should be included in the Artifact produced for this GitRepository.

@@ -279,7 +280,6 @@ string -(Optional)

Revision is a human-readable identifier traceable in the origin source system. It can be a Git commit SHA, Git tag, a Helm chart version, etc.

@@ -641,6 +641,7 @@ the GitRepository as cloned from the URL, using their default settings.

+(Optional)

Include specifies a list of GitRepository resources which Artifacts should be included in the Artifact produced for this GitRepository.

diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index 74dbebc3..e4b53a5f 100644 --- a/hack/boilerplate.go.txt +++ b/hack/boilerplate.go.txt @@ -1,5 +1,5 @@ /* -Copyright 2022 The Flux authors +Copyright 2023 The Flux authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.