Skip to content
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/Bucket #3485

Merged
merged 1 commit into from
May 6, 2023

Conversation

yike21
Copy link
Member

@yike21 yike21 commented Apr 29, 2023

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/Bucket 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

`Resource Interpreter`: Support `source.toolkit.fluxcd.io/v1beta2/Bucket`

@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Apr 29, 2023
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 29, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2023

Codecov Report

Merging #3485 (729aa56) into master (b841c54) will not change coverage.
The diff coverage is n/a.

📣 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    #3485   +/-   ##
=======================================
  Coverage   53.61%   53.61%           
=======================================
  Files         210      210           
  Lines       19182    19182           
=======================================
  Hits        10284    10284           
- Misses       8345     8346    +1     
+ Partials      553      552    -1     
Flag Coverage Δ
unittests 53.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 2 files with indirect coverage changes

@yike21
Copy link
Member Author

yike21 commented May 1, 2023

The test report base on karmadactl interpret is below:
note that the interpretHealth is false, and wantResult here is false. So it's OK.

### Check the customizations in file
$ karmadactl interpret -f customizations.yaml --check
I0501 19:04:08.017641 1154607 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 19:04:08.017803 1154607 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 19:04:08.029221 1154607 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 19:04:08.029333 1154607 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-bucket
TARGET: source.toolkit.fluxcd.io/v1beta2 Bucket   
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-bucket.yaml --observed-file testdata/observed-bucket.yaml 
I0501 19:04:18.207887 1154750 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 19:04:18.208043 1154750 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 19:04:18.217224 1154750 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 19:04:18.217368 1154750 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: Bucket
metadata:
    name: sample
    namespace: test-bucket
spec:
    bucketName: podinfo
    endpoint: minio.minio.svc.cluster.local:9000
    insecure: true
    interval: 5m0s
    provider: generic
    secretRef:
        name: fake-minio-credentials
    suspend: true
    timeout: 60s

### Execute the statusReflection rule
$ karmadactl interpret -f customizations.yaml --operation interpretStatus --observed-file testdata/observed-bucket.yaml 
I0501 19:04:32.645656 1154970 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 19:04:32.645866 1154970 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 19:04:32.655305 1154970 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 19:04:32.655418 1154970 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:
conditions:
    - lastTransitionTime: "2023-04-29T14:03:19Z"
      message: building artifact
      observedGeneration: 1
      reason: ProgressingWithRetry
      status: "True"
      type: Reconciling
    - lastTransitionTime: "2023-04-29T14:03:19Z"
      message: 'invalid ''fake-secret'' secret data: required fields ''accesskey'' and ''secretkey'''
      observedGeneration: 1
      reason: AuthenticationFailed
      status: "False"
      type: Ready
    - lastTransitionTime: "2023-04-29T14:01:44Z"
      message: 'invalid ''fake-secret'' secret data: required fields ''accesskey'' and ''secretkey'''
      observedGeneration: 1
      reason: AuthenticationFailed
      status: "True"
      type: FetchFailed

### Execute the healthInterpretation rule
$ karmadactl interpret -f customizations.yaml --operation interpretHealth --observed-file testdata/observed-bucket.yaml 
I0501 19:04:57.559273 1155282 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 19:04:57.559492 1155282 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 19:04:57.569215 1155282 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 19:04:57.569353 1155282 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:
false

### Execute the dependencyInterpretation rule 
$ karmadactl interpret -f customizations.yaml --operation interpretDependency --observed-file testdata/observed-bucket.yaml 
I0501 19:05:11.277817 1155488 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 19:05:11.278093 1155488 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 19:05:11.291086 1155488 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 19:05:11.291214 1155488 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-minio-credentials
  namespace: test-bucket

### Execute the statusAggregation rule 
$ karmadactl interpret -f customizations.yaml --operation aggregateStatus --observed-file testdata/observed-bucket.yaml --status-file testdata/status-file.yaml 
I0501 19:05:49.101253 1155981 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 19:05:49.101583 1155981 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 19:05:49.119844 1155981 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 19:05:49.120043 1155981 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: Bucket
metadata:
    name: sample
    namespace: test-bucket
spec:
    bucketName: podinfo
    endpoint: minio.minio.svc.cluster.local:9000
    insecure: true
    interval: 5m0s
    provider: generic
    secretRef:
        name: fake-minio-credentials
    suspend: true
    timeout: 60s
status:
    conditions:
        - lastTransitionTime: "2023-04-29T14:02:31Z"
          message: member1=building artifact, member3=building artifact
          observedGeneration: 1
          reason: ProgressingWithRetry
          status: "True"
          type: Reconciling
        - lastTransitionTime: "2023-04-29T14:02:31Z"
          message: 'member1=invalid ''fake-secret'' secret data: required fields ''accesskey'' and ''secretkey'', member3=invalid ''fake-secret'' secret data: required fields ''accesskey'' and ''secretkey'''
          observedGeneration: 1
          reason: AuthenticationFailed
          status: "False"
          type: Ready
        - lastTransitionTime: "2023-04-29T14:01:44Z"
          message: 'member1=invalid ''fake-secret'' secret data: required fields ''accesskey'' and ''secretkey'', member3=invalid ''fake-secret'' secret data: required fields ''accesskey'' and ''secretkey'''
          observedGeneration: 1
          reason: AuthenticationFailed
          status: "True"
          type: FetchFailed

@Poor12
Copy link
Member

Poor12 commented May 6, 2023

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2023
@karmada-bot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2023
@karmada-bot karmada-bot merged commit 060dbf9 into karmada-io:master May 6, 2023
@yike21 yike21 deleted the bundle-fluxcd-Bucket branch May 6, 2023 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants