-
Notifications
You must be signed in to change notification settings - Fork 859
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 customizations for source.toolkit.fluxcd.io/v1beta2/OCIRepository #3482
add customizations for source.toolkit.fluxcd.io/v1beta2/OCIRepository #3482
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #3482 +/- ##
==========================================
- Coverage 53.62% 53.62% -0.01%
==========================================
Files 210 210
Lines 19182 19182
==========================================
- Hits 10287 10286 -1
- Misses 8343 8344 +1
Partials 552 552
Flags with carried forward coverage won't be shown. Click here to find out more. |
82c246a
to
e600e60
Compare
The test report base on ### Check the customizations in file
$ karmadactl interpret -f customizations.yaml --check
I0501 18:39:59.663208 1133844 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:39:59.663658 1133844 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:39:59.676541 1133844 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:39:59.676863 1133844 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
-----------------------------------
SOURCE: declarative-configuration-ocirepository
TARGET: source.toolkit.fluxcd.io/v1beta2 OCIRepository
RULERS:
Retain: PASS
InterpretReplica: UNSET
ReviseReplica: UNSET
InterpretStatus: PASS
AggregateStatus: PASS
InterpretHealth: PASS
InterpretDependency: PASS
### Execute the retention rule
$ karmadactl interpret -f customizations.yaml --operation retain --desired-file testdata/desired-ocirepository.yaml --observed-file testdata/observed-ocirepository.yaml
I0501 18:40:13.367630 1134058 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:40:13.368063 1134058 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:40:13.377319 1134058 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:40:13.377413 1134058 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
---
# [1/1] retained:
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
name: sample
namespace: test-ocirepository
spec:
interval: 5m
ref:
semver: 6.2.x
suspend: true
url: oci://ghcr.io/stefanprodan/podinfo-deploy
### Execute the statusReflection rule
$ karmadactl interpret -f customizations.yaml --operation interpretStatus --observed-file testdata/observed-ocirepository.yaml
I0501 18:40:42.048515 1134414 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:40:42.048773 1134414 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:40:42.062364 1134414 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:40:42.062491 1134414 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
---
# [1/1] status:
artifact:
digest: sha256:b6ccead26c790c8a0d40579905edc6d83f732ceacc0f4133f578fed456a2438a
lastUpdateTime: "2023-04-29T06:07:53Z"
metadata:
org.opencontainers.image.created: "2022-11-09T11:24:23Z"
org.opencontainers.image.revision: 6.2.3/8615cb75d926ea0ba5353b1d56867868c737bf5e
org.opencontainers.image.source: https://github.com/stefanprodan/podinfo
path: ocirepository/test-ocirepository/sample/sha256:a081a2c95eff48a80add59a9db3488c1653b8f82223ed409e32d925d228af792.tar.gz
revision: 6.2.3@sha256:a081a2c95eff48a80add59a9db3488c1653b8f82223ed409e32d925d228af792
size: 1103
url: http://source-controller.flux-system.svc.cluster.local./ocirepository/test-ocirepository/sample/sha256:a081a2c95eff48a80add59a9db3488c1653b8f82223ed409e32d925d228af792.tar.gz
conditions:
- lastTransitionTime: "2023-04-29T06:07:53Z"
message: stored artifact for digest '6.2.3@sha256:a081a2c95eff48a80add59a9db3488c1653b8f82223ed409e32d925d228af792'
observedGeneration: 1
reason: Succeeded
status: "True"
type: Ready
- lastTransitionTime: "2023-04-29T06:07:53Z"
message: stored artifact for digest '6.2.3@sha256:a081a2c95eff48a80add59a9db3488c1653b8f82223ed409e32d925d228af792'
observedGeneration: 1
reason: Succeeded
status: "True"
type: ArtifactInStorage
url: http://source-controller.flux-system.svc.cluster.local./ocirepository/test-ocirepository/sample/latest.tar.gz
### Execute the healthInterpretation rule
$ karmadactl interpret -f customizations.yaml --operation interpretHealth --observed-file testdata/observed-ocirepository.yaml
I0501 18:41:00.268049 1134670 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:41:00.268219 1134670 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:41:00.278142 1134670 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:41:00.278247 1134670 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
---
# [1/1] healthy:
true
### Execute the dependencyInterpretation rule
$ karmadactl interpret -f customizations.yaml --operation interpretDependency --observed-file testdata/observed-ocirepository.yaml
I0501 18:41:14.375932 1134889 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:41:14.376089 1134889 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:41:14.386914 1134889 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:41:14.387347 1134889 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
---
# [1/1] dependencies:
- apiVersion: v1
kind: Secret
name: fake-secret
namespace: test-ocirepository
- apiVersion: v1
kind: ServiceAccount
name: fake-serviceaccount
namespace: test-ocirepository
### Execute the statusAggregation rule
$ karmadactl interpret -f customizations.yaml --operation aggregateStatus --observed-file testdata/observed-ocirepository.yaml --status-file testdata/status-file.yaml
I0501 18:41:32.842745 1135145 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:41:32.842943 1135145 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:41:32.853589 1135145 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0501 18:41:32.853681 1135145 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
---
# [1/1] aggregatedStatus:
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
name: sample
namespace: test-ocirepository
spec:
interval: 5m
provider: generic
ref:
semver: 6.2.x
secretRef:
name: fake-secret
serviceAccountName: fake-serviceaccount
suspend: true
timeout: 60s
url: oci://ghcr.io/stefanprodan/podinfo-deploy
status:
artifact:
digest: sha256:b6ccead26c790c8a0d40579905edc6d83f732ceacc0f4133f578fed456a2438a
lastUpdateTime: "2023-04-29T06:07:53Z"
metadata:
org.opencontainers.image.created: "2022-11-09T11:24:23Z"
org.opencontainers.image.revision: 6.2.3/8615cb75d926ea0ba5353b1d56867868c737bf5e
org.opencontainers.image.source: https://github.com/stefanprodan/podinfo
path: ocirepository/test-ocirepository/sample/sha256:a081a2c95eff48a80add59a9db3488c1653b8f82223ed409e32d925d228af792.tar.gz
revision: 6.2.3@sha256:a081a2c95eff48a80add59a9db3488c1653b8f82223ed409e32d925d228af792
size: 1103
url: http://source-controller.flux-system.svc.cluster.local./ocirepository/test-ocirepository/sample/sha256:a081a2c95eff48a80add59a9db3488c1653b8f82223ed409e32d925d228af792.tar.gz
conditions:
- lastTransitionTime: "2023-04-29T06:07:53Z"
message: member1=stored artifact for digest '6.2.3@sha256:a081a2c95eff48a80add59a9db3488c1653b8f82223ed409e32d925d228af792', member3=stored artifact for digest '6.2.3@sha256:a081a2c95eff48a80add59a9db3488c1653b8f82223ed409e32d925d228af792'
observedGeneration: 1
reason: Succeeded
status: "True"
type: Ready
- lastTransitionTime: "2023-04-29T06:07:53Z"
message: member1=stored artifact for digest '6.2.3@sha256:a081a2c95eff48a80add59a9db3488c1653b8f82223ed409e32d925d228af792', member3=stored artifact for digest '6.2.3@sha256:a081a2c95eff48a80add59a9db3488c1653b8f82223ed409e32d925d228af792'
observedGeneration: 1
reason: Succeeded
status: "True"
type: ArtifactInStorage
url: http://source-controller.flux-system.svc.cluster.local./ocirepository/test-ocirepository/sample/latest.tar.gz
|
2747a0f
to
2b159d6
Compare
Signed-off-by: yike21 <yike21@qq.com>
2b159d6
to
ac4fe4f
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Poor12 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:
Approvers can indicate their approval by writing |
semver: 6.2.x | ||
secretRef: | ||
name: fake-secret | ||
serviceAccountName: fake-serviceaccount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How was this serviceAccountName
generated?
/cc @yike21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not see this serviceAccountName
field in the desired-ocirepository.yaml
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is just for testing 'dependencyInterpretation'. In fact, .spec.serviceAccountName
is edited and not generated.
@chaunceyjiang: GitHub didn't allow me to request PR reviews from the following users: yike21. Note that only karmada-io members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Add third-party resources
source.toolkit.fluxcd.io/v1beta2/OCIRepository
into Resource Interpreter framework.Which issue(s) this PR fixes:
Part of #3331
Special notes for your reviewer:
@Poor12
Does this PR introduce a user-facing change?:
NONE