Remove deprecated status fields from OCIRepository v1
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
parent
34bb9862e6
commit
aadaf1c0aa
1
Makefile
1
Makefile
|
|
@ -115,7 +115,6 @@ manifests: controller-gen ## Generate manifests, e.g. CRD, RBAC, etc.
|
||||||
cd api; $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role paths="./..." output:crd:artifacts:config="../config/crd/bases"
|
cd api; $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role paths="./..." output:crd:artifacts:config="../config/crd/bases"
|
||||||
|
|
||||||
api-docs: gen-crd-api-reference-docs ## Generate API reference documentation
|
api-docs: gen-crd-api-reference-docs ## Generate API reference documentation
|
||||||
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir=./api/v1beta2 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/v1beta2/source.md
|
|
||||||
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir=./api/v1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/v1/source.md
|
$(GEN_CRD_API_REFERENCE_DOCS) -api-dir=./api/v1 -config=./hack/api-docs/config.json -template-dir=./hack/api-docs/template -out-file=./docs/api/v1/source.md
|
||||||
|
|
||||||
tidy: ## Run go mod tidy
|
tidy: ## Run go mod tidy
|
||||||
|
|
|
||||||
|
|
@ -108,9 +108,6 @@ type OCIRepositorySpec struct {
|
||||||
// authenticating with a certificate; the CA cert is useful if
|
// authenticating with a certificate; the CA cert is useful if
|
||||||
// you are using a self-signed server certificate. The Secret must
|
// you are using a self-signed server certificate. The Secret must
|
||||||
// be of type `Opaque` or `kubernetes.io/tls`.
|
// be of type `Opaque` or `kubernetes.io/tls`.
|
||||||
//
|
|
||||||
// Note: Support for the `caFile`, `certFile` and `keyFile` keys have
|
|
||||||
// been deprecated.
|
|
||||||
// +optional
|
// +optional
|
||||||
CertSecretRef *meta.LocalObjectReference `json:"certSecretRef,omitempty"`
|
CertSecretRef *meta.LocalObjectReference `json:"certSecretRef,omitempty"`
|
||||||
|
|
||||||
|
|
@ -205,20 +202,6 @@ type OCIRepositoryStatus struct {
|
||||||
// +optional
|
// +optional
|
||||||
Artifact *Artifact `json:"artifact,omitempty"`
|
Artifact *Artifact `json:"artifact,omitempty"`
|
||||||
|
|
||||||
// ContentConfigChecksum is a checksum of all the configurations related to
|
|
||||||
// the content of the source artifact:
|
|
||||||
// - .spec.ignore
|
|
||||||
// - .spec.layerSelector
|
|
||||||
// observed in .status.observedGeneration version of the object. This can
|
|
||||||
// be used to determine if the content configuration has changed and the
|
|
||||||
// artifact needs to be rebuilt.
|
|
||||||
// It has the format of `<algo>:<checksum>`, for example: `sha256:<checksum>`.
|
|
||||||
//
|
|
||||||
// Deprecated: Replaced with explicit fields for observed artifact content
|
|
||||||
// config in the status.
|
|
||||||
// +optional
|
|
||||||
ContentConfigChecksum string `json:"contentConfigChecksum,omitempty"`
|
|
||||||
|
|
||||||
// ObservedIgnore is the observed exclusion patterns used for constructing
|
// ObservedIgnore is the observed exclusion patterns used for constructing
|
||||||
// the source artifact.
|
// the source artifact.
|
||||||
// +optional
|
// +optional
|
||||||
|
|
|
||||||
|
|
@ -68,9 +68,6 @@ spec:
|
||||||
authenticating with a certificate; the CA cert is useful if
|
authenticating with a certificate; the CA cert is useful if
|
||||||
you are using a self-signed server certificate. The Secret must
|
you are using a self-signed server certificate. The Secret must
|
||||||
be of type `Opaque` or `kubernetes.io/tls`.
|
be of type `Opaque` or `kubernetes.io/tls`.
|
||||||
|
|
||||||
Note: Support for the `caFile`, `certFile` and `keyFile` keys have
|
|
||||||
been deprecated.
|
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
description: Name of the referent.
|
description: Name of the referent.
|
||||||
|
|
@ -364,20 +361,6 @@ spec:
|
||||||
- type
|
- type
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
contentConfigChecksum:
|
|
||||||
description: |-
|
|
||||||
ContentConfigChecksum is a checksum of all the configurations related to
|
|
||||||
the content of the source artifact:
|
|
||||||
- .spec.ignore
|
|
||||||
- .spec.layerSelector
|
|
||||||
observed in .status.observedGeneration version of the object. This can
|
|
||||||
be used to determine if the content configuration has changed and the
|
|
||||||
artifact needs to be rebuilt.
|
|
||||||
It has the format of `<algo>:<checksum>`, for example: `sha256:<checksum>`.
|
|
||||||
|
|
||||||
Deprecated: Replaced with explicit fields for observed artifact content
|
|
||||||
config in the status.
|
|
||||||
type: string
|
|
||||||
lastHandledReconcileAt:
|
lastHandledReconcileAt:
|
||||||
description: |-
|
description: |-
|
||||||
LastHandledReconcileAt holds the value of the most recent
|
LastHandledReconcileAt holds the value of the most recent
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
apiVersion: source.toolkit.fluxcd.io/v1beta2
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
kind: OCIRepository
|
kind: OCIRepository
|
||||||
metadata:
|
metadata:
|
||||||
name: podinfo-deploy-signed-with-notation
|
name: podinfo-deploy-signed-with-notation
|
||||||
|
|
|
||||||
|
|
@ -1196,8 +1196,6 @@ registry. The client cert and key are useful if you are
|
||||||
authenticating with a certificate; the CA cert is useful if
|
authenticating with a certificate; the CA cert is useful if
|
||||||
you are using a self-signed server certificate. The Secret must
|
you are using a self-signed server certificate. The Secret must
|
||||||
be of type <code>Opaque</code> or <code>kubernetes.io/tls</code>.</p>
|
be of type <code>Opaque</code> or <code>kubernetes.io/tls</code>.</p>
|
||||||
<p>Note: Support for the <code>caFile</code>, <code>certFile</code> and <code>keyFile</code> keys have
|
|
||||||
been deprecated.</p>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -3296,8 +3294,6 @@ registry. The client cert and key are useful if you are
|
||||||
authenticating with a certificate; the CA cert is useful if
|
authenticating with a certificate; the CA cert is useful if
|
||||||
you are using a self-signed server certificate. The Secret must
|
you are using a self-signed server certificate. The Secret must
|
||||||
be of type <code>Opaque</code> or <code>kubernetes.io/tls</code>.</p>
|
be of type <code>Opaque</code> or <code>kubernetes.io/tls</code>.</p>
|
||||||
<p>Note: Support for the <code>caFile</code>, <code>certFile</code> and <code>keyFile</code> keys have
|
|
||||||
been deprecated.</p>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -3457,27 +3453,6 @@ Artifact
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<code>contentConfigChecksum</code><br>
|
|
||||||
<em>
|
|
||||||
string
|
|
||||||
</em>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<em>(Optional)</em>
|
|
||||||
<p>ContentConfigChecksum is a checksum of all the configurations related to
|
|
||||||
the content of the source artifact:
|
|
||||||
- .spec.ignore
|
|
||||||
- .spec.layerSelector
|
|
||||||
observed in .status.observedGeneration version of the object. This can
|
|
||||||
be used to determine if the content configuration has changed and the
|
|
||||||
artifact needs to be rebuilt.
|
|
||||||
It has the format of <code><algo>:<checksum></code>, for example: <code>sha256:<checksum></code>.</p>
|
|
||||||
<p>Deprecated: Replaced with explicit fields for observed artifact content
|
|
||||||
config in the status.</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<code>observedIgnore</code><br>
|
<code>observedIgnore</code><br>
|
||||||
<em>
|
<em>
|
||||||
string
|
string
|
||||||
|
|
|
||||||
|
|
@ -326,10 +326,6 @@ data:
|
||||||
ca.crt: <BASE64>
|
ca.crt: <BASE64>
|
||||||
```
|
```
|
||||||
|
|
||||||
**Warning:** Support for the `caFile`, `certFile` and `keyFile` keys have been
|
|
||||||
deprecated. If you have any Secrets using these keys and specified in an
|
|
||||||
OCIRepository, the controller will log a deprecation warning.
|
|
||||||
|
|
||||||
### Proxy secret reference
|
### Proxy secret reference
|
||||||
|
|
||||||
`.spec.proxySecretRef.name` is an optional field used to specify the name of a
|
`.spec.proxySecretRef.name` is an optional field used to specify the name of a
|
||||||
|
|
@ -1073,19 +1069,6 @@ configuration issue in the OCIRepository spec. When a reconciliation fails, the
|
||||||
reconciliation is performed again after the failure, the reason is updated to
|
reconciliation is performed again after the failure, the reason is updated to
|
||||||
`Progressing`.
|
`Progressing`.
|
||||||
|
|
||||||
### Content Configuration Checksum
|
|
||||||
|
|
||||||
The source-controller calculates the SHA256 checksum of the various
|
|
||||||
configurations of the OCIRepository that indicate a change in source and
|
|
||||||
records it in `.status.contentConfigChecksum`. This field is used to determine
|
|
||||||
if the source artifact needs to be rebuilt.
|
|
||||||
|
|
||||||
**Deprecation Note:** `contentConfigChecksum` is no longer used and will be
|
|
||||||
removed in the next API version. The individual components used for generating
|
|
||||||
content configuration checksum now have explicit fields in the status. This
|
|
||||||
makes the observations used by the controller for making artifact rebuild
|
|
||||||
decisions more transparent and easier to debug.
|
|
||||||
|
|
||||||
### Observed Ignore
|
### Observed Ignore
|
||||||
|
|
||||||
The source-controller reports an observed ignore in the OCIRepository's
|
The source-controller reports an observed ignore in the OCIRepository's
|
||||||
|
|
|
||||||
|
|
@ -1225,7 +1225,6 @@ func (r *OCIRepositoryReconciler) reconcileArtifact(ctx context.Context, sp *pat
|
||||||
// Record the observations on the object.
|
// Record the observations on the object.
|
||||||
obj.Status.Artifact = artifact.DeepCopy()
|
obj.Status.Artifact = artifact.DeepCopy()
|
||||||
obj.Status.Artifact.Metadata = metadata.Metadata
|
obj.Status.Artifact.Metadata = metadata.Metadata
|
||||||
obj.Status.ContentConfigChecksum = "" // To be removed in the next API version.
|
|
||||||
obj.Status.ObservedIgnore = obj.Spec.Ignore
|
obj.Status.ObservedIgnore = obj.Spec.Ignore
|
||||||
obj.Status.ObservedLayerSelector = obj.Spec.LayerSelector
|
obj.Status.ObservedLayerSelector = obj.Spec.LayerSelector
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3028,12 +3028,12 @@ func TestOCIRepository_objectLevelWorkloadIdentityFeatureGate(t *testing.T) {
|
||||||
})
|
})
|
||||||
g.Expect(err).NotTo(HaveOccurred())
|
g.Expect(err).NotTo(HaveOccurred())
|
||||||
|
|
||||||
obj := &ociv1.OCIRepository{
|
obj := &sourcev1.OCIRepository{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
GenerateName: "ocirepository-reconcile",
|
GenerateName: "ocirepository-reconcile",
|
||||||
Namespace: ns.Name,
|
Namespace: ns.Name,
|
||||||
},
|
},
|
||||||
Spec: ociv1.OCIRepositorySpec{
|
Spec: sourcev1.OCIRepositorySpec{
|
||||||
URL: "oci://ghcr.io/stefanprodan/manifests/podinfo",
|
URL: "oci://ghcr.io/stefanprodan/manifests/podinfo",
|
||||||
Interval: metav1.Duration{Duration: 60 * time.Minute},
|
Interval: metav1.Duration{Duration: 60 * time.Minute},
|
||||||
Provider: "aws",
|
Provider: "aws",
|
||||||
|
|
@ -3044,7 +3044,7 @@ func TestOCIRepository_objectLevelWorkloadIdentityFeatureGate(t *testing.T) {
|
||||||
g.Expect(testEnv.Create(ctx, obj)).To(Succeed())
|
g.Expect(testEnv.Create(ctx, obj)).To(Succeed())
|
||||||
|
|
||||||
key := client.ObjectKey{Name: obj.Name, Namespace: obj.Namespace}
|
key := client.ObjectKey{Name: obj.Name, Namespace: obj.Namespace}
|
||||||
resultobj := &ociv1.OCIRepository{}
|
resultobj := &sourcev1.OCIRepository{}
|
||||||
|
|
||||||
g.Eventually(func() bool {
|
g.Eventually(func() bool {
|
||||||
if err := testEnv.Get(ctx, key, resultobj); err != nil {
|
if err := testEnv.Get(ctx, key, resultobj); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -452,7 +452,7 @@ func int64p(i int64) *int64 {
|
||||||
return &i
|
return &i
|
||||||
}
|
}
|
||||||
|
|
||||||
func logOCIRepoStatus(t *testing.T, obj *sourcev1beta2.OCIRepository) {
|
func logOCIRepoStatus(t *testing.T, obj *sourcev1.OCIRepository) {
|
||||||
sts, _ := yaml.Marshal(obj.Status)
|
sts, _ := yaml.Marshal(obj.Status)
|
||||||
t.Log(string(sts))
|
t.Log(string(sts))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue