diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 23505bc..22beba5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -32,6 +32,8 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + with: + submodules: recursive # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml index ef2261f..999a44c 100644 --- a/.github/workflows/dependabot.yml +++ b/.github/workflows/dependabot.yml @@ -9,3 +9,8 @@ updates: directory: / schedule: interval: daily + + - package-ecosystem: gitsubmodule + directory: / + schedule: + interval: monthly diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..8e928d7 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,20 @@ +name: Lint +on: + pull_request: + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: 1.20.x + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + args: --timeout 5m0s --verbose diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0cec78f..e1d6951 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ permissions: jobs: semantic-release: permissions: - contents: write # for codfish/semantic-release-action to create release tags + contents: write # for codfish/semantic-release-action to create release tags runs-on: ubuntu-latest outputs: release-version: ${{ steps.semantic.outputs.release-version }} @@ -22,6 +22,8 @@ jobs: egress-policy: audit - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + with: + submodules: true - uses: codfish/semantic-release-action@cbd853afe12037afb1306caca9d6b1ab6a58cf2a # v1.10.0 id: semantic env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..083f67f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] +name: Test +jobs: + test: + strategy: + matrix: + platform: [ubuntu-latest] + go-version: + - 1.20.x + runs-on: ${{ matrix.platform }} + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: recursive + - name: Test + run: go test ./... + env: + ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH: go1.20 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a749528 --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +.PHONY: test +test: + go test ./... -v + +.PHONY: lint +lint: + golangci-lint run diff --git a/argo-cd b/argo-cd index f0b8ffb..c2dfab5 160000 --- a/argo-cd +++ b/argo-cd @@ -1 +1 @@ -Subproject commit f0b8ffb7caa0b71634a26654cb532c236aa81cc6 +Subproject commit c2dfab5560cbe2bbc0daec31814a1eae57e9c363 diff --git a/go.mod b/go.mod index d53fd5d..a178dc3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/flanksource/is-healthy -go 1.19 +go 1.20 require ( github.com/gobwas/glob v0.2.3 diff --git a/pkg/health/health.go b/pkg/health/health.go index 3c39cb6..e9ea7f6 100644 --- a/pkg/health/health.go +++ b/pkg/health/health.go @@ -5,6 +5,15 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" ) +type Health string + +const ( + HealthHealthy Health = "healthy" + HealthUnhealthy Health = "unhealthy" + HealthUnknown Health = "unknown" + HealthWarning Health = "warning" +) + // Represents resource health status type HealthStatusCode string @@ -24,20 +33,33 @@ const ( // Indicates that resource is missing in the cluster. HealthStatusMissing HealthStatusCode = "Missing" - HealthStatusCreating HealthStatusCode = "Creating" - HealthStatusDeleted HealthStatusCode = "Deleted" - HealthStatusDeleting HealthStatusCode = "Deleting" - HealthStatusError HealthStatusCode = "Error" - HealthStatusInaccesible HealthStatusCode = "Inaccesible" - HealthStatusInfo HealthStatusCode = "Info" - HealthStatusPending HealthStatusCode = "Pending" - HealthStatusMaintenance HealthStatusCode = "Maintenance" - HealthStatusScaling HealthStatusCode = "Scaling" - HealthStatusUnhealthy HealthStatusCode = "Unhealthy" - HealthStatusUpdating HealthStatusCode = "Updating" - HealthStatusWarning HealthStatusCode = "Warning" - HealthStatusStopped HealthStatusCode = "Stopped" - HealthStatusStopping HealthStatusCode = "Stopping" + HealthStatusCompleted HealthStatusCode = "Completed" + HealthStatusCrashLoopBackoff HealthStatusCode = "CrashLoopBackOff" + HealthStatusCreating HealthStatusCode = "Creating" + HealthStatusDeleted HealthStatusCode = "Deleted" + HealthStatusDeleting HealthStatusCode = "Deleting" + HealthStatusError HealthStatusCode = "Error" + HealthStatusRolloutFailed HealthStatusCode = "Rollout Failed" + HealthStatusInaccesible HealthStatusCode = "Inaccesible" + HealthStatusInfo HealthStatusCode = "Info" + HealthStatusPending HealthStatusCode = "Pending" + HealthStatusMaintenance HealthStatusCode = "Maintenance" + HealthStatusScaling HealthStatusCode = "Scaling" + HealthStatusRestart HealthStatusCode = "Restarting" + HealthStatusStarting HealthStatusCode = "Starting" + + HealthStatusScalingUp HealthStatusCode = "Scaling Up" + HealthStatusScaledToZero HealthStatusCode = "Scaled to Zero" + HealthStatusScalingDown HealthStatusCode = "Scaling Down" + HealthStatusRunning HealthStatusCode = "Running" + + HealthStatusRollingOut HealthStatusCode = "Rolling Out" + + HealthStatusUnhealthy HealthStatusCode = "Unhealthy" + HealthStatusUpdating HealthStatusCode = "Updating" + HealthStatusWarning HealthStatusCode = "Warning" + HealthStatusStopped HealthStatusCode = "Stopped" + HealthStatusStopping HealthStatusCode = "Stopping" ) // Implements custom health assessment that overrides built-in assessment @@ -72,11 +94,15 @@ func IsWorse(current, new HealthStatusCode) bool { // GetResourceHealth returns the health of a k8s resource func GetResourceHealth(obj *unstructured.Unstructured, healthOverride HealthOverride) (health *HealthStatus, err error) { - if obj.GetDeletionTimestamp() != nil { - return &HealthStatus{ - Status: HealthStatusProgressing, - Message: "Pending deletion", - }, nil + if healthCheck := GetHealthCheckFunc(obj.GroupVersionKind()); healthCheck != nil { + if health, err = healthCheck(obj); err != nil { + health = &HealthStatus{ + Status: HealthStatusUnknown, + Message: err.Error(), + } + } else { + return health, nil + } } if healthOverride != nil { @@ -93,18 +119,16 @@ func GetResourceHealth(obj *unstructured.Unstructured, healthOverride HealthOver } } - if healthCheck := GetHealthCheckFunc(obj.GroupVersionKind()); healthCheck != nil { - if health, err = healthCheck(obj); err != nil { - health = &HealthStatus{ - Status: HealthStatusUnknown, - Message: err.Error(), - } - } + if obj.GetDeletionTimestamp() != nil { + return &HealthStatus{ + Status: HealthStatusDeleting, + }, nil } if health == nil { return &HealthStatus{ Status: HealthStatusUnknown, + Ready: true, }, nil } return health, err @@ -140,28 +164,10 @@ func GetHealthCheckFunc(gvk schema.GroupVersionKind) func(obj *unstructured.Unst case "Application": return getArgoApplicationHealth } - case "kustomize.toolkit.fluxcd.io": - switch gvk.Kind { - case "Kustomization": - return getFluxKustomizationHealth - } - case "helm.toolkit.fluxcd.io": - switch gvk.Kind { - case "HelmRelease": - return getFluxHelmReleaseHealth - } - case "source.toolkit.fluxcd.io": - switch gvk.Kind { - case "HelmRepository", "GitRepository": - return getFluxRepositoryHealth - } - - // case "apiregistration.k8s.io": - // switch gvk.Kind { - // case APIServiceKind: - // return getAPIServiceHealth - // } - + case "kustomize.toolkit.fluxcd.io", "helm.toolkit.fluxcd.io", "source.toolkit.fluxcd.io": + return GetDefaultHealth + case "cert-manager.io": + return GetDefaultHealth case "networking.k8s.io": switch gvk.Kind { case IngressKind: @@ -182,6 +188,8 @@ func GetHealthCheckFunc(gvk schema.GroupVersionKind) func(obj *unstructured.Unst switch gvk.Kind { case JobKind: return getJobHealth + case CronJobKind: + return getCronJobHealth } case "autoscaling": switch gvk.Kind { diff --git a/pkg/health/health_argo.go b/pkg/health/health_argo.go index 97a8b85..f1f21ac 100644 --- a/pkg/health/health_argo.go +++ b/pkg/health/health_argo.go @@ -33,43 +33,49 @@ func GetArgoWorkflowHealth(obj *unstructured.Unstructured) (*HealthStatus, error return nil, err } switch wf.Status.Phase { - case "", nodePending, nodeRunning: - return &HealthStatus{Status: HealthStatusProgressing, Message: wf.Status.Message}, nil + case "", nodePending: + return &HealthStatus{Health: HealthHealthy, Status: HealthStatusProgressing, Message: wf.Status.Message}, nil + case nodeRunning: + return &HealthStatus{Ready: true, Health: HealthHealthy, Status: HealthStatusProgressing, Message: wf.Status.Message}, nil case nodeSucceeded: - return &HealthStatus{Status: HealthStatusHealthy, Message: wf.Status.Message}, nil + return &HealthStatus{Ready: true, Health: HealthHealthy, Status: HealthStatusHealthy, Message: wf.Status.Message}, nil case nodeFailed, nodeError: - return &HealthStatus{Status: HealthStatusDegraded, Message: wf.Status.Message}, nil + return &HealthStatus{Health: HealthUnhealthy, Status: HealthStatusDegraded, Message: wf.Status.Message}, nil } - return &HealthStatus{Status: HealthStatusUnknown, Message: wf.Status.Message}, nil + return &HealthStatus{Health: HealthUnknown, Status: HealthStatusUnknown, Message: wf.Status.Message}, nil } -// An agnostic workflow object only considers Status.Phase and Status.Message. It is agnostic to the API version or any -// other fields. -type argoApplication struct { - Status struct { - Health HealthStatus - } -} +const ( + SyncStatusCodeSynced = "Synced" +) func getArgoApplicationHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { - var app argoApplication - if err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Object, &app); err != nil { - return nil, err + hs := &HealthStatus{Health: HealthUnknown} + var status map[string]interface{} + + status, ok := obj.Object["status"].(map[string]interface{}) + if !ok { + return hs, nil } - switch app.Status.Health.Status { - case HealthStatusProgressing: - return &HealthStatus{Status: HealthStatusProgressing, Message: app.Status.Health.Message}, nil - case HealthStatusHealthy: - return &HealthStatus{Status: HealthStatusHealthy, Message: app.Status.Health.Message}, nil - case HealthStatusSuspended: - return &HealthStatus{Status: HealthStatusSuspended, Message: app.Status.Health.Message}, nil - case HealthStatusDegraded: - return &HealthStatus{Status: HealthStatusDegraded, Message: app.Status.Health.Message}, nil - case HealthStatusMissing: - return &HealthStatus{Status: HealthStatusMissing, Message: app.Status.Health.Message}, nil - case HealthStatusUnknown: - return &HealthStatus{Status: HealthStatusUnknown, Message: app.Status.Health.Message}, nil + if sync, ok := status["sync"].(map[string]interface{}); ok { + hs.Ready = sync["status"] == SyncStatusCodeSynced + } + if health, ok := status["health"].(map[string]interface{}); ok { + if message, ok := health["message"]; ok { + hs.Message = message.(string) + } + if argoHealth, ok := health["status"]; ok { + hs.Status = HealthStatusCode(argoHealth.(string)) + switch hs.Status { + case HealthStatusHealthy: + hs.Health = HealthHealthy + case HealthStatusDegraded: + hs.Health = HealthUnhealthy + case HealthStatusUnknown, HealthStatusMissing, HealthStatusProgressing, HealthStatusSuspended: + hs.Health = HealthUnknown + } + } } - return &HealthStatus{Status: HealthStatusUnknown, Message: app.Status.Health.Message}, nil + return hs, nil } diff --git a/pkg/health/health_aws.go b/pkg/health/health_aws.go index 8ecc01f..43a99e8 100644 --- a/pkg/health/health_aws.go +++ b/pkg/health/health_aws.go @@ -73,11 +73,11 @@ var awsStatusMap = map[string]map[string]HealthStatusCode{ "maintenance": HealthStatusMaintenance, "modifying": HealthStatusUpdating, "moving-to-vpc": HealthStatusMaintenance, - "rebooting": HealthStatusStopping, + "rebooting": HealthStatusRestart, "resetting-master-credentials": HealthStatusMaintenance, "renaming": HealthStatusMaintenance, "restore-error": HealthStatusError, - "starting": HealthStatusProgressing, + "starting": HealthStatusStarting, "stopped": HealthStatusStopped, "stopping": HealthStatusStopping, "storage-config-upgrade": HealthStatusUpdating, @@ -88,7 +88,7 @@ var awsStatusMap = map[string]map[string]HealthStatusCode{ AWSResourceTypeELB: { "active": HealthStatusHealthy, - "provisioning": HealthStatusProgressing, + "provisioning": HealthStatusCreating, "active_impaired": HealthStatusWarning, "failed": HealthStatusError, }, diff --git a/pkg/health/health_cronjob.go b/pkg/health/health_cronjob.go new file mode 100644 index 0000000..dca1e52 --- /dev/null +++ b/pkg/health/health_cronjob.go @@ -0,0 +1,67 @@ +package health + +import ( + "fmt" + + batchv1 "k8s.io/api/batch/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" +) + +func getCronJobHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { + gvk := obj.GroupVersionKind() + switch gvk { + case batchv1.SchemeGroupVersion.WithKind(JobKind): + var job batchv1.CronJob + err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Object, &job) + if err != nil { + return nil, fmt.Errorf("failed to convert unstructured Job to typed: %v", err) + } + return getBatchv1CronJobHealth(&job) + default: + return nil, fmt.Errorf("unsupported CronJob GVK: %s", gvk) + } +} + +func getBatchv1CronJobHealth(job *batchv1.CronJob) (*HealthStatus, error) { + if job.Status.LastScheduleTime == nil { + return &HealthStatus{ + Health: HealthUnknown, + Message: "Not scheduled yet", + }, nil + } + + if job.Status.LastSuccessfulTime == nil { + return &HealthStatus{ + Health: HealthUnhealthy, + Status: HealthStatusError, + Message: "No successful run yet", + }, nil + } + + if job.Status.LastSuccessfulTime.Before(job.Status.LastScheduleTime) { + return &HealthStatus{ + Ready: true, // The cronjob did in fact run + Health: HealthUnhealthy, + Status: HealthStatusError, + Message: "Last run failed, last successful run was" + job.Status.LastSuccessfulTime.Format("2006-01-02 15:04:05 -0700"), + }, nil + } + + if len(job.Status.Active) > 0 { + return &HealthStatus{ + Ready: true, + Health: HealthHealthy, + Status: HealthStatusRunning, + Message: "Running since" + job.Status.LastScheduleTime.Format("2006-01-02 15:04:05 -0700"), + }, nil + } + + return &HealthStatus{ + Ready: true, + Health: HealthHealthy, + Status: HealthStatusCompleted, + Message: fmt.Sprintf("Last run at %s in %s", job.Status.LastScheduleTime.Format("2006-01-02 15:04:05 -0700"), job.Status.LastSuccessfulTime.Sub(job.Status.LastScheduleTime.Time)), + }, nil + +} diff --git a/pkg/health/health_daemonset.go b/pkg/health/health_daemonset.go index 9bf252e..65d7f6b 100644 --- a/pkg/health/health_daemonset.go +++ b/pkg/health/health_daemonset.go @@ -24,33 +24,50 @@ func getDaemonSetHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { } func getAppsv1DaemonSetHealth(daemon *appsv1.DaemonSet) (*HealthStatus, error) { - // Borrowed at kubernetes/kubectl/rollout_status.go https://github.com/kubernetes/kubernetes/blob/5232ad4a00ec93942d0b2c6359ee6cd1201b46bc/pkg/kubectl/rollout_status.go#L110 - if daemon.Generation <= daemon.Status.ObservedGeneration { - if daemon.Spec.UpdateStrategy.Type == appsv1.OnDeleteDaemonSetStrategyType { - return &HealthStatus{ - Status: HealthStatusHealthy, - Message: fmt.Sprintf("daemon set %d out of %d new pods have been updated", daemon.Status.UpdatedNumberScheduled, daemon.Status.DesiredNumberScheduled), - }, nil - } - if daemon.Status.UpdatedNumberScheduled < daemon.Status.DesiredNumberScheduled { - return &HealthStatus{ - Status: HealthStatusProgressing, - Message: fmt.Sprintf("Waiting for daemon set %q rollout to finish: %d out of %d new pods have been updated...", daemon.Name, daemon.Status.UpdatedNumberScheduled, daemon.Status.DesiredNumberScheduled), - }, nil - } - if daemon.Status.NumberAvailable < daemon.Status.DesiredNumberScheduled { - return &HealthStatus{ - Status: HealthStatusProgressing, - Message: fmt.Sprintf("Waiting for daemon set %q rollout to finish: %d of %d updated pods are available...", daemon.Name, daemon.Status.NumberAvailable, daemon.Status.DesiredNumberScheduled), - }, nil - } - } else { + + health := HealthUnknown + + if daemon.Status.NumberAvailable == daemon.Status.DesiredNumberScheduled { + health = HealthHealthy + } else if daemon.Status.NumberAvailable > 0 { + health = HealthWarning + } else if daemon.Status.NumberAvailable == 0 { + health = HealthUnhealthy + } + + if daemon.Generation == daemon.Status.ObservedGeneration && daemon.Status.UpdatedNumberScheduled == daemon.Status.DesiredNumberScheduled { + return &HealthStatus{ + Health: HealthHealthy, + Ready: true, + Status: HealthStatusRunning, + }, nil + } + + if daemon.Spec.UpdateStrategy.Type == appsv1.OnDeleteDaemonSetStrategyType { + return &HealthStatus{ + Health: health, + Ready: daemon.Status.NumberAvailable == daemon.Status.DesiredNumberScheduled, + Status: HealthStatusRunning, + Message: fmt.Sprintf("%d of %d pods updated", daemon.Status.UpdatedNumberScheduled, daemon.Status.DesiredNumberScheduled), + }, nil + } + if daemon.Status.UpdatedNumberScheduled < daemon.Status.DesiredNumberScheduled { return &HealthStatus{ - Status: HealthStatusProgressing, - Message: "Waiting for rollout to finish: observed daemon set generation less than desired generation", + Health: health, + Status: HealthStatusRollingOut, + Message: fmt.Sprintf("%d of %d pods updated", daemon.Status.UpdatedNumberScheduled, daemon.Status.DesiredNumberScheduled), }, nil } + if daemon.Status.NumberAvailable < daemon.Status.DesiredNumberScheduled { + return &HealthStatus{ + Health: health, + Status: HealthStatusRollingOut, + Message: fmt.Sprintf("%d of %d pods ready", daemon.Status.NumberAvailable, daemon.Status.DesiredNumberScheduled), + }, nil + } + return &HealthStatus{ - Status: HealthStatusHealthy, + Status: HealthStatusRunning, + Health: health, }, nil } diff --git a/pkg/health/health_deployment.go b/pkg/health/health_deployment.go index 8bbccb0..80fabd2 100644 --- a/pkg/health/health_deployment.go +++ b/pkg/health/health_deployment.go @@ -17,61 +17,68 @@ func getDeploymentHealth(obj *unstructured.Unstructured) (*HealthStatus, error) if err != nil { return nil, fmt.Errorf("failed to convert unstructured Deployment to typed: %v", err) } - return getAppsv1DeploymentHealth(&deployment) + return getAppsv1DeploymentHealth(&deployment, obj) default: return nil, fmt.Errorf("unsupported Deployment GVK: %s", gvk) } } -func getAppsv1DeploymentHealth(deployment *appsv1.Deployment) (*HealthStatus, error) { - if deployment.Spec.Paused { +func getAppsv1DeploymentHealth(deployment *appsv1.Deployment, obj *unstructured.Unstructured) (*HealthStatus, error) { + status, err := GetDefaultHealth(obj) + if err != nil { + return status, err + } + + replicas := int32(0) + + if deployment.Spec.Replicas != nil { + replicas = *deployment.Spec.Replicas + } + + if replicas == 0 && deployment.Status.Replicas == 0 { return &HealthStatus{ - Status: HealthStatusSuspended, - Message: "Deployment is paused", + Ready: true, + Status: HealthStatusScaledToZero, + Health: HealthUnknown, }, nil } - // Borrowed at kubernetes/kubectl/rollout_status.go https://github.com/kubernetes/kubernetes/blob/5232ad4a00ec93942d0b2c6359ee6cd1201b46bc/pkg/kubectl/rollout_status.go#L80 - if deployment.Generation <= deployment.Status.ObservedGeneration { - cond := getAppsv1DeploymentCondition(deployment.Status, appsv1.DeploymentProgressing) - if cond != nil && cond.Reason == "ProgressDeadlineExceeded" { - return &HealthStatus{ - Status: HealthStatusDegraded, - Message: fmt.Sprintf("Deployment %q exceeded its progress deadline", deployment.Name), - }, nil - } else if deployment.Spec.Replicas != nil && deployment.Status.UpdatedReplicas < *deployment.Spec.Replicas { - return &HealthStatus{ - Status: HealthStatusProgressing, - Message: fmt.Sprintf("Waiting for rollout to finish: %d out of %d new replicas have been updated...", deployment.Status.UpdatedReplicas, *deployment.Spec.Replicas), - }, nil - } else if deployment.Status.Replicas > deployment.Status.UpdatedReplicas { - return &HealthStatus{ - Status: HealthStatusProgressing, - Message: fmt.Sprintf("Waiting for rollout to finish: %d old replicas are pending termination...", deployment.Status.Replicas-deployment.Status.UpdatedReplicas), - }, nil - } else if deployment.Status.AvailableReplicas < deployment.Status.UpdatedReplicas { - return &HealthStatus{ - Status: HealthStatusProgressing, - Message: fmt.Sprintf("Waiting for rollout to finish: %d of %d updated replicas are available...", deployment.Status.AvailableReplicas, deployment.Status.UpdatedReplicas), - }, nil - } + + if deployment.Status.ReadyReplicas == replicas { + status.PreppendMessage("%d pods ready", deployment.Status.ReadyReplicas) } else { - return &HealthStatus{ - Status: HealthStatusProgressing, - Message: "Waiting for rollout to finish: observed deployment generation less than desired generation", - }, nil + status.PreppendMessage("%d of %d pods ready", deployment.Status.ReadyReplicas, replicas) } - return &HealthStatus{ - Status: HealthStatusHealthy, - }, nil -} + if deployment.Spec.Paused { + status.Ready = false + status.Status = HealthStatusSuspended + return status, err + } -func getAppsv1DeploymentCondition(status appsv1.DeploymentStatus, condType appsv1.DeploymentConditionType) *appsv1.DeploymentCondition { - for i := range status.Conditions { - c := status.Conditions[i] - if c.Type == condType { - return &c + if deployment.Status.ReadyReplicas > 0 { + status.Status = HealthStatusRunning + } + + if status.Health == HealthUnhealthy { + return status, nil + } + + if deployment.Status.ReadyReplicas < replicas { + status.AppendMessage("%d starting", deployment.Status.Replicas-deployment.Status.ReadyReplicas) + if deployment.Status.Replicas < replicas { + status.AppendMessage("%d creating", replicas-deployment.Status.Replicas) } + status.Ready = false + status.Status = HealthStatusStarting + } else if deployment.Status.UpdatedReplicas < replicas { + status.AppendMessage("%d updating", replicas-deployment.Status.UpdatedReplicas) + status.Ready = false + status.Status = HealthStatusRollingOut + } else if deployment.Status.Replicas > replicas { + status.AppendMessage("%d pods terminating", deployment.Status.Replicas-replicas) + status.Ready = false + status.Status = HealthStatusScalingDown } - return nil + + return status, nil } diff --git a/pkg/health/health_flux.go b/pkg/health/health_flux.go deleted file mode 100644 index a0c29bb..0000000 --- a/pkg/health/health_flux.go +++ /dev/null @@ -1,192 +0,0 @@ -package health - -import ( - "fmt" - "sort" - - v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" -) - -type fluxStatusType string - -const ( - fluxHealthy fluxStatusType = "Healthy" - fluxReady fluxStatusType = "Ready" - fluxReconciling fluxStatusType = "Reconciling" -) - -type fluxKustomization struct { - Status struct { - Conditions []struct { - Type fluxStatusType - Status v1.ConditionStatus - Reason string - Message string - } - } -} - -func getFluxKustomizationHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { - var k fluxKustomization - err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Object, &k) - if err != nil { - return nil, err - } - - ranking := map[fluxStatusType]int{ - fluxHealthy: 3, - fluxReady: 2, - fluxReconciling: 1, - } - sort.Slice(k.Status.Conditions, func(i, j int) bool { - return ranking[k.Status.Conditions[i].Type] > ranking[k.Status.Conditions[j].Type] - }) - for _, c := range k.Status.Conditions { - msg := fmt.Sprintf("%s: %s", c.Reason, c.Message) - if c.Type == fluxHealthy { - if c.Status == v1.ConditionTrue { - return &HealthStatus{Status: HealthStatusHealthy, Message: msg}, nil - } else { - return &HealthStatus{Status: HealthStatusDegraded, Message: msg}, nil - } - } - - if c.Type == fluxReady { - if c.Status == v1.ConditionTrue { - return &HealthStatus{Status: HealthStatusHealthy, Message: msg}, nil - } else { - return &HealthStatus{Status: HealthStatusDegraded, Message: msg}, nil - } - } - // All conditions apart from Healthy/Ready should be false - if c.Status == v1.ConditionTrue { - return &HealthStatus{ - Status: HealthStatusDegraded, - Message: msg, - }, nil - } - } - - return &HealthStatus{Status: HealthStatusUnknown, Message: ""}, nil -} - -type helmStatusType string - -const ( - helmReleased helmStatusType = "Released" - helmReady helmStatusType = "Ready" -) - -type fluxHelmRelease struct { - Status struct { - Conditions []struct { - Type helmStatusType - Status v1.ConditionStatus - Reason string - Message string - } - } -} - -func getFluxHelmReleaseHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { - var hr fluxHelmRelease - err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Object, &hr) - if err != nil { - return nil, err - } - - ranking := map[helmStatusType]int{ - helmReleased: 2, - helmReady: 1, - } - sort.Slice(hr.Status.Conditions, func(i, j int) bool { - return ranking[hr.Status.Conditions[i].Type] > ranking[hr.Status.Conditions[j].Type] - }) - - for _, c := range hr.Status.Conditions { - msg := fmt.Sprintf("%s: %s", c.Reason, c.Message) - if c.Type == helmReleased { - if c.Status == v1.ConditionTrue { - return &HealthStatus{Status: HealthStatusHealthy, Message: msg}, nil - } else { - return &HealthStatus{Status: HealthStatusDegraded, Message: msg}, nil - } - } - - if c.Type == helmReady { - if c.Status == v1.ConditionTrue { - return &HealthStatus{Status: HealthStatusHealthy, Message: msg}, nil - } else { - return &HealthStatus{Status: HealthStatusDegraded, Message: msg}, nil - } - } - // All conditions apart from Healthy/Ready should be false - if c.Status == v1.ConditionTrue { - return &HealthStatus{ - Status: HealthStatusDegraded, - Message: msg, - }, nil - } - } - - return &HealthStatus{Status: HealthStatusUnknown, Message: ""}, nil -} - -type fluxRepoStatusType string - -const ( - fluxRepoReconciling fluxRepoStatusType = "Reconciling" - fluxRepoReady fluxRepoStatusType = "Ready" - fluxRepoFetchFailed fluxRepoStatusType = "FetchFailed" - fluxRepoArtifactInStorage helmStatusType = "ArtifactInStorage" -) - -type fluxRepo struct { - Status struct { - Conditions []struct { - Type fluxRepoStatusType - Status v1.ConditionStatus - Reason string - Message string - } - } -} - -func getFluxRepositoryHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { - var hr fluxRepo - err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Object, &hr) - if err != nil { - return nil, err - } - - ranking := map[fluxRepoStatusType]int{ - fluxRepoReady: 3, - fluxRepoFetchFailed: 2, - fluxRepoReconciling: 1, - } - sort.Slice(hr.Status.Conditions, func(i, j int) bool { - return ranking[hr.Status.Conditions[i].Type] > ranking[hr.Status.Conditions[j].Type] - }) - - for _, c := range hr.Status.Conditions { - msg := fmt.Sprintf("%s: %s", c.Reason, c.Message) - if c.Type == fluxRepoReady { - if c.Status == v1.ConditionTrue { - return &HealthStatus{Status: HealthStatusHealthy, Message: msg}, nil - } else { - return &HealthStatus{Status: HealthStatusDegraded, Message: msg}, nil - } - } - - // All conditions apart from Healthy/Ready should be false - if c.Status == v1.ConditionTrue { - return &HealthStatus{ - Status: HealthStatusDegraded, - Message: msg, - }, nil - } - } - return &HealthStatus{Status: HealthStatusUnknown, Message: ""}, nil -} diff --git a/pkg/health/health_hpa.go b/pkg/health/health_hpa.go index 749df85..9529d6a 100644 --- a/pkg/health/health_hpa.go +++ b/pkg/health/health_hpa.go @@ -14,6 +14,7 @@ import ( var ( progressingStatus = &HealthStatus{ + Health: HealthHealthy, Status: HealthStatusProgressing, Message: "Waiting to Autoscale", } @@ -133,6 +134,7 @@ func checkConditions(conditions []hpaCondition, progressingStatus *HealthStatus) for _, condition := range conditions { if isDegraded(&condition) { return &HealthStatus{ + Health: HealthUnhealthy, Status: HealthStatusDegraded, Message: condition.Message, }, nil @@ -140,7 +142,9 @@ func checkConditions(conditions []hpaCondition, progressingStatus *HealthStatus) if isHealthy(&condition) { return &HealthStatus{ + Health: HealthHealthy, Status: HealthStatusHealthy, + Ready: true, Message: condition.Message, }, nil } diff --git a/pkg/health/health_ingress.go b/pkg/health/health_ingress.go index ee697f9..fa1f80d 100644 --- a/pkg/health/health_ingress.go +++ b/pkg/health/health_ingress.go @@ -11,14 +11,21 @@ func getIngressHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { if err != nil { return &HealthStatus{Status: HealthStatusError, Message: fmt.Sprintf("failed to ingress status: %v", err)}, nil } else if !found { - return &HealthStatus{Status: HealthStatusPending, Message: "ingress loadbalancer status not found"}, nil + return &HealthStatus{Health: HealthHealthy, Status: HealthStatusPending, Message: "ingress loadbalancer status not found"}, nil } - health := HealthStatus{} + health := HealthStatus{ + // Ready: false, // not possible to decide this from the information available + Health: HealthHealthy, + } if len(ingresses) > 0 { health.Status = HealthStatusHealthy + health.Health = HealthHealthy + health.Ready = true + } else { - health.Status = HealthStatusProgressing + health.Status = HealthStatusPending + health.Health = HealthUnknown } return &health, nil } diff --git a/pkg/health/health_job.go b/pkg/health/health_job.go index 9565069..7d05234 100644 --- a/pkg/health/health_job.go +++ b/pkg/health/health_job.go @@ -2,6 +2,7 @@ package health import ( "fmt" + corev1 "k8s.io/api/core/v1" batchv1 "k8s.io/api/batch/v1" @@ -25,47 +26,36 @@ func getJobHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { } func getBatchv1JobHealth(job *batchv1.Job) (*HealthStatus, error) { - failed := false - var failMsg string - complete := false - var message string - isSuspended := false + for _, condition := range job.Status.Conditions { switch condition.Type { case batchv1.JobFailed: - failed = true - complete = true - failMsg = condition.Message + return &HealthStatus{ + Ready: true, + Health: HealthUnhealthy, + Status: HealthStatusError, + Message: condition.Message, + }, nil case batchv1.JobComplete: - complete = true - message = condition.Message + return &HealthStatus{ + Ready: true, + Status: HealthStatusCompleted, + Health: HealthHealthy, + Message: condition.Message, + }, nil case batchv1.JobSuspended: - complete = true - message = condition.Message if condition.Status == corev1.ConditionTrue { - isSuspended = true + return &HealthStatus{ + Health: HealthUnknown, + Status: HealthStatusSuspended, + Message: condition.Message, + }, nil } } } - if !complete { - return &HealthStatus{ - Status: HealthStatusProgressing, - Message: message, - }, nil - } else if failed { - return &HealthStatus{ - Status: HealthStatusDegraded, - Message: failMsg, - }, nil - } else if isSuspended { - return &HealthStatus{ - Status: HealthStatusSuspended, - Message: failMsg, - }, nil - } else { - return &HealthStatus{ - Status: HealthStatusHealthy, - Message: message, - }, nil - } + + return &HealthStatus{ + Health: HealthHealthy, + Status: HealthStatusRunning, + }, nil } diff --git a/pkg/health/health_namespace.go b/pkg/health/health_namespace.go index e7ab9b4..e5ab5cb 100644 --- a/pkg/health/health_namespace.go +++ b/pkg/health/health_namespace.go @@ -16,11 +16,14 @@ func getNamespaceHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { if node.Status.Phase == v1.NamespaceActive { return &HealthStatus{ + Ready: true, + Health: HealthUnknown, Status: HealthStatusHealthy, }, nil } return &HealthStatus{ + Health: HealthUnknown, Status: HealthStatusDeleting, }, nil } diff --git a/pkg/health/health_node.go b/pkg/health/health_node.go index 43b8087..95aa64f 100644 --- a/pkg/health/health_node.go +++ b/pkg/health/health_node.go @@ -12,12 +12,14 @@ import ( func getNodeHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { var node v1.Node if err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Object, &node); err != nil { - return nil, fmt.Errorf("failed to convert unstructured Node to typed: %v", err) } + for _, cond := range node.Status.Conditions { if cond.Type == v1.NodeReady && cond.Status == v1.ConditionTrue { return &HealthStatus{ + Ready: true, + Health: HealthHealthy, Status: HealthStatusHealthy, }, nil } @@ -30,5 +32,6 @@ func getNodeHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { }, nil } } + return nil, errors.New("no conditions matched for node status") } diff --git a/pkg/health/health_pod.go b/pkg/health/health_pod.go index 6c80c1d..1570e92 100644 --- a/pkg/health/health_pod.go +++ b/pkg/health/health_pod.go @@ -25,6 +25,23 @@ func getPodHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { } func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) { + isReady := IsPodReady(pod) + if pod.ObjectMeta.DeletionTimestamp != nil && !pod.ObjectMeta.DeletionTimestamp.IsZero() { + if isReady { + return &HealthStatus{ + Status: HealthStatusDeleting, + Ready: false, + Health: HealthHealthy, + }, nil + } else { + return &HealthStatus{ + Status: HealthStatusDeleting, + Ready: false, + Health: HealthUnhealthy, + }, nil + } + } + // This logic cannot be applied when the pod.Spec.RestartPolicy is: corev1.RestartPolicyOnFailure, // corev1.RestartPolicyNever, otherwise it breaks the resource hook logic. // The issue is, if we mark a pod with ImagePullBackOff as Degraded, and the pod is used as a resource hook, @@ -33,19 +50,22 @@ func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) { // completed. if pod.Spec.RestartPolicy == corev1.RestartPolicyAlways { var status HealthStatusCode + var health Health var messages []string for _, containerStatus := range pod.Status.ContainerStatuses { waiting := containerStatus.State.Waiting // Article listing common container errors: https://medium.com/kokster/debugging-crashloopbackoffs-with-init-containers-26f79e9fb5bf if waiting != nil && (strings.HasPrefix(waiting.Reason, "Err") || strings.HasSuffix(waiting.Reason, "Error") || strings.HasSuffix(waiting.Reason, "BackOff")) { - status = HealthStatusDegraded + health = HealthUnhealthy + status = HealthStatusCode(waiting.Reason) messages = append(messages, waiting.Message) } } if status != "" { return &HealthStatus{ + Health: health, Status: status, Message: strings.Join(messages, ", "), }, nil @@ -70,33 +90,38 @@ func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) { switch pod.Status.Phase { case corev1.PodPending: return &HealthStatus{ - Status: HealthStatusProgressing, + Health: HealthUnknown, + Status: HealthStatusPending, Message: pod.Status.Message, }, nil case corev1.PodSucceeded: return &HealthStatus{ - Status: HealthStatusHealthy, + Health: HealthHealthy, + Status: HealthStatusCompleted, + Ready: true, Message: pod.Status.Message, }, nil case corev1.PodFailed: if pod.Status.Message != "" { // Pod has a nice error message. Use that. - return &HealthStatus{Status: HealthStatusDegraded, Message: pod.Status.Message}, nil + return &HealthStatus{Health: HealthUnhealthy, Status: HealthStatusError, Ready: true, Message: pod.Status.Message}, nil } for _, ctr := range append(pod.Status.InitContainerStatuses, pod.Status.ContainerStatuses...) { if msg := getFailMessage(&ctr); msg != "" { - return &HealthStatus{Status: HealthStatusDegraded, Message: msg}, nil + return &HealthStatus{Health: HealthUnhealthy, Status: HealthStatusError, Ready: true, Message: msg}, nil } } - return &HealthStatus{Status: HealthStatusDegraded, Message: ""}, nil + return &HealthStatus{Health: HealthUnhealthy, Status: HealthStatusError, Message: "", Ready: true}, nil case corev1.PodRunning: switch pod.Spec.RestartPolicy { case corev1.RestartPolicyAlways: // if pod is ready, it is automatically healthy - if IsPodReady(pod) { + if isReady { return &HealthStatus{ - Status: HealthStatusHealthy, + Health: HealthHealthy, + Ready: true, + Status: HealthStatusRunning, Message: pod.Status.Message, }, nil } @@ -104,27 +129,38 @@ func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) { for _, ctrStatus := range pod.Status.ContainerStatuses { if ctrStatus.LastTerminationState.Terminated != nil { return &HealthStatus{ - Status: HealthStatusDegraded, - Message: pod.Status.Message, + Health: HealthUnhealthy, + Ready: true, + Status: HealthStatusCode(ctrStatus.LastTerminationState.Terminated.Reason), + Message: ctrStatus.LastTerminationState.Terminated.Message, }, nil } } // otherwise we are progressing towards a ready state return &HealthStatus{ - Status: HealthStatusProgressing, + Health: HealthUnknown, + Status: HealthStatusStarting, Message: pod.Status.Message, }, nil case corev1.RestartPolicyOnFailure, corev1.RestartPolicyNever: - // pods set with a restart policy of OnFailure or Never, have a finite life. - // These pods are typically resource hooks. Thus, we consider these as Progressing - // instead of healthy. - return &HealthStatus{ - Status: HealthStatusProgressing, - Message: pod.Status.Message, - }, nil + + if isReady { + return &HealthStatus{ + Health: HealthHealthy, + Status: HealthStatusRunning, + }, nil + } else { + return &HealthStatus{ + Health: HealthUnhealthy, + Status: HealthStatusRunning, + }, nil + } + } } + return &HealthStatus{ + Health: HealthUnknown, Status: HealthStatusUnknown, Message: pod.Status.Message, }, nil diff --git a/pkg/health/health_pvc.go b/pkg/health/health_pvc.go index 5e934e1..ca5caac 100644 --- a/pkg/health/health_pvc.go +++ b/pkg/health/health_pvc.go @@ -24,16 +24,20 @@ func getPVCHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { } func getCorev1PVCHealth(pvc *corev1.PersistentVolumeClaim) (*HealthStatus, error) { - var status HealthStatusCode + health := HealthStatus{Health: HealthHealthy} switch pvc.Status.Phase { case corev1.ClaimLost: - status = HealthStatusDegraded + health.Health = HealthUnhealthy + health.Status = HealthStatusDegraded case corev1.ClaimPending: - status = HealthStatusProgressing + health.Status = HealthStatusProgressing case corev1.ClaimBound: - status = HealthStatusHealthy + health.Ready = true + health.Status = HealthStatusHealthy default: - status = HealthStatusUnknown + health.Health = HealthUnknown + health.Status = HealthStatusUnknown } - return &HealthStatus{Status: status}, nil + + return &health, nil } diff --git a/pkg/health/health_replicaset.go b/pkg/health/health_replicaset.go index 5435f20..55ac099 100644 --- a/pkg/health/health_replicaset.go +++ b/pkg/health/health_replicaset.go @@ -25,28 +25,61 @@ func getReplicaSetHealth(obj *unstructured.Unstructured) (*HealthStatus, error) } func getAppsv1ReplicaSetHealth(replicaSet *appsv1.ReplicaSet) (*HealthStatus, error) { - if replicaSet.Generation <= replicaSet.Status.ObservedGeneration { - cond := getAppsv1ReplicaSetCondition(replicaSet.Status, appsv1.ReplicaSetReplicaFailure) - if cond != nil && cond.Status == corev1.ConditionTrue { - return &HealthStatus{ - Status: HealthStatusDegraded, - Message: cond.Message, - }, nil - } else if replicaSet.Spec.Replicas != nil && replicaSet.Status.AvailableReplicas < *replicaSet.Spec.Replicas { - return &HealthStatus{ - Status: HealthStatusProgressing, - Message: fmt.Sprintf("Waiting for rollout to finish: %d out of %d new replicas are available...", replicaSet.Status.AvailableReplicas, *replicaSet.Spec.Replicas), - }, nil - } + health := HealthUnknown + if (replicaSet.Spec.Replicas == nil || *replicaSet.Spec.Replicas == 0) && replicaSet.Status.Replicas == 0 { + return &HealthStatus{ + Ready: true, + Status: HealthStatusScaledToZero, + Health: health, + }, nil + } + + if replicaSet.Spec.Replicas != nil && replicaSet.Status.ReadyReplicas >= *replicaSet.Spec.Replicas { + health = HealthHealthy + } else if replicaSet.Status.ReadyReplicas > 0 { + health = HealthWarning } else { + health = HealthUnhealthy + } + + if replicaSet.Generation == replicaSet.Status.ObservedGeneration && replicaSet.Status.ReadyReplicas == *replicaSet.Spec.Replicas { + return &HealthStatus{ + Health: health, + Status: HealthStatusRunning, + Ready: true, + }, nil + } + + failCondition := getAppsv1ReplicaSetCondition(replicaSet.Status, appsv1.ReplicaSetReplicaFailure) + if failCondition != nil && failCondition.Status == corev1.ConditionTrue { + return &HealthStatus{ + Health: health, + Status: HealthStatusError, + Message: failCondition.Message, + }, nil + } + + if replicaSet.Status.ReadyReplicas < *replicaSet.Spec.Replicas { + return &HealthStatus{ + Health: health, + Status: HealthStatusScalingUp, + Message: fmt.Sprintf("%d of %d pods ready", replicaSet.Status.ReadyReplicas, *replicaSet.Spec.Replicas), + Ready: true, + }, nil + } + + if replicaSet.Status.ReadyReplicas > *replicaSet.Spec.Replicas { return &HealthStatus{ - Status: HealthStatusProgressing, - Message: "Waiting for rollout to finish: observed replica set generation less than desired generation", + Health: health, + Status: HealthStatusScalingDown, + Message: fmt.Sprintf("%d pods terminating", replicaSet.Status.ReadyReplicas-*replicaSet.Spec.Replicas), + Ready: true, }, nil } return &HealthStatus{ - Status: HealthStatusHealthy, + Status: HealthStatusUnknown, + Health: health, }, nil } diff --git a/pkg/health/health_service.go b/pkg/health/health_service.go index 5e7b124..3ca17d6 100644 --- a/pkg/health/health_service.go +++ b/pkg/health/health_service.go @@ -24,13 +24,20 @@ func getServiceHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { } func getCorev1ServiceHealth(service *corev1.Service) (*HealthStatus, error) { - health := HealthStatus{Status: HealthStatusHealthy} + health := HealthStatus{Health: HealthHealthy, Status: HealthStatusHealthy} if service.Spec.Type == corev1.ServiceTypeLoadBalancer { if len(service.Status.LoadBalancer.Ingress) > 0 { - health.Status = HealthStatusHealthy + health.Status = HealthStatusRunning + health.Health = HealthHealthy + health.Ready = true } else { - health.Status = HealthStatusProgressing + health.Status = HealthStatusCreating + health.Health = HealthUnknown } + } else { + health.Ready = true + health.Status = HealthStatusUnknown + health.Health = HealthUnknown } return &health, nil } diff --git a/pkg/health/health_statefulset.go b/pkg/health/health_statefulset.go index 30e4f7d..91bf047 100644 --- a/pkg/health/health_statefulset.go +++ b/pkg/health/health_statefulset.go @@ -24,48 +24,43 @@ func getStatefulSetHealth(obj *unstructured.Unstructured) (*HealthStatus, error) } func getAppsv1StatefulSetHealth(sts *appsv1.StatefulSet) (*HealthStatus, error) { - // Borrowed at kubernetes/kubectl/rollout_status.go https://github.com/kubernetes/kubernetes/blob/5232ad4a00ec93942d0b2c6359ee6cd1201b46bc/pkg/kubectl/rollout_status.go#L131 - if sts.Status.ObservedGeneration == 0 || sts.Generation > sts.Status.ObservedGeneration { - return &HealthStatus{ - Status: HealthStatusProgressing, - Message: "Waiting for statefulset spec update to be observed...", - }, nil + + health := HealthHealthy + if sts.Status.ReadyReplicas == 0 { + health = HealthUnhealthy + } else if sts.Status.UpdatedReplicas == 0 { + health = HealthWarning + } else if sts.Spec.Replicas != nil && sts.Status.ReadyReplicas >= *sts.Spec.Replicas { + health = HealthHealthy } + if sts.Spec.Replicas != nil && sts.Status.ReadyReplicas < *sts.Spec.Replicas { return &HealthStatus{ - Status: HealthStatusProgressing, - Message: fmt.Sprintf("Waiting for %d pods to be ready...", *sts.Spec.Replicas-sts.Status.ReadyReplicas), - }, nil - } - if sts.Spec.UpdateStrategy.Type == appsv1.RollingUpdateStatefulSetStrategyType && sts.Spec.UpdateStrategy.RollingUpdate != nil { - if sts.Spec.Replicas != nil && sts.Spec.UpdateStrategy.RollingUpdate.Partition != nil { - if sts.Status.UpdatedReplicas < (*sts.Spec.Replicas - *sts.Spec.UpdateStrategy.RollingUpdate.Partition) { - return &HealthStatus{ - Status: HealthStatusProgressing, - Message: fmt.Sprintf("Waiting for partitioned roll out to finish: %d out of %d new pods have been updated...", - sts.Status.UpdatedReplicas, (*sts.Spec.Replicas - *sts.Spec.UpdateStrategy.RollingUpdate.Partition)), - }, nil - } - } - return &HealthStatus{ - Status: HealthStatusHealthy, - Message: fmt.Sprintf("partitioned roll out complete: %d new pods have been updated...", sts.Status.UpdatedReplicas), + Health: health, + Status: HealthStatusRollingOut, + Message: fmt.Sprintf("%d of %d pods ready", sts.Status.ReadyReplicas, *sts.Spec.Replicas), }, nil } - if sts.Spec.UpdateStrategy.Type == appsv1.OnDeleteStatefulSetStrategyType { + + if sts.Spec.Replicas != nil && sts.Status.UpdatedReplicas < *sts.Spec.Replicas { return &HealthStatus{ - Status: HealthStatusHealthy, - Message: fmt.Sprintf("statefulset has %d ready pods", sts.Status.ReadyReplicas), + Health: health, + Status: HealthStatusRollingOut, + Message: fmt.Sprintf("%d of %d pods updated", sts.Status.UpdatedReplicas, *sts.Spec.Replicas), }, nil } - if sts.Status.UpdateRevision != sts.Status.CurrentRevision { + + if sts.Status.ObservedGeneration == 0 || sts.Generation > sts.Status.ObservedGeneration { return &HealthStatus{ - Status: HealthStatusProgressing, - Message: fmt.Sprintf("waiting for statefulset rolling update to complete %d pods at revision %s...", sts.Status.UpdatedReplicas, sts.Status.UpdateRevision), + Health: health, + Status: HealthStatusRollingOut, }, nil } + return &HealthStatus{ - Status: HealthStatusHealthy, - Message: fmt.Sprintf("statefulset rolling update complete %d pods at revision %s...", sts.Status.CurrentReplicas, sts.Status.CurrentRevision), + Ready: true, + Health: health, + Status: HealthStatusRunning, }, nil + } diff --git a/pkg/health/health_test.go b/pkg/health/health_test.go index cf3a9ba..e9a7a27 100644 --- a/pkg/health/health_test.go +++ b/pkg/health/health_test.go @@ -16,9 +16,11 @@ import ( "sigs.k8s.io/yaml" ) -func assertAppHealth(t *testing.T, yamlPath string, expectedStatus health.HealthStatusCode) { +func assertAppHealth(t *testing.T, yamlPath string, expectedStatus health.HealthStatusCode, expectedHealth health.Health, expectedReady bool) { health := getHealthStatus(yamlPath, t) assert.NotNil(t, health) + assert.Equal(t, expectedHealth, health.Health) + assert.Equal(t, expectedReady, health.Ready) assert.Equal(t, expectedStatus, health.Status) } @@ -34,99 +36,108 @@ func getHealthStatus(yamlPath string, t *testing.T) *health.HealthStatus { } func TestNamespace(t *testing.T) { - assertAppHealth(t, "./testdata/namespace.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/namespace-terminating.yaml", health.HealthStatusDeleting) + assertAppHealth(t, "./testdata/namespace.yaml", health.HealthStatusHealthy, health.HealthUnknown, true) + assertAppHealth(t, "./testdata/namespace-terminating.yaml", health.HealthStatusDeleting, health.HealthUnknown, false) } func TestCertificate(t *testing.T) { - assertAppHealth(t, "./testdata/certificate-healthy.yaml", health.HealthStatusHealthy) + b := "../resource_customizations/cert-manager.io/Certificate/testdata/" + assertAppHealth(t, "./testdata/certificate-healthy.yaml", "Issued", health.HealthHealthy, true) + assertAppHealth(t, b+"degraded_configError.yaml", "ConfigError", health.HealthUnhealthy, true) + assertAppHealth(t, b+"progressing_issuing.yaml", "Issuing", health.HealthUnknown, false) +} + +func TestExternalSecrets(t *testing.T) { + b := "../resource_customizations/external-secrets.io/ExternalSecret/testdata/" + assertAppHealth(t, b+"degraded.yaml", "", health.HealthUnhealthy, true) + assertAppHealth(t, b+"progressing.yaml", "Progressing", health.HealthUnknown, false) + assertAppHealth(t, b+"healthy.yaml", "", health.HealthHealthy, true) } func TestDeploymentHealth(t *testing.T) { - assertAppHealth(t, "./testdata/nginx.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/deployment-progressing.yaml", health.HealthStatusProgressing) - assertAppHealth(t, "./testdata/deployment-suspended.yaml", health.HealthStatusSuspended) - assertAppHealth(t, "./testdata/deployment-degraded.yaml", health.HealthStatusDegraded) + assertAppHealth(t, "./testdata/nginx.yaml", health.HealthStatusRunning, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/deployment-progressing.yaml", health.HealthStatusStarting, health.HealthHealthy, false) + assertAppHealth(t, "./testdata/deployment-suspended.yaml", health.HealthStatusSuspended, health.HealthHealthy, false) + assertAppHealth(t, "./testdata/deployment-degraded.yaml", health.HealthStatusStarting, health.HealthHealthy, false) + assertAppHealth(t, "./testdata/deployment-scaling-down.yaml", health.HealthStatusScalingDown, health.HealthHealthy, false) + assertAppHealth(t, "./testdata/deployment-failed.yaml", health.HealthStatusRolloutFailed, health.HealthUnhealthy, false) } func TestStatefulSetHealth(t *testing.T) { - assertAppHealth(t, "./testdata/statefulset.yaml", health.HealthStatusHealthy) + assertAppHealth(t, "./testdata/statefulset.yaml", health.HealthStatusRollingOut, health.HealthWarning, false) } func TestStatefulSetOnDeleteHealth(t *testing.T) { - assertAppHealth(t, "./testdata/statefulset-ondelete.yaml", health.HealthStatusHealthy) + assertAppHealth(t, "./testdata/statefulset-ondelete.yaml", health.HealthStatusRollingOut, health.HealthWarning, false) } func TestDaemonSetOnDeleteHealth(t *testing.T) { - assertAppHealth(t, "./testdata/daemonset-ondelete.yaml", health.HealthStatusHealthy) + assertAppHealth(t, "./testdata/daemonset-ondelete.yaml", health.HealthStatusRunning, health.HealthHealthy, true) } func TestPVCHealth(t *testing.T) { - assertAppHealth(t, "./testdata/pvc-bound.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/pvc-pending.yaml", health.HealthStatusProgressing) + assertAppHealth(t, "./testdata/pvc-bound.yaml", health.HealthStatusHealthy, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/pvc-pending.yaml", health.HealthStatusProgressing, health.HealthHealthy, false) } func TestServiceHealth(t *testing.T) { - assertAppHealth(t, "./testdata/svc-clusterip.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/svc-loadbalancer.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/svc-loadbalancer-unassigned.yaml", health.HealthStatusProgressing) - assertAppHealth(t, "./testdata/svc-loadbalancer-nonemptylist.yaml", health.HealthStatusHealthy) + assertAppHealth(t, "./testdata/svc-clusterip.yaml", health.HealthStatusUnknown, health.HealthUnknown, true) + assertAppHealth(t, "./testdata/svc-loadbalancer.yaml", health.HealthStatusRunning, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/svc-loadbalancer-unassigned.yaml", health.HealthStatusCreating, health.HealthUnknown, false) + assertAppHealth(t, "./testdata/svc-loadbalancer-nonemptylist.yaml", health.HealthStatusRunning, health.HealthHealthy, true) } func TestIngressHealth(t *testing.T) { - assertAppHealth(t, "./testdata/ingress.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/ingress-unassigned.yaml", health.HealthStatusProgressing) - assertAppHealth(t, "./testdata/ingress-nonemptylist.yaml", health.HealthStatusHealthy) + assertAppHealth(t, "./testdata/ingress.yaml", health.HealthStatusHealthy, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/ingress-unassigned.yaml", health.HealthStatusPending, health.HealthHealthy, false) + assertAppHealth(t, "./testdata/ingress-nonemptylist.yaml", health.HealthStatusHealthy, health.HealthHealthy, true) } func TestCRD(t *testing.T) { - assert.Nil(t, getHealthStatus("./testdata/knative-service.yaml", t)) + assertAppHealth(t, "./testdata/knative-service.yaml", health.HealthStatusProgressing, health.HealthUnknown, false) } func TestJob(t *testing.T) { - assertAppHealth(t, "./testdata/job-running.yaml", health.HealthStatusProgressing) - assertAppHealth(t, "./testdata/job-failed.yaml", health.HealthStatusDegraded) - assertAppHealth(t, "./testdata/job-succeeded.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/job-suspended.yaml", health.HealthStatusSuspended) + assertAppHealth(t, "./testdata/job-running.yaml", health.HealthStatusRunning, health.HealthHealthy, false) + assertAppHealth(t, "./testdata/job-failed.yaml", health.HealthStatusError, health.HealthUnhealthy, true) + assertAppHealth(t, "./testdata/job-succeeded.yaml", health.HealthStatusCompleted, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/job-suspended.yaml", health.HealthStatusSuspended, health.HealthUnknown, false) } func TestHPA(t *testing.T) { - assertAppHealth(t, "./testdata/hpa-v2-healthy.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/hpa-v2-degraded.yaml", health.HealthStatusDegraded) - assertAppHealth(t, "./testdata/hpa-v2-progressing.yaml", health.HealthStatusProgressing) - assertAppHealth(t, "./testdata/hpa-v2beta2-healthy.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/hpa-v2beta1-healthy-disabled.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/hpa-v2beta1-healthy.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/hpa-v1-degraded.yaml", health.HealthStatusDegraded) - assertAppHealth(t, "./testdata/hpa-v1-healthy.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/hpa-v1-healthy-toofew.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/hpa-v1-progressing.yaml", health.HealthStatusProgressing) - assertAppHealth(t, "./testdata/hpa-v1-progressing-with-no-annotations.yaml", health.HealthStatusProgressing) -} + assertAppHealth(t, "./testdata/hpa-v2-healthy.yaml", health.HealthStatusHealthy, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/hpa-v2-degraded.yaml", health.HealthStatusDegraded, health.HealthUnhealthy, false) + assertAppHealth(t, "./testdata/hpa-v2-progressing.yaml", health.HealthStatusProgressing, health.HealthHealthy, false) + assertAppHealth(t, "./testdata/hpa-v2beta2-healthy.yaml", health.HealthStatusHealthy, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/hpa-v2beta1-healthy-disabled.yaml", health.HealthStatusHealthy, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/hpa-v2beta1-healthy.yaml", health.HealthStatusHealthy, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/hpa-v1-degraded.yaml", health.HealthStatusDegraded, health.HealthUnhealthy, false) + assertAppHealth(t, "./testdata/hpa-v2-degraded.yaml", health.HealthStatusDegraded, health.HealthUnhealthy, false) -func TestPod(t *testing.T) { - assertAppHealth(t, "./testdata/pod-pending.yaml", health.HealthStatusProgressing) - assertAppHealth(t, "./testdata/pod-running-not-ready.yaml", health.HealthStatusProgressing) - assertAppHealth(t, "./testdata/pod-crashloop.yaml", health.HealthStatusDegraded) - assertAppHealth(t, "./testdata/pod-imagepullbackoff.yaml", health.HealthStatusDegraded) - assertAppHealth(t, "./testdata/pod-error.yaml", health.HealthStatusDegraded) - assertAppHealth(t, "./testdata/pod-running-restart-always.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/pod-running-restart-never.yaml", health.HealthStatusProgressing) - assertAppHealth(t, "./testdata/pod-running-restart-onfailure.yaml", health.HealthStatusProgressing) - assertAppHealth(t, "./testdata/pod-failed.yaml", health.HealthStatusDegraded) - assertAppHealth(t, "./testdata/pod-succeeded.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/pod-deletion.yaml", health.HealthStatusProgressing) + assertAppHealth(t, "./testdata/hpa-v1-healthy.yaml", health.HealthStatusHealthy, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/hpa-v1-healthy-toofew.yaml", health.HealthStatusHealthy, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/hpa-v1-progressing.yaml", health.HealthStatusProgressing, health.HealthHealthy, false) + assertAppHealth(t, "./testdata/hpa-v1-progressing-with-no-annotations.yaml", health.HealthStatusProgressing, health.HealthHealthy, false) } -func TestApplication(t *testing.T) { - assert.Nil(t, getHealthStatus("./testdata/application-healthy.yaml", t)) - assert.Nil(t, getHealthStatus("./testdata/application-degraded.yaml", t)) +func TestPod(t *testing.T) { + assertAppHealth(t, "./testdata/pod-pending.yaml", health.HealthStatusPending, health.HealthUnknown, false) + assertAppHealth(t, "./testdata/pod-running-not-ready.yaml", health.HealthStatusStarting, health.HealthUnknown, false) + assertAppHealth(t, "./testdata/pod-crashloop.yaml", health.HealthStatusCrashLoopBackoff, health.HealthUnhealthy, false) + assertAppHealth(t, "./testdata/pod-imagepullbackoff.yaml", "ImagePullBackOff", health.HealthUnhealthy, false) + assertAppHealth(t, "./testdata/pod-error.yaml", health.HealthStatusError, health.HealthUnhealthy, true) + assertAppHealth(t, "./testdata/pod-running-restart-always.yaml", health.HealthStatusRunning, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/pod-running-restart-never.yaml", health.HealthStatusRunning, health.HealthHealthy, false) + assertAppHealth(t, "./testdata/pod-running-restart-onfailure.yaml", health.HealthStatusRunning, health.HealthUnhealthy, false) + assertAppHealth(t, "./testdata/pod-failed.yaml", health.HealthStatusError, health.HealthUnhealthy, true) + assertAppHealth(t, "./testdata/pod-succeeded.yaml", health.HealthStatusCompleted, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/pod-deletion.yaml", health.HealthStatusDeleting, health.HealthUnhealthy, false) } // func TestAPIService(t *testing.T) { -// assertAppHealth(t, "./testdata/apiservice-v1-true.yaml", HealthStatusHealthy) -// assertAppHealth(t, "./testdata/apiservice-v1-false.yaml", HealthStatusProgressing) -// assertAppHealth(t, "./testdata/apiservice-v1beta1-true.yaml", HealthStatusHealthy) -// assertAppHealth(t, "./testdata/apiservice-v1beta1-false.yaml", HealthStatusProgressing) +// assertAppHealth(t, "./testdata/apiservice-v1-true.yaml", HealthStatusHealthy, health.HealthHealthy, true) +// assertAppHealth(t, "./testdata/apiservice-v1-false.yaml", HealthStatusProgressing, health.HealthHealthy, true) +// assertAppHealth(t, "./testdata/apiservice-v1beta1-true.yaml", HealthStatusHealthy, health.HealthHealthy, true) +// assertAppHealth(t, "./testdata/apiservice-v1beta1-false.yaml", HealthStatusProgressing, health.HealthHealthy, true) // } func TestGetArgoWorkflowHealth(t *testing.T) { @@ -180,20 +191,22 @@ func TestGetArgoWorkflowHealth(t *testing.T) { } func TestArgoApplication(t *testing.T) { - assertAppHealth(t, "./testdata/argo-application-healthy.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/argo-application-missing.yaml", health.HealthStatusMissing) + assertAppHealth(t, "./testdata/argo-application-healthy.yaml", health.HealthStatusHealthy, health.HealthHealthy, true) + assertAppHealth(t, "./testdata/argo-application-missing.yaml", health.HealthStatusMissing, health.HealthUnknown, false) } func TestFluxResources(t *testing.T) { - assertAppHealth(t, "./testdata/flux-kustomization-healthy.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/flux-kustomization-unhealthy.yaml", health.HealthStatusDegraded) - - assertAppHealth(t, "./testdata/flux-helmrelease-healthy.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/flux-helmrelease-unhealthy.yaml", health.HealthStatusDegraded) - - assertAppHealth(t, "./testdata/flux-helmrepository-healthy.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/flux-helmrepository-unhealthy.yaml", health.HealthStatusDegraded) - - assertAppHealth(t, "./testdata/flux-gitrepository-healthy.yaml", health.HealthStatusHealthy) - assertAppHealth(t, "./testdata/flux-gitrepository-unhealthy.yaml", health.HealthStatusDegraded) + assertAppHealth(t, "./testdata/flux-kustomization-healthy.yaml", "Succeeded", health.HealthHealthy, true) + assertAppHealth(t, "./testdata/flux-kustomization-unhealthy.yaml", "Progressing", health.HealthUnknown, false) + assertAppHealth(t, "./testdata/flux-kustomization-failed.yaml", "BuildFailed", health.HealthUnhealthy, false) + status := getHealthStatus("./testdata/flux-kustomization-failed.yaml", t) + assert.Contains(t, status.Message, "err='accumulating resources from 'kubernetes_resource_ingress_fail.yaml'") + assertAppHealth(t, "./testdata/flux-helmrelease-healthy.yaml", "ReconciliationSucceeded", health.HealthHealthy, true) + assertAppHealth(t, "./testdata/flux-helmrelease-unhealthy.yaml", "UpgradeFailed", health.HealthUnhealthy, false) + + assertAppHealth(t, "./testdata/flux-helmrepository-healthy.yaml", "Succeeded", health.HealthHealthy, true) + assertAppHealth(t, "./testdata/flux-helmrepository-unhealthy.yaml", "Failed", health.HealthUnhealthy, false) + + assertAppHealth(t, "./testdata/flux-gitrepository-healthy.yaml", "Succeeded", health.HealthHealthy, true) + assertAppHealth(t, "./testdata/flux-gitrepository-unhealthy.yaml", "GitOperationFailed", health.HealthUnhealthy, false) } diff --git a/pkg/health/status.go b/pkg/health/status.go new file mode 100644 index 0000000..a7f000b --- /dev/null +++ b/pkg/health/status.go @@ -0,0 +1,217 @@ +package health + +import ( + _ "embed" + + "gopkg.in/yaml.v2" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" +) + +//go:embed statusMap.yaml +var statusYaml []byte + +var statusByKind map[string]StatusMap + +func init() { + statusByKind = make(map[string]StatusMap) + if err := yaml.Unmarshal(statusYaml, &statusByKind); err != nil { + panic(err.Error()) + } +} + +type status struct { + Status struct { + Conditions []metav1.Condition + } +} + +type GenericStatus struct { + Conditions []metav1.Condition + Fields map[string]interface{} +} + +func (s GenericStatus) IsEqualInt(a, b string) bool { + aInt, aOk := s.Int(a) + bInt, bOk := s.Int(b) + return aOk && bOk && aInt == bInt +} + +func (s GenericStatus) Int(name string) (int32, bool) { + value, ok := s.Fields[name] + if !ok { + return 0, false + } + + switch v := value.(type) { + case int32: + return v, true + case int64: + return int32(v), true + } + return 0, false +} + +func (s GenericStatus) FindCondition(name string) *metav1.Condition { + if name == "" || name == NoCondition { + return nil + } + // FindStatusCondition finds the conditionType in conditions. + for i := range s.Conditions { + if s.Conditions[i].Type == name { + return &s.Conditions[i] + } + } + return nil +} + +func GetGenericStatus(obj *unstructured.Unstructured) GenericStatus { + s := GenericStatus{ + Fields: obj.Object["status"].(map[string]interface{}), + } + holder := status{} + + err := runtime.DefaultUnstructuredConverter.FromUnstructured(obj.Object, &holder) + if err != nil { + return s + } + s.Conditions = holder.Status.Conditions + return s +} + +type OnCondition struct { + // When 2 conditions are true, which one takes precedence from a status/message perspective + Order int `yaml:"order:omitempty" json:"order,omitempty"` + // If the condition matches, mark ready + Ready bool `json:"ready" yaml:"ready"` + + // If the condition matches, mark not ready + NotReady bool `json:"notReady" yaml:"notReady,omitempty"` + + // If the condition is true, use the conditions message + Message bool `json:"message" yaml:"message"` + Health Health `json:"health,omitempty" yaml:"health,omitempty"` + // Health to set if the condition is false + + Status HealthStatusCode `json:"status,omitempty" yaml:"status,omitempty"` +} + +func (mapped *OnCondition) Apply(health *HealthStatus, c *metav1.Condition) { + if mapped.Ready { + health.Ready = true + } + + if mapped.NotReady { + health.Ready = false + } + + if mapped.Health != "" { + health.Health = mapped.Health + } + + if mapped.Status != "" { + if health.Status == "" || mapped.Order >= health.order { + health.Status = mapped.Status + } + } else if c.Reason != "" { + if health.Status == "" || mapped.Order >= health.order { + health.Status = HealthStatusCode(c.Reason) + } + + } + + if mapped.Message && c.Message != "" { + if health.Message == "" || mapped.Order >= health.order { + health.Message = c.Message + } + } + +} + +type Condition struct { + OnCondition `yaml:",inline" json:",inline"` + + OnFalse *OnCondition `yaml:"onFalse,omitempty" json:"onFalse,omitempty"` + OnUnknown *OnCondition `yaml:"onUnknown,omitempty" json:"onUnknown,omitempty"` + + // Custom settings per reason + Reasons map[string]OnCondition `yaml:"reasons,omitempty" json:"reasons,omitempty"` +} + +func (mapped *Condition) Apply(health *HealthStatus, c *metav1.Condition) { + if c.Status == metav1.ConditionTrue { + mapped.OnCondition.Apply(health, c) + } else if c.Status == metav1.ConditionFalse && mapped.OnFalse != nil { + mapped.OnFalse.Apply(health, c) + } else if c.Status == metav1.ConditionFalse && mapped.OnFalse == nil { + if mapped.Health == HealthHealthy { + // if this is a healthy condition and no specific onFalse handling, mark unhealthy + health.Health = HealthUnhealthy + if mapped.Message { + health.Message = c.Message + } + if health.Status == "" && c.Reason != "" { + health.Status = HealthStatusCode(c.Reason) + } + } + if mapped.Ready { + if health.Status == "" && c.Reason != "" { + health.Status = HealthStatusCode(c.Reason) + } + } + if mapped.Message { + if health.Message == "" || mapped.Order >= health.order { + health.Message = c.Message + } + } + } else if c.Status == metav1.ConditionUnknown && mapped.OnUnknown != nil { + mapped.OnUnknown.Apply(health, c) + } + if reason, ok := mapped.Reasons[c.Reason]; ok { + reason.Apply(health, c) + } +} + +type StatusMap struct { + Conditions map[string]Condition `yaml:"conditions" json:"conditions"` + UnhealthyIsNotReady bool `yaml:"unhealthyIsNotReady" json:"unhealthyIsNotReady"` +} + +const NoCondition = "none" + +func GetDefaultHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { + if statusMap, ok := statusByKind[obj.GetAPIVersion()+"/"+obj.GetKind()]; ok { + return GetHealthFromStatus(GetGenericStatus(obj), statusMap) + } else if statusMap, ok := statusByKind[obj.GetKind()]; ok { + return GetHealthFromStatus(GetGenericStatus(obj), statusMap) + } + + return &HealthStatus{}, nil +} + +func GetHealth(obj *unstructured.Unstructured, statusMap StatusMap) (*HealthStatus, error) { + return GetHealthFromStatus(GetGenericStatus(obj), statusMap) +} + +func GetHealthFromStatus(k GenericStatus, statusMap StatusMap) (*HealthStatus, error) { + health := &HealthStatus{ + Health: HealthUnknown, + } + if len(statusMap.Conditions) == 0 { + return health, nil + } + + for _, condition := range k.Conditions { + mappedCondition, ok := statusMap.Conditions[condition.Type] + if ok { + mappedCondition.Apply(health, &condition) + } + } + + if statusMap.UnhealthyIsNotReady && health.Health != HealthHealthy { + health.Ready = false + } + + return health, nil +} diff --git a/pkg/health/statusMap.yaml b/pkg/health/statusMap.yaml new file mode 100644 index 0000000..6034d96 --- /dev/null +++ b/pkg/health/statusMap.yaml @@ -0,0 +1,176 @@ +Issuer: + conditions: + Ready: + ready: true + health: healthy +ClusterIssuer: + conditions: + Ready: + ready: true + health: healthy +Certificate: + conditions: + Ready: + ready: true + health: healthy + status: Issued + onFalse: + status: Issuing + health: unknown + reasons: + ConfigError: + ready: true + health: unhealthy + +CertificateRequest: + conditions: + InvalidRequest: + ready: true + health: unhealthy + message: true + Denied: + ready: true + health: unhealthy + message: true + Ready: + ready: true + health: healthy + reasons: + Pending: + status: Issuing + Failed: + ready: true + + status: + acme: + order: + url: https://acme-v02.api.letsencrypt.org/acme/order/45250083/316944902 + conditions: + - lastTransitionTime: "2019-02-15T18:21:10Z" + message: Order validated + reason: OrderValidated + status: "False" + type: ValidateFailed + - lastTransitionTime: null + message: Certificate issued successfully + reason: CertIssued + status: "True" + type: Ready + +Deployment: + conditions: + ReplicaFailure: + health: unhealthy + notReady: true + message: true + Progressing: + ready: true + status: Running + onFalse: + status: Rolling Out + reasons: + ProgressDeadlineExceeded: + health: unhealthy + notReady: true + status: Rollout Failed + order: 1 + message: true + Available: + health: healthy + onFalse: + health: unhealthy + message: true + +Kustomization: + conditions: + Ready: + ready: true + message: true + reasons: + Progressing: + status: Progressing + health: unknown + BuildFailed: + health: unhealthy + FetchFailed: + health: warning + StorageOperationFailed: + health: unhealthy + ArtifactOutdated: + health: warning + DependencyNotReady: + health: warning + Healthy: + health: healthy + onFalse: + message: true + health: warning + +#helm.toolkit.fluxcd.io +HelmRelease: &flux + conditions: + Remediated: + health: warning + message: true + TestSuccess: + health: true + order: 2 + Ready: + ready: true + health: healthy + message: true + onUnknown: + status: Reconciling + nonReady: true + + Reconciling: + status: Reconciling + reasons: + ProgressingWithRetry: + health: warning + order: 1 + +HelmRepository: &flux + conditions: + Reconciling: + status: Reconciling + reasons: + ProgressingWithRetry: + health: warning + order: 2 + ArtifactOutdated: + order: 1 + status: Updating + nonReady: true + Ready: + ready: true + health: healthy + onFalse: + order: 3 + health: unhealthy + message: true + Stalled: + order: 2 + healthy: unhealthy + nonReady: true + IncludeUnavailable: + health: unhealthy + FetchFailed: + health: unhealthy + StorageOperationFailed: + health: unhealthy + SourceVerified: + onFalse: + health: warning + message: true + order: -1 + +#source.toolkit.fluxcd.io: +GitRepository: *flux +HelmChart: *flux +OCIRepository: *flux +source.toolkit.fluxcd.io/v1beta2/Bucket: *flux +source.toolkit.fluxcd.io/v1beta1/Bucket: *flux +image.toolkit.fluxcd.io/v1beta2/ImagePolicy: *flux +image.toolkit.fluxcd.io/v1beta2/ImageRepository: *flux +image.toolkit.fluxcd.io/v1beta2/ImageUpdateAutomation: *flux diff --git a/pkg/health/testdata/deployment-degraded.yaml b/pkg/health/testdata/deployment-degraded.yaml index 1075767..7f49967 100644 --- a/pkg/health/testdata/deployment-degraded.yaml +++ b/pkg/health/testdata/deployment-degraded.yaml @@ -16,7 +16,7 @@ metadata: uid: bb9af0c7-8a44-11e8-9e23-42010aa80010 spec: progressDeadlineSeconds: 600 - replicas: 1 + replicas: 2 revisionHistoryLimit: 10 selector: matchLabels: @@ -34,15 +34,15 @@ spec: app.kubernetes.io/instance: guestbook-default spec: containers: - - image: gcr.io/heptio-images/ks-guestbook-demo:0.3 - imagePullPolicy: IfNotPresent - name: guestbook-ui - ports: - - containerPort: 80 - protocol: TCP - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File + - image: gcr.io/heptio-images/ks-guestbook-demo:0.3 + imagePullPolicy: IfNotPresent + name: guestbook-ui + ports: + - containerPort: 80 + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler @@ -51,18 +51,16 @@ spec: status: availableReplicas: 1 conditions: - - lastTransitionTime: 2018-07-18T04:48:48Z - lastUpdateTime: 2018-07-18T04:48:48Z - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: Available - - lastTransitionTime: 2018-07-18T06:29:23Z - lastUpdateTime: 2018-07-18T06:29:23Z - message: ReplicaSet "guestbook-ui-75dd4d49d5" has timed out progressing. - reason: ProgressDeadlineExceeded - status: "False" - type: Progressing + - lastTransitionTime: 2018-07-18T04:48:48Z + lastUpdateTime: 2018-07-18T04:48:48Z + message: Deployment has minimum availability. + reason: MinimumReplicasAvailable + status: "True" + type: Available + - lastTransitionTime: 2018-07-18T06:29:23Z + lastUpdateTime: 2018-07-18T06:29:23Z + status: "True" + type: Progressing observedGeneration: 4 readyReplicas: 1 replicas: 2 diff --git a/pkg/health/testdata/deployment-failed.yaml b/pkg/health/testdata/deployment-failed.yaml new file mode 100644 index 0000000..bfb511a --- /dev/null +++ b/pkg/health/testdata/deployment-failed.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + deployment.kubernetes.io/revision: "4" + kubectl.kubernetes.io/last-applied-configuration: | + {"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"app.kubernetes.io/instance":"guestbook-default"},"name":"guestbook-ui","namespace":"default"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"guestbook-ui"}},"template":{"metadata":{"labels":{"app":"guestbook-ui","app.kubernetes.io/instance":"guestbook-default"}},"spec":{"containers":[{"image":"gcr.io/heptio-images/ks-guestbook-demo:0.3","name":"guestbook-ui","ports":[{"containerPort":80}]}]}}}} + creationTimestamp: 2018-07-18T04:40:44Z + generation: 4 + labels: + app.kubernetes.io/instance: guestbook-default + name: guestbook-ui + namespace: default + resourceVersion: "13660" + selfLink: /apis/apps/v1/namespaces/default/deployments/guestbook-ui + uid: bb9af0c7-8a44-11e8-9e23-42010aa80010 +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app: guestbook-ui + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + creationTimestamp: null + labels: + app: guestbook-ui + app.kubernetes.io/instance: guestbook-default + spec: + containers: + - image: gcr.io/heptio-images/ks-guestbook-demo:0.3 + imagePullPolicy: IfNotPresent + name: guestbook-ui + ports: + - containerPort: 80 + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + conditions: + - lastTransitionTime: 2018-07-18T04:48:48Z + lastUpdateTime: 2018-07-18T04:48:48Z + message: Deployment has minimum availability. + reason: MinimumReplicasAvailable + status: "True" + type: Available + - lastTransitionTime: 2018-07-18T06:29:23Z + lastUpdateTime: 2018-07-18T06:29:23Z + message: ReplicaSet "guestbook-ui-75dd4d49d5" has timed out progressing. + reason: ProgressDeadlineExceeded + status: "False" + type: Progressing + observedGeneration: 4 + readyReplicas: 0 + replicas: 1 + unavailableReplicas: 1 + updatedReplicas: 1 diff --git a/pkg/health/testdata/deployment-progressing.yaml b/pkg/health/testdata/deployment-progressing.yaml index 8a05925..cf61d45 100644 --- a/pkg/health/testdata/deployment-progressing.yaml +++ b/pkg/health/testdata/deployment-progressing.yaml @@ -16,7 +16,7 @@ metadata: uid: bb9af0c7-8a44-11e8-9e23-42010aa80010 spec: progressDeadlineSeconds: 600 - replicas: 1 + replicas: 2 revisionHistoryLimit: 10 selector: matchLabels: @@ -34,15 +34,15 @@ spec: app.kubernetes.io/instance: guestbook-default spec: containers: - - image: gcr.io/heptio-images/ks-guestbook-demo:0.3 - imagePullPolicy: IfNotPresent - name: guestbook-ui - ports: - - containerPort: 80 - protocol: TCP - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File + - image: gcr.io/heptio-images/ks-guestbook-demo:0.3 + imagePullPolicy: IfNotPresent + name: guestbook-ui + ports: + - containerPort: 80 + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File dnsPolicy: ClusterFirst restartPolicy: Always schedulerName: default-scheduler @@ -51,18 +51,18 @@ spec: status: availableReplicas: 1 conditions: - - lastTransitionTime: 2018-07-18T04:48:48Z - lastUpdateTime: 2018-07-18T04:48:48Z - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: Available - - lastTransitionTime: 2018-07-18T04:40:44Z - lastUpdateTime: 2018-07-18T06:19:22Z - message: ReplicaSet "guestbook-ui-75dd4d49d5" is progressing. - reason: ReplicaSetUpdated - status: "True" - type: Progressing + - lastTransitionTime: 2018-07-18T04:48:48Z + lastUpdateTime: 2018-07-18T04:48:48Z + message: Deployment has minimum availability. + reason: MinimumReplicasAvailable + status: "True" + type: Available + - lastTransitionTime: 2018-07-18T04:40:44Z + lastUpdateTime: 2018-07-18T06:19:22Z + message: ReplicaSet "guestbook-ui-75dd4d49d5" is progressing. + reason: ReplicaSetUpdated + status: "True" + type: Progressing observedGeneration: 4 readyReplicas: 1 replicas: 2 diff --git a/pkg/health/testdata/deployment-scaling-down.yaml b/pkg/health/testdata/deployment-scaling-down.yaml new file mode 100644 index 0000000..8e906a3 --- /dev/null +++ b/pkg/health/testdata/deployment-scaling-down.yaml @@ -0,0 +1,70 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + deployment.kubernetes.io/revision: "4" + kubectl.kubernetes.io/last-applied-configuration: | + {"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"app.kubernetes.io/instance":"guestbook-default"},"name":"guestbook-ui","namespace":"default"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"guestbook-ui"}},"template":{"metadata":{"labels":{"app":"guestbook-ui","app.kubernetes.io/instance":"guestbook-default"}},"spec":{"containers":[{"image":"gcr.io/heptio-images/ks-guestbook-demo:0.3","name":"guestbook-ui","ports":[{"containerPort":80}]}]}}}} + creationTimestamp: 2018-07-18T04:40:44Z + generation: 4 + labels: + app.kubernetes.io/instance: guestbook-default + name: guestbook-ui + namespace: default + resourceVersion: "13660" + selfLink: /apis/apps/v1/namespaces/default/deployments/guestbook-ui + uid: bb9af0c7-8a44-11e8-9e23-42010aa80010 +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app: guestbook-ui + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + creationTimestamp: null + labels: + app: guestbook-ui + app.kubernetes.io/instance: guestbook-default + spec: + containers: + - image: gcr.io/heptio-images/ks-guestbook-demo:0.3 + imagePullPolicy: IfNotPresent + name: guestbook-ui + ports: + - containerPort: 80 + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + conditions: + - lastTransitionTime: 2018-07-18T04:48:48Z + lastUpdateTime: 2018-07-18T04:48:48Z + message: Deployment has minimum availability. + reason: MinimumReplicasAvailable + status: "True" + type: Available + - lastTransitionTime: 2018-07-18T06:29:23Z + lastUpdateTime: 2018-07-18T06:29:23Z + message: ReplicaSet "guestbook-ui-75dd4d49d5" has timed out progressing. + reason: OK + status: "False" + type: Progressing + observedGeneration: 4 + readyReplicas: 1 + replicas: 2 + unavailableReplicas: 1 + updatedReplicas: 1 diff --git a/pkg/health/testdata/flux-kustomization-failed.yaml b/pkg/health/testdata/flux-kustomization-failed.yaml new file mode 100644 index 0000000..042abe8 --- /dev/null +++ b/pkg/health/testdata/flux-kustomization-failed.yaml @@ -0,0 +1,182 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1beta2 +kind: Kustomization +metadata: + uid: 1519b807-3d90-455b-b33f-4a7868a3f404 + name: canaries + labels: + kustomize.toolkit.fluxcd.io/name: aws-demo-infra + kustomize.toolkit.fluxcd.io/namespace: flux-system + namespace: default + finalizers: + - finalizers.fluxcd.io + annotations: + config.kubernetes.io/origin: | + path: environments/default/namespace.yaml + creationTimestamp: 2023-09-05T22:23:14Z +spec: + path: ./fixtures + force: false + prune: true + interval: 5m0s + sourceRef: + kind: GitRepository + name: canaries + validation: client + targetNamespace: canaries +status: + inventory: + entries: + - v: v1 + id: _canary-checker-priority_scheduling.k8s.io_PriorityClass + - v: v1 + id: _test-rbac-ldap_rbac.authorization.k8s.io_ClusterRole + - v: v1 + id: _test-rbac-role_rbac.authorization.k8s.io_ClusterRoleBinding + - v: v1 + id: canaries_apacheds-ldif__ConfigMap + - v: v1 + id: canaries_basic-auth__ConfigMap + - v: v1 + id: canaries_jmeter-fail-test__ConfigMap + - v: v1 + id: canaries_jmeter-pass-test__ConfigMap + - v: v1 + id: canaries_aws-credentials__Secret + - v: v1 + id: canaries_basic-auth__Secret + - v: v1 + id: canaries_elasticsearch__Secret + - v: v1 + id: canaries_opensearch__Secret + - v: v1 + id: canaries_podinfo-header__Secret + - v: v1 + id: canaries_secrets__Secret + - v: v1 + id: canaries_apacheds__Service + - v: v1 + id: canaries_elasticsearch__Service + - v: v1 + id: canaries_mongo__Service + - v: v1 + id: canaries_mssql__Service + - v: v1 + id: canaries_mysql__Service + - v: v1 + id: canaries_opensearch__Service + - v: v1 + id: canaries_podinfo__Service + - v: v1 + id: canaries_postgres__Service + - v: v1 + id: canaries_redis__Service + - v: v1 + id: canaries_apacheds_apps_Deployment + - v: v1 + id: canaries_elasticsearch_apps_Deployment + - v: v1 + id: canaries_mongo_apps_Deployment + - v: v1 + id: canaries_mssql_apps_Deployment + - v: v1 + id: canaries_mysql_apps_Deployment + - v: v1 + id: canaries_opensearch_apps_Deployment + - v: v1 + id: canaries_podinfo_apps_Deployment + - v: v1 + id: canaries_postgres_apps_Deployment + - v: v1 + id: canaries_redis_apps_Deployment + - v: v1 + id: canaries_k8s-check-not-ready__Pod + - v: v1 + id: canaries_k8s-check-ready__Pod + - v: v1 + id: canaries_alertmanager_canaries.flanksource.com_Canary + - v: v1 + id: canaries_dns-fail_canaries.flanksource.com_Canary + - v: v1 + id: canaries_dns-pass_canaries.flanksource.com_Canary + - v: v1 + id: canaries_elasticsearch-fail_canaries.flanksource.com_Canary + - v: v1 + id: canaries_elasticsearch-pass_canaries.flanksource.com_Canary + - v: v1 + id: canaries_git-pull-push_canaries.flanksource.com_Canary + - v: v1 + id: canaries_github-pass_canaries.flanksource.com_Canary + - v: v1 + id: canaries_github-test-expression-pass_canaries.flanksource.com_Canary + - v: v1 + id: canaries_http-fail_canaries.flanksource.com_Canary + - v: v1 + id: canaries_http-fail-timeout_canaries.flanksource.com_Canary + - v: v1 + id: canaries_http-pass-single_canaries.flanksource.com_Canary + - v: v1 + id: canaries_junit-fail_canaries.flanksource.com_Canary + - v: v1 + id: canaries_junit-pass_canaries.flanksource.com_Canary + - v: v1 + id: canaries_kubernetes-bundle_canaries.flanksource.com_Canary + - v: v1 + id: canaries_ldap-pass_canaries.flanksource.com_Canary + - v: v1 + id: canaries_mongo_canaries.flanksource.com_Canary + - v: v1 + id: canaries_mongo-fail_canaries.flanksource.com_Canary + - v: v1 + id: canaries_mssql-fail_canaries.flanksource.com_Canary + - v: v1 + id: canaries_mssql-pass_canaries.flanksource.com_Canary + - v: v1 + id: canaries_mysql-fail_canaries.flanksource.com_Canary + - v: v1 + id: canaries_mysql-pass_canaries.flanksource.com_Canary + - v: v1 + id: canaries_namespace-pass_canaries.flanksource.com_Canary + - v: v1 + id: canaries_opensearch-fail_canaries.flanksource.com_Canary + - v: v1 + id: canaries_opensearch-pass_canaries.flanksource.com_Canary + - v: v1 + id: canaries_pod-fail_canaries.flanksource.com_Canary + - v: v1 + id: canaries_pod-pass_canaries.flanksource.com_Canary + - v: v1 + id: canaries_postgres-fail_canaries.flanksource.com_Canary + - v: v1 + id: canaries_postgres-succeed_canaries.flanksource.com_Canary + - v: v1 + id: canaries_prometheus_canaries.flanksource.com_Canary + - v: v1 + id: canaries_redis-fail_canaries.flanksource.com_Canary + - v: v1 + id: canaries_redis-succeed_canaries.flanksource.com_Canary + - v: v1 + id: canaries_podinfo-ing_networking.k8s.io_Ingress + conditions: + - type: Reconciling + reason: ProgressingWithRetry + status: "True" + message: Building manifests for revision + master/e18f1b71f253f3fe14735899346897759924f119 with a timeout of 4m30s + - type: Ready + reason: BuildFailed + status: "False" + message: "kustomize build failed: accumulating resources: accumulation + err='accumulating resources from 'k8s': read + /tmp/kustomization-903663509/fixtures/k8s: is a directory': recursed + accumulation of path '/tmp/kustomization-903663509/fixtures/k8s': + accumulating resources: accumulation err='accumulating resources from + 'kubernetes_resource_ingress_fail.yaml': open + /tmp/kustomization-903663509/fixtures/k8s/kubernetes_resource_ingress_f\ + ail.yaml: no such file or directory': must build at directory: not a + valid directory: evalsymlink failure on + '/tmp/kustomization-903663509/fixtures/k8s/kubernetes_resource_ingress_\ + fail.yaml' : lstat + /tmp/kustomization-903663509/fixtures/k8s/kubernetes_resource_ingress_f\ + ail.yaml: no such file or directory" + lastAppliedRevision: master/df995110d56b6192fbc6d58d80385c4664ae38ba + lastAttemptedRevision: master/e18f1b71f253f3fe14735899346897759924f119 diff --git a/pkg/health/utils.go b/pkg/health/utils.go index 70b0323..f7830d6 100644 --- a/pkg/health/utils.go +++ b/pkg/health/utils.go @@ -1,6 +1,7 @@ package health import ( + "fmt" "time" corev1 "k8s.io/api/core/v1" @@ -18,6 +19,7 @@ const ( DaemonSetKind = "DaemonSet" IngressKind = "Ingress" JobKind = "Job" + CronJobKind = "CronJob" PersistentVolumeClaimKind = "PersistentVolumeClaim" CustomResourceDefinitionKind = "CustomResourceDefinition" PodKind = "Pod" @@ -27,10 +29,35 @@ const ( ) type HealthStatus struct { + Ready bool `json:"ready"` + Health Health `json:"health"` // Status holds the status code of the application or resource Status HealthStatusCode `json:"status,omitempty" protobuf:"bytes,1,opt,name=status"` // Message is a human-readable informational message describing the health status Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` + + order int `json:"-" yaml:"-"` +} + +func (hs *HealthStatus) AppendMessage(msg string, args ...interface{}) { + if msg == "" { + return + } + if hs.Message != "" { + hs.Message += ", " + } + hs.Message += fmt.Sprintf(msg, args...) +} + +func (hs *HealthStatus) PreppendMessage(msg string, args ...interface{}) { + if msg == "" { + return + } + if hs.Message != "" { + hs.Message = fmt.Sprintf(msg, args...) + ", " + hs.Message + } else { + hs.Message = fmt.Sprintf(msg, args...) + } } // IsPodAvailable returns true if a pod is available; false otherwise. diff --git a/pkg/lua/custom_actions_test.go b/pkg/lua/custom_actions_test.go index 9e82bf4..a1d29a1 100644 --- a/pkg/lua/custom_actions_test.go +++ b/pkg/lua/custom_actions_test.go @@ -13,67 +13,6 @@ import ( "sigs.k8s.io/yaml" ) -type testNormalizer struct{} - -func (t testNormalizer) Normalize(un *unstructured.Unstructured) error { - if un == nil { - return nil - } - switch un.GetKind() { - case "Job": - err := unstructured.SetNestedField(un.Object, map[string]interface{}{"name": "not sure why this works"}, "metadata") - if err != nil { - return fmt.Errorf("failed to normalize Job: %w", err) - } - } - switch un.GetKind() { - case "DaemonSet", "Deployment", "StatefulSet": - err := unstructured.SetNestedStringMap(un.Object, map[string]string{"kubectl.kubernetes.io/restartedAt": "0001-01-01T00:00:00Z"}, "spec", "template", "metadata", "annotations") - if err != nil { - return fmt.Errorf("failed to normalize %s: %w", un.GetKind(), err) - } - } - switch un.GetKind() { - case "Deployment": - err := unstructured.SetNestedField(un.Object, nil, "status") - if err != nil { - return fmt.Errorf("failed to normalize %s: %w", un.GetKind(), err) - } - err = unstructured.SetNestedField(un.Object, nil, "metadata", "creationTimestamp") - if err != nil { - return fmt.Errorf("failed to normalize %s: %w", un.GetKind(), err) - } - err = unstructured.SetNestedField(un.Object, nil, "metadata", "generation") - if err != nil { - return fmt.Errorf("failed to normalize %s: %w", un.GetKind(), err) - } - case "Rollout": - err := unstructured.SetNestedField(un.Object, nil, "spec", "restartAt") - if err != nil { - return fmt.Errorf("failed to normalize %s: %w", un.GetKind(), err) - } - case "ExternalSecret": - err := unstructured.SetNestedStringMap(un.Object, map[string]string{"force-sync": "0001-01-01T00:00:00Z"}, "metadata", "annotations") - if err != nil { - return fmt.Errorf("failed to normalize %s: %w", un.GetKind(), err) - } - case "Workflow": - err := unstructured.SetNestedField(un.Object, nil, "metadata", "resourceVersion") - if err != nil { - return fmt.Errorf("failed to normalize Rollout: %w", err) - } - err = unstructured.SetNestedField(un.Object, nil, "metadata", "uid") - if err != nil { - return fmt.Errorf("failed to normalize Rollout: %w", err) - } - err = unstructured.SetNestedField(un.Object, nil, "metadata", "annotations", "workflows.argoproj.io/scheduled-time") - if err != nil { - return fmt.Errorf("failed to normalize Rollout: %w", err) - } - } - return nil -} - type ActionTestStructure struct { DiscoveryTests []IndividualDiscoveryTest `yaml:"discoveryTests"` ActionTests []IndividualActionTest `yaml:"actionTests"` diff --git a/pkg/lua/lua.go b/pkg/lua/lua.go index 3e3e70e..45f2141 100644 --- a/pkg/lua/lua.go +++ b/pkg/lua/lua.go @@ -7,6 +7,7 @@ import ( "fmt" "os" "path/filepath" + "strings" "time" "github.com/flanksource/is-healthy/pkg/health" @@ -110,12 +111,29 @@ func (vm VM) ExecuteHealthLua(obj *unstructured.Unstructured, script string) (*h if err != nil { return nil, err } - if !isValidHealthStatusCode(healthStatus.Status) { - return &health.HealthStatus{ - Status: health.HealthStatusUnknown, - Message: invalidHealthStatus, - }, nil + + if healthStatus.Status != "" && healthStatus.Health == "" { + switch healthStatus.Status { + case health.HealthStatusUnknown: + healthStatus.Health = health.HealthUnknown + healthStatus.Status = "" + case health.HealthStatusProgressing: + healthStatus.Health = health.HealthUnknown + case health.HealthStatusSuspended: + healthStatus.Health = health.HealthUnknown + case health.HealthStatusHealthy: + healthStatus.Status = "" + healthStatus.Health = health.HealthHealthy + healthStatus.Ready = true + case health.HealthStatusDegraded: + healthStatus.Status = "" + healthStatus.Health = health.HealthUnhealthy + healthStatus.Ready = true + case health.HealthStatusMissing: + healthStatus.Ready = true + } } + healthStatus.Health = health.Health(strings.ToLower(string(healthStatus.Health))) return healthStatus, nil } @@ -414,14 +432,6 @@ func (vm VM) getPredefinedLuaScripts(objKey string, scriptFile string) (string, return string(data), nil } -func isValidHealthStatusCode(statusCode health.HealthStatusCode) bool { - switch statusCode { - case health.HealthStatusUnknown, health.HealthStatusProgressing, health.HealthStatusSuspended, health.HealthStatusHealthy, health.HealthStatusDegraded, health.HealthStatusMissing: - return true - } - return false -} - // Took logic from the link below and added the int, int32, and int64 types since the value would have type int64 // while actually running in the controller and it was not reproducible through testing. // https://github.com/layeh/gopher-json/blob/97fed8db84274c421dbfffbb28ec859901556b97/json.go#L154 diff --git a/pkg/lua/lua_test.go b/pkg/lua/lua_test.go index abaf6ab..27581b8 100644 --- a/pkg/lua/lua_test.go +++ b/pkg/lua/lua_test.go @@ -89,8 +89,9 @@ func TestExecuteNewHealthStatusFunction(t *testing.T) { status, err := vm.ExecuteHealthLua(testObj, newHealthStatusFunction) assert.Nil(t, err) expectedHealthStatus := &health.HealthStatus{ - Status: "Healthy", + Health: health.HealthHealthy, Message: "testMessage", + Ready: true, } assert.Equal(t, expectedHealthStatus, status) @@ -102,7 +103,8 @@ func TestExecuteWildcardHealthStatusFunction(t *testing.T) { status, err := vm.ExecuteHealthLua(testObj, newWildcardHealthStatusFunction) assert.Nil(t, err) expectedHealthStatus := &health.HealthStatus{ - Status: "Healthy", + Health: health.HealthHealthy, + Ready: true, Message: "testWildcardMessage", } assert.Equal(t, expectedHealthStatus, status) @@ -128,23 +130,6 @@ func TestFailLuaReturnNonTable(t *testing.T) { assert.Equal(t, fmt.Errorf(incorrectReturnType, "table", "number"), err) } -const invalidHealthStatusStatus = `local healthStatus = {} -healthStatus.status = "test" -return healthStatus -` - -func TestInvalidHealthStatusStatus(t *testing.T) { - testObj := StrToUnstructured(objJSON) - vm := VM{} - status, err := vm.ExecuteHealthLua(testObj, invalidHealthStatusStatus) - assert.Nil(t, err) - expectedStatus := &health.HealthStatus{ - Status: health.HealthStatusUnknown, - Message: invalidHealthStatus, - } - assert.Equal(t, expectedStatus, status) -} - const infiniteLoop = `while true do ; end` func TestHandleInfiniteLoop(t *testing.T) { @@ -729,7 +714,8 @@ return hs` status, err := overrides.GetResourceHealth(testObj) assert.Nil(t, err) expectedStatus := &health.HealthStatus{ - Status: health.HealthStatusHealthy, + Health: health.HealthHealthy, + Ready: true, Message: "Standard lib was used", } assert.Equal(t, expectedStatus, status) @@ -751,7 +737,8 @@ return hs` status, err := overrides.GetResourceHealth(testObj) assert.Nil(t, err) expectedStatus := &health.HealthStatus{ - Status: health.HealthStatusHealthy, + Health: health.HealthHealthy, + Ready: true, } assert.Equal(t, expectedStatus, status) }) diff --git a/pkg/lua/resources.go b/pkg/lua/resources.go index f2f2a44..4fed7fd 100644 --- a/pkg/lua/resources.go +++ b/pkg/lua/resources.go @@ -2,7 +2,6 @@ package lua import ( "encoding/json" - "regexp" "gopkg.in/yaml.v2" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -121,46 +120,6 @@ type ResourceActionParam struct { Default string `json:"default,omitempty" protobuf:"bytes,4,opt,name=default"` } -// TODO: refactor to use rbacpolicy.ActionGet, rbacpolicy.ActionCreate, without import cycle -var validActions = map[string]bool{ - "get": true, - "create": true, - "update": true, - "delete": true, - "sync": true, - "override": true, - "*": true, -} - -var validActionPatterns = []*regexp.Regexp{ - regexp.MustCompile("action/.*"), -} - -func isValidAction(action string) bool { - if validActions[action] { - return true - } - for i := range validActionPatterns { - if validActionPatterns[i].MatchString(action) { - return true - } - } - return false -} - -// TODO: same as validActions, refacotor to use rbacpolicy.ResourceApplications etc. -var validResources = map[string]bool{ - "applications": true, - "repositories": true, - "clusters": true, - "exec": true, - "logs": true, -} - -func isValidResource(resource string) bool { - return validResources[resource] -} - // UnmarshalToUnstructured unmarshals a resource representation in JSON to unstructured data func UnmarshalToUnstructured(resource string) (*unstructured.Unstructured, error) { if resource == "" || resource == "null" { diff --git a/pkg/resource_customizations b/pkg/resource_customizations new file mode 120000 index 0000000..9ac2ee6 --- /dev/null +++ b/pkg/resource_customizations @@ -0,0 +1 @@ +../argo-cd/resource_customizations \ No newline at end of file diff --git a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/health.lua b/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/health.lua deleted file mode 100644 index 3be1879..0000000 --- a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/health.lua +++ /dev/null @@ -1,27 +0,0 @@ -health_check = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil and obj.status.replicas ~= nil then - numTrue = 0 - for i, condition in pairs(obj.status.conditions) do - if (condition.type == "Available" or (condition.type == "Progressing" and condition.reason == "NewReplicationControllerAvailable")) and condition.status == "True" then - numTrue = numTrue + 1 - end - end - if numTrue == 2 or obj.status.replicas == 0 then - health_check.status = "Healthy" - health_check.message = "replication controller successfully rolled out" - return health_check - elseif numTrue == 1 then - health_check.status = "Progressing" - health_check.message = "replication controller is waiting for pods to run" - return health_check - else - health_check.status = "Degraded" - health_check.message = "Deployment config is degraded" - return health_check - end - end -end -health_check.status = "Progressing" -health_check.message = "replication controller is waiting for pods to run" -return health_check \ No newline at end of file diff --git a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/health_test.yaml b/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/health_test.yaml deleted file mode 100644 index cd38c4b..0000000 --- a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "replication controller is waiting for pods to run" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Progressing - message: "replication controller is waiting for pods to run" - inputPath: testdata/progressing_rc_updated.yaml -- healthStatus: - status: Degraded - message: "Deployment config is degraded" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: "replication controller successfully rolled out" - inputPath: testdata/healthy.yaml -- healthStatus: - status: Healthy - message: "replication controller successfully rolled out" - inputPath: testdata/healthy_zero_replicas.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/degraded.yaml b/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/degraded.yaml deleted file mode 100644 index 31379fa..0000000 --- a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/degraded.yaml +++ /dev/null @@ -1,156 +0,0 @@ -kind: DeploymentConfig -apiVersion: apps.openshift.io/v1 -metadata: - name: example - namespace: default - uid: ba99eac7-ed9c-4154-bda1-69d25a90b278 - resourceVersion: '412743' - generation: 1 - creationTimestamp: '2021-08-25T23:48:11Z' - managedFields: - - manager: Mozilla - operation: Update - apiVersion: apps.openshift.io/v1 - time: '2021-08-25T23:48:11Z' - fieldsType: FieldsV1 - fieldsV1: - 'f:spec': - 'f:replicas': {} - 'f:selector': - .: {} - 'f:app': {} - 'f:strategy': - 'f:activeDeadlineSeconds': {} - 'f:rollingParams': - .: {} - 'f:intervalSeconds': {} - 'f:maxSurge': {} - 'f:maxUnavailable': {} - 'f:timeoutSeconds': {} - 'f:updatePeriodSeconds': {} - 'f:type': {} - 'f:template': - .: {} - 'f:metadata': - .: {} - 'f:creationTimestamp': {} - 'f:labels': - .: {} - 'f:app': {} - 'f:spec': - .: {} - 'f:containers': - .: {} - 'k:{"name":"httpd"}': - .: {} - 'f:image': {} - 'f:imagePullPolicy': {} - 'f:name': {} - 'f:ports': - .: {} - 'k:{"containerPort":8080,"protocol":"TCP"}': - .: {} - 'f:containerPort': {} - 'f:protocol': {} - 'f:resources': {} - 'f:terminationMessagePath': {} - 'f:terminationMessagePolicy': {} - 'f:dnsPolicy': {} - 'f:restartPolicy': {} - 'f:schedulerName': {} - 'f:securityContext': {} - 'f:terminationGracePeriodSeconds': {} - 'f:triggers': {} - - manager: openshift-controller-manager - operation: Update - apiVersion: apps.openshift.io/v1 - time: '2021-08-25T23:48:11Z' - fieldsType: FieldsV1 - fieldsV1: - 'f:status': - 'f:conditions': - .: {} - 'k:{"type":"Available"}': - .: {} - 'f:lastTransitionTime': {} - 'f:lastUpdateTime': {} - 'f:message': {} - 'f:status': {} - 'f:type': {} - 'k:{"type":"Progressing"}': - .: {} - 'f:lastTransitionTime': {} - 'f:lastUpdateTime': {} - 'f:message': {} - 'f:status': {} - 'f:type': {} - 'f:details': - .: {} - 'f:causes': {} - 'f:message': {} - 'f:latestVersion': {} - 'f:observedGeneration': {} -spec: - strategy: - type: Rolling - rollingParams: - updatePeriodSeconds: 1 - intervalSeconds: 1 - timeoutSeconds: 600 - maxUnavailable: 25% - maxSurge: 25% - resources: {} - activeDeadlineSeconds: 21600 - triggers: - - type: ConfigChange - replicas: 3 - revisionHistoryLimit: 10 - test: false - selector: - app: httpd - template: - metadata: - creationTimestamp: null - labels: - app: httpd - spec: - containers: - - name: httpd - image: >- - image-registry.openshift-image-registry.svc:5000/openshift/httpd:latest - ports: - - containerPort: 8080 - protocol: TCP - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - imagePullPolicy: Always - restartPolicy: Always - terminationGracePeriodSeconds: 30 - dnsPolicy: ClusterFirst - securityContext: {} - schedulerName: default-scheduler -status: - latestVersion: 1 - observedGeneration: 1 - replicas: 10 - updatedReplicas: 10 - availableReplicas: 0 - unavailableReplicas: 10 - details: - message: config change - causes: - - type: ConfigChange - conditions: - - type: Available - status: 'False' - lastUpdateTime: '2021-08-25T23:48:11Z' - lastTransitionTime: '2021-08-25T23:48:11Z' - message: Deployment config does not have minimum availability. - - type: Progressing - status: Unknown - lastUpdateTime: '2021-08-25T23:48:11Z' - lastTransitionTime: '2021-08-25T23:48:11Z' - message: >- - replication controller "example-1" is waiting for pod "example-1-deploy" - to run \ No newline at end of file diff --git a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/healthy.yaml b/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/healthy.yaml deleted file mode 100644 index 266f655..0000000 --- a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/healthy.yaml +++ /dev/null @@ -1,66 +0,0 @@ -kind: DeploymentConfig -apiVersion: apps.openshift.io/v1 -metadata: - name: example - namespace: default -spec: - strategy: - type: Rolling - rollingParams: - updatePeriodSeconds: 1 - intervalSeconds: 1 - timeoutSeconds: 600 - maxUnavailable: 25% - maxSurge: 25% - resources: {} - activeDeadlineSeconds: 21600 - triggers: - - type: ConfigChange - replicas: 3 - revisionHistoryLimit: 10 - test: false - selector: - app: httpd - template: - metadata: - creationTimestamp: null - labels: - app: httpd - spec: - containers: - - name: httpd - image: >- - image-registry.openshift-image-registry.svc:5000/openshift/httpd:latest - ports: - - containerPort: 8080 - protocol: TCP - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - imagePullPolicy: Always - restartPolicy: Always - terminationGracePeriodSeconds: 30 - dnsPolicy: ClusterFirst - securityContext: {} - schedulerName: default-scheduler -status: - observedGeneration: 1 - details: - message: config change - causes: - - type: ConfigChange - availableReplicas: 3 - conditions: - - type: Available - status: 'True' - lastUpdateTime: '2021-08-25T23:48:29Z' - lastTransitionTime: '2021-08-25T23:48:29Z' - message: Deployment config has minimum availability. - - type: Progressing - status: 'True' - lastUpdateTime: '2021-08-25T23:48:29Z' - lastTransitionTime: '2021-08-25T23:48:15Z' - reason: NewReplicationControllerAvailable - message: replication controller "example-1" successfully rolled out - replicas: 3 - readyReplicas: 3 \ No newline at end of file diff --git a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/healthy_zero_replicas.yaml b/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/healthy_zero_replicas.yaml deleted file mode 100644 index c0837a3..0000000 --- a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/healthy_zero_replicas.yaml +++ /dev/null @@ -1,68 +0,0 @@ -kind: DeploymentConfig -apiVersion: apps.openshift.io/v1 -metadata: - name: example - namespace: default -spec: - strategy: - type: Rolling - rollingParams: - updatePeriodSeconds: 1 - intervalSeconds: 1 - timeoutSeconds: 600 - maxUnavailable: 25% - maxSurge: 25% - resources: {} - activeDeadlineSeconds: 21600 - triggers: - - type: ConfigChange - replicas: 3 - revisionHistoryLimit: 10 - test: false - selector: - app: httpd - template: - metadata: - creationTimestamp: null - labels: - app: httpd - spec: - containers: - - name: httpd - image: >- - image-registry.openshift-image-registry.svc:5000/openshift/httpd:latest - ports: - - containerPort: 8080 - protocol: TCP - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - imagePullPolicy: Always - restartPolicy: Always - terminationGracePeriodSeconds: 30 - dnsPolicy: ClusterFirst - securityContext: {} - schedulerName: default-scheduler -status: - availableReplicas: 0 - conditions: - - lastTransitionTime: '2022-02-02T12:22:22Z' - lastUpdateTime: '2022-02-02T12:23:53Z' - message: replication controller "jenkins-1" successfully rolled out - reason: NewReplicationControllerAvailable - status: 'True' - type: Progressing - - lastTransitionTime: '2022-02-02T14:11:11Z' - lastUpdateTime: '2022-02-02T14:11:11Z' - message: Deployment config does not have minimum availability. - status: 'False' - type: Available - details: - causes: - - type: ConfigChange - message: config change - latestVersion: 1 - observedGeneration: 5 - replicas: 0 - unavailableReplicas: 0 - updatedReplicas: 0 \ No newline at end of file diff --git a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/progressing.yaml b/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/progressing.yaml deleted file mode 100644 index 6f83257..0000000 --- a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/progressing.yaml +++ /dev/null @@ -1,163 +0,0 @@ -kind: DeploymentConfig -apiVersion: apps.openshift.io/v1 -metadata: - name: example - namespace: default - uid: 365e7b5a-a72e-4fdf-be9d-cd5590d956bb - resourceVersion: '88832' - generation: 1 - creationTimestamp: '2021-08-26T04:37:06Z' - managedFields: - - manager: Mozilla - operation: Update - apiVersion: apps.openshift.io/v1 - time: '2021-08-26T04:37:06Z' - fieldsType: FieldsV1 - fieldsV1: - 'f:spec': - 'f:replicas': {} - 'f:revisionHistoryLimit': {} - 'f:selector': - .: {} - 'f:app': {} - 'f:strategy': - 'f:activeDeadlineSeconds': {} - 'f:rollingParams': - .: {} - 'f:intervalSeconds': {} - 'f:maxSurge': {} - 'f:maxUnavailable': {} - 'f:timeoutSeconds': {} - 'f:updatePeriodSeconds': {} - 'f:type': {} - 'f:template': - .: {} - 'f:metadata': - .: {} - 'f:creationTimestamp': {} - 'f:labels': - .: {} - 'f:app': {} - 'f:spec': - .: {} - 'f:containers': - .: {} - 'k:{"name":"httpd"}': - .: {} - 'f:image': {} - 'f:imagePullPolicy': {} - 'f:name': {} - 'f:ports': - .: {} - 'k:{"containerPort":8080,"protocol":"TCP"}': - .: {} - 'f:containerPort': {} - 'f:protocol': {} - 'f:resources': {} - 'f:terminationMessagePath': {} - 'f:terminationMessagePolicy': {} - 'f:dnsPolicy': {} - 'f:restartPolicy': {} - 'f:schedulerName': {} - 'f:securityContext': {} - 'f:terminationGracePeriodSeconds': {} - 'f:triggers': {} - - manager: openshift-controller-manager - operation: Update - apiVersion: apps.openshift.io/v1 - time: '2021-08-26T04:37:11Z' - fieldsType: FieldsV1 - fieldsV1: - 'f:status': - 'f:updatedReplicas': {} - 'f:readyReplicas': {} - 'f:conditions': - .: {} - 'k:{"type":"Available"}': - .: {} - 'f:lastTransitionTime': {} - 'f:lastUpdateTime': {} - 'f:message': {} - 'f:status': {} - 'f:type': {} - 'k:{"type":"Progressing"}': - .: {} - 'f:lastTransitionTime': {} - 'f:lastUpdateTime': {} - 'f:message': {} - 'f:status': {} - 'f:type': {} - 'f:details': - .: {} - 'f:causes': {} - 'f:message': {} - 'f:replicas': {} - 'f:availableReplicas': {} - 'f:observedGeneration': {} - 'f:unavailableReplicas': {} - 'f:latestVersion': {} -spec: - strategy: - type: Rolling - rollingParams: - updatePeriodSeconds: 1 - intervalSeconds: 1 - timeoutSeconds: 600 - maxUnavailable: 25% - maxSurge: 25% - resources: {} - activeDeadlineSeconds: 21600 - triggers: - - type: ConfigChange - replicas: 20 - revisionHistoryLimit: 10 - test: false - selector: - app: httpd - template: - metadata: - creationTimestamp: null - labels: - app: httpd - spec: - containers: - - name: httpd - image: >- - image-registry.openshift-image-registry.svc:5000/openshift/httpd:latest - ports: - - containerPort: 8080 - protocol: TCP - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - imagePullPolicy: Always - restartPolicy: Always - terminationGracePeriodSeconds: 30 - dnsPolicy: ClusterFirst - securityContext: {} - schedulerName: default-scheduler -status: - observedGeneration: 1 - details: - message: config change - causes: - - type: ConfigChange - availableReplicas: 20 - unavailableReplicas: 0 - latestVersion: 1 - updatedReplicas: 20 - conditions: - - type: Progressing - status: Unknown - lastUpdateTime: '2021-08-26T04:37:06Z' - lastTransitionTime: '2021-08-26T04:37:06Z' - message: >- - replication controller "example-1" is waiting for pod "example-1-deploy" - to run - - type: Available - status: 'True' - lastUpdateTime: '2021-08-26T04:37:12Z' - lastTransitionTime: '2021-08-26T04:37:12Z' - message: Deployment config has minimum availability. - replicas: 20 - readyReplicas: 20 diff --git a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/progressing_rc_updated.yaml b/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/progressing_rc_updated.yaml deleted file mode 100644 index 8495344..0000000 --- a/pkg/resource_customizations/apps.openshift.io/DeploymentConfig/testdata/progressing_rc_updated.yaml +++ /dev/null @@ -1,66 +0,0 @@ -kind: DeploymentConfig -apiVersion: apps.openshift.io/v1 -metadata: - name: example - namespace: default -spec: - strategy: - type: Rolling - rollingParams: - updatePeriodSeconds: 1 - intervalSeconds: 1 - timeoutSeconds: 600 - maxUnavailable: 25% - maxSurge: 25% - resources: {} - activeDeadlineSeconds: 21600 - triggers: - - type: ConfigChange - replicas: 3 - revisionHistoryLimit: 10 - test: false - selector: - app: httpd - template: - metadata: - creationTimestamp: null - labels: - app: httpd - spec: - containers: - - name: httpd - image: >- - image-registry.openshift-image-registry.svc:5000/openshift/httpd:latest - ports: - - containerPort: 8080 - protocol: TCP - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - imagePullPolicy: Always - restartPolicy: Always - terminationGracePeriodSeconds: 30 - dnsPolicy: ClusterFirst - securityContext: {} - schedulerName: default-scheduler -status: - observedGeneration: 1 - details: - message: config change - causes: - - type: ConfigChange - availableReplicas: 3 - conditions: - - type: Available - status: 'True' - lastUpdateTime: '2021-08-25T23:48:29Z' - lastTransitionTime: '2021-08-25T23:48:29Z' - message: Deployment config has minimum availability. - - type: Progressing - status: 'True' - lastUpdateTime: '2021-08-25T23:48:29Z' - lastTransitionTime: '2021-08-25T23:48:15Z' - reason: ReplicationControllerUpdated - message: replication controller "example-1" is progressing - replicas: 3 - readyReplicas: 3 \ No newline at end of file diff --git a/pkg/resource_customizations/apps/DaemonSet/actions/action_test.yaml b/pkg/resource_customizations/apps/DaemonSet/actions/action_test.yaml deleted file mode 100644 index 4298ac4..0000000 --- a/pkg/resource_customizations/apps/DaemonSet/actions/action_test.yaml +++ /dev/null @@ -1,4 +0,0 @@ -actionTests: -- action: restart - inputPath: testdata/daemonset.yaml - expectedOutputPath: testdata/daemonset-restarted.yaml diff --git a/pkg/resource_customizations/apps/DaemonSet/actions/discovery.lua b/pkg/resource_customizations/apps/DaemonSet/actions/discovery.lua deleted file mode 100644 index 4955737..0000000 --- a/pkg/resource_customizations/apps/DaemonSet/actions/discovery.lua +++ /dev/null @@ -1,3 +0,0 @@ -actions = {} -actions["restart"] = {} -return actions diff --git a/pkg/resource_customizations/apps/DaemonSet/actions/restart/action.lua b/pkg/resource_customizations/apps/DaemonSet/actions/restart/action.lua deleted file mode 100644 index 457c767..0000000 --- a/pkg/resource_customizations/apps/DaemonSet/actions/restart/action.lua +++ /dev/null @@ -1,9 +0,0 @@ -local os = require("os") -if obj.spec.template.metadata == nil then - obj.spec.template.metadata = {} -end -if obj.spec.template.metadata.annotations == nil then - obj.spec.template.metadata.annotations = {} -end -obj.spec.template.metadata.annotations["kubectl.kubernetes.io/restartedAt"] = os.date("!%Y-%m-%dT%XZ") -return obj diff --git a/pkg/resource_customizations/apps/DaemonSet/actions/testdata/daemonset-restarted.yaml b/pkg/resource_customizations/apps/DaemonSet/actions/testdata/daemonset-restarted.yaml deleted file mode 100644 index e6ff036..0000000 --- a/pkg/resource_customizations/apps/DaemonSet/actions/testdata/daemonset-restarted.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: apps/v1 -kind: DaemonSet -metadata: - annotations: - deprecated.daemonset.template.generation: "3" - creationTimestamp: "2019-09-13T08:52:50Z" - generation: 3 - labels: - app.kubernetes.io/instance: extensions - name: daemonset - namespace: statefulset - resourceVersion: "7472656" - selfLink: /apis/apps/v1/namespaces/statefulset/daemonsets/daemonset - uid: de04d075-d603-11e9-9e69-42010aa8005f -spec: - revisionHistoryLimit: 10 - selector: - matchLabels: - name: daemonset - template: - metadata: - annotations: - kubectl.kubernetes.io/restartedAt: "0001-01-01T00:00:00Z" - labels: - name: daemonset - spec: - containers: - - image: registry.k8s.io/nginx-slim:0.8 - imagePullPolicy: IfNotPresent - name: nginx - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 - updateStrategy: - rollingUpdate: - maxUnavailable: 1 - type: RollingUpdate -status: - currentNumberScheduled: 4 - desiredNumberScheduled: 4 - numberAvailable: 4 - numberMisscheduled: 0 - numberReady: 4 - observedGeneration: 3 - updatedNumberScheduled: 4 diff --git a/pkg/resource_customizations/apps/DaemonSet/actions/testdata/daemonset.yaml b/pkg/resource_customizations/apps/DaemonSet/actions/testdata/daemonset.yaml deleted file mode 100644 index d293188..0000000 --- a/pkg/resource_customizations/apps/DaemonSet/actions/testdata/daemonset.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: apps/v1 -kind: DaemonSet -metadata: - annotations: - deprecated.daemonset.template.generation: "3" - creationTimestamp: "2019-09-13T08:52:50Z" - generation: 3 - labels: - app.kubernetes.io/instance: extensions - name: daemonset - namespace: statefulset - resourceVersion: "7472656" - selfLink: /apis/apps/v1/namespaces/statefulset/daemonsets/daemonset - uid: de04d075-d603-11e9-9e69-42010aa8005f -spec: - revisionHistoryLimit: 10 - selector: - matchLabels: - name: daemonset - template: - metadata: - labels: - name: daemonset - spec: - containers: - - image: registry.k8s.io/nginx-slim:0.8 - imagePullPolicy: IfNotPresent - name: nginx - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 - updateStrategy: - rollingUpdate: - maxUnavailable: 1 - type: RollingUpdate -status: - currentNumberScheduled: 4 - desiredNumberScheduled: 4 - numberAvailable: 4 - numberMisscheduled: 0 - numberReady: 4 - observedGeneration: 3 - updatedNumberScheduled: 4 diff --git a/pkg/resource_customizations/apps/Deployment/actions/action_test.yaml b/pkg/resource_customizations/apps/Deployment/actions/action_test.yaml deleted file mode 100644 index 14538c8..0000000 --- a/pkg/resource_customizations/apps/Deployment/actions/action_test.yaml +++ /dev/null @@ -1,10 +0,0 @@ -actionTests: -- action: restart - inputPath: testdata/deployment.yaml - expectedOutputPath: testdata/deployment-restarted.yaml -- action: pause - inputPath: testdata/deployment.yaml - expectedOutputPath: testdata/deployment-pause.yaml -- action: resume - inputPath: testdata/deployment-pause.yaml - expectedOutputPath: testdata/deployment-resume.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/apps/Deployment/actions/discovery.lua b/pkg/resource_customizations/apps/Deployment/actions/discovery.lua deleted file mode 100644 index 52b52fb..0000000 --- a/pkg/resource_customizations/apps/Deployment/actions/discovery.lua +++ /dev/null @@ -1,10 +0,0 @@ -actions = {} -actions["restart"] = {} - -local paused = false -if obj.spec.paused ~= nil then - paused = obj.spec.paused - actions["pause"] = {paused} -end -actions["resume"] = {["disabled"] = not(paused)} -return actions diff --git a/pkg/resource_customizations/apps/Deployment/actions/pause/action.lua b/pkg/resource_customizations/apps/Deployment/actions/pause/action.lua deleted file mode 100644 index ba3e108..0000000 --- a/pkg/resource_customizations/apps/Deployment/actions/pause/action.lua +++ /dev/null @@ -1,2 +0,0 @@ -obj.spec.paused = true -return obj \ No newline at end of file diff --git a/pkg/resource_customizations/apps/Deployment/actions/restart/action.lua b/pkg/resource_customizations/apps/Deployment/actions/restart/action.lua deleted file mode 100644 index 457c767..0000000 --- a/pkg/resource_customizations/apps/Deployment/actions/restart/action.lua +++ /dev/null @@ -1,9 +0,0 @@ -local os = require("os") -if obj.spec.template.metadata == nil then - obj.spec.template.metadata = {} -end -if obj.spec.template.metadata.annotations == nil then - obj.spec.template.metadata.annotations = {} -end -obj.spec.template.metadata.annotations["kubectl.kubernetes.io/restartedAt"] = os.date("!%Y-%m-%dT%XZ") -return obj diff --git a/pkg/resource_customizations/apps/Deployment/actions/resume/action.lua b/pkg/resource_customizations/apps/Deployment/actions/resume/action.lua deleted file mode 100644 index 94cff65..0000000 --- a/pkg/resource_customizations/apps/Deployment/actions/resume/action.lua +++ /dev/null @@ -1,2 +0,0 @@ -obj.spec.paused = nil -return obj \ No newline at end of file diff --git a/pkg/resource_customizations/apps/Deployment/actions/testdata/deployment-pause.yaml b/pkg/resource_customizations/apps/Deployment/actions/testdata/deployment-pause.yaml deleted file mode 100644 index 3ddbbe3..0000000 --- a/pkg/resource_customizations/apps/Deployment/actions/testdata/deployment-pause.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - deployment.kubernetes.io/revision: "1" - creationTimestamp: "2021-09-21T22:35:20Z" - name: nginx-deploy - namespace: default - generation: 2 -spec: - paused: true - progressDeadlineSeconds: 600 - replicas: 3 - revisionHistoryLimit: 10 - selector: - matchLabels: - app: nginx - strategy: - rollingUpdate: - maxSurge: 25% - maxUnavailable: 25% - type: RollingUpdate - template: - metadata: - creationTimestamp: null - labels: - app: nginx - spec: - containers: - - image: nginx:latest - imagePullPolicy: Always - name: nginx - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 -status: - availableReplicas: 3 - conditions: - - lastTransitionTime: "2021-09-21T22:35:31Z" - lastUpdateTime: "2021-09-21T22:35:31Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: Available - - lastTransitionTime: "2021-09-21T22:36:25Z" - lastUpdateTime: "2021-09-21T22:36:25Z" - message: Deployment is paused - reason: DeploymentPaused - status: Unknown - type: Progressing - observedGeneration: 2 - readyReplicas: 3 - replicas: 3 - updatedReplicas: 3 \ No newline at end of file diff --git a/pkg/resource_customizations/apps/Deployment/actions/testdata/deployment-restarted.yaml b/pkg/resource_customizations/apps/Deployment/actions/testdata/deployment-restarted.yaml deleted file mode 100644 index 373bd06..0000000 --- a/pkg/resource_customizations/apps/Deployment/actions/testdata/deployment-restarted.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - deployment.kubernetes.io/revision: "1" - creationTimestamp: "2019-09-12T01:33:53Z" - generation: 1 - name: nginx-deploy - namespace: default - resourceVersion: "6897444" - selfLink: /apis/apps/v1/namespaces/default/deployments/nginx-deploy - uid: 61689d6d-d4fd-11e9-9e69-42010aa8005f -spec: - progressDeadlineSeconds: 600 - replicas: 3 - revisionHistoryLimit: 10 - selector: - matchLabels: - app: nginx - strategy: - rollingUpdate: - maxSurge: 25% - maxUnavailable: 25% - type: RollingUpdate - template: - metadata: - labels: - app: nginx - annotations: - kubectl.kubernetes.io/restartedAt: "0001-01-01T00:00:00Z" - spec: - containers: - - image: nginx:latest - imagePullPolicy: Always - name: nginx - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 -status: - availableReplicas: 2 - conditions: - - lastTransitionTime: "2019-09-12T01:33:53Z" - lastUpdateTime: "2019-09-12T01:33:53Z" - message: Deployment does not have minimum availability. - reason: MinimumReplicasUnavailable - status: "False" - type: Available - - lastTransitionTime: "2019-09-12T01:33:53Z" - lastUpdateTime: "2019-09-12T01:34:05Z" - message: ReplicaSet "nginx-deploy-9cb4784bd" is progressing. - reason: ReplicaSetUpdated - status: "True" - type: Progressing - observedGeneration: 1 - readyReplicas: 2 - replicas: 3 - unavailableReplicas: 1 - updatedReplicas: 3 diff --git a/pkg/resource_customizations/apps/Deployment/actions/testdata/deployment-resume.yaml b/pkg/resource_customizations/apps/Deployment/actions/testdata/deployment-resume.yaml deleted file mode 100644 index 8ccb8dc..0000000 --- a/pkg/resource_customizations/apps/Deployment/actions/testdata/deployment-resume.yaml +++ /dev/null @@ -1,58 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - deployment.kubernetes.io/revision: "1" - creationTimestamp: "2021-09-21T22:35:20Z" - generation: 3 - name: nginx-deploy - namespace: default -spec: - progressDeadlineSeconds: 600 - replicas: 3 - revisionHistoryLimit: 10 - selector: - matchLabels: - app: nginx - strategy: - rollingUpdate: - maxSurge: 25% - maxUnavailable: 25% - type: RollingUpdate - template: - metadata: - creationTimestamp: null - labels: - app: nginx - spec: - containers: - - image: nginx:latest - imagePullPolicy: Always - name: nginx - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 -status: - availableReplicas: 3 - conditions: - - lastTransitionTime: "2021-09-21T22:35:31Z" - lastUpdateTime: "2021-09-21T22:35:31Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: Available - - lastTransitionTime: "2021-09-21T22:38:10Z" - lastUpdateTime: "2021-09-21T22:38:10Z" - message: ReplicaSet "nginx-deploy-55649fd747" has successfully progressed. - reason: NewReplicaSetAvailable - status: "True" - type: Progressing - observedGeneration: 3 - readyReplicas: 3 - replicas: 3 - updatedReplicas: 3 \ No newline at end of file diff --git a/pkg/resource_customizations/apps/Deployment/actions/testdata/deployment.yaml b/pkg/resource_customizations/apps/Deployment/actions/testdata/deployment.yaml deleted file mode 100644 index 6d41db1..0000000 --- a/pkg/resource_customizations/apps/Deployment/actions/testdata/deployment.yaml +++ /dev/null @@ -1,61 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - annotations: - deployment.kubernetes.io/revision: "1" - creationTimestamp: "2019-09-12T01:33:53Z" - generation: 1 - name: nginx-deploy - namespace: default - resourceVersion: "6897444" - selfLink: /apis/apps/v1/namespaces/default/deployments/nginx-deploy - uid: 61689d6d-d4fd-11e9-9e69-42010aa8005f -spec: - progressDeadlineSeconds: 600 - replicas: 3 - revisionHistoryLimit: 10 - selector: - matchLabels: - app: nginx - strategy: - rollingUpdate: - maxSurge: 25% - maxUnavailable: 25% - type: RollingUpdate - template: - metadata: - labels: - app: nginx - spec: - containers: - - image: nginx:latest - imagePullPolicy: Always - name: nginx - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 -status: - availableReplicas: 2 - conditions: - - lastTransitionTime: "2019-09-12T01:33:53Z" - lastUpdateTime: "2019-09-12T01:33:53Z" - message: Deployment does not have minimum availability. - reason: MinimumReplicasUnavailable - status: "False" - type: Available - - lastTransitionTime: "2019-09-12T01:33:53Z" - lastUpdateTime: "2019-09-12T01:34:05Z" - message: ReplicaSet "nginx-deploy-9cb4784bd" is progressing. - reason: ReplicaSetUpdated - status: "True" - type: Progressing - observedGeneration: 1 - readyReplicas: 2 - replicas: 3 - unavailableReplicas: 1 - updatedReplicas: 3 diff --git a/pkg/resource_customizations/apps/StatefulSet/actions/action_test.yaml b/pkg/resource_customizations/apps/StatefulSet/actions/action_test.yaml deleted file mode 100644 index bab15aa..0000000 --- a/pkg/resource_customizations/apps/StatefulSet/actions/action_test.yaml +++ /dev/null @@ -1,4 +0,0 @@ -actionTests: -- action: restart - inputPath: testdata/statefulset.yaml - expectedOutputPath: testdata/statefulset-restarted.yaml diff --git a/pkg/resource_customizations/apps/StatefulSet/actions/discovery.lua b/pkg/resource_customizations/apps/StatefulSet/actions/discovery.lua deleted file mode 100644 index 4955737..0000000 --- a/pkg/resource_customizations/apps/StatefulSet/actions/discovery.lua +++ /dev/null @@ -1,3 +0,0 @@ -actions = {} -actions["restart"] = {} -return actions diff --git a/pkg/resource_customizations/apps/StatefulSet/actions/restart/action.lua b/pkg/resource_customizations/apps/StatefulSet/actions/restart/action.lua deleted file mode 100644 index 457c767..0000000 --- a/pkg/resource_customizations/apps/StatefulSet/actions/restart/action.lua +++ /dev/null @@ -1,9 +0,0 @@ -local os = require("os") -if obj.spec.template.metadata == nil then - obj.spec.template.metadata = {} -end -if obj.spec.template.metadata.annotations == nil then - obj.spec.template.metadata.annotations = {} -end -obj.spec.template.metadata.annotations["kubectl.kubernetes.io/restartedAt"] = os.date("!%Y-%m-%dT%XZ") -return obj diff --git a/pkg/resource_customizations/apps/StatefulSet/actions/testdata/statefulset-restarted.yaml b/pkg/resource_customizations/apps/StatefulSet/actions/testdata/statefulset-restarted.yaml deleted file mode 100644 index 44f902f..0000000 --- a/pkg/resource_customizations/apps/StatefulSet/actions/testdata/statefulset-restarted.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - creationTimestamp: "2019-09-13T08:52:54Z" - generation: 2 - labels: - app.kubernetes.io/instance: extensions - name: statefulset - namespace: statefulset - resourceVersion: "7471813" - selfLink: /apis/apps/v1/namespaces/statefulset/statefulsets/statefulset - uid: dfe8fadf-d603-11e9-9e69-42010aa8005f -spec: - podManagementPolicy: OrderedReady - replicas: 3 - revisionHistoryLimit: 10 - selector: - matchLabels: - app: statefulset - serviceName: statefulset - template: - metadata: - labels: - app: statefulset - annotations: - kubectl.kubernetes.io/restartedAt: "0001-01-01T00:00:00Z" - spec: - containers: - - image: registry.k8s.io/nginx-slim:0.8 - imagePullPolicy: IfNotPresent - name: nginx - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 - updateStrategy: - rollingUpdate: - partition: 0 - type: RollingUpdate -status: - collisionCount: 0 - currentReplicas: 3 - currentRevision: statefulset-85b7f767c6 - observedGeneration: 2 - readyReplicas: 3 - replicas: 3 - updateRevision: statefulset-85b7f767c6 - updatedReplicas: 3 diff --git a/pkg/resource_customizations/apps/StatefulSet/actions/testdata/statefulset.yaml b/pkg/resource_customizations/apps/StatefulSet/actions/testdata/statefulset.yaml deleted file mode 100644 index 7804814..0000000 --- a/pkg/resource_customizations/apps/StatefulSet/actions/testdata/statefulset.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - creationTimestamp: "2019-09-13T08:52:54Z" - generation: 2 - labels: - app.kubernetes.io/instance: extensions - name: statefulset - namespace: statefulset - resourceVersion: "7471813" - selfLink: /apis/apps/v1/namespaces/statefulset/statefulsets/statefulset - uid: dfe8fadf-d603-11e9-9e69-42010aa8005f -spec: - podManagementPolicy: OrderedReady - replicas: 3 - revisionHistoryLimit: 10 - selector: - matchLabels: - app: statefulset - serviceName: statefulset - template: - metadata: - labels: - app: statefulset - spec: - containers: - - image: registry.k8s.io/nginx-slim:0.8 - imagePullPolicy: IfNotPresent - name: nginx - resources: {} - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 - updateStrategy: - rollingUpdate: - partition: 0 - type: RollingUpdate -status: - collisionCount: 0 - currentReplicas: 3 - currentRevision: statefulset-85b7f767c6 - observedGeneration: 2 - readyReplicas: 3 - replicas: 3 - updateRevision: statefulset-85b7f767c6 - updatedReplicas: 3 diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/action_test.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/action_test.yaml deleted file mode 100644 index e99cfeb..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/action_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -discoveryTests: -- inputPath: testdata/runningAnalysisRun.yaml - result: - - name: terminate - disabled: false -- inputPath: testdata/failedAnalysisRun.yaml - result: - - name: terminate - disabled: true -actionTests: -- action: terminate - inputPath: testdata/runningAnalysisRun.yaml - expectedOutputPath: testdata/runningAnalysisRun_terminated.yaml diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/discovery.lua b/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/discovery.lua deleted file mode 100644 index b98eaf0..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/discovery.lua +++ /dev/null @@ -1,8 +0,0 @@ -actions = {} -actions["terminate"] = {["disabled"] = (obj.spec.terminate or - obj.status.phase == "Successful" or - obj.status.phase == "Failed" or - obj.status.phase == "Error" or - obj.status.phase == "Inconclusive" -)} -return actions diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/terminate/action.lua b/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/terminate/action.lua deleted file mode 100644 index 9ab153d..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/terminate/action.lua +++ /dev/null @@ -1,2 +0,0 @@ -obj.spec.terminate = true -return obj diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/testdata/failedAnalysisRun.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/testdata/failedAnalysisRun.yaml deleted file mode 100644 index c094f38..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/testdata/failedAnalysisRun.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - name: canary-demo-analysis-template-6c6bb7cf6f-9k5rj - namespace: default -spec: - analysisSpec: - metrics: - - failureCondition: len(result) > 0 - interval: 10 - name: memory-usage - provider: - prometheus: - address: 'http://prometheus-operator-prometheus.prometheus-operator:9090' - query: > - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview",status!~"[4-5].*"}[2m])) - / - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview"}[2m])) - successCondition: len(result) > 0 -status: - metricResults: - - count: 1 - failed: 1 - measurements: - - finishedAt: '2019-10-28T18:23:23Z' - startedAt: '2019-10-28T18:23:23Z' - phase: Failed - value: '[0.9768211920529802]' - name: memory-usage - phase: Failed - phase: Failed diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/testdata/runningAnalysisRun.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/testdata/runningAnalysisRun.yaml deleted file mode 100644 index 36848b7..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/testdata/runningAnalysisRun.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - name: canary-demo-analysis-template-6c6bb7cf6f-5bpxj - namespace: default -spec: - analysisSpec: - metrics: - - failureCondition: len(result) == 0 - interval: 10 - name: memory-usage - provider: - prometheus: - address: 'http://prometheus-operator-prometheus.prometheus-operator:9090' - query: > - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview",status!~"[4-5].*"}[2m])) - / - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview"}[2m])) - successCondition: len(result) > 0 -status: - metricResults: - - count: 2 - measurements: - - finishedAt: '2019-10-28T18:22:05Z' - startedAt: '2019-10-28T18:22:05Z' - phase: Successful - value: '[0.9721293199554069]' - - finishedAt: '2019-10-28T18:22:15Z' - startedAt: '2019-10-28T18:22:15Z' - phase: Successful - value: '[0.9721293199554069]' - name: memory-usage - phase: Running - successful: 2 - phase: Running diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/testdata/runningAnalysisRun_terminated.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/testdata/runningAnalysisRun_terminated.yaml deleted file mode 100644 index 1c133cf..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/actions/testdata/runningAnalysisRun_terminated.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - name: canary-demo-analysis-template-6c6bb7cf6f-5bpxj - namespace: default -spec: - terminate: true - analysisSpec: - metrics: - - failureCondition: len(result) == 0 - interval: 10 - name: memory-usage - provider: - prometheus: - address: 'http://prometheus-operator-prometheus.prometheus-operator:9090' - query: > - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview",status!~"[4-5].*"}[2m])) - / - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview"}[2m])) - successCondition: len(result) > 0 -status: - metricResults: - - count: 2 - measurements: - - finishedAt: '2019-10-28T18:22:05Z' - startedAt: '2019-10-28T18:22:05Z' - phase: Successful - value: '[0.9721293199554069]' - - finishedAt: '2019-10-28T18:22:15Z' - startedAt: '2019-10-28T18:22:15Z' - phase: Successful - value: '[0.9721293199554069]' - name: memory-usage - phase: Running - successful: 2 - phase: Running diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/health.lua b/pkg/resource_customizations/argoproj.io/AnalysisRun/health.lua deleted file mode 100644 index ea2f53a..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/health.lua +++ /dev/null @@ -1,40 +0,0 @@ -hs = {} - -function messageOrDefault(field, default) - if field ~= nil then - return field - end - return default - end - -if obj.status ~= nil then - if obj.status.phase == "Pending" then - hs.status = "Progressing" - hs.message = "Analysis run is running" - end - if obj.status.phase == "Running" then - hs.status = "Progressing" - hs.message = "Analysis run is running" - end - if obj.status.phase == "Successful" then - hs.status = "Healthy" - hs.message = messageOrDefault(obj.status.message, "Analysis run completed successfully") - end - if obj.status.phase == "Failed" then - hs.status = "Degraded" - hs.message = messageOrDefault(obj.status.message, "Analysis run failed") - end - if obj.status.phase == "Error" then - hs.status = "Degraded" - hs.message = messageOrDefault(obj.status.message, "Analysis run had an error") - end - if obj.status.phase == "Inconclusive" then - hs.status = "Unknown" - hs.message = messageOrDefault(obj.status.message, "Analysis run was inconclusive") - end - return hs -end - -hs.status = "Progressing" -hs.message = "Waiting for analysis run to finish: status has not been reconciled." -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/health_test.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/health_test.yaml deleted file mode 100644 index 762139a..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/health_test.yaml +++ /dev/null @@ -1,45 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Analysis run is running" - inputPath: testdata/pendingAnalysisRun.yaml -- healthStatus: - status: Progressing - message: "Waiting for analysis run to finish: status has not been reconciled." - inputPath: testdata/noStatusAnalysisRun.yaml -- healthStatus: - status: Progressing - message: "Analysis run is running" - inputPath: testdata/runningAnalysisRun.yaml -- healthStatus: - status: Healthy - message: "Analysis run completed successfully" - inputPath: testdata/successfulAnalysisRun.yaml -- healthStatus: - status: Degraded - message: "Analysis run failed" - inputPath: testdata/failedAnalysisRun.yaml -- healthStatus: - status: Degraded - message: "Status Message: Assessed as Failed" - inputPath: testdata/failedAnalysisRunWithStatusMessage.yaml -- healthStatus: - status: Degraded - message: "Analysis run had an error" - inputPath: testdata/errorAnalysisRun.yaml -- healthStatus: - status: Degraded - message: "Status Message: Assessed as Error" - inputPath: testdata/errorAnalysisRunWithStatusMessage.yaml -- healthStatus: - status: Unknown - message: "Analysis run was inconclusive" - inputPath: testdata/inconclusiveAnalysisRun.yaml -- healthStatus: - status: Unknown - message: "Status Message: Assessed as Inconclusive" - inputPath: testdata/inconclusiveAnalysisRunWithStatusMessage.yaml -- healthStatus: - status: Healthy - message: "run terminated" - inputPath: testdata/terminatedAnalysisRun.yaml diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/errorAnalysisRun.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/errorAnalysisRun.yaml deleted file mode 100644 index 0609656..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/errorAnalysisRun.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - name: canary-demo-analysis-template-6c6bb7cf6f-btpgc - namespace: default -spec: - analysisSpec: - metrics: - - failureCondition: result < 92 - interval: 10 - name: memory-usage - provider: - prometheus: - address: 'http://prometheus-operator-prometheus.prometheus-operator:9090' - query: > - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview",status!~"[4-5].*"}[2m])) - / - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview"}[2m])) - successCondition: result > 95 -status: - metricResults: - - consecutiveError: 5 - error: 5 - measurements: - - finishedAt: '2019-10-28T18:13:01Z' - startedAt: '2019-10-28T18:13:01Z' - phase: Error - value: '[0.9832775919732442]' - - finishedAt: '2019-10-28T18:13:11Z' - startedAt: '2019-10-28T18:13:11Z' - phase: Error - value: '[0.9832775919732442]' - - finishedAt: '2019-10-28T18:13:21Z' - startedAt: '2019-10-28T18:13:21Z' - phase: Error - value: '[0.9722530521642618]' - - finishedAt: '2019-10-28T18:13:31Z' - startedAt: '2019-10-28T18:13:31Z' - phase: Error - value: '[0.9722530521642618]' - - finishedAt: '2019-10-28T18:13:41Z' - startedAt: '2019-10-28T18:13:41Z' - phase: Error - value: '[0.9722530521642618]' - name: memory-usage - phase: Error - phase: Error diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/errorAnalysisRunWithStatusMessage.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/errorAnalysisRunWithStatusMessage.yaml deleted file mode 100644 index e290ff0..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/errorAnalysisRunWithStatusMessage.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - name: canary-demo-analysis-template-6c6bb7cf6f-btpgc - namespace: default -spec: - analysisSpec: - metrics: - - failureCondition: result < 92 - interval: 10 - name: memory-usage - provider: - prometheus: - address: 'http://prometheus-operator-prometheus.prometheus-operator:9090' - query: > - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview",status!~"[4-5].*"}[2m])) - / - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview"}[2m])) - successCondition: result > 95 -status: - message: "Status Message: Assessed as Error" - metricResults: - - consecutiveError: 5 - error: 5 - measurements: - - finishedAt: '2019-10-28T18:13:01Z' - startedAt: '2019-10-28T18:13:01Z' - phase: Error - value: '[0.9832775919732442]' - - finishedAt: '2019-10-28T18:13:11Z' - startedAt: '2019-10-28T18:13:11Z' - phase: Error - value: '[0.9832775919732442]' - - finishedAt: '2019-10-28T18:13:21Z' - startedAt: '2019-10-28T18:13:21Z' - phase: Error - value: '[0.9722530521642618]' - - finishedAt: '2019-10-28T18:13:31Z' - startedAt: '2019-10-28T18:13:31Z' - phase: Error - value: '[0.9722530521642618]' - - finishedAt: '2019-10-28T18:13:41Z' - startedAt: '2019-10-28T18:13:41Z' - phase: Error - value: '[0.9722530521642618]' - name: memory-usage - phase: Error - phase: Error diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/failedAnalysisRun.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/failedAnalysisRun.yaml deleted file mode 100644 index c094f38..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/failedAnalysisRun.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - name: canary-demo-analysis-template-6c6bb7cf6f-9k5rj - namespace: default -spec: - analysisSpec: - metrics: - - failureCondition: len(result) > 0 - interval: 10 - name: memory-usage - provider: - prometheus: - address: 'http://prometheus-operator-prometheus.prometheus-operator:9090' - query: > - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview",status!~"[4-5].*"}[2m])) - / - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview"}[2m])) - successCondition: len(result) > 0 -status: - metricResults: - - count: 1 - failed: 1 - measurements: - - finishedAt: '2019-10-28T18:23:23Z' - startedAt: '2019-10-28T18:23:23Z' - phase: Failed - value: '[0.9768211920529802]' - name: memory-usage - phase: Failed - phase: Failed diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/failedAnalysisRunWithStatusMessage.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/failedAnalysisRunWithStatusMessage.yaml deleted file mode 100644 index 84c9ff8..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/failedAnalysisRunWithStatusMessage.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - name: canary-demo-analysis-template-6c6bb7cf6f-9k5rj - namespace: default -spec: - analysisSpec: - metrics: - - failureCondition: len(result) > 0 - interval: 10 - name: memory-usage - provider: - prometheus: - address: 'http://prometheus-operator-prometheus.prometheus-operator:9090' - query: > - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview",status!~"[4-5].*"}[2m])) - / - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview"}[2m])) - successCondition: len(result) > 0 -status: - message: "Status Message: Assessed as Failed" - metricResults: - - count: 1 - failed: 1 - measurements: - - finishedAt: '2019-10-28T18:23:23Z' - startedAt: '2019-10-28T18:23:23Z' - phase: Failed - value: '[0.9768211920529802]' - name: memory-usage - phase: Failed - phase: Failed diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/inconclusiveAnalysisRun.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/inconclusiveAnalysisRun.yaml deleted file mode 100644 index 00a9c02..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/inconclusiveAnalysisRun.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - name: canary-demo-analysis-template-6c6bb7cf6f-ddvn8 - namespace: default -spec: - analysisSpec: - metrics: - - failureCondition: len(result) == 0 - interval: 10 - name: memory-usage - provider: - prometheus: - address: 'http://prometheus-operator-prometheus.prometheus-operator:9090' - query: > - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview",status!~"[4-5].*"}[2m])) - / - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview"}[2m])) - successCondition: len(result) == 0 -status: - metricResults: - - count: 1 - inconclusive: 1 - measurements: - - finishedAt: '2019-10-28T18:24:31Z' - startedAt: '2019-10-28T18:24:31Z' - phase: Inconclusive - value: '[0.9744444444444443]' - name: memory-usage - phase: Inconclusive - phase: Inconclusive diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/inconclusiveAnalysisRunWithStatusMessage.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/inconclusiveAnalysisRunWithStatusMessage.yaml deleted file mode 100644 index 43add8a..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/inconclusiveAnalysisRunWithStatusMessage.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - name: canary-demo-analysis-template-6c6bb7cf6f-ddvn8 - namespace: default -spec: - analysisSpec: - metrics: - - failureCondition: len(result) == 0 - interval: 10 - name: memory-usage - provider: - prometheus: - address: 'http://prometheus-operator-prometheus.prometheus-operator:9090' - query: > - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview",status!~"[4-5].*"}[2m])) - / - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview"}[2m])) - successCondition: len(result) == 0 -status: - message: "Status Message: Assessed as Inconclusive" - metricResults: - - count: 1 - inconclusive: 1 - measurements: - - finishedAt: '2019-10-28T18:24:31Z' - startedAt: '2019-10-28T18:24:31Z' - phase: Inconclusive - value: '[0.9744444444444443]' - name: memory-usage - phase: Inconclusive - phase: Inconclusive diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/noStatusAnalysisRun.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/noStatusAnalysisRun.yaml deleted file mode 100644 index c443493..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/noStatusAnalysisRun.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - name: canary-demo-analysis-template-6c6bb7cf6f-9k5rj - namespace: default -spec: - analysisSpec: - metrics: - - failureCondition: len(result) > 0 - interval: 10 - name: memory-usage - provider: - prometheus: - address: 'http://prometheus-operator-prometheus.prometheus-operator:9090' - query: > - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview",status!~"[4-5].*"}[2m])) - / - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview"}[2m])) - successCondition: len(result) > 0 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/pendingAnalysisRun.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/pendingAnalysisRun.yaml deleted file mode 100644 index 55f4840..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/pendingAnalysisRun.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - name: analysis-template -spec: - metrics: - - name: memory-usage - interval: 10 - successCondition: result > 95 - failureCondition: result < 92 - provider: - prometheus: - address: http://prometheus-operator-prometheus.prometheus-operator:9090 - query: | - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview",status!~"[4-5].*"}[2m])) / sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview"}[2m])) -status: - phase: Pending \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/runningAnalysisRun.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/runningAnalysisRun.yaml deleted file mode 100644 index 36848b7..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/runningAnalysisRun.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - name: canary-demo-analysis-template-6c6bb7cf6f-5bpxj - namespace: default -spec: - analysisSpec: - metrics: - - failureCondition: len(result) == 0 - interval: 10 - name: memory-usage - provider: - prometheus: - address: 'http://prometheus-operator-prometheus.prometheus-operator:9090' - query: > - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview",status!~"[4-5].*"}[2m])) - / - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview"}[2m])) - successCondition: len(result) > 0 -status: - metricResults: - - count: 2 - measurements: - - finishedAt: '2019-10-28T18:22:05Z' - startedAt: '2019-10-28T18:22:05Z' - phase: Successful - value: '[0.9721293199554069]' - - finishedAt: '2019-10-28T18:22:15Z' - startedAt: '2019-10-28T18:22:15Z' - phase: Successful - value: '[0.9721293199554069]' - name: memory-usage - phase: Running - successful: 2 - phase: Running diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/successfulAnalysisRun.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/successfulAnalysisRun.yaml deleted file mode 100644 index 0ebcde1..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/successfulAnalysisRun.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - name: canary-demo-analysis-template-6c6bb7cf6f-zvcmx - namespace: default -spec: - analysisSpec: - metrics: - - failureCondition: len(result) == 0 - name: memory-usage - provider: - prometheus: - address: 'http://prometheus-operator-prometheus.prometheus-operator:9090' - query: > - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview",status!~"[4-5].*"}[2m])) - / - sum(rate(nginx_ingress_controller_requests{ingress="canary-demo-preview"}[2m])) - successCondition: len(result) > 0 -status: - metricResults: - - count: 1 - measurements: - - finishedAt: '2019-10-28T18:20:37Z' - startedAt: '2019-10-28T18:20:37Z' - phase: Successful - value: '[0.965324384787472]' - name: memory-usage - phase: Successful - successful: 1 - phase: Successful diff --git a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/terminatedAnalysisRun.yaml b/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/terminatedAnalysisRun.yaml deleted file mode 100644 index b7e8350..0000000 --- a/pkg/resource_customizations/argoproj.io/AnalysisRun/testdata/terminatedAnalysisRun.yaml +++ /dev/null @@ -1,71 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: AnalysisRun -metadata: - annotations: - rollout.argoproj.io/revision: '2' - creationTimestamp: '2020-11-06T18:39:45Z' - generation: 4 - labels: - rollout-type: Step - rollouts-pod-template-hash: ff68867ff - step-index: '0' - name: rollout-canary-ff68867ff-2-0 - namespace: default - ownerReferences: - - apiVersion: argoproj.io/v1alpha1 - blockOwnerDeletion: true - controller: true - kind: Rollout - name: rollout-canary - uid: 0223237a-0dc1-45f6-881c-fe1873b1771f - resourceVersion: '1381' - selfLink: >- - /apis/argoproj.io/v1alpha1/namespaces/default/analysisruns/rollout-canary-ff68867ff-2-0 - uid: 863da27d-df03-41d2-a528-cc2f1ec25358 -spec: - args: - - name: exit-code - value: '0' - - name: duration - value: 1h - metrics: - - name: sleep-job - provider: - job: - metadata: - creationTimestamp: null - spec: - backoffLimit: 0 - template: - metadata: - creationTimestamp: null - spec: - containers: - - args: - - 'sleep {{args.duration}} && exit {{args.exit-code}}' - command: - - sh - - '-c' - - '-x' - image: 'nginx:1.19-alpine' - name: sleep-job - resources: {} - restartPolicy: Never - terminate: true -status: - message: run terminated - metricResults: - - count: 1 - measurements: - - finishedAt: '2020-11-06T18:42:58Z' - message: metric terminated - metadata: - job-name: 863da27d-df03-41d2-a528-cc2f1ec25358.sleep-job.1 - phase: Successful - startedAt: '2020-11-06T18:39:45Z' - message: metric terminated - name: sleep-job - phase: Successful - successful: 1 - phase: Successful - startedAt: '2020-11-06T18:39:45Z' diff --git a/pkg/resource_customizations/argoproj.io/ApplicationSet/health.lua b/pkg/resource_customizations/argoproj.io/ApplicationSet/health.lua deleted file mode 100644 index 3292ebb..0000000 --- a/pkg/resource_customizations/argoproj.io/ApplicationSet/health.lua +++ /dev/null @@ -1,24 +0,0 @@ -hs = {} - -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in pairs(obj.status.conditions) do - if condition.type == "ErrorOccurred" and condition.status == "True" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "ResourcesUpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - end - end -end - --- Conditions were introduced in ApplicationSet v0.3. To give v0.2 users a good experience, we default to "Healthy". --- Once v0.3 is more generally adopted, we'll default to "Progressing" instead. -hs.status = "Healthy" -hs.message = "" -return hs diff --git a/pkg/resource_customizations/argoproj.io/ApplicationSet/health_test.yaml b/pkg/resource_customizations/argoproj.io/ApplicationSet/health_test.yaml deleted file mode 100644 index 8c8aadc..0000000 --- a/pkg/resource_customizations/argoproj.io/ApplicationSet/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: - - healthStatus: - status: Healthy - message: "ApplicationSet up to date" - inputPath: testdata/healthyApplicationSet.yaml - - healthStatus: - status: Degraded - message: "found less than two generators, Merge requires two or more" - inputPath: testdata/errorApplicationSetWithStatusMessage.yaml - - healthStatus: - status: Healthy - message: "" - inputPath: testdata/noStatusApplicationSet.yaml diff --git a/pkg/resource_customizations/argoproj.io/ApplicationSet/testdata/errorApplicationSetWithStatusMessage.yaml b/pkg/resource_customizations/argoproj.io/ApplicationSet/testdata/errorApplicationSetWithStatusMessage.yaml deleted file mode 100644 index 11df7d2..0000000 --- a/pkg/resource_customizations/argoproj.io/ApplicationSet/testdata/errorApplicationSetWithStatusMessage.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: ApplicationSet -metadata: - name: cluster-git - namespace: argocd -spec: - generators: - - merge: - generators: [] - mergeKeys: - - server - template: - metadata: - name: '{{name}}' - spec: - destination: - namespace: default - server: '{{server}}' - project: default - source: - path: helm-guestbook - repoURL: https://github.com/argoproj/argocd-example-apps/ - targetRevision: HEAD -status: - conditions: - - lastTransitionTime: "2021-11-12T14:28:01Z" - message: found less than two generators, Merge requires two or more - reason: ApplicationGenerationFromParamsError - status: "True" - type: ErrorOccurred - - lastTransitionTime: "2021-11-12T14:28:01Z" - message: found less than two generators, Merge requires two or more - reason: ErrorOccurred - status: "False" - type: ParametersGenerated - - lastTransitionTime: "2021-11-12T14:28:01Z" - message: found less than two generators, Merge requires two or more - reason: ApplicationGenerationFromParamsError - status: "False" - type: ResourcesUpToDate diff --git a/pkg/resource_customizations/argoproj.io/ApplicationSet/testdata/healthyApplicationSet.yaml b/pkg/resource_customizations/argoproj.io/ApplicationSet/testdata/healthyApplicationSet.yaml deleted file mode 100644 index 87f4086..0000000 --- a/pkg/resource_customizations/argoproj.io/ApplicationSet/testdata/healthyApplicationSet.yaml +++ /dev/null @@ -1,60 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: ApplicationSet -metadata: - name: cluster-git - namespace: argocd -spec: - generators: - - merge: - generators: - - clusters: - values: - kafka: "true" - redis: "false" - - clusters: - selector: - matchLabels: - use-kafka: "false" - values: - kafka: "false" - - list: - elements: - - name: minikube - values.redis: "true" - mergeKeys: - - name - template: - metadata: - name: '{{name}}' - spec: - destination: - namespace: default - server: '{{server}}' - project: default - source: - helm: - parameters: - - name: kafka - value: '{{values.kafka}}' - - name: redis - value: '{{values.redis}}' - path: helm-guestbook - repoURL: https://github.com/argoproj/argocd-example-apps/ - targetRevision: HEAD -status: - conditions: - - lastTransitionTime: "2021-11-12T18:40:00Z" - message: Successfully generated parameters for all Applications - reason: ApplicationSetUpToDate - status: "False" - type: ErrorOccurred - - lastTransitionTime: "2021-11-12T18:40:00Z" - message: Successfully generated parameters for all Applications - reason: ParametersGenerated - status: "True" - type: ParametersGenerated - - lastTransitionTime: "2021-11-12T18:40:00Z" - message: ApplicationSet up to date - reason: ApplicationSetUpToDate - status: "True" - type: ResourcesUpToDate diff --git a/pkg/resource_customizations/argoproj.io/ApplicationSet/testdata/noStatusApplicationSet.yaml b/pkg/resource_customizations/argoproj.io/ApplicationSet/testdata/noStatusApplicationSet.yaml deleted file mode 100644 index 45edc63..0000000 --- a/pkg/resource_customizations/argoproj.io/ApplicationSet/testdata/noStatusApplicationSet.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: ApplicationSet -metadata: - name: cluster-git - namespace: argocd -spec: - generators: - - merge: - generators: - - clusters: - values: - kafka: "true" - redis: "false" - - clusters: - selector: - matchLabels: - use-kafka: "false" - values: - kafka: "false" - - list: - elements: - - name: minikube - values.redis: "true" - mergeKeys: - - name - template: - metadata: - name: '{{name}}' - spec: - destination: - namespace: default - server: '{{server}}' - project: default - source: - helm: - parameters: - - name: kafka - value: '{{values.kafka}}' - - name: redis - value: '{{values.redis}}' - path: helm-guestbook - repoURL: https://github.com/argoproj/argocd-example-apps/ - targetRevision: HEAD diff --git a/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/action_test.yaml b/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/action_test.yaml deleted file mode 100644 index 4c7aa77..0000000 --- a/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/action_test.yaml +++ /dev/null @@ -1,4 +0,0 @@ -actionTests: -- action: create-workflow - inputPath: testdata/cronworkflow.yaml - expectedOutputPath: testdata/workflow.yaml diff --git a/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/create-workflow/action.lua b/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/create-workflow/action.lua deleted file mode 100644 index 35f7a66..0000000 --- a/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/create-workflow/action.lua +++ /dev/null @@ -1,82 +0,0 @@ -local os = require("os") - --- This action constructs a Workflow resource from a CronWorkflow resource, to enable creating a CronWorkflow instance --- on demand. --- It returns an array with a single member - a table with the operation to perform (create) and the Workflow resource. --- It mimics the output of "argo submit --from=CronWorkflow/" command, declaratively. - --- This code is written to mimic what the Argo Workflows API server does to create a Workflow from a CronWorkflow. --- https://github.com/argoproj/argo-workflows/blob/873a58de7dd9dad76d5577b8c4294a58b52849b8/workflow/common/convert.go#L12 - --- Deep-copying an object is a ChatGPT generated code. --- Since empty tables are treated as empty arrays, the resulting k8s resource might be invalid (arrays instead of maps). --- So empty tables are not cloned to the target object. -function deepCopy(object) - local lookup_table = {} - local function _copy(obj) - if type(obj) ~= "table" then - return obj - elseif lookup_table[obj] then - return lookup_table[obj] - elseif next(obj) == nil then - return nil - else - local new_table = {} - lookup_table[obj] = new_table - for key, value in pairs(obj) do - new_table[_copy(key)] = _copy(value) - end - return setmetatable(new_table, getmetatable(obj)) - end - end - return _copy(object) -end - -workflow = {} -workflow.apiVersion = "argoproj.io/v1alpha1" -workflow.kind = "Workflow" - -workflow.metadata = {} -workflow.metadata.name = obj.metadata.name .. "-" ..os.date("!%Y%m%d%H%M") -workflow.metadata.namespace = obj.metadata.namespace -workflow.metadata.labels = {} -workflow.metadata.annotations = {} -if (obj.spec.workflowMetadata ~= nil) then - if (obj.spec.workflowMetadata.labels ~= nil) then - workflow.metadata.labels = deepCopy(obj.spec.workflowMetadata.labels) - end - if (obj.spec.workflowMetadata.annotations ~= nil) then - workflow.metadata.annotations = deepCopy(obj.spec.workflowMetadata.annotations) - end -end -workflow.metadata.labels["workflows.argoproj.io/cron-workflow"] = obj.metadata.name -if (obj.metadata.labels["workflows.argoproj.io/controller-instanceid"] ~= nil) then - workflow.metadata.labels["workflows.argoproj.io/controller-instanceid"] = obj.metadata.labels["workflows.argoproj.io/controller-instanceid"] -end -workflow.metadata.annotations["workflows.argoproj.io/scheduled-time"] = os.date("!%Y-%m-%dT%d:%H:%MZ") - -workflow.finalizers = {} --- add all finalizers from obj.spec.workflowMetadata.finalizers -if (obj.spec.workflowMetadata ~= nil and obj.spec.workflowMetadata.finalizers ~= nil) then - for i, finalizer in ipairs(obj.spec.workflowMetadata.finalizers) do - workflow.finalizers[i] = finalizer - end -end - -ownerRef = {} -ownerRef.apiVersion = obj.apiVersion -ownerRef.kind = obj.kind -ownerRef.name = obj.metadata.name -ownerRef.uid = obj.metadata.uid -workflow.metadata.ownerReferences = {} -workflow.metadata.ownerReferences[1] = ownerRef - -workflow.spec = deepCopy(obj.spec.workflowSpec) - -impactedResource = {} -impactedResource.operation = "create" -impactedResource.resource = workflow -result = {} -result[1] = impactedResource - -return result \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/discovery.lua b/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/discovery.lua deleted file mode 100644 index 5e16c6c..0000000 --- a/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/discovery.lua +++ /dev/null @@ -1,3 +0,0 @@ -actions = {} -actions["create-workflow"] = {} -return actions \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/testdata/cronworkflow.yaml b/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/testdata/cronworkflow.yaml deleted file mode 100644 index 2a2c7d1..0000000 --- a/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/testdata/cronworkflow.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: CronWorkflow -metadata: - annotations: - cronworkflows.argoproj.io/last-used-schedule: CRON_TZ=America/Los_Angeles * * * * * - labels: - workflows.argoproj.io/controller-instanceid: test-instance - app.kubernetes.io/instance: test - name: hello-world - namespace: default -spec: - concurrencyPolicy: Replace - failedJobsHistoryLimit: 4 - schedule: '* * * * *' - startingDeadlineSeconds: 0 - successfulJobsHistoryLimit: 4 - suspend: true - timezone: America/Los_Angeles - workflowSpec: - entrypoint: whalesay - templates: - - container: - args: - - "\U0001F553 hello world. Scheduled on: {{workflow.scheduledTime}}" - command: - - cowsay - image: 'docker/whalesay:latest' - name: whalesay - workflowMetadata: - labels: - example: test - annotations: - another-example: another-test - finalizers: [test-finalizer] diff --git a/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/testdata/workflow.yaml b/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/testdata/workflow.yaml deleted file mode 100644 index 9f231db..0000000 --- a/pkg/resource_customizations/argoproj.io/CronWorkflow/actions/testdata/workflow.yaml +++ /dev/null @@ -1,28 +0,0 @@ -- k8sOperation: create - unstructuredObj: - apiVersion: argoproj.io/v1alpha1 - kind: Workflow - metadata: - annotations: - another-example: another-test - labels: - workflows.argoproj.io/cron-workflow: hello-world - workflows.argoproj.io/controller-instanceid: test-instance - example: test - name: hello-world-202306221736 - namespace: default - ownerReferences: - - apiVersion: argoproj.io/v1alpha1 - kind: CronWorkflow - name: hello-world - finalizers: [test-finalizer] - spec: - entrypoint: whalesay - templates: - - container: - args: - - "\U0001F553 hello world. Scheduled on: {{workflow.scheduledTime}}" - command: - - cowsay - image: 'docker/whalesay:latest' - name: whalesay diff --git a/pkg/resource_customizations/argoproj.io/CronWorkflow/health.lua b/pkg/resource_customizations/argoproj.io/CronWorkflow/health.lua deleted file mode 100644 index d1b7367..0000000 --- a/pkg/resource_customizations/argoproj.io/CronWorkflow/health.lua +++ /dev/null @@ -1,26 +0,0 @@ -hs = {} - -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in pairs(obj.status.conditions) do - if condition.type == "SpecError" and condition.status == "True" then - hs.status = "Degraded" - hs.message = condition.message - return hs - elseif condition.type == "SubmissionError" and condition.status == "True" then - hs.status = "Degraded" - hs.message = condition.message - return hs - elseif condition.type == "Completed" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - end - end -end - -hs.status = "Healthy" -hs.message = "CronWorkflow is healthy." - -return hs diff --git a/pkg/resource_customizations/argoproj.io/CronWorkflow/health_test.yaml b/pkg/resource_customizations/argoproj.io/CronWorkflow/health_test.yaml deleted file mode 100644 index d95d066..0000000 --- a/pkg/resource_customizations/argoproj.io/CronWorkflow/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: - - healthStatus: - status: Healthy - message: "we are done" - inputPath: testdata/healthyCronWorkflow.yaml - - healthStatus: - status: Degraded - message: "something is wrong with the spec" - inputPath: testdata/degradedCronWorkflowWithSpecError.yaml - - healthStatus: - status: Degraded - message: "there is a submission error" - inputPath: testdata/degradedCronWorkflowWithSubmissionError.yaml - - healthStatus: - status: Healthy - message: "CronWorkflow is healthy." - inputPath: testdata/noConditionsCronWorkflow.yaml - - healthStatus: - status: Healthy - message: "CronWorkflow is healthy." - inputPath: testdata/withConditionButHealthyCronWorkflow.yaml diff --git a/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/degradedCronWorkflowWithSpecError.yaml b/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/degradedCronWorkflowWithSpecError.yaml deleted file mode 100644 index d3911cd..0000000 --- a/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/degradedCronWorkflowWithSpecError.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: CronWorkflow -metadata: - name: test-cron-wf - namespace: argocd -spec: - entrypoint: sampleEntryPoint -status: - conditions: - - lastTransitionTime: "2021-11-12T14:28:01Z" - message: something is wrong with the spec - status: "True" - type: SpecError diff --git a/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/degradedCronWorkflowWithSubmissionError.yaml b/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/degradedCronWorkflowWithSubmissionError.yaml deleted file mode 100644 index 0dce68e..0000000 --- a/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/degradedCronWorkflowWithSubmissionError.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: CronWorkflow -metadata: - name: test-cron-wf - namespace: argocd -spec: - entrypoint: sampleEntryPoint -status: - conditions: - - lastTransitionTime: "2021-11-12T14:28:01Z" - message: there is a submission error - status: "True" - type: SubmissionError diff --git a/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/healthyCronWorkflow.yaml b/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/healthyCronWorkflow.yaml deleted file mode 100644 index 04a81ec..0000000 --- a/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/healthyCronWorkflow.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: CronWorkflow -metadata: - name: test-cron-wf - namespace: argocd -spec: - entrypoint: sampleEntryPoint -status: - conditions: - - lastTransitionTime: "2021-11-12T14:28:01Z" - message: we are done - status: "True" - type: Completed diff --git a/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/noConditionsCronWorkflow.yaml b/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/noConditionsCronWorkflow.yaml deleted file mode 100644 index 4ec8b25..0000000 --- a/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/noConditionsCronWorkflow.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: CronWorkflow -metadata: - name: test-cron-wf - namespace: argocd -spec: - entrypoint: sampleEntryPoint diff --git a/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/withConditionButHealthyCronWorkflow.yaml b/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/withConditionButHealthyCronWorkflow.yaml deleted file mode 100644 index 99ada4d..0000000 --- a/pkg/resource_customizations/argoproj.io/CronWorkflow/testdata/withConditionButHealthyCronWorkflow.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: CronWorkflow -metadata: - name: test-cron-wf - namespace: argocd -spec: - entrypoint: sampleEntryPoint -status: - conditions: - - lastTransitionTime: "2021-11-12T14:28:01Z" - message: this status may be outdated and we may still be progressing - status: "False" - type: SpecError diff --git a/pkg/resource_customizations/argoproj.io/EventBus/health.lua b/pkg/resource_customizations/argoproj.io/EventBus/health.lua deleted file mode 100644 index 4d2c676..0000000 --- a/pkg/resource_customizations/argoproj.io/EventBus/health.lua +++ /dev/null @@ -1,21 +0,0 @@ -hs={ status = "Progressing", message = "Waiting for initialization" } - -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for _, condition in ipairs(obj.status.conditions) do - if condition.type == "Deployed" and condition.status == "False" then - hs.status = "Degraded" - hs.message = condition.message or condition.reason - return hs - end - if condition.type == "Deployed" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message or condition.reason - return hs - end - end - end -end - - -return hs diff --git a/pkg/resource_customizations/argoproj.io/EventBus/health_test.yaml b/pkg/resource_customizations/argoproj.io/EventBus/health_test.yaml deleted file mode 100644 index 7babe7f..0000000 --- a/pkg/resource_customizations/argoproj.io/EventBus/health_test.yaml +++ /dev/null @@ -1,9 +0,0 @@ -tests: - - healthStatus: - status: Healthy - message: "JetStream is deployed" - inputPath: testdata/healthy.yaml - - healthStatus: - status: Degraded - message: 'failed to get jetstream version, err: unsupported version "iwillfail", supported versions: "2.9.5,latest"' - inputPath: testdata/degraded.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/EventBus/testdata/degraded.yaml b/pkg/resource_customizations/argoproj.io/EventBus/testdata/degraded.yaml deleted file mode 100644 index 4ffd1cf..0000000 --- a/pkg/resource_customizations/argoproj.io/EventBus/testdata/degraded.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: EventBus -metadata: - name: test - namespace: eventbus-test -spec: - jetstream: - replicas: 3 - version: iwillfail -status: - conditions: - - lastTransitionTime: null - status: 'True' - type: Configured - - lastTransitionTime: null - message: >- - failed to get jetstream version, err: unsupported version "iwillfail", - supported versions: "2.9.5,latest" - reason: JetStreamStatefulSetFailed - status: 'False' - type: Deployed \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/EventBus/testdata/healthy.yaml b/pkg/resource_customizations/argoproj.io/EventBus/testdata/healthy.yaml deleted file mode 100644 index 8db1455..0000000 --- a/pkg/resource_customizations/argoproj.io/EventBus/testdata/healthy.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: EventBus -metadata: - name: test - namespace: eventbus-test -spec: - jetstream: - replicas: 3 - version: latest -status: - conditions: - - lastTransitionTime: '2022-12-30T11:44:15Z' - status: 'True' - type: Configured - - lastTransitionTime: '2022-12-30T11:44:15Z' - message: JetStream is deployed - reason: Succeeded - status: 'True' - type: Deployed \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Experiment/health.lua b/pkg/resource_customizations/argoproj.io/Experiment/health.lua deleted file mode 100644 index 1587f68..0000000 --- a/pkg/resource_customizations/argoproj.io/Experiment/health.lua +++ /dev/null @@ -1,28 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.phase == "Pending" then - hs.status = "Progressing" - hs.message = "Experiment is pending" - end - if obj.status.phase == "Running" then - hs.status = "Progressing" - hs.message = "Experiment is running" - end - if obj.status.phase == "Successful" then - hs.status = "Healthy" - hs.message = "Experiment is successful" - end - if obj.status.phase == "Failed" then - hs.status = "Degraded" - hs.message = "Experiment has failed" - end - if obj.status.phase == "Error" then - hs.status = "Degraded" - hs.message = "Experiment had an error" - end - return hs -end - -hs.status = "Progressing" -hs.message = "Waiting for experiment to finish: status has not been reconciled." -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Experiment/health_test.yaml b/pkg/resource_customizations/argoproj.io/Experiment/health_test.yaml deleted file mode 100644 index 1d14ec9..0000000 --- a/pkg/resource_customizations/argoproj.io/Experiment/health_test.yaml +++ /dev/null @@ -1,25 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Experiment is pending" - inputPath: testdata/pendingExperiment.yaml -- healthStatus: - status: Progressing - message: "Waiting for experiment to finish: status has not been reconciled." - inputPath: testdata/noStatusExperiment.yaml -- healthStatus: - status: Progressing - message: "Experiment is running" - inputPath: testdata/runningExperiment.yaml -- healthStatus: - status: Healthy - message: "Experiment is successful" - inputPath: testdata/successfulExperiment.yaml -- healthStatus: - status: Degraded - message: "Experiment has failed" - inputPath: testdata/failedExperiment.yaml -- healthStatus: - status: Degraded - message: "Experiment had an error" - inputPath: testdata/errorExperiment.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Experiment/testdata/errorExperiment.yaml b/pkg/resource_customizations/argoproj.io/Experiment/testdata/errorExperiment.yaml deleted file mode 100644 index 3b1e8e9..0000000 --- a/pkg/resource_customizations/argoproj.io/Experiment/testdata/errorExperiment.yaml +++ /dev/null @@ -1,49 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Experiment -metadata: - name: experiment-error-template-missing - namespace: jesse-test -spec: - analyses: - - name: does-not-exist - templateName: does-not-exist - templates: - - name: baseline - selector: - matchLabels: - app: rollouts-demo - template: - metadata: - labels: - app: rollouts-demo - spec: - containers: - - image: argoproj/rollouts-demo:blue - name: rollouts-demo -status: - analysisRuns: - - analysisRun: "" - message: 'AnalysisTemplate verification failed for analysis ''does-not-exist'': - analysistemplate.argoproj.io "does-not-exist" not found' - name: does-not-exist - phase: Error - availableAt: "2019-10-27T23:13:10Z" - conditions: - - lastTransitionTime: "2019-10-27T23:13:07Z" - lastUpdateTime: "2019-10-28T05:59:33Z" - message: Experiment "experiment-error-template-missing" is running. - reason: NewReplicaSetAvailable - phase: "True" - type: Progressing - message: 'AnalysisTemplate verification failed for analysis ''does-not-exist'': - analysistemplate.argoproj.io "does-not-exist" not found' - running: true - phase: Error - templateStatuses: - - availableReplicas: 0 - lastTransitionTime: "2019-10-28T05:59:33Z" - name: baseline - readyReplicas: 0 - replicas: 0 - phase: Successful - updatedReplicas: 0 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Experiment/testdata/failedExperiment.yaml b/pkg/resource_customizations/argoproj.io/Experiment/testdata/failedExperiment.yaml deleted file mode 100644 index ddc1977..0000000 --- a/pkg/resource_customizations/argoproj.io/Experiment/testdata/failedExperiment.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Experiment -metadata: - name: example-experiment - namespace: default -spec: - analyses: - - name: test - templateName: analysis-template - duration: 60 - templates: - - name: baseline - selector: - matchLabels: - app: rollouts-demo - color: blue - template: - metadata: - labels: - app: rollouts-demo - color: blue - spec: - containers: - - image: 'argoproj/rollouts-demo:blue' - name: guestbook -status: - analysisRuns: - - analysisRun: example-experiment-test-57vl8 - name: test - phase: Failed - availableAt: '2019-10-28T20:58:00Z' - conditions: - - lastTransitionTime: '2019-10-28T20:57:58Z' - lastUpdateTime: '2019-10-28T20:58:01Z' - message: Experiment "example-experiment" is running. - reason: NewReplicaSetAvailable - phase: 'True' - type: Progressing - phase: Failed - templateStatuses: - - availableReplicas: 0 - lastTransitionTime: '2019-10-28T20:58:01Z' - name: baseline - readyReplicas: 0 - replicas: 0 - phase: Successful - updatedReplicas: 0 - - availableReplicas: 0 - lastTransitionTime: '2019-10-28T20:58:01Z' - name: canary - readyReplicas: 0 - replicas: 0 - phase: Successful - updatedReplicas: 0 diff --git a/pkg/resource_customizations/argoproj.io/Experiment/testdata/noStatusExperiment.yaml b/pkg/resource_customizations/argoproj.io/Experiment/testdata/noStatusExperiment.yaml deleted file mode 100644 index 7508f1f..0000000 --- a/pkg/resource_customizations/argoproj.io/Experiment/testdata/noStatusExperiment.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Experiment -metadata: - annotations: - kubectl.kubernetes.io/last-applied-configuration: > - {"apiVersion":"argoproj.io/v1alpha1","kind":"Experiment","metadata":{"annotations":{},"labels":{"app.kubernetes.io/instance":"rollouts-canary"},"name":"example-experiment","namespace":"argo-rollouts"},"spec":{"duration":60,"templates":[{"name":"baseline","selector":{"matchLabels":{"app":"rollouts-demo","color":"blue"}},"template":{"metadata":{"labels":{"app":"rollouts-demo","color":"blue"}},"spec":{"containers":[{"image":"argoproj/rollouts-demo:blue","name":"guestbook"}]}}},{"name":"canary","selector":{"matchLabels":{"app":"rollouts-demo","color":"yellow"}},"template":{"metadata":{"labels":{"app":"rollouts-demo","color":"yellow"}},"spec":{"containers":[{"image":"argoproj/rollouts-demo:yellow","name":"guestbook"}]}}}]}} - creationTimestamp: '2019-10-28T20:13:28Z' - generation: 1 - labels: - app.kubernetes.io/instance: rollouts-canary - name: example-experiment - namespace: argo-rollouts - resourceVersion: '28562006' - selfLink: >- - /apis/argoproj.io/v1alpha1/namespaces/argo-rollouts/experiments/example-experiment - uid: 67792f8a-f9bf-11e9-a15b-42010aa80033 -spec: - duration: 60 - templates: - - name: baseline - selector: - matchLabels: - app: rollouts-demo - color: blue - template: - metadata: - labels: - app: rollouts-demo - color: blue - spec: - containers: - - image: 'argoproj/rollouts-demo:blue' - name: guestbook diff --git a/pkg/resource_customizations/argoproj.io/Experiment/testdata/pendingExperiment.yaml b/pkg/resource_customizations/argoproj.io/Experiment/testdata/pendingExperiment.yaml deleted file mode 100644 index 9b74c70..0000000 --- a/pkg/resource_customizations/argoproj.io/Experiment/testdata/pendingExperiment.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Experiment -metadata: - name: experiment-with-analysis-5hm74 - namespace: default -spec: - analyses: - - name: job - templateName: job - duration: 3600 - templates: - - name: baseline - selector: - matchLabels: - app: rollouts-demo - template: - metadata: - labels: - app: rollouts-demo - spec: - containers: - - image: argoproj/rollouts-demo:blue - name: rollouts-demo -status: - analysisRuns: - - analysisRun: experiment-with-analysis-5hm74-job-h4bgb - name: job - phase: Running - availableAt: "2019-10-21T03:40:28Z" - conditions: - - lastTransitionTime: "2019-10-21T03:40:28Z" - lastUpdateTime: "2019-10-21T03:40:28Z" - message: Experiment "experiment-with-analysis-5hm74" has successfully ran and - completed. - reason: ExperimentCompleted - phase: "False" - type: Progressing - running: false - phase: Pending - templateStatuses: - - availableReplicas: 0 - lastTransitionTime: "2019-10-28T20:22:01Z" - name: baseline - readyReplicas: 0 - replicas: 0 - phase: Progressing - updatedReplicas: 0 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Experiment/testdata/runningExperiment.yaml b/pkg/resource_customizations/argoproj.io/Experiment/testdata/runningExperiment.yaml deleted file mode 100644 index 4cbe8ab..0000000 --- a/pkg/resource_customizations/argoproj.io/Experiment/testdata/runningExperiment.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Experiment -metadata: - name: example-experiment - namespace: argo-rollouts -spec: - duration: 60 - templates: - - name: baseline - selector: - matchLabels: - app: rollouts-demo - color: blue - template: - metadata: - labels: - app: rollouts-demo - color: blue - spec: - containers: - - image: 'argoproj/rollouts-demo:blue' - name: guestbook -status: - availableAt: '2019-10-28T20:15:02Z' - conditions: - - lastTransitionTime: '2019-10-28T20:14:59Z' - lastUpdateTime: '2019-10-28T20:15:02Z' - message: Experiment "example-experiment" is running. - reason: NewReplicaSetAvailable - phase: 'True' - type: Progressing - phase: Running - templateStatuses: - - availableReplicas: 1 - lastTransitionTime: '2019-10-28T20:15:02Z' - name: baseline - readyReplicas: 1 - replicas: 1 - phase: Running - updatedReplicas: 1 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Experiment/testdata/successfulExperiment.yaml b/pkg/resource_customizations/argoproj.io/Experiment/testdata/successfulExperiment.yaml deleted file mode 100644 index 5ccc177..0000000 --- a/pkg/resource_customizations/argoproj.io/Experiment/testdata/successfulExperiment.yaml +++ /dev/null @@ -1,61 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Experiment -metadata: - name: example-experiment - namespace: argo-rollouts -spec: - duration: 60 - templates: - - name: baseline - selector: - matchLabels: - app: rollouts-demo - color: blue - template: - metadata: - labels: - app: rollouts-demo - color: blue - spec: - containers: - - image: 'argoproj/rollouts-demo:blue' - name: guestbook - - name: canary - selector: - matchLabels: - app: rollouts-demo - color: yellow - template: - metadata: - labels: - app: rollouts-demo - color: yellow - spec: - containers: - - image: 'argoproj/rollouts-demo:yellow' - name: guestbook -status: - availableAt: '2019-10-28T20:15:02Z' - conditions: - - lastTransitionTime: '2019-10-28T20:20:54Z' - lastUpdateTime: '2019-10-28T20:20:54Z' - message: Experiment "example-experiment" has successfully ran and completed. - reason: ExperimentCompleted - phase: 'False' - type: Progressing - phase: Successful - templateStatuses: - - availableReplicas: 1 - lastTransitionTime: '2019-10-28T20:15:02Z' - name: baseline - readyReplicas: 1 - replicas: 1 - phase: Successful - updatedReplicas: 1 - - availableReplicas: 1 - lastTransitionTime: '2019-10-28T20:15:01Z' - name: canary - readyReplicas: 1 - replicas: 1 - phase: Successful - updatedReplicas: 1 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/abort/action.lua b/pkg/resource_customizations/argoproj.io/Rollout/actions/abort/action.lua deleted file mode 100644 index d0177ea..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/abort/action.lua +++ /dev/null @@ -1,2 +0,0 @@ -obj.status.abort = true -return obj diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/action_test.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/action_test.yaml deleted file mode 100644 index f3c3057..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/action_test.yaml +++ /dev/null @@ -1,131 +0,0 @@ -discoveryTests: -- inputPath: testdata/pre_v0.6_paused_rollout.yaml - result: - - name: resume - disabled: false - - name: restart - disabled: false - - name: abort - disabled: false - - name: retry - disabled: true - - name: promote-full - disabled: true -- inputPath: testdata/pre_v0.6_not_paused_rollout.yaml - result: - - name: restart - disabled: false - - name: resume - disabled: true - - name: abort - disabled: false - - name: retry - disabled: true - - name: promote-full - disabled: true -- inputPath: testdata/pre_v0.6_nil_paused_rollout.yaml - result: - - name: restart - disabled: false - - name: resume - disabled: true - - name: abort - disabled: false - - name: retry - disabled: true - - name: promote-full - disabled: true -- inputPath: testdata/has_pause_condition_rollout.yaml - result: - - name: restart - disabled: false - - name: resume - disabled: false - - name: abort - disabled: false - - name: retry - disabled: true - - name: promote-full - disabled: false -- inputPath: testdata/no_pause_condition_rollout.yaml - result: - - name: restart - disabled: false - - name: resume - disabled: true - - name: abort - disabled: false - - name: retry - disabled: true - - name: promote-full - disabled: false -- inputPath: testdata/healthy_rollout.yaml - result: - - name: restart - disabled: false - - name: resume - disabled: true - - name: abort - disabled: true - - name: retry - disabled: true - - name: promote-full - disabled: true -- inputPath: testdata/v0.9_aborted_rollout.yaml - result: - - name: restart - disabled: false - - name: resume - disabled: true - - name: abort - disabled: true - - name: retry - disabled: false - - name: promote-full - disabled: false -- inputPath: testdata/v0.9_aborted_bg_rollout.yaml - result: - - name: restart - disabled: false - - name: resume - disabled: true - - name: abort - disabled: true - - name: retry - disabled: false - - name: promote-full - disabled: true -- inputPath: testdata/aborted_bg_rollout.yaml - result: - - name: restart - disabled: false - - name: resume - disabled: true - - name: abort - disabled: true - - name: retry - disabled: false - - name: promote-full - disabled: false -actionTests: -- action: resume - inputPath: testdata/pre_v0.6_paused_rollout.yaml - expectedOutputPath: testdata/pre_v0.6_not_paused_rollout.yaml -- action: resume - inputPath: testdata/has_pause_condition_rollout.yaml - expectedOutputPath: testdata/no_pause_condition_rollout.yaml -- action: abort - inputPath: testdata/has_pause_condition_rollout.yaml - expectedOutputPath: testdata/has_pause_condition_rollout_aborted.yaml -- action: restart - inputPath: testdata/rollout_not_restarted.yaml - expectedOutputPath: testdata/rollout_restarted.yaml -- action: retry - inputPath: testdata/v0.9_aborted_rollout.yaml - expectedOutputPath: testdata/retried_rollout.yaml -- action: promote-full - inputPath: testdata/v0.9_aborted_rollout.yaml - expectedOutputPath: testdata/v0.9_promote-full_rollout.yaml -- action: promote-full - inputPath: testdata/aborted_rollout.yaml - expectedOutputPath: testdata/promote-full_rollout.yaml diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/discovery.lua b/pkg/resource_customizations/argoproj.io/Rollout/actions/discovery.lua deleted file mode 100644 index 93d09d9..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/discovery.lua +++ /dev/null @@ -1,28 +0,0 @@ -actions = {} -actions["restart"] = {["disabled"] = false} - -local paused = false -if obj.status ~= nil and obj.status.pauseConditions ~= nil then - paused = table.getn(obj.status.pauseConditions) > 0 -elseif obj.spec.paused ~= nil then - paused = obj.spec.paused -end -actions["resume"] = {["disabled"] = not(paused)} - -fullyPromoted = obj.status.currentPodHash == obj.status.stableRS -actions["abort"] = {["disabled"] = fullyPromoted or obj.status.abort} -actions["retry"] = {["disabled"] = fullyPromoted or not(obj.status.abort)} - -actions["promote-full"] = {["disabled"] = true} -if obj.status ~= nil and not(fullyPromoted) then - generation = tonumber(obj.status.observedGeneration) - if generation == nil or generation > obj.metadata.generation then - -- rollouts v0.9 - full promotion only supported for canary - actions["promote-full"] = {["disabled"] = obj.spec.strategy.blueGreen ~= nil} - else - -- rollouts v0.10+ - actions["promote-full"]["disabled"] = false - end -end - -return actions diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/promote-full/action.lua b/pkg/resource_customizations/argoproj.io/Rollout/actions/promote-full/action.lua deleted file mode 100644 index 431c3f9..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/promote-full/action.lua +++ /dev/null @@ -1,14 +0,0 @@ -if obj.status ~= nil then - generation = tonumber(obj.status.observedGeneration) - if generation == nil or generation > obj.metadata.generation then - -- rollouts v0.9 and below - obj.status.abort = nil - if obj.spec.strategy.canary.steps ~= nil then - obj.status.currentStepIndex = table.getn(obj.spec.strategy.canary.steps) - end - else - -- rollouts v0.10+ - obj.status.promoteFull = true - end -end -return obj diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/restart/action.lua b/pkg/resource_customizations/argoproj.io/Rollout/actions/restart/action.lua deleted file mode 100644 index 7f9a9ec..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/restart/action.lua +++ /dev/null @@ -1,3 +0,0 @@ -local os = require("os") -obj.spec.restartAt = os.date("!%Y-%m-%dT%XZ") -return obj diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/resume/action.lua b/pkg/resource_customizations/argoproj.io/Rollout/actions/resume/action.lua deleted file mode 100644 index 9aa2aa2..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/resume/action.lua +++ /dev/null @@ -1,9 +0,0 @@ -if obj.status.pauseConditions ~= nil and table.getn(obj.status.pauseConditions) > 0 then - obj.status.pauseConditions = nil -end - -if obj.spec.paused ~= nil and obj.spec.paused then - obj.spec.paused = false -end - -return obj \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/retry/action.lua b/pkg/resource_customizations/argoproj.io/Rollout/actions/retry/action.lua deleted file mode 100644 index 844e596..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/retry/action.lua +++ /dev/null @@ -1,2 +0,0 @@ -obj.status.abort = nil -return obj diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/aborted_bg_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/aborted_bg_rollout.yaml deleted file mode 100644 index 747fe86..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/aborted_bg_rollout.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: "2" - creationTimestamp: "2020-11-13T08:37:51Z" - generation: 3 - name: bluegreen - namespace: argocd-e2e - resourceVersion: "202207" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/argocd-e2e/rollouts/bluegreen - uid: 39d30e1e-5e0e-460a-a217-fa21215f1d1f -spec: - replicas: 3 - selector: - matchLabels: - app: bluegreen - strategy: - blueGreen: - activeService: bluegreen - autoPromotionEnabled: false - scaleDownDelaySeconds: 10 - template: - metadata: - creationTimestamp: null - labels: - app: bluegreen - spec: - containers: - - image: nginx:1.18-alpine - name: bluegreen - resources: - requests: - cpu: 1m - memory: 16Mi -status: - HPAReplicas: 3 - abort: true - abortedAt: "2020-11-13T08:38:19Z" - availableReplicas: 3 - blueGreen: - activeSelector: 54bd6f9c67 - canary: {} - conditions: - - lastTransitionTime: "2020-11-13T08:37:53Z" - lastUpdateTime: "2020-11-13T08:37:53Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - - lastTransitionTime: "2020-11-13T08:38:19Z" - lastUpdateTime: "2020-11-13T08:38:19Z" - message: Rollout is aborted - reason: RolloutAborted - status: "False" - type: Progressing - currentPodHash: 5b6f6b55c4 - observedGeneration: "3" - readyReplicas: 3 - replicas: 6 - selector: app=bluegreen,rollouts-pod-template-hash=54bd6f9c67 - stableRS: 54bd6f9c67 - updatedReplicas: 3 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/aborted_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/aborted_rollout.yaml deleted file mode 100644 index 03e76d4..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/aborted_rollout.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: "2" - creationTimestamp: "2020-11-13T08:25:35Z" - generation: 3 - name: basic - namespace: argocd-e2e - resourceVersion: "201579" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/argocd-e2e/rollouts/basic - uid: 201161e2-c761-4e52-91a1-d4872be9ead4 -spec: - replicas: 1 - selector: - matchLabels: - app: basic - strategy: - canary: - steps: - - setWeight: 50 - - pause: {} - template: - metadata: - creationTimestamp: null - labels: - app: basic - spec: - containers: - - image: nginx:1.18-alpine - name: basic - resources: - requests: - cpu: 1m - memory: 16Mi -status: - HPAReplicas: 1 - abort: true - abortedAt: "2020-11-13T08:25:53Z" - availableReplicas: 1 - blueGreen: {} - canary: {} - conditions: - - lastTransitionTime: "2020-11-13T08:25:36Z" - lastUpdateTime: "2020-11-13T08:25:36Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - - lastTransitionTime: "2020-11-13T08:25:53Z" - lastUpdateTime: "2020-11-13T08:25:53Z" - message: Rollout is aborted - reason: RolloutAborted - status: "False" - type: Progressing - currentPodHash: 75fdb4ccf6 - currentStepHash: 757f5f97b - currentStepIndex: 0 - observedGeneration: "3" - readyReplicas: 1 - replicas: 1 - selector: app=basic - stableRS: 754cb84d5 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/has_pause_condition_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/has_pause_condition_rollout.yaml deleted file mode 100644 index 6d64aeb..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/has_pause_condition_rollout.yaml +++ /dev/null @@ -1,61 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - name: canary-demo - namespace: default -spec: - replicas: 5 - revisionHistoryLimit: 3 - selector: - matchLabels: - app: canary-demo - strategy: - canary: - analysis: - name: analysis - templateName: analysis-template - canaryService: canary-demo-preview - steps: - - setWeight: 40 - - pause: {} - - setWeight: 60 - - pause: {} - - setWeight: 80 - - pause: - duration: 10 - template: - metadata: - labels: - app: canary-demo - spec: - containers: - - image: argoproj/rollouts-demo:yellow - imagePullPolicy: Always - name: canary-demo - ports: - - containerPort: 8080 - name: http - protocol: TCP - resources: - requests: - cpu: 5m - memory: 32Mi -status: - HPAReplicas: 5 - availableReplicas: 5 - blueGreen: {} - canary: - currentBackgroundAnalysisRun: canary-demo-6758949f55-6-analysis - stableRS: 645d5dbc4c - controllerPause: true - currentPodHash: 6758949f55 - currentStepHash: 59f8666948 - currentStepIndex: 1 - observedGeneration: 58b949649c - pauseConditions: - - reason: CanaryPauseStep - startTime: "2019-11-05T18:10:29Z" - readyReplicas: 5 - replicas: 5 - selector: app=canary-demo - updatedReplicas: 2 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/has_pause_condition_rollout_aborted.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/has_pause_condition_rollout_aborted.yaml deleted file mode 100644 index 5c118c2..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/has_pause_condition_rollout_aborted.yaml +++ /dev/null @@ -1,62 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - name: canary-demo - namespace: default -spec: - replicas: 5 - revisionHistoryLimit: 3 - selector: - matchLabels: - app: canary-demo - strategy: - canary: - analysis: - name: analysis - templateName: analysis-template - canaryService: canary-demo-preview - steps: - - setWeight: 40 - - pause: {} - - setWeight: 60 - - pause: {} - - setWeight: 80 - - pause: - duration: 10 - template: - metadata: - labels: - app: canary-demo - spec: - containers: - - image: argoproj/rollouts-demo:yellow - imagePullPolicy: Always - name: canary-demo - ports: - - containerPort: 8080 - name: http - protocol: TCP - resources: - requests: - cpu: 5m - memory: 32Mi -status: - abort: true - HPAReplicas: 5 - availableReplicas: 5 - blueGreen: {} - canary: - currentBackgroundAnalysisRun: canary-demo-6758949f55-6-analysis - stableRS: 645d5dbc4c - controllerPause: true - currentPodHash: 6758949f55 - currentStepHash: 59f8666948 - currentStepIndex: 1 - observedGeneration: 58b949649c - pauseConditions: - - reason: CanaryPauseStep - startTime: "2019-11-05T18:10:29Z" - readyReplicas: 5 - replicas: 5 - selector: app=canary-demo - updatedReplicas: 2 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/healthy_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/healthy_rollout.yaml deleted file mode 100644 index 8a20b4b..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/healthy_rollout.yaml +++ /dev/null @@ -1,64 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: '2' - creationTimestamp: '2020-11-06T09:09:54Z' - generation: 12 - labels: - app.kubernetes.io/instance: rollouts-demo - name: rollout-bluegreen - namespace: default - resourceVersion: '2232' - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/rollout-bluegreen - uid: a5047899-8288-43c2-95d7-a8e0a8b45ed6 -spec: - replicas: 2 - revisionHistoryLimit: 2 - selector: - matchLabels: - app: rollout-bluegreen - strategy: - blueGreen: - activeService: rollout-bluegreen-active - previewService: rollout-bluegreen-preview - template: - metadata: - creationTimestamp: null - labels: - app: rollout-bluegreen - spec: - containers: - - image: 'nginx:1.19-alpine' - imagePullPolicy: Always - name: rollouts-demo - ports: - - containerPort: 8080 - resources: {} -status: - HPAReplicas: 2 - availableReplicas: 2 - blueGreen: - activeSelector: '8576595585' - previewSelector: '8576595585' - canary: {} - conditions: - - lastTransitionTime: '2020-11-06T09:10:35Z' - lastUpdateTime: '2020-11-06T09:10:35Z' - message: Rollout has minimum availability - reason: AvailableReason - status: 'True' - type: Available - - lastTransitionTime: '2020-11-06T09:09:54Z' - lastUpdateTime: '2020-11-06T09:13:09Z' - message: ReplicaSet "rollout-bluegreen-8576595585" has successfully progressed. - reason: NewReplicaSetAvailable - status: 'True' - type: Progressing - currentPodHash: '8576595585' - observedGeneration: 7b965d5d74 - readyReplicas: 2 - replicas: 2 - selector: 'app=rollout-bluegreen,rollouts-pod-template-hash=8576595585' - stableRS: '8576595585' - updatedReplicas: 2 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/no_pause_condition_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/no_pause_condition_rollout.yaml deleted file mode 100644 index fb1ba19..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/no_pause_condition_rollout.yaml +++ /dev/null @@ -1,58 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - name: canary-demo - namespace: default -spec: - replicas: 5 - revisionHistoryLimit: 3 - selector: - matchLabels: - app: canary-demo - strategy: - canary: - analysis: - name: analysis - templateName: analysis-template - canaryService: canary-demo-preview - steps: - - setWeight: 40 - - pause: {} - - setWeight: 60 - - pause: {} - - setWeight: 80 - - pause: - duration: 10 - template: - metadata: - labels: - app: canary-demo - spec: - containers: - - image: argoproj/rollouts-demo:yellow - imagePullPolicy: Always - name: canary-demo - ports: - - containerPort: 8080 - name: http - protocol: TCP - resources: - requests: - cpu: 5m - memory: 32Mi -status: - HPAReplicas: 5 - availableReplicas: 5 - blueGreen: {} - canary: - currentBackgroundAnalysisRun: canary-demo-6758949f55-6-analysis - stableRS: 645d5dbc4c - controllerPause: true - currentPodHash: 6758949f55 - currentStepHash: 59f8666948 - currentStepIndex: 1 - observedGeneration: 58b949649c - readyReplicas: 5 - replicas: 5 - selector: app=canary-demo - updatedReplicas: 2 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/one_replica_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/one_replica_rollout.yaml deleted file mode 100644 index 949e4ea..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/one_replica_rollout.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - clusterName: "" - creationTimestamp: 2019-03-22T21:04:31Z - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-bluegreen - name: guestbook-bluegreen - namespace: default - resourceVersion: "888906" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/guestbook-bluegreen - uid: 16a1edf0-4ce6-11e9-994f-025000000001 -spec: - minReadySeconds: 30 - replicas: 1 - revisionHistoryLimit: 2 - selector: - matchLabels: - app: guestbook-bluegreen - strategy: - blueGreen: - activeService: guestbook-bluegreen-active - previewService: guestbook-bluegreen-preview - template: - metadata: - labels: - app: guestbook-bluegreen - spec: - containers: - - image: gcr.io/heptio-images/ks-guestbook-demo:0.2 - name: guestbook-bluegreen - ports: - - containerPort: 80 -status: - availableReplicas: 1 - blueGreen: - activeSelector: 6c767bd46c - conditions: - - lastTransitionTime: 2019-04-01T22:31:44Z - lastUpdateTime: 2019-04-01T22:31:44Z - message: Rollout is serving traffic from the active service. - reason: Available - status: "True" - type: Available - currentPodHash: 6c767bd46c - observedGeneration: 869957df4b - pauseStartTime: 2019-03-26T05:47:32Z - readyReplicas: 1 - replicas: 1 - updatedReplicas: 1 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/pre_v0.6_nil_paused_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/pre_v0.6_nil_paused_rollout.yaml deleted file mode 100644 index 949e4ea..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/pre_v0.6_nil_paused_rollout.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - clusterName: "" - creationTimestamp: 2019-03-22T21:04:31Z - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-bluegreen - name: guestbook-bluegreen - namespace: default - resourceVersion: "888906" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/guestbook-bluegreen - uid: 16a1edf0-4ce6-11e9-994f-025000000001 -spec: - minReadySeconds: 30 - replicas: 1 - revisionHistoryLimit: 2 - selector: - matchLabels: - app: guestbook-bluegreen - strategy: - blueGreen: - activeService: guestbook-bluegreen-active - previewService: guestbook-bluegreen-preview - template: - metadata: - labels: - app: guestbook-bluegreen - spec: - containers: - - image: gcr.io/heptio-images/ks-guestbook-demo:0.2 - name: guestbook-bluegreen - ports: - - containerPort: 80 -status: - availableReplicas: 1 - blueGreen: - activeSelector: 6c767bd46c - conditions: - - lastTransitionTime: 2019-04-01T22:31:44Z - lastUpdateTime: 2019-04-01T22:31:44Z - message: Rollout is serving traffic from the active service. - reason: Available - status: "True" - type: Available - currentPodHash: 6c767bd46c - observedGeneration: 869957df4b - pauseStartTime: 2019-03-26T05:47:32Z - readyReplicas: 1 - replicas: 1 - updatedReplicas: 1 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/pre_v0.6_not_paused_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/pre_v0.6_not_paused_rollout.yaml deleted file mode 100644 index 8e81cff..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/pre_v0.6_not_paused_rollout.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - clusterName: "" - creationTimestamp: 2019-03-22T21:04:31Z - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-bluegreen - name: guestbook-bluegreen - namespace: default - resourceVersion: "888906" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/guestbook-bluegreen - uid: 16a1edf0-4ce6-11e9-994f-025000000001 -spec: - minReadySeconds: 30 - replicas: 1 - revisionHistoryLimit: 2 - selector: - matchLabels: - app: guestbook-bluegreen - strategy: - blueGreen: - activeService: guestbook-bluegreen-active - previewService: guestbook-bluegreen-preview - template: - metadata: - labels: - app: guestbook-bluegreen - spec: - containers: - - image: gcr.io/heptio-images/ks-guestbook-demo:0.2 - name: guestbook-bluegreen - ports: - - containerPort: 80 - paused: false -status: - availableReplicas: 1 - blueGreen: - activeSelector: 6c767bd46c - conditions: - - lastTransitionTime: 2019-04-01T22:31:44Z - lastUpdateTime: 2019-04-01T22:31:44Z - message: Rollout is serving traffic from the active service. - reason: Available - status: "True" - type: Available - currentPodHash: 6c767bd46c - observedGeneration: 869957df4b - pauseStartTime: 2019-03-26T05:47:32Z - readyReplicas: 1 - replicas: 1 - updatedReplicas: 1 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/pre_v0.6_paused_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/pre_v0.6_paused_rollout.yaml deleted file mode 100644 index 0c7062d..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/pre_v0.6_paused_rollout.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - clusterName: "" - creationTimestamp: 2019-03-22T21:04:31Z - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-bluegreen - name: guestbook-bluegreen - namespace: default - resourceVersion: "888906" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/guestbook-bluegreen - uid: 16a1edf0-4ce6-11e9-994f-025000000001 -spec: - minReadySeconds: 30 - paused: true - replicas: 1 - revisionHistoryLimit: 2 - selector: - matchLabels: - app: guestbook-bluegreen - strategy: - blueGreen: - activeService: guestbook-bluegreen-active - previewService: guestbook-bluegreen-preview - template: - metadata: - labels: - app: guestbook-bluegreen - spec: - containers: - - image: gcr.io/heptio-images/ks-guestbook-demo:0.2 - name: guestbook-bluegreen - ports: - - containerPort: 80 -status: - availableReplicas: 1 - blueGreen: - activeSelector: 6c767bd46c - conditions: - - lastTransitionTime: 2019-04-01T22:31:44Z - lastUpdateTime: 2019-04-01T22:31:44Z - message: Rollout is serving traffic from the active service. - reason: Available - status: "True" - type: Available - currentPodHash: 6c767bd46c - observedGeneration: 869957df4b - pauseStartTime: 2019-03-26T05:47:32Z - readyReplicas: 1 - replicas: 1 - updatedReplicas: 1 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/promote-full_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/promote-full_rollout.yaml deleted file mode 100644 index b16dbc3..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/promote-full_rollout.yaml +++ /dev/null @@ -1,64 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: "2" - creationTimestamp: "2020-11-13T08:25:35Z" - generation: 3 - name: basic - namespace: argocd-e2e - resourceVersion: "201579" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/argocd-e2e/rollouts/basic - uid: 201161e2-c761-4e52-91a1-d4872be9ead4 -spec: - replicas: 1 - selector: - matchLabels: - app: basic - strategy: - canary: - steps: - - setWeight: 50 - - pause: {} - template: - metadata: - creationTimestamp: null - labels: - app: basic - spec: - containers: - - image: nginx:1.18-alpine - name: basic - resources: - requests: - cpu: 1m - memory: 16Mi -status: - promoteFull: true - HPAReplicas: 1 - abort: true - abortedAt: "2020-11-13T08:25:53Z" - availableReplicas: 1 - blueGreen: {} - canary: {} - conditions: - - lastTransitionTime: "2020-11-13T08:25:36Z" - lastUpdateTime: "2020-11-13T08:25:36Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - - lastTransitionTime: "2020-11-13T08:25:53Z" - lastUpdateTime: "2020-11-13T08:25:53Z" - message: Rollout is aborted - reason: RolloutAborted - status: "False" - type: Progressing - currentPodHash: 75fdb4ccf6 - currentStepHash: 757f5f97b - currentStepIndex: 0 - observedGeneration: "3" - readyReplicas: 1 - replicas: 1 - selector: app=basic - stableRS: 754cb84d5 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/retried_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/retried_rollout.yaml deleted file mode 100644 index 97a0013..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/retried_rollout.yaml +++ /dev/null @@ -1,81 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: '4' - creationTimestamp: '2020-11-06T09:09:54Z' - generation: 76 - labels: - app.kubernetes.io/instance: rollouts-demo - name: rollout-canary - namespace: default - resourceVersion: '4977' - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/rollout-canary - uid: a5047899-8288-43c2-95d7-a8e0a8b45ed6 -spec: - replicas: 2 - restartAt: '2020-11-06T10:03:31Z' - revisionHistoryLimit: 2 - selector: - matchLabels: - app: rollout-canary - strategy: - canary: - steps: - - setWeight: 1 - - pause: {} - template: - metadata: - annotations: - restart: asdfaaa - labels: - app: rollout-canary - spec: - containers: - - image: 'nginx:1.19-alpine' - imagePullPolicy: Always - lifecycle: - postStart: - exec: - command: - - sleep - - '30' - preStop: - exec: - command: - - sleep - - '30' - name: rollouts-demo - ports: - - containerPort: 8080 - resources: {} -status: - HPAReplicas: 2 - abort: null - abortedAt: '2020-11-06T10:08:32Z' - availableReplicas: 2 - blueGreen: {} - canary: - stableRS: 69d59f5445 - conditions: - - lastTransitionTime: '2020-11-06T10:06:38Z' - lastUpdateTime: '2020-11-06T10:06:38Z' - message: Rollout has minimum availability - reason: AvailableReason - status: 'True' - type: Available - - lastTransitionTime: '2020-11-06T10:08:32Z' - lastUpdateTime: '2020-11-06T10:08:32Z' - message: Rollout is aborted - reason: RolloutAborted - status: 'False' - type: Progressing - currentPodHash: 7797495b94 - currentStepHash: 566d47875b - currentStepIndex: 0 - observedGeneration: 74dbb4676d - readyReplicas: 2 - replicas: 2 - restartedAt: '2020-11-06T10:03:31Z' - selector: app=rollout-canary - stableRS: 69d59f5445 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/rollout_not_restarted.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/rollout_not_restarted.yaml deleted file mode 100644 index 72376d0..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/rollout_not_restarted.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - name: canary-demo - namespace: default -spec: - replicas: 5 - revisionHistoryLimit: 1 - selector: - matchLabels: - app: canary-demo - strategy: - canary: - analysis: - args: - - name: ingress - value: canary-demo - templateName: success-rate - canaryService: canary-demo-preview - maxSurge: 1 - maxUnavailable: 1 - steps: - - setWeight: 40 - - pause: {} - - setWeight: 60 - - pause: - duration: 10 - - setWeight: 80 - - pause: - duration: 10 - template: - metadata: - labels: - app: canary-demo - spec: - containers: - - image: argoproj/rollouts-demo:red - imagePullPolicy: Always - name: canary-demo - ports: - - containerPort: 8080 - name: http - protocol: TCP - resources: - requests: - cpu: 5m - memory: 32Mi \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/rollout_restarted.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/rollout_restarted.yaml deleted file mode 100644 index fb6005a..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/rollout_restarted.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - name: canary-demo - namespace: default -spec: - replicas: 5 - restartAt: "0001-01-01T00:00:00Z" - revisionHistoryLimit: 1 - selector: - matchLabels: - app: canary-demo - strategy: - canary: - analysis: - args: - - name: ingress - value: canary-demo - templateName: success-rate - canaryService: canary-demo-preview - maxSurge: 1 - maxUnavailable: 1 - steps: - - setWeight: 40 - - pause: {} - - setWeight: 60 - - pause: - duration: 10 - - setWeight: 80 - - pause: - duration: 10 - template: - metadata: - labels: - app: canary-demo - spec: - containers: - - image: argoproj/rollouts-demo:red - imagePullPolicy: Always - name: canary-demo - ports: - - containerPort: 8080 - name: http - protocol: TCP - resources: - requests: - cpu: 5m - memory: 32Mi \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/three_replica_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/three_replica_rollout.yaml deleted file mode 100644 index 2a531f6..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/three_replica_rollout.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - clusterName: "" - creationTimestamp: 2019-03-22T21:04:31Z - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-bluegreen - name: guestbook-bluegreen - namespace: default - resourceVersion: "888906" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/guestbook-bluegreen - uid: 16a1edf0-4ce6-11e9-994f-025000000001 -spec: - minReadySeconds: 30 - replicas: 3 - revisionHistoryLimit: 2 - selector: - matchLabels: - app: guestbook-bluegreen - strategy: - blueGreen: - activeService: guestbook-bluegreen-active - previewService: guestbook-bluegreen-preview - template: - metadata: - labels: - app: guestbook-bluegreen - spec: - containers: - - image: gcr.io/heptio-images/ks-guestbook-demo:0.2 - name: guestbook-bluegreen - ports: - - containerPort: 80 -status: - availableReplicas: 1 - blueGreen: - activeSelector: 6c767bd46c - conditions: - - lastTransitionTime: 2019-04-01T22:31:44Z - lastUpdateTime: 2019-04-01T22:31:44Z - message: Rollout is serving traffic from the active service. - reason: Available - status: "True" - type: Available - currentPodHash: 6c767bd46c - observedGeneration: 869957df4b - pauseStartTime: 2019-03-26T05:47:32Z - readyReplicas: 1 - replicas: 1 - updatedReplicas: 1 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/v0.9_aborted_bg_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/v0.9_aborted_bg_rollout.yaml deleted file mode 100644 index 4a2c883..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/v0.9_aborted_bg_rollout.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: "2" - creationTimestamp: "2020-11-13T08:37:51Z" - generation: 3 - name: bluegreen - namespace: argocd-e2e - resourceVersion: "202207" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/argocd-e2e/rollouts/bluegreen - uid: 39d30e1e-5e0e-460a-a217-fa21215f1d1f -spec: - replicas: 3 - selector: - matchLabels: - app: bluegreen - strategy: - blueGreen: - activeService: bluegreen - autoPromotionEnabled: false - scaleDownDelaySeconds: 10 - template: - metadata: - creationTimestamp: null - labels: - app: bluegreen - spec: - containers: - - image: nginx:1.18-alpine - name: bluegreen - resources: - requests: - cpu: 1m - memory: 16Mi -status: - HPAReplicas: 3 - abort: true - abortedAt: "2020-11-13T08:38:19Z" - availableReplicas: 3 - blueGreen: - activeSelector: 54bd6f9c67 - canary: {} - conditions: - - lastTransitionTime: "2020-11-13T08:37:53Z" - lastUpdateTime: "2020-11-13T08:37:53Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - - lastTransitionTime: "2020-11-13T08:38:19Z" - lastUpdateTime: "2020-11-13T08:38:19Z" - message: Rollout is aborted - reason: RolloutAborted - status: "False" - type: Progressing - currentPodHash: 5b6f6b55c4 - observedGeneration: "abc123" - readyReplicas: 3 - replicas: 6 - selector: app=bluegreen,rollouts-pod-template-hash=54bd6f9c67 - stableRS: 54bd6f9c67 - updatedReplicas: 3 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/v0.9_aborted_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/v0.9_aborted_rollout.yaml deleted file mode 100644 index 9900b51..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/v0.9_aborted_rollout.yaml +++ /dev/null @@ -1,81 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: '4' - creationTimestamp: '2020-11-06T09:09:54Z' - generation: 76 - labels: - app.kubernetes.io/instance: rollouts-demo - name: rollout-canary - namespace: default - resourceVersion: '4977' - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/rollout-canary - uid: a5047899-8288-43c2-95d7-a8e0a8b45ed6 -spec: - replicas: 2 - restartAt: '2020-11-06T10:03:31Z' - revisionHistoryLimit: 2 - selector: - matchLabels: - app: rollout-canary - strategy: - canary: - steps: - - setWeight: 1 - - pause: {} - template: - metadata: - annotations: - restart: asdfaaa - labels: - app: rollout-canary - spec: - containers: - - image: 'nginx:1.19-alpine' - imagePullPolicy: Always - lifecycle: - postStart: - exec: - command: - - sleep - - '30' - preStop: - exec: - command: - - sleep - - '30' - name: rollouts-demo - ports: - - containerPort: 8080 - resources: {} -status: - HPAReplicas: 2 - abort: true - abortedAt: '2020-11-06T10:08:32Z' - availableReplicas: 2 - blueGreen: {} - canary: - stableRS: 69d59f5445 - conditions: - - lastTransitionTime: '2020-11-06T10:06:38Z' - lastUpdateTime: '2020-11-06T10:06:38Z' - message: Rollout has minimum availability - reason: AvailableReason - status: 'True' - type: Available - - lastTransitionTime: '2020-11-06T10:08:32Z' - lastUpdateTime: '2020-11-06T10:08:32Z' - message: Rollout is aborted - reason: RolloutAborted - status: 'False' - type: Progressing - currentPodHash: 7797495b94 - currentStepHash: 566d47875b - currentStepIndex: 0 - observedGeneration: 74dbb4676d - readyReplicas: 2 - replicas: 2 - restartedAt: '2020-11-06T10:03:31Z' - selector: app=rollout-canary - stableRS: 69d59f5445 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/v0.9_promote-full_rollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/v0.9_promote-full_rollout.yaml deleted file mode 100644 index d917ffa..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/actions/testdata/v0.9_promote-full_rollout.yaml +++ /dev/null @@ -1,81 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: '4' - creationTimestamp: '2020-11-06T09:09:54Z' - generation: 76 - labels: - app.kubernetes.io/instance: rollouts-demo - name: rollout-canary - namespace: default - resourceVersion: '4977' - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/rollout-canary - uid: a5047899-8288-43c2-95d7-a8e0a8b45ed6 -spec: - replicas: 2 - restartAt: '2020-11-06T10:03:31Z' - revisionHistoryLimit: 2 - selector: - matchLabels: - app: rollout-canary - strategy: - canary: - steps: - - setWeight: 1 - - pause: {} - template: - metadata: - annotations: - restart: asdfaaa - labels: - app: rollout-canary - spec: - containers: - - image: 'nginx:1.19-alpine' - imagePullPolicy: Always - lifecycle: - postStart: - exec: - command: - - sleep - - '30' - preStop: - exec: - command: - - sleep - - '30' - name: rollouts-demo - ports: - - containerPort: 8080 - resources: {} -status: - HPAReplicas: 2 - abort: null - abortedAt: '2020-11-06T10:08:32Z' - availableReplicas: 2 - blueGreen: {} - canary: - stableRS: 69d59f5445 - conditions: - - lastTransitionTime: '2020-11-06T10:06:38Z' - lastUpdateTime: '2020-11-06T10:06:38Z' - message: Rollout has minimum availability - reason: AvailableReason - status: 'True' - type: Available - - lastTransitionTime: '2020-11-06T10:08:32Z' - lastUpdateTime: '2020-11-06T10:08:32Z' - message: Rollout is aborted - reason: RolloutAborted - status: 'False' - type: Progressing - currentPodHash: 7797495b94 - currentStepHash: 566d47875b - currentStepIndex: 2 - observedGeneration: 74dbb4676d - readyReplicas: 2 - replicas: 2 - restartedAt: '2020-11-06T10:03:31Z' - selector: app=rollout-canary - stableRS: 69d59f5445 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/health.lua b/pkg/resource_customizations/argoproj.io/Rollout/health.lua deleted file mode 100644 index 8d352a3..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/health.lua +++ /dev/null @@ -1,165 +0,0 @@ -function checkReplicasStatus(obj) - hs = {} - desiredReplicas = getNumberValueOrDefault(obj.spec.replicas, 1) - statusReplicas = getNumberValueOrDefault(obj.status.replicas, 0) - updatedReplicas = getNumberValueOrDefault(obj.status.updatedReplicas, 0) - availableReplicas = getNumberValueOrDefault(obj.status.availableReplicas, 0) - - if updatedReplicas < desiredReplicas then - hs.status = "Progressing" - hs.message = "Waiting for roll out to finish: More replicas need to be updated" - return hs - end - if availableReplicas < updatedReplicas then - hs.status = "Progressing" - hs.message = "Waiting for roll out to finish: updated replicas are still becoming available" - return hs - end - return nil -end - --- In Argo Rollouts v0.8 we deprecated .status.canary.stableRS for .status.stableRS --- This func grabs the correct one. -function getStableRS(obj) - if obj.status.stableRS ~= nil then - return obj.status.stableRS - end - if obj.status.canary ~= nil then - return obj.status.canary.stableRS - end - return "" -end - -function getNumberValueOrDefault(field, default) - if field ~= nil then - return field - end - return default -end - -function checkPaused(obj) - hs = {} - hs.status = "Suspended" - hs.message = "Rollout is paused" - if obj.status.pauseConditions ~= nil and table.getn(obj.status.pauseConditions) > 0 then - return hs - end - - if obj.spec.paused ~= nil and obj.spec.paused then - return hs - end - return nil -end - --- isGenerationObserved determines if the rollout spec has been observed by the controller. This --- only applies to v0.10 rollout which uses a numeric status.observedGeneration. For v0.9 rollouts --- and below this function always returns true. -function isGenerationObserved(obj) - if obj.status == nil then - return false - end - observedGeneration = tonumber(obj.status.observedGeneration) - if observedGeneration == nil or observedGeneration > obj.metadata.generation then - -- if we get here, the rollout is a v0.9 rollout - return true - end - return observedGeneration == obj.metadata.generation -end - --- isWorkloadGenerationObserved determines if the referenced workload's generation spec has been --- observed by the controller. This only applies to v1.1 rollout -function isWorkloadGenerationObserved(obj) - if obj.spec.workloadRef == nil or obj.metadata.annotations == nil then - -- rollout is v1.0 or earlier - return true - end - workloadGen = tonumber(obj.metadata.annotations["rollout.argoproj.io/workload-generation"]) - observedWorkloadGen = tonumber(obj.status.workloadObservedGeneration) - return workloadGen == observedWorkloadGen -end - -hs = {} -if not isGenerationObserved(obj) or not isWorkloadGenerationObserved(obj) then - hs.status = "Progressing" - hs.message = "Waiting for rollout spec update to be observed" - return hs -end - --- Argo Rollouts v1.0 has been improved to record a phase/message in status, which Argo CD can blindly surface -if obj.status.phase ~= nil then - if obj.status.phase == "Paused" then - -- Map Rollout's "Paused" status to Argo CD's "Suspended" - hs.status = "Suspended" - else - hs.status = obj.status.phase - end - hs.message = obj.status.message - return hs -end - -for _, condition in ipairs(obj.status.conditions) do - if condition.type == "InvalidSpec" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Progressing" and condition.reason == "RolloutAborted" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Progressing" and condition.reason == "ProgressDeadlineExceeded" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end -end - -isPaused = checkPaused(obj) -if isPaused ~= nil then - return isPaused -end - -if obj.status.currentPodHash == nil then - hs.status = "Progressing" - hs.message = "Waiting for rollout to finish: status has not been reconciled." - return hs -end - -replicasHS = checkReplicasStatus(obj) -if replicasHS ~= nil then - return replicasHS -end - - -stableRS = getStableRS(obj) - -if obj.spec.strategy.blueGreen ~= nil then - if obj.status.blueGreen == nil or obj.status.blueGreen.activeSelector ~= obj.status.currentPodHash then - hs.status = "Progressing" - hs.message = "active service cutover pending" - return hs - end - -- Starting in v0.8 blue-green uses status.stableRS. To drop support for v0.7, uncomment following - -- if stableRS == "" or stableRS ~= obj.status.currentPodHash then - if stableRS ~= "" and stableRS ~= obj.status.currentPodHash then - hs.status = "Progressing" - hs.message = "waiting for analysis to complete" - return hs - end -elseif obj.spec.strategy.canary ~= nil then - if statusReplicas > updatedReplicas then - hs.status = "Progressing" - hs.message = "Waiting for roll out to finish: old replicas are pending termination" - return hs - end - if stableRS == "" or stableRS ~= obj.status.currentPodHash then - hs.status = "Progressing" - hs.message = "Waiting for rollout to finish steps" - return hs - end -end - -hs.status = "Healthy" -hs.message = "" -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/health_test.yaml b/pkg/resource_customizations/argoproj.io/Rollout/health_test.yaml deleted file mode 100644 index a9fa6c2..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/health_test.yaml +++ /dev/null @@ -1,94 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Waiting for rollout spec update to be observed" - inputPath: testdata/newRolloutWithoutStatus.yaml -- healthStatus: - status: Progressing - message: "Waiting for rollout spec update to be observed" - inputPath: testdata/progressing_newGeneration.yaml -- healthStatus: - status: Progressing - message: "Waiting for rollout spec update to be observed" - inputPath: testdata/progressing_newWorkloadGeneration.yaml -- healthStatus: - status: Degraded - message: "InvalidSpec" - inputPath: testdata/degraded_statusPhaseMessage.yaml -- healthStatus: - status: Healthy - message: "" - inputPath: testdata/healthy_legacy_v0.9_observedGeneration.yaml -- healthStatus: - status: Healthy - message: "" - inputPath: testdata/healthy_legacy_v0.9_observedGeneration_numeric.yaml -- healthStatus: - status: Healthy - message: "" - inputPath: testdata/healthy_legacy_v1.0_newWorkloadGeneration.yaml -- healthStatus: - status: Healthy - message: "" - inputPath: testdata/healthy_newWorkloadGeneration.yaml -- healthStatus: - status: Degraded - message: "The Rollout \"basic\" is invalid: spec.strategy.strategy: Required value: Rollout has missing field '.spec.strategy.canary or .spec.strategy.blueGreen'" - inputPath: testdata/degraded_invalidSpec.yaml -- healthStatus: - status: Degraded - message: ReplicaSet "guestbook-bluegreen-helm-guestbook-6b8cf6f7db" has timed out progressing. - inputPath: testdata/degraded_rolloutTimeout.yaml -- healthStatus: - status: Degraded - message: Rollout is aborted - inputPath: testdata/degraded_abortedRollout.yaml -#BlueGreen -- healthStatus: - status: Healthy - inputPath: testdata/bluegreen/healthy_servingActiveService.yaml -- healthStatus: - status: Progressing - message: "Waiting for roll out to finish: More replicas need to be updated" - inputPath: testdata/bluegreen/progressing_addingMoreReplicas.yaml -- healthStatus: - status: Progressing - message: "Waiting for roll out to finish: updated replicas are still becoming available" - inputPath: testdata/bluegreen/progressing_waitingUntilAvailable.yaml -#Canary -- healthStatus: - status: Progressing - message: "Waiting for roll out to finish: More replicas need to be updated" - inputPath: testdata/canary/progressing_setWeightStep.yaml -- healthStatus: - status: Progressing - message: "Waiting for roll out to finish: old replicas are pending termination" - inputPath: testdata/canary/progressing_killingOldReplicas.yaml -- healthStatus: - status: Suspended - message: Rollout is paused - inputPath: testdata/suspended_controllerPause.yaml -- healthStatus: - status: Suspended - message: Rollout is paused - inputPath: testdata/suspended_userPause.yaml -- healthStatus: - status: Suspended - message: CanaryPauseStep - inputPath: testdata/suspended_v1.0_pausedRollout.yaml -- healthStatus: - status: Healthy - inputPath: testdata/canary/healthy_executedAllStepsPreV0.8.yaml -- healthStatus: - status: Healthy - inputPath: testdata/canary/healthy_executedAllSteps.yaml -- healthStatus: - status: Progressing - message: 'Waiting for roll out to finish: updated replicas are still becoming available' - inputPath: testdata/canary/progressing_noSteps.yaml -- healthStatus: - status: Healthy - inputPath: testdata/canary/healthy_noSteps.yaml -- healthStatus: - status: Healthy - inputPath: testdata/canary/healthy_emptyStepsList.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/bluegreen/healthy_servingActiveService.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/bluegreen/healthy_servingActiveService.yaml deleted file mode 100644 index 45000bc..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/bluegreen/healthy_servingActiveService.yaml +++ /dev/null @@ -1,56 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: "1" - clusterName: "" - creationTimestamp: 2019-01-22T16:52:54Z - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-default - ksonnet.io/component: guestbook-ui - name: ks-guestbook-ui - namespace: default - resourceVersion: "153353" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/ks-guestbook-ui - uid: 29802403-1e66-11e9-a6a4-025000000001 -spec: - minReadySeconds: 30 - replicas: 1 - selector: - matchLabels: - app: ks-guestbook-ui - strategy: - blueGreen: - activeService: ks-guestbook-ui-active - previewService: ks-guestbook-ui-preview - type: BlueGreenUpdate - template: - metadata: - creationTimestamp: null - labels: - app: ks-guestbook-ui - spec: - containers: - - image: gcr.io/heptio-images/ks-guestbook-demo:0.2 - name: ks-guestbook-ui - ports: - - containerPort: 80 - resources: {} -status: - availableReplicas: 1 - blueGreen: - activeSelector: dc689d967 - previewSelector: "" - conditions: - - lastTransitionTime: 2019-01-24T09:51:02Z - lastUpdateTime: 2019-01-24T09:51:02Z - message: Rollout is serving traffic from the active service. - reason: Available - status: "True" - type: Available - currentPodHash: dc689d967 - observedGeneration: 77646c9d4c - readyReplicas: 1 - replicas: 1 - updatedReplicas: 1 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/bluegreen/progressing_addingMoreReplicas.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/bluegreen/progressing_addingMoreReplicas.yaml deleted file mode 100644 index ae3a8e1..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/bluegreen/progressing_addingMoreReplicas.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: "7" - clusterName: "" - creationTimestamp: 2019-01-22T16:52:54Z - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-default - name: ks-guestbook-ui - namespace: default - resourceVersion: "164023" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/ks-guestbook-ui - uid: 29802403-1e66-11e9-a6a4-025000000001 -spec: - minReadySeconds: 30 - replicas: 3 - selector: - matchLabels: - app: ks-guestbook-ui - strategy: - blueGreen: - activeService: ks-guestbook-ui-active - previewService: ks-guestbook-ui-preview - type: BlueGreenUpdate - template: - metadata: - creationTimestamp: null - labels: - app: ks-guestbook-ui - spec: - containers: - - image: gcr.io/heptio-images/ks-guestbook-demo:0.1 - name: ks-guestbook-ui - ports: - - containerPort: 83 - resources: {} -status: - activeSelector: 85f9884f5d - availableReplicas: 3 - conditions: - - lastTransitionTime: 2019-01-25T07:44:26Z - lastUpdateTime: 2019-01-25T07:44:26Z - message: Rollout is serving traffic from the active service. - reason: Available - status: "True" - type: Available - currentPodHash: 697fb9575c - observedGeneration: 767f98959f - previewSelector: "" - readyReplicas: 3 - replicas: 3 - updatedReplicas: 0 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/bluegreen/progressing_waitingUntilAvailable.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/bluegreen/progressing_waitingUntilAvailable.yaml deleted file mode 100644 index 901ddd5..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/bluegreen/progressing_waitingUntilAvailable.yaml +++ /dev/null @@ -1,55 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: "1" - clusterName: "" - creationTimestamp: 2019-01-25T16:19:09Z - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-default - ksonnet.io/component: guestbook-ui - name: ks-guestbook-ui - namespace: default - resourceVersion: "164590" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/ks-guestbook-ui - uid: f1b99cb0-20bc-11e9-a811-025000000001 -spec: - minReadySeconds: 30 - replicas: 3 - selector: - matchLabels: - app: ks-guestbook-ui - strategy: - blueGreen: - activeService: ks-guestbook-ui-active - previewService: ks-guestbook-ui-preview - type: BlueGreenUpdate - template: - metadata: - creationTimestamp: null - labels: - app: ks-guestbook-ui - spec: - containers: - - image: gcr.io/heptio-images/ks-guestbook-demo:0.1 - name: ks-guestbook-ui - ports: - - containerPort: 83 - resources: {} -status: - activeSelector: 697fb9575c - availableReplicas: 0 - conditions: - - lastTransitionTime: 2019-01-25T16:19:09Z - lastUpdateTime: 2019-01-25T16:19:09Z - message: Rollout is not serving traffic from the active service. - reason: Available - status: "False" - type: Available - currentPodHash: 697fb9575c - observedGeneration: 767f98959f - previewSelector: "" - readyReplicas: 3 - replicas: 3 - updatedReplicas: 3 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/healthy_emptyStepsList.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/healthy_emptyStepsList.yaml deleted file mode 100644 index 7b8efea..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/healthy_emptyStepsList.yaml +++ /dev/null @@ -1,65 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: '2' - clusterName: '' - creationTimestamp: '2019-05-01T21:55:30Z' - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-canary - ksonnet.io/component: guestbook-ui - name: guestbook-canary - namespace: default - resourceVersion: '956205' - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/guestbook-canary - uid: d6105ccd-6c5b-11e9-b8d7-025000000001 -spec: - minReadySeconds: 10 - replicas: 5 - selector: - matchLabels: - app: guestbook-canary - strategy: - canary: - maxSurge: 1 - maxUnavailable: 0 - steps: [] - template: - metadata: - creationTimestamp: null - labels: - app: guestbook-canary - spec: - containers: - - image: 'gcr.io/heptio-images/ks-guestbook-demo:0.2' - name: guestbook-canary - ports: - - containerPort: 80 - resources: {} -status: - HPAReplicas: 5 - availableReplicas: 5 - blueGreen: {} - canary: - stableRS: 567dd56d89 - conditions: - - lastTransitionTime: '2019-05-01T22:00:16Z' - lastUpdateTime: '2019-05-01T22:00:16Z' - message: Rollout has minimum availability - reason: AvailableReason - status: 'True' - type: Available - - lastTransitionTime: '2019-05-01T21:55:30Z' - lastUpdateTime: '2019-05-01T22:00:16Z' - message: ReplicaSet "guestbook-canary-567dd56d89" has successfully progressed. - reason: NewReplicaSetAvailable - status: 'True' - type: Progressing - currentPodHash: 567dd56d89 - currentStepHash: 6c9545789c - observedGeneration: 6886f85bff - readyReplicas: 5 - replicas: 5 - selector: app=guestbook-canary - updatedReplicas: 5 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/healthy_executedAllSteps.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/healthy_executedAllSteps.yaml deleted file mode 100644 index a4d5485..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/healthy_executedAllSteps.yaml +++ /dev/null @@ -1,73 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - kubectl.kubernetes.io/last-applied-configuration: > - {"apiVersion":"argoproj.io/v1alpha1","kind":"Rollout","metadata":{"annotations":{},"labels":{"app.kubernetes.io/instance":"guestbook-canary","ksonnet.io/component":"guestbook-ui"},"name":"guestbook-canary","namespace":"default"},"spec":{"minReadySeconds":10,"replicas":5,"selector":{"matchLabels":{"app":"guestbook-canary"}},"strategy":{"canary":{"maxSurge":1,"maxUnavailable":0,"steps":[{"setWeight":20},{"pause":{"duration":30}},{"setWeight":40},{"pause":{}}]}},"template":{"metadata":{"labels":{"app":"guestbook-canary"}},"spec":{"containers":[{"image":"gcr.io/heptio-images/ks-guestbook-demo:0.1","name":"guestbook-canary","ports":[{"containerPort":80}]}]}}}} - rollout.argoproj.io/revision: '1' - clusterName: '' - creationTimestamp: '2019-05-01T21:55:30Z' - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-canary - ksonnet.io/component: guestbook-ui - name: guestbook-canary - namespace: default - resourceVersion: '955764' - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/guestbook-canary - uid: d6105ccd-6c5b-11e9-b8d7-025000000001 -spec: - minReadySeconds: 10 - replicas: 5 - selector: - matchLabels: - app: guestbook-canary - strategy: - canary: - maxSurge: 1 - maxUnavailable: 0 - steps: - - setWeight: 20 - - pause: - duration: 30 - - setWeight: 40 - - pause: {} - template: - metadata: - creationTimestamp: null - labels: - app: guestbook-canary - spec: - containers: - - image: 'gcr.io/heptio-images/ks-guestbook-demo:0.1' - name: guestbook-canary - ports: - - containerPort: 80 - resources: {} -status: - HPAReplicas: 5 - availableReplicas: 5 - blueGreen: {} - canary: {} - conditions: - - lastTransitionTime: '2019-05-01T21:55:30Z' - lastUpdateTime: '2019-05-01T21:55:58Z' - message: ReplicaSet "guestbook-canary-84ccfddd66" has successfully progressed. - reason: NewReplicaSetAvailable - status: 'True' - type: Progressing - - lastTransitionTime: '2019-05-01T21:55:58Z' - lastUpdateTime: '2019-05-01T21:55:58Z' - message: Rollout has minimum availability - reason: AvailableReason - status: 'True' - type: Available - currentPodHash: 84ccfddd66 - currentStepHash: 5f8fbdf7bb - currentStepIndex: 4 - observedGeneration: c45557fd9 - readyReplicas: 5 - replicas: 5 - selector: app=guestbook-canary - stableRS: 84ccfddd66 - updatedReplicas: 5 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/healthy_executedAllStepsPreV0.8.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/healthy_executedAllStepsPreV0.8.yaml deleted file mode 100644 index 52073ff..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/healthy_executedAllStepsPreV0.8.yaml +++ /dev/null @@ -1,73 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - kubectl.kubernetes.io/last-applied-configuration: > - {"apiVersion":"argoproj.io/v1alpha1","kind":"Rollout","metadata":{"annotations":{},"labels":{"app.kubernetes.io/instance":"guestbook-canary","ksonnet.io/component":"guestbook-ui"},"name":"guestbook-canary","namespace":"default"},"spec":{"minReadySeconds":10,"replicas":5,"selector":{"matchLabels":{"app":"guestbook-canary"}},"strategy":{"canary":{"maxSurge":1,"maxUnavailable":0,"steps":[{"setWeight":20},{"pause":{"duration":30}},{"setWeight":40},{"pause":{}}]}},"template":{"metadata":{"labels":{"app":"guestbook-canary"}},"spec":{"containers":[{"image":"gcr.io/heptio-images/ks-guestbook-demo:0.1","name":"guestbook-canary","ports":[{"containerPort":80}]}]}}}} - rollout.argoproj.io/revision: '1' - clusterName: '' - creationTimestamp: '2019-05-01T21:55:30Z' - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-canary - ksonnet.io/component: guestbook-ui - name: guestbook-canary - namespace: default - resourceVersion: '955764' - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/guestbook-canary - uid: d6105ccd-6c5b-11e9-b8d7-025000000001 -spec: - minReadySeconds: 10 - replicas: 5 - selector: - matchLabels: - app: guestbook-canary - strategy: - canary: - maxSurge: 1 - maxUnavailable: 0 - steps: - - setWeight: 20 - - pause: - duration: 30 - - setWeight: 40 - - pause: {} - template: - metadata: - creationTimestamp: null - labels: - app: guestbook-canary - spec: - containers: - - image: 'gcr.io/heptio-images/ks-guestbook-demo:0.1' - name: guestbook-canary - ports: - - containerPort: 80 - resources: {} -status: - HPAReplicas: 5 - availableReplicas: 5 - blueGreen: {} - canary: - stableRS: 84ccfddd66 - conditions: - - lastTransitionTime: '2019-05-01T21:55:30Z' - lastUpdateTime: '2019-05-01T21:55:58Z' - message: ReplicaSet "guestbook-canary-84ccfddd66" has successfully progressed. - reason: NewReplicaSetAvailable - status: 'True' - type: Progressing - - lastTransitionTime: '2019-05-01T21:55:58Z' - lastUpdateTime: '2019-05-01T21:55:58Z' - message: Rollout has minimum availability - reason: AvailableReason - status: 'True' - type: Available - currentPodHash: 84ccfddd66 - currentStepHash: 5f8fbdf7bb - currentStepIndex: 4 - observedGeneration: c45557fd9 - readyReplicas: 5 - replicas: 5 - selector: app=guestbook-canary - updatedReplicas: 5 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/healthy_noSteps.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/healthy_noSteps.yaml deleted file mode 100644 index 092d45c..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/healthy_noSteps.yaml +++ /dev/null @@ -1,66 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - kubectl.kubernetes.io/last-applied-configuration: > - {"apiVersion":"argoproj.io/v1alpha1","kind":"Rollout","metadata":{"annotations":{},"labels":{"app.kubernetes.io/instance":"guestbook-canary","ksonnet.io/component":"guestbook-ui"},"name":"guestbook-canary","namespace":"default"},"spec":{"minReadySeconds":10,"replicas":5,"selector":{"matchLabels":{"app":"guestbook-canary"}},"strategy":{"canary":{"maxSurge":1,"maxUnavailable":0,"steps":[{"setWeight":20},{"pause":{"duration":30}},{"setWeight":40},{"pause":{}}]}},"template":{"metadata":{"labels":{"app":"guestbook-canary"}},"spec":{"containers":[{"image":"gcr.io/heptio-images/ks-guestbook-demo:0.1","name":"guestbook-canary","ports":[{"containerPort":80}]}]}}}} - rollout.argoproj.io/revision: '2' - clusterName: '' - creationTimestamp: '2019-05-01T21:55:30Z' - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-canary - ksonnet.io/component: guestbook-ui - name: guestbook-canary - namespace: default - resourceVersion: '956205' - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/guestbook-canary - uid: d6105ccd-6c5b-11e9-b8d7-025000000001 -spec: - minReadySeconds: 10 - replicas: 5 - selector: - matchLabels: - app: guestbook-canary - strategy: - canary: - maxSurge: 1 - maxUnavailable: 0 - template: - metadata: - creationTimestamp: null - labels: - app: guestbook-canary - spec: - containers: - - image: 'gcr.io/heptio-images/ks-guestbook-demo:0.2' - name: guestbook-canary - ports: - - containerPort: 80 - resources: {} -status: - HPAReplicas: 5 - availableReplicas: 5 - blueGreen: {} - canary: - stableRS: 567dd56d89 - conditions: - - lastTransitionTime: '2019-05-01T22:00:16Z' - lastUpdateTime: '2019-05-01T22:00:16Z' - message: Rollout has minimum availability - reason: AvailableReason - status: 'True' - type: Available - - lastTransitionTime: '2019-05-01T21:55:30Z' - lastUpdateTime: '2019-05-01T22:00:16Z' - message: ReplicaSet "guestbook-canary-567dd56d89" has successfully progressed. - reason: NewReplicaSetAvailable - status: 'True' - type: Progressing - currentPodHash: 567dd56d89 - currentStepHash: 6c9545789c - observedGeneration: 6886f85bff - readyReplicas: 5 - replicas: 5 - selector: app=guestbook-canary - updatedReplicas: 5 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/progressing_killingOldReplicas.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/progressing_killingOldReplicas.yaml deleted file mode 100644 index aab3d8f..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/progressing_killingOldReplicas.yaml +++ /dev/null @@ -1,61 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - kubectl.kubernetes.io/last-applied-configuration: | - {"apiVersion":"argoproj.io/v1alpha1","kind":"Rollout","metadata":{"annotations":{},"name":"example-rollout-canary","namespace":"default"},"spec":{"minReadySeconds":30,"replicas":5,"revisionHistoryLimit":3,"selector":{"matchLabels":{"app":"guestbook"}},"strategy":{"canary":{"steps":[{"setWeight":20},{"pause":{"duration":20}},{"setWeight":40},{"pause":{}}]}},"template":{"metadata":{"labels":{"app":"guestbook"}},"spec":{"containers":[{"image":"gcr.io/heptio-images/ks-guestbook-demo:0.1","name":"guestbook","ports":[{"containerPort":80}]}]}}}} - rollout.argoproj.io/revision: "3" - creationTimestamp: "2019-10-20T15:42:26Z" - generation: 101 - name: example-rollout-canary - namespace: default - resourceVersion: "1779901" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/example-rollout-canary - uid: f8ebf794-8b4e-4a1f-a2d1-a85bc1d206ef -spec: - minReadySeconds: 30 - replicas: 5 - revisionHistoryLimit: 3 - selector: - matchLabels: - app: guestbook - strategy: - canary: {} - template: - metadata: - creationTimestamp: null - labels: - app: guestbook - spec: - containers: - - image: gcr.io/heptio-images/ks-guestbook-demo:0.1 - name: guestbook - ports: - - containerPort: 80 - resources: {} -status: - HPAReplicas: 6 - availableReplicas: 5 - blueGreen: {} - canary: - stableRS: 74d6dc8544 - conditions: - - lastTransitionTime: "2019-10-25T16:08:02Z" - lastUpdateTime: "2019-10-25T16:08:02Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - - lastTransitionTime: "2019-10-25T16:50:19Z" - lastUpdateTime: "2019-11-07T18:19:25Z" - message: ReplicaSet "example-rollout-canary-694fb7759c" is progressing. - reason: ReplicaSetUpdated - status: "True" - type: Progressing - currentPodHash: 694fb7759c - currentStepHash: 5ffbfbbd64 - observedGeneration: 7fcc96c7b7 - readyReplicas: 6 - replicas: 6 - selector: app=guestbook - updatedReplicas: 5 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/progressing_noSteps.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/progressing_noSteps.yaml deleted file mode 100644 index 41e7a07..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/progressing_noSteps.yaml +++ /dev/null @@ -1,64 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: '2' - clusterName: '' - creationTimestamp: '2019-05-01T21:55:30Z' - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-canary - ksonnet.io/component: guestbook-ui - name: guestbook-canary - namespace: default - resourceVersion: '956159' - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/guestbook-canary - uid: d6105ccd-6c5b-11e9-b8d7-025000000001 -spec: - minReadySeconds: 10 - replicas: 5 - selector: - matchLabels: - app: guestbook-canary - strategy: - canary: - maxSurge: 1 - maxUnavailable: 0 - template: - metadata: - creationTimestamp: null - labels: - app: guestbook-canary - spec: - containers: - - image: 'gcr.io/heptio-images/ks-guestbook-demo:0.2' - name: guestbook-canary - ports: - - containerPort: 80 - resources: {} -status: - HPAReplicas: 6 - availableReplicas: 2 - blueGreen: {} - canary: - stableRS: 567dd56d89 - conditions: - - lastTransitionTime: '2019-05-01T21:59:58Z' - lastUpdateTime: '2019-05-01T21:59:58Z' - message: Rollout does not have minimum availability - reason: AvailableReason - status: 'False' - type: Available - - lastTransitionTime: '2019-05-01T21:55:30Z' - lastUpdateTime: '2019-05-01T22:00:05Z' - message: ReplicaSet "guestbook-canary-567dd56d89" is progressing. - reason: ReplicaSetUpdated - status: 'True' - type: Progressing - currentPodHash: 567dd56d89 - currentStepHash: 6c9545789c - observedGeneration: 6886f85bff - readyReplicas: 4 - replicas: 6 - selector: app=guestbook-canary - updatedReplicas: 5 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/progressing_setWeightStep.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/progressing_setWeightStep.yaml deleted file mode 100644 index a521be9..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/canary/progressing_setWeightStep.yaml +++ /dev/null @@ -1,69 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - kubectl.kubernetes.io/last-applied-configuration: | - {"apiVersion":"argoproj.io/v1alpha1","kind":"Rollout","metadata":{"annotations":{},"name":"example-rollout-canary","namespace":"default"},"spec":{"minReadySeconds":30,"replicas":5,"revisionHistoryLimit":3,"selector":{"matchLabels":{"app":"guestbook"}},"strategy":{"canary":{"steps":[{"setWeight":20},{"pause":{"duration":20}},{"setWeight":40},{"pause":{}}]}},"template":{"metadata":{"labels":{"app":"guestbook"}},"spec":{"containers":[{"image":"gcr.io/heptio-images/ks-guestbook-demo:0.1","name":"guestbook","ports":[{"containerPort":80}]}]}}}} - rollout.argoproj.io/revision: "2" - clusterName: "" - creationTimestamp: 2019-04-26T20:17:43Z - generation: 1 - name: example-rollout-canary - namespace: default - resourceVersion: "696688" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/example-rollout-canary - uid: 58f6f1bb-6860-11e9-b8d7-025000000001 -spec: - minReadySeconds: 30 - replicas: 5 - revisionHistoryLimit: 3 - selector: - matchLabels: - app: guestbook - strategy: - canary: - steps: - - setWeight: 20 - - pause: - duration: 20 - - setWeight: 40 - - pause: {} - template: - metadata: - creationTimestamp: null - labels: - app: guestbook - spec: - containers: - - image: gcr.io/heptio-images/ks-guestbook-demo:0.2 - name: guestbook - ports: - - containerPort: 80 - resources: {} -status: - HPAReplicas: 5 - availableReplicas: 5 - blueGreen: {} - canary: - stableRS: df986d68 - conditions: - - lastTransitionTime: 2019-04-26T20:18:05Z - lastUpdateTime: 2019-04-26T20:18:05Z - message: Rollout is not serving traffic from the active service. - reason: Available - status: "False" - type: Available - - lastTransitionTime: 2019-04-26T20:18:58Z - lastUpdateTime: 2019-04-26T20:19:29Z - message: ReplicaSet "example-rollout-canary-6b566f47b7" is progressing. - reason: ReplicaSetUpdated - status: "True" - type: Progressing - currentPodHash: 6b566f47b7 - currentStepHash: 6567fc959c - currentStepIndex: 3 - observedGeneration: 6df79499bc - readyReplicas: 5 - replicas: 5 - selector: app=guestbook - updatedReplicas: 2 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/degraded_abortedRollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/degraded_abortedRollout.yaml deleted file mode 100644 index d821d6a..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/degraded_abortedRollout.yaml +++ /dev/null @@ -1,70 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - name: canary-demo - namespace: default -spec: - replicas: 5 - revisionHistoryLimit: 3 - selector: - matchLabels: - app: canary-demo - strategy: - canary: - analysis: - name: analysis - templateName: analysis-template - canaryService: canary-demo-preview - steps: - - setWeight: 40 - - pause: {} - - setWeight: 60 - - pause: {} - - setWeight: 80 - - pause: - duration: 10 - template: - metadata: - creationTimestamp: null - labels: - app: canary-demo - spec: - containers: - - image: argoproj/rollouts-demo:yellow - imagePullPolicy: Always - name: canary-demo - ports: - - containerPort: 8080 - name: http - protocol: TCP - resources: - requests: - cpu: 5m - memory: 32Mi -status: - HPAReplicas: 5 - abort: true - availableReplicas: 5 - blueGreen: {} - canary: - stableRS: 645d5dbc4c - conditions: - - lastTransitionTime: "2019-11-03T01:32:46Z" - lastUpdateTime: "2019-11-03T01:32:46Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - - lastTransitionTime: "2019-11-05T18:20:12Z" - lastUpdateTime: "2019-11-05T18:20:12Z" - message: Rollout is aborted - reason: RolloutAborted - status: "False" - type: Progressing - currentPodHash: 6758949f55 - currentStepHash: 59f8666948 - currentStepIndex: 0 - observedGeneration: 58b949649c - readyReplicas: 5 - replicas: 5 - selector: app=canary-demo \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/degraded_invalidSpec.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/degraded_invalidSpec.yaml deleted file mode 100644 index ff48a5d..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/degraded_invalidSpec.yaml +++ /dev/null @@ -1,65 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: "1" - creationTimestamp: "2020-11-13T00:22:49Z" - generation: 3 - name: basic - namespace: argocd-e2e - resourceVersion: "181746" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/argocd-e2e/rollouts/basic - uid: 5b0926f3-30b7-4727-a76e-46c0d2617906 -spec: - replicas: 1 - selector: - matchLabels: - app: basic - strategy: {} - template: - metadata: - creationTimestamp: null - labels: - app: basic - spec: - containers: - - image: nginx:1.19-alpine - name: basic - resources: - requests: - cpu: 1m - memory: 16Mi -status: - HPAReplicas: 1 - availableReplicas: 1 - blueGreen: {} - canary: {} - conditions: - - lastTransitionTime: "2020-11-13T00:22:48Z" - lastUpdateTime: "2020-11-13T00:22:50Z" - message: ReplicaSet "basic-754cb84d5" has successfully progressed. - reason: NewReplicaSetAvailable - status: "True" - type: Progressing - - lastTransitionTime: "2020-11-13T00:22:50Z" - lastUpdateTime: "2020-11-13T00:22:50Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - - lastTransitionTime: "2020-11-13T00:40:30Z" - lastUpdateTime: "2020-11-13T00:40:30Z" - message: 'The Rollout "basic" is invalid: spec.strategy.strategy: Required value: - Rollout has missing field ''.spec.strategy.canary or .spec.strategy.blueGreen''' - reason: InvalidSpec - status: "True" - type: InvalidSpec - currentPodHash: 754cb84d5 - currentStepHash: 757f5f97b - currentStepIndex: 2 - observedGeneration: "3" - readyReplicas: 1 - replicas: 1 - selector: app=basic - stableRS: 754cb84d5 - updatedReplicas: 1 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/degraded_rolloutTimeout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/degraded_rolloutTimeout.yaml deleted file mode 100644 index bfded3c..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/degraded_rolloutTimeout.yaml +++ /dev/null @@ -1,84 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: '4' - clusterName: '' - creationTimestamp: '2019-04-29T21:37:38Z' - generation: 1 - labels: - app: helm-guestbook - app.kubernetes.io/instance: guestbook-bluegreen - chart: helm-guestbook-0.1.0 - heritage: Tiller - release: guestbook-bluegreen - name: guestbook-bluegreen-helm-guestbook - namespace: default - selfLink: >- - /apis/argoproj.io/v1alpha1/namespaces/default/rollouts/guestbook-bluegreen-helm-guestbook -spec: - minReadySeconds: 0 - progressDeadlineSeconds: 32 - replicas: 3 - revisionHistoryLimit: 3 - selector: - matchLabels: - app: helm-guestbook - release: guestbook-bluegreen - strategy: - blueGreen: - activeService: guestbook-bluegreen-helm-guestbook - previewReplicaCount: 1 - previewService: guestbook-bluegreen-helm-guestbook-preview - template: - metadata: - creationTimestamp: null - labels: - app: helm-guestbook - release: guestbook-bluegreen - spec: - containers: - - image: 'gcr.io/heptio-images/ks-guestbook-demo:0.3' - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: / - port: http - name: helm-guestbook - ports: - - containerPort: 80 - name: http - protocol: TCP - readinessProbe: - httpGet: - path: / - port: http - resources: {} -status: - HPAReplicas: 3 - availableReplicas: 3 - blueGreen: - activeSelector: 8464d8564d - canary: {} - conditions: - - lastTransitionTime: '2019-05-01T17:52:59Z' - lastUpdateTime: '2019-05-01T17:52:59Z' - message: Rollout has minimum availability - reason: AvailableReason - status: 'True' - type: Available - - lastTransitionTime: '2019-05-01T21:36:03Z' - lastUpdateTime: '2019-05-01T21:36:03Z' - message: >- - ReplicaSet "guestbook-bluegreen-helm-guestbook-6b8cf6f7db" has timed out - progressing. - reason: ProgressDeadlineExceeded - status: 'False' - type: Progressing - currentPodHash: 6b8cf6f7db - observedGeneration: 7bcdbf7bd9 - readyReplicas: 3 - replicas: 4 - selector: >- - app=helm-guestbook,release=guestbook-bluegreen,rollouts-pod-template-hash=8464d8564d - updatedReplicas: 1 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/degraded_statusPhaseMessage.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/degraded_statusPhaseMessage.yaml deleted file mode 100644 index 02c161d..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/degraded_statusPhaseMessage.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - creationTimestamp: "2020-11-13T00:44:55Z" - generation: 1 - name: basic - namespace: argocd-e2e - resourceVersion: "182108" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/argocd-e2e/rollouts/basic - uid: 34e4bbfc-222c-4968-bd60-2b30ae81110d -spec: - replicas: 1 - selector: - matchLabels: - app: basic - strategy: - canary: - steps: - - setWeight: 50 - - pause: {} - template: - metadata: - creationTimestamp: null - labels: - app: basic - spec: - containers: - - image: nginx:1.19-alpine - name: basic - resources: - requests: - cpu: 1m - memory: 16Mi -status: - HPAReplicas: 1 - availableReplicas: 1 - blueGreen: {} - canary: {} - conditions: {} - phase: "Degraded" - message: "InvalidSpec" - currentPodHash: 754cb84d5 - currentStepHash: 757f5f97b - currentStepIndex: 2 - observedGeneration: "8575574967" ## <---- uses legacy observedGeneration hash which are numbers - readyReplicas: 1 - replicas: 1 - selector: app=basic - stableRS: 754cb84d5 - updatedReplicas: 1 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/healthy_legacy_v0.9_observedGeneration.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/healthy_legacy_v0.9_observedGeneration.yaml deleted file mode 100644 index 61d7c1e..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/healthy_legacy_v0.9_observedGeneration.yaml +++ /dev/null @@ -1,60 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - creationTimestamp: "2020-11-13T00:44:55Z" - generation: 1 - name: basic - namespace: argocd-e2e - resourceVersion: "182108" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/argocd-e2e/rollouts/basic - uid: 34e4bbfc-222c-4968-bd60-2b30ae81110d -spec: - replicas: 1 - selector: - matchLabels: - app: basic - strategy: - canary: - steps: - - setWeight: 50 - - pause: {} - template: - metadata: - creationTimestamp: null - labels: - app: basic - spec: - containers: - - image: nginx:1.19-alpine - name: basic - resources: - requests: - cpu: 1m - memory: 16Mi -status: - HPAReplicas: 1 - availableReplicas: 1 - blueGreen: {} - canary: {} - conditions: - - lastTransitionTime: "2020-11-13T00:48:20Z" - lastUpdateTime: "2020-11-13T00:48:22Z" - message: ReplicaSet "basic-754cb84d5" has successfully progressed. - reason: NewReplicaSetAvailable - status: "True" - type: Progressing - - lastTransitionTime: "2020-11-13T00:48:22Z" - lastUpdateTime: "2020-11-13T00:48:22Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - currentPodHash: 754cb84d5 - currentStepHash: 757f5f97b - currentStepIndex: 2 - observedGeneration: "abc123" ## <---- uses legacy observedGeneration hash - readyReplicas: 1 - replicas: 1 - selector: app=basic - stableRS: 754cb84d5 - updatedReplicas: 1 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/healthy_legacy_v0.9_observedGeneration_numeric.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/healthy_legacy_v0.9_observedGeneration_numeric.yaml deleted file mode 100644 index 1281116..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/healthy_legacy_v0.9_observedGeneration_numeric.yaml +++ /dev/null @@ -1,60 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - creationTimestamp: "2020-11-13T00:44:55Z" - generation: 1 - name: basic - namespace: argocd-e2e - resourceVersion: "182108" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/argocd-e2e/rollouts/basic - uid: 34e4bbfc-222c-4968-bd60-2b30ae81110d -spec: - replicas: 1 - selector: - matchLabels: - app: basic - strategy: - canary: - steps: - - setWeight: 50 - - pause: {} - template: - metadata: - creationTimestamp: null - labels: - app: basic - spec: - containers: - - image: nginx:1.19-alpine - name: basic - resources: - requests: - cpu: 1m - memory: 16Mi -status: - HPAReplicas: 1 - availableReplicas: 1 - blueGreen: {} - canary: {} - conditions: - - lastTransitionTime: "2020-11-13T00:48:20Z" - lastUpdateTime: "2020-11-13T00:48:22Z" - message: ReplicaSet "basic-754cb84d5" has successfully progressed. - reason: NewReplicaSetAvailable - status: "True" - type: Progressing - - lastTransitionTime: "2020-11-13T00:48:22Z" - lastUpdateTime: "2020-11-13T00:48:22Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - currentPodHash: 754cb84d5 - currentStepHash: 757f5f97b - currentStepIndex: 2 - observedGeneration: "8575574967" ## <---- uses legacy observedGeneration hash which are numbers - readyReplicas: 1 - replicas: 1 - selector: app=basic - stableRS: 754cb84d5 - updatedReplicas: 1 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/healthy_legacy_v1.0_newWorkloadGeneration.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/healthy_legacy_v1.0_newWorkloadGeneration.yaml deleted file mode 100644 index f231ff5..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/healthy_legacy_v1.0_newWorkloadGeneration.yaml +++ /dev/null @@ -1,58 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: "1" - creationTimestamp: "2021-07-27T12:14:11Z" - generation: 3 - name: rollout-ref-deployment - namespace: default - resourceVersion: "4220" - uid: a3d1d224-ac4f-4f84-9274-e01e1d43b036 -spec: - replicas: 5 - strategy: - canary: - steps: - - setWeight: 20 - - pause: - duration: 10s - workloadRef: - apiVersion: apps/v1 - kind: Deployment - name: rollout-ref-deployment -status: - HPAReplicas: 5 - availableReplicas: 5 - blueGreen: {} - canary: {} - collisionCount: 1 - conditions: - - lastTransitionTime: "2021-07-27T12:14:21Z" - lastUpdateTime: "2021-07-27T12:14:21Z" - message: RolloutCompleted - reason: RolloutCompleted - status: "True" - type: Completed - - lastTransitionTime: "2021-07-27T12:14:11Z" - lastUpdateTime: "2021-07-27T12:14:21Z" - message: ReplicaSet "rollout-ref-deployment-75bbd56864" has successfully progressed. - reason: NewReplicaSetAvailable - status: "True" - type: Progressing - - lastTransitionTime: "2021-07-27T12:14:21Z" - lastUpdateTime: "2021-07-27T12:14:21Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - currentPodHash: 75bbd56864 - currentStepHash: 55f5d87bd9 - currentStepIndex: 2 - observedGeneration: "3" - phase: Healthy - readyReplicas: 5 - replicas: 5 - selector: app=rollout-ref-deployment - stableRS: 75bbd56864 - updatedReplicas: 5 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/healthy_newWorkloadGeneration.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/healthy_newWorkloadGeneration.yaml deleted file mode 100644 index 4418a81..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/healthy_newWorkloadGeneration.yaml +++ /dev/null @@ -1,60 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: "1" - rollout.argoproj.io/workload-generation: "1" - creationTimestamp: "2021-07-27T12:14:11Z" - generation: 3 - name: rollout-ref-deployment - namespace: default - resourceVersion: "4220" - uid: a3d1d224-ac4f-4f84-9274-e01e1d43b036 -spec: - replicas: 5 - strategy: - canary: - steps: - - setWeight: 20 - - pause: - duration: 10s - workloadRef: - apiVersion: apps/v1 - kind: Deployment - name: rollout-ref-deployment -status: - HPAReplicas: 5 - availableReplicas: 5 - blueGreen: {} - canary: {} - collisionCount: 1 - conditions: - - lastTransitionTime: "2021-07-27T12:14:21Z" - lastUpdateTime: "2021-07-27T12:14:21Z" - message: RolloutCompleted - reason: RolloutCompleted - status: "True" - type: Completed - - lastTransitionTime: "2021-07-27T12:14:11Z" - lastUpdateTime: "2021-07-27T12:14:21Z" - message: ReplicaSet "rollout-ref-deployment-75bbd56864" has successfully progressed. - reason: NewReplicaSetAvailable - status: "True" - type: Progressing - - lastTransitionTime: "2021-07-27T12:14:21Z" - lastUpdateTime: "2021-07-27T12:14:21Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - currentPodHash: 75bbd56864 - currentStepHash: 55f5d87bd9 - currentStepIndex: 2 - observedGeneration: "3" - phase: Healthy - readyReplicas: 5 - replicas: 5 - selector: app=rollout-ref-deployment - stableRS: 75bbd56864 - updatedReplicas: 5 - workloadObservedGeneration: "1" diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/newRolloutWithoutStatus.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/newRolloutWithoutStatus.yaml deleted file mode 100644 index 089529f..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/newRolloutWithoutStatus.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - creationTimestamp: "2020-11-13T00:44:55Z" - generation: 1 - name: basic - namespace: argocd-e2e - resourceVersion: "181938" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/argocd-e2e/rollouts/basic - uid: 34e4bbfc-222c-4968-bd60-2b30ae81110d -spec: - selector: - matchLabels: - app: basic - strategy: - canary: - steps: - - setWeight: 50 - - pause: {} - template: - metadata: - labels: - app: basic - spec: - containers: - - image: nginx:1.19-alpine - name: basic - resources: - requests: - cpu: 1m - memory: 16Mi diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/progressing_newGeneration.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/progressing_newGeneration.yaml deleted file mode 100644 index 1a45b71..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/progressing_newGeneration.yaml +++ /dev/null @@ -1,60 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - creationTimestamp: "2020-11-13T00:44:55Z" - generation: 2 - name: basic - namespace: argocd-e2e - resourceVersion: "182108" - selfLink: /apis/argoproj.io/v1alpha1/namespaces/argocd-e2e/rollouts/basic - uid: 34e4bbfc-222c-4968-bd60-2b30ae81110d -spec: - replicas: 1 - selector: - matchLabels: - app: basic - strategy: - canary: - steps: - - setWeight: 50 - - pause: {} - template: - metadata: - creationTimestamp: null - labels: - app: basic - spec: - containers: - - image: nginx:1.19-alpine - name: basic - resources: - requests: - cpu: 1m - memory: 16Mi -status: - HPAReplicas: 1 - availableReplicas: 1 - blueGreen: {} - canary: {} - conditions: - - lastTransitionTime: "2020-11-13T00:48:20Z" - lastUpdateTime: "2020-11-13T00:48:22Z" - message: ReplicaSet "basic-754cb84d5" has successfully progressed. - reason: NewReplicaSetAvailable - status: "True" - type: Progressing - - lastTransitionTime: "2020-11-13T00:48:22Z" - lastUpdateTime: "2020-11-13T00:48:22Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - currentPodHash: 754cb84d5 - currentStepHash: 757f5f97b - currentStepIndex: 2 - observedGeneration: "1" # <-- uses new integer observedGeneration - readyReplicas: 1 - replicas: 1 - selector: app=basic - stableRS: 754cb84d5 - updatedReplicas: 1 diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/progressing_newWorkloadGeneration.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/progressing_newWorkloadGeneration.yaml deleted file mode 100644 index bc5f0f4..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/progressing_newWorkloadGeneration.yaml +++ /dev/null @@ -1,60 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: "1" - rollout.argoproj.io/workload-generation: "2" - creationTimestamp: "2021-07-27T12:14:11Z" - generation: 3 - name: rollout-ref-deployment - namespace: default - resourceVersion: "4220" - uid: a3d1d224-ac4f-4f84-9274-e01e1d43b036 -spec: - replicas: 5 - strategy: - canary: - steps: - - setWeight: 20 - - pause: - duration: 10s - workloadRef: - apiVersion: apps/v1 - kind: Deployment - name: rollout-ref-deployment -status: - HPAReplicas: 5 - availableReplicas: 5 - blueGreen: {} - canary: {} - collisionCount: 1 - conditions: - - lastTransitionTime: "2021-07-27T12:14:21Z" - lastUpdateTime: "2021-07-27T12:14:21Z" - message: RolloutCompleted - reason: RolloutCompleted - status: "True" - type: Completed - - lastTransitionTime: "2021-07-27T12:14:11Z" - lastUpdateTime: "2021-07-27T12:14:21Z" - message: ReplicaSet "rollout-ref-deployment-75bbd56864" has successfully progressed. - reason: NewReplicaSetAvailable - status: "True" - type: Progressing - - lastTransitionTime: "2021-07-27T12:14:21Z" - lastUpdateTime: "2021-07-27T12:14:21Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - currentPodHash: 75bbd56864 - currentStepHash: 55f5d87bd9 - currentStepIndex: 2 - observedGeneration: "3" - phase: Healthy - readyReplicas: 5 - replicas: 5 - selector: app=rollout-ref-deployment - stableRS: 75bbd56864 - updatedReplicas: 5 - workloadObservedGeneration: "1" diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/suspended_controllerPause.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/suspended_controllerPause.yaml deleted file mode 100644 index a3b9af3..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/suspended_controllerPause.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - name: canary-demo - namespace: default -spec: - replicas: 5 - revisionHistoryLimit: 1 - selector: - matchLabels: - app: canary-demo - strategy: - canary: - canaryService: canary-demo-preview - steps: - - setWeight: 20 - - pause: {} - template: - metadata: - creationTimestamp: null - labels: - app: canary-demo - spec: - containers: - - image: argoproj/rollouts-demo:yellow - imagePullPolicy: Always - name: canary-demo -status: - HPAReplicas: 5 - availableReplicas: 5 - blueGreen: {} - canary: - stableRS: 75c96899b8 - conditions: - - lastTransitionTime: "2019-12-09T18:34:12Z" - lastUpdateTime: "2019-12-09T18:34:12Z" - message: Rollout is paused - reason: RolloutPaused - status: Unknown - type: Progressing - controllerPause: true - currentPodHash: 6758949f55 - currentStepHash: f64cdc9d - currentStepIndex: 1 - observedGeneration: 5b9f9dd6c6 - pauseConditions: - - reason: CanaryPauseStep - startTime: "2019-12-09T18:34:12Z" - readyReplicas: 5 - replicas: 5 - selector: app=canary-demo - updatedReplicas: 1 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/suspended_userPause.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/suspended_userPause.yaml deleted file mode 100644 index 66c958f..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/suspended_userPause.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - name: example-rollout-canary - namespace: default -spec: - paused: true - replicas: 5 - selector: - matchLabels: - app: guestbook - strategy: - canary: - steps: - - setWeight: 20 - - pause: {} - template: - metadata: - labels: - app: guestbook - spec: - containers: - - image: gcr.io/heptio-images/ks-guestbook-demo:0.2 - name: guestbook -status: - HPAReplicas: 5 - availableReplicas: 5 - blueGreen: {} - canary: - stableRS: df986d68 - conditions: - - lastTransitionTime: 2019-04-26T20:18:38Z - lastUpdateTime: 2019-04-26T20:18:38Z - message: Rollout is paused - reason: RolloutPaused - status: Unknown - type: Progressing - currentPodHash: 6b566f47b7 - currentStepHash: 6567fc959c - currentStepIndex: 1 - observedGeneration: 5c788f4484 - pauseStartTime: 2019-04-26T20:18:38Z - readyReplicas: 5 - replicas: 5 - selector: app=guestbook - updatedReplicas: 1 \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/Rollout/testdata/suspended_v1.0_pausedRollout.yaml b/pkg/resource_customizations/argoproj.io/Rollout/testdata/suspended_v1.0_pausedRollout.yaml deleted file mode 100644 index 9684a91..0000000 --- a/pkg/resource_customizations/argoproj.io/Rollout/testdata/suspended_v1.0_pausedRollout.yaml +++ /dev/null @@ -1,97 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Rollout -metadata: - annotations: - rollout.argoproj.io/revision: '2' - creationTimestamp: '2021-06-30T04:40:44Z' - generation: 5 - labels: - app.kubernetes.io/instance: rollouts-demo - name: rollouts-demo - namespace: rollouts-demo - resourceVersion: '4838641' - uid: bf946046-d90e-49b9-863c-76f82bed3b31 -spec: - replicas: 5 - revisionHistoryLimit: 1 - selector: - matchLabels: - app: rollouts-demo - strategy: - canary: - canaryService: rollouts-demo-desired - stableService: rollouts-demo-stable - steps: - - setWeight: 21 - - pause: {} - - setWeight: 40 - - pause: - duration: 10 - - setWeight: 60 - - pause: - duration: 10 - - setWeight: 80 - - pause: - duration: 10 - template: - metadata: - labels: - app: rollouts-demo - spec: - containers: - - image: 'argoproj/rollouts-demo:yellow' - imagePullPolicy: Always - name: rollouts-demo - ports: - - containerPort: 8080 - name: http - protocol: TCP - resources: - requests: - cpu: 5m - memory: 32Mi -status: - HPAReplicas: 6 - availableReplicas: 6 - blueGreen: {} - canary: {} - conditions: - - lastTransitionTime: '2021-06-30T05:01:22Z' - lastUpdateTime: '2021-06-30T05:01:22Z' - message: RolloutCompleted - reason: RolloutCompleted - status: 'False' - type: Completed - - lastTransitionTime: '2021-06-30T05:01:27Z' - lastUpdateTime: '2021-06-30T05:01:27Z' - message: Rollout has minimum availability - reason: AvailableReason - status: 'True' - type: Available - - lastTransitionTime: '2021-07-15T21:08:55Z' - lastUpdateTime: '2021-07-15T21:08:55Z' - message: Rollout is paused - reason: RolloutPaused - status: Unknown - type: Progressing - - lastTransitionTime: '2021-07-15T21:08:55Z' - lastUpdateTime: '2021-07-15T21:08:55Z' - message: Rollout is paused - reason: RolloutPaused - status: 'True' - type: Paused - controllerPause: true - currentPodHash: 8566c77b97 - currentStepHash: 7d5979db69 - currentStepIndex: 1 - message: CanaryPauseStep - observedGeneration: '5' - pauseConditions: - - reason: CanaryPauseStep - startTime: '2021-07-15T21:08:55Z' - phase: Paused - readyReplicas: 6 - replicas: 6 - selector: app=rollouts-demo - stableRS: 77f4f8ff97 - updatedReplicas: 2 diff --git a/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/action_test.yaml b/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/action_test.yaml deleted file mode 100644 index db503fe..0000000 --- a/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/action_test.yaml +++ /dev/null @@ -1,4 +0,0 @@ -actionTests: -- action: create-workflow - inputPath: testdata/workflowtemplate.yaml - expectedOutputPath: testdata/workflow.yaml diff --git a/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/create-workflow/action.lua b/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/create-workflow/action.lua deleted file mode 100644 index 66f5ec5..0000000 --- a/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/create-workflow/action.lua +++ /dev/null @@ -1,39 +0,0 @@ -local os = require("os") - --- This action constructs a Workflow resource from a WorkflowTemplate resource, to enable creating a WorkflowTemplate instance --- on demand. --- It returns an array with a single member - a table with the operation to perform (create) and the Workflow resource. --- It mimics the output of "argo submit --from=workflowtemplate/" command, declaratively. - --- This code is written to mimic what the Argo Workflows API server does to create a Workflow from a WorkflowTemplate. --- https://github.com/argoproj/argo-workflows/blob/873a58de7dd9dad76d5577b8c4294a58b52849b8/workflow/common/convert.go#L34 - -workflow = {} -workflow.apiVersion = "argoproj.io/v1alpha1" -workflow.kind = "Workflow" - -workflow.metadata = {} -workflow.metadata.name = obj.metadata.name .. "-" ..os.date("!%Y%m%d%H%M") -workflow.metadata.namespace = obj.metadata.namespace -workflow.metadata.labels = {} -workflow.metadata.labels["workflows.argoproj.io/workflow-template"] = obj.metadata.name - -workflow.spec = {} -workflow.spec.workflowTemplateRef = {} -workflow.spec.workflowTemplateRef.name = obj.metadata.name - -ownerRef = {} -ownerRef.apiVersion = obj.apiVersion -ownerRef.kind = obj.kind -ownerRef.name = obj.metadata.name -ownerRef.uid = obj.metadata.uid -workflow.metadata.ownerReferences = {} -workflow.metadata.ownerReferences[1] = ownerRef - -impactedResource = {} -impactedResource.operation = "create" -impactedResource.resource = workflow -result = {} -result[1] = impactedResource - -return result \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/discovery.lua b/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/discovery.lua deleted file mode 100644 index 5e16c6c..0000000 --- a/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/discovery.lua +++ /dev/null @@ -1,3 +0,0 @@ -actions = {} -actions["create-workflow"] = {} -return actions \ No newline at end of file diff --git a/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/testdata/workflow.yaml b/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/testdata/workflow.yaml deleted file mode 100644 index 46063be..0000000 --- a/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/testdata/workflow.yaml +++ /dev/null @@ -1,16 +0,0 @@ -- k8sOperation: create - unstructuredObj: - apiVersion: argoproj.io/v1alpha1 - kind: Workflow - metadata: - labels: - workflows.argoproj.io/workflow-template: workflow-template-submittable - name: workflow-template-submittable-202306221735 - namespace: default - ownerReferences: - - apiVersion: argoproj.io/v1alpha1 - kind: WorkflowTemplate - name: workflow-template-submittable - spec: - workflowTemplateRef: - name: workflow-template-submittable diff --git a/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/testdata/workflowtemplate.yaml b/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/testdata/workflowtemplate.yaml deleted file mode 100644 index 5b7d231..0000000 --- a/pkg/resource_customizations/argoproj.io/WorkflowTemplate/actions/testdata/workflowtemplate.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: WorkflowTemplate -metadata: - labels: - app.kubernetes.io/instance: test - name: workflow-template-submittable - namespace: default -spec: - arguments: - parameters: - - name: message - value: hello world - entrypoint: whalesay-template - templates: - - container: - args: - - '{{inputs.parameters.message}}' - command: - - cowsay - image: docker/whalesay - inputs: - parameters: - - name: message - name: whalesay-template diff --git a/pkg/resource_customizations/batch/CronJob/actions/action_test.yaml b/pkg/resource_customizations/batch/CronJob/actions/action_test.yaml deleted file mode 100644 index a9b5320..0000000 --- a/pkg/resource_customizations/batch/CronJob/actions/action_test.yaml +++ /dev/null @@ -1,4 +0,0 @@ -actionTests: -- action: create-job - inputPath: testdata/cronjob.yaml - expectedOutputPath: testdata/job.yaml diff --git a/pkg/resource_customizations/batch/CronJob/actions/create-job/action.lua b/pkg/resource_customizations/batch/CronJob/actions/create-job/action.lua deleted file mode 100644 index 119e0d3..0000000 --- a/pkg/resource_customizations/batch/CronJob/actions/create-job/action.lua +++ /dev/null @@ -1,58 +0,0 @@ -local os = require("os") - --- This action constructs a Job resource from a CronJob resource, to enable creating a CronJob instance on demand. --- It returns an array with a single member - a table with the operation to perform (create) and the Job resource. --- It mimics the output of "kubectl create job --from=" command, declaratively. - --- Deep-copying an object is a ChatGPT generated code. --- Since empty tables are treated as empty arrays, the resulting k8s resource might be invalid (arrays instead of maps). --- So empty tables are not cloned to the target object. -function deepCopy(object) - local lookup_table = {} - local function _copy(obj) - if type(obj) ~= "table" then - return obj - elseif lookup_table[obj] then - return lookup_table[obj] - elseif next(obj) == nil then - return nil - else - local new_table = {} - lookup_table[obj] = new_table - for key, value in pairs(obj) do - new_table[_copy(key)] = _copy(value) - end - return setmetatable(new_table, getmetatable(obj)) - end - end - return _copy(object) -end - -job = {} -job.apiVersion = "batch/v1" -job.kind = "Job" - -job.metadata = {} -job.metadata.name = obj.metadata.name .. "-" ..os.date("!%Y%m%d%H%M") -job.metadata.namespace = obj.metadata.namespace - -ownerRef = {} -ownerRef.apiVersion = obj.apiVersion -ownerRef.kind = obj.kind -ownerRef.name = obj.metadata.name -ownerRef.uid = obj.metadata.uid -job.metadata.ownerReferences = {} -job.metadata.ownerReferences[1] = ownerRef - -job.spec = {} -job.spec.suspend = false -job.spec.template = {} -job.spec.template.spec = deepCopy(obj.spec.jobTemplate.spec.template.spec) - -impactedResource = {} -impactedResource.operation = "create" -impactedResource.resource = job -result = {} -result[1] = impactedResource - -return result \ No newline at end of file diff --git a/pkg/resource_customizations/batch/CronJob/actions/discovery.lua b/pkg/resource_customizations/batch/CronJob/actions/discovery.lua deleted file mode 100644 index f90293c..0000000 --- a/pkg/resource_customizations/batch/CronJob/actions/discovery.lua +++ /dev/null @@ -1,3 +0,0 @@ -actions = {} -actions["create-job"] = {} -return actions \ No newline at end of file diff --git a/pkg/resource_customizations/batch/CronJob/actions/testdata/cronjob.yaml b/pkg/resource_customizations/batch/CronJob/actions/testdata/cronjob.yaml deleted file mode 100644 index 118fc83..0000000 --- a/pkg/resource_customizations/batch/CronJob/actions/testdata/cronjob.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: batch/v1 -kind: CronJob -metadata: - name: hello - namespace: test-ns - uid: "123" -spec: - schedule: "* * * * *" - jobTemplate: - spec: - template: - spec: - containers: - - name: hello - image: busybox:1.28 - imagePullPolicy: IfNotPresent - command: - - /bin/sh - - -c - - date; echo Hello from the Kubernetes cluster - resources: {} - restartPolicy: OnFailure \ No newline at end of file diff --git a/pkg/resource_customizations/batch/CronJob/actions/testdata/job.yaml b/pkg/resource_customizations/batch/CronJob/actions/testdata/job.yaml deleted file mode 100644 index cf0f92d..0000000 --- a/pkg/resource_customizations/batch/CronJob/actions/testdata/job.yaml +++ /dev/null @@ -1,19 +0,0 @@ -- k8sOperation: create - unstructuredObj: - apiVersion: batch/v1 - kind: Job - metadata: - name: hello-00000000000 - namespace: test-ns - spec: - template: - spec: - containers: - - name: hello - image: busybox:1.28 - imagePullPolicy: IfNotPresent - command: - - /bin/sh - - -c - - date; echo Hello from the Kubernetes cluster - restartPolicy: OnFailure \ No newline at end of file diff --git a/pkg/resource_customizations/bitnami.com/SealedSecret/health.lua b/pkg/resource_customizations/bitnami.com/SealedSecret/health.lua deleted file mode 100644 index 2e3bc3a..0000000 --- a/pkg/resource_customizations/bitnami.com/SealedSecret/health.lua +++ /dev/null @@ -1,20 +0,0 @@ -health_status={} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Synced" and condition.status == "False" then - health_status.status = "Degraded" - health_status.message = condition.message - return health_status - end - if condition.type == "Synced" and condition.status == "True" then - health_status.status = "Healthy" - health_status.message = condition.message - return health_status - end - end - end -end -health_status.status = "Progressing" -health_status.message = "Waiting for Sealed Secret to be decrypted" -return health_status diff --git a/pkg/resource_customizations/bitnami.com/SealedSecret/health_test.yaml b/pkg/resource_customizations/bitnami.com/SealedSecret/health_test.yaml deleted file mode 100644 index 8d26cf2..0000000 --- a/pkg/resource_customizations/bitnami.com/SealedSecret/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Waiting for Sealed Secret to be decrypted" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Degraded - message: "no key could decrypt secret (.dockerconfigjson)" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: "" - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/bitnami.com/SealedSecret/testdata/degraded.yaml b/pkg/resource_customizations/bitnami.com/SealedSecret/testdata/degraded.yaml deleted file mode 100644 index 01a2f6c..0000000 --- a/pkg/resource_customizations/bitnami.com/SealedSecret/testdata/degraded.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - labels: - app.kubernetes.io/instance: sealed-secrets - name: test - namespace: test -spec: - encryptedData: - .dockerconfigjson: xyz - template: - metadata: - creationTimestamp: null - name: test - namespace: test - type: kubernetes.io/dockerconfigjson -status: - conditions: - - lastTransitionTime: "2021-02-11T15:56:29Z" - lastUpdateTime: "2021-02-11T15:57:37Z" - message: no key could decrypt secret (.dockerconfigjson) - status: "False" - type: Synced - observedGeneration: 1 \ No newline at end of file diff --git a/pkg/resource_customizations/bitnami.com/SealedSecret/testdata/healthy.yaml b/pkg/resource_customizations/bitnami.com/SealedSecret/testdata/healthy.yaml deleted file mode 100644 index b713453..0000000 --- a/pkg/resource_customizations/bitnami.com/SealedSecret/testdata/healthy.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - labels: - app.kubernetes.io/instance: sealed-secrets - name: test - namespace: test -spec: - encryptedData: - .dockerconfigjson: xyz - template: - metadata: - creationTimestamp: null - name: test - namespace: test - type: kubernetes.io/dockerconfigjson -status: - conditions: - - lastTransitionTime: "2021-02-11T15:56:29Z" - lastUpdateTime: "2021-02-11T15:57:37Z" - message: "" - status: "True" - type: Synced - observedGeneration: 1 \ No newline at end of file diff --git a/pkg/resource_customizations/bitnami.com/SealedSecret/testdata/progressing.yaml b/pkg/resource_customizations/bitnami.com/SealedSecret/testdata/progressing.yaml deleted file mode 100644 index f8d51f3..0000000 --- a/pkg/resource_customizations/bitnami.com/SealedSecret/testdata/progressing.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - labels: - app.kubernetes.io/instance: sealed-secrets - name: test - namespace: test -spec: - encryptedData: - .dockerconfigjson: xyz - template: - metadata: - creationTimestamp: null - name: test - namespace: test - type: kubernetes.io/dockerconfigjson diff --git a/pkg/resource_customizations/cassandra.rook.io/Cluster/health.lua b/pkg/resource_customizations/cassandra.rook.io/Cluster/health.lua deleted file mode 100644 index 5bf48f6..0000000 --- a/pkg/resource_customizations/cassandra.rook.io/Cluster/health.lua +++ /dev/null @@ -1,24 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.racks ~= nil then - all_racks_good = true - for key, value in pairs(obj.status.racks) do - if all_racks_good and value.members ~= nil and value.readyMembers ~= nil and value.members ~= value.readyMembers then - all_racks_good = false - break - end - end - if all_racks_good then - hs.status = "Healthy" - else - hs.status = "Progressing" - hs.message = "Waiting for Cassandra Cluster" - end - return hs - end -end - -hs.status = "Progressing" -hs.message = "Waiting for Cassandra Cluster" -return hs - diff --git a/pkg/resource_customizations/cassandra.rook.io/Cluster/health_test.yaml b/pkg/resource_customizations/cassandra.rook.io/Cluster/health_test.yaml deleted file mode 100644 index 2f7b7b5..0000000 --- a/pkg/resource_customizations/cassandra.rook.io/Cluster/health_test.yaml +++ /dev/null @@ -1,9 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Waiting for Cassandra Cluster" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Healthy - message: "" - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/cassandra.rook.io/Cluster/testdata/healthy.yaml b/pkg/resource_customizations/cassandra.rook.io/Cluster/testdata/healthy.yaml deleted file mode 100644 index b42422a..0000000 --- a/pkg/resource_customizations/cassandra.rook.io/Cluster/testdata/healthy.yaml +++ /dev/null @@ -1,96 +0,0 @@ -apiVersion: cassandra.rook.io/v1alpha1 -kind: Cluster -metadata: - name: rook-cassandra - namespace: rook-cassandra -spec: - version: 3.11.6 - repository: my-private-repo.io/cassandra - mode: cassandra - # A key/value list of annotations - annotations: - # key: value - datacenter: - name: us-east-1 - racks: - - name: us-east-1a - members: 3 - storage: - volumeClaimTemplates: - - metadata: - name: rook-cassandra-data - spec: - storageClassName: my-storage-class - resources: - requests: - storage: 200Gi - resources: - requests: - cpu: 8 - memory: 32Gi - limits: - cpu: 8 - memory: 32Gi - - name: us-east-1b - members: 3 - storage: - volumeClaimTemplates: - - metadata: - name: rook-cassandra-data - spec: - storageClassName: my-storage-class - resources: - requests: - storage: 200Gi - resources: - requests: - cpu: 8 - memory: 32Gi - limits: - cpu: 8 - memory: 32Gi - - name: us-east-1c - members: 3 - storage: - volumeClaimTemplates: - - metadata: - name: rook-cassandra-data - spec: - storageClassName: my-storage-class - resources: - requests: - storage: 200Gi - resources: - requests: - cpu: 8 - memory: 32Gi - limits: - cpu: 8 - memory: 32Gi - # A key/value list of annotations - annotations: - # key: value - placement: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: topology.kubernetes.io/region - operator: In - values: - - us-east-1 - - key: topology.kubernetes.io/zone - operator: In - values: - - us-east-1a -status: - racks: - us-east-1a: - members: 3 - readyMembers: 3 - us-east-1b: - members: 3 - readyMembers: 3 - us-east-1c: - members: 3 - readyMembers: 3 diff --git a/pkg/resource_customizations/cassandra.rook.io/Cluster/testdata/progressing.yaml b/pkg/resource_customizations/cassandra.rook.io/Cluster/testdata/progressing.yaml deleted file mode 100644 index 4034bec..0000000 --- a/pkg/resource_customizations/cassandra.rook.io/Cluster/testdata/progressing.yaml +++ /dev/null @@ -1,96 +0,0 @@ -apiVersion: cassandra.rook.io/v1alpha1 -kind: Cluster -metadata: - name: rook-cassandra - namespace: rook-cassandra -spec: - version: 3.11.6 - repository: my-private-repo.io/cassandra - mode: cassandra - # A key/value list of annotations - annotations: - # key: value - datacenter: - name: us-east-1 - racks: - - name: us-east-1a - members: 3 - storage: - volumeClaimTemplates: - - metadata: - name: rook-cassandra-data - spec: - storageClassName: my-storage-class - resources: - requests: - storage: 200Gi - resources: - requests: - cpu: 8 - memory: 32Gi - limits: - cpu: 8 - memory: 32Gi - - name: us-east-1b - members: 3 - storage: - volumeClaimTemplates: - - metadata: - name: rook-cassandra-data - spec: - storageClassName: my-storage-class - resources: - requests: - storage: 200Gi - resources: - requests: - cpu: 8 - memory: 32Gi - limits: - cpu: 8 - memory: 32Gi - - name: us-east-1c - members: 3 - storage: - volumeClaimTemplates: - - metadata: - name: rook-cassandra-data - spec: - storageClassName: my-storage-class - resources: - requests: - storage: 200Gi - resources: - requests: - cpu: 8 - memory: 32Gi - limits: - cpu: 8 - memory: 32Gi - # A key/value list of annotations - annotations: - # key: value - placement: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: topology.kubernetes.io/region - operator: In - values: - - us-east-1 - - key: topology.kubernetes.io/zone - operator: In - values: - - us-east-1a -status: - racks: - us-east-1a: - members: 3 - readyMembers: 1 - us-east-1b: - members: 3 - readyMembers: 0 - us-east-1c: - members: 3 - readyMembers: 3 diff --git a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/health.lua b/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/health.lua deleted file mode 100644 index 73cdef2..0000000 --- a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/health.lua +++ /dev/null @@ -1,25 +0,0 @@ -hs = { status="Progressing", message="No status available"} -if obj.status ~= nil then - if obj.status.phase ~= nil then - hs.message = obj.status.phase - if hs.message == "Succeeded" then - hs.status = "Healthy" - return hs - elseif hs.message == "Failed" or hs.message == "Unknown" then - hs.status = "Degraded" - elseif hs.message == "Paused" then - hs.status = "Suspended" - return hs - end - end - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Running" and condition.status == "False" and condition.reason == "Error" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - end - end -end -return hs diff --git a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/health_test.yaml b/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/health_test.yaml deleted file mode 100644 index 4f6ad1d..0000000 --- a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "No status available" - inputPath: testdata/progressing_nostatus.yaml -- healthStatus: - status: Progressing - message: "ImportInProgress" - inputPath: testdata/progressing_importing.yaml -- healthStatus: - status: Healthy - message: "Succeeded" - inputPath: testdata/healthy_succeeded.yaml -- healthStatus: - status: Progressing - message: "ImportScheduled" - inputPath: testdata/progressing_containercreating.yaml -- healthStatus: - status: Degraded - message: "Unable to connect to http data source: expected status code 200, got 404. Status: 404 Not Found" - inputPath: testdata/degraded_badurl.yaml diff --git a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/degraded_badurl.yaml b/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/degraded_badurl.yaml deleted file mode 100644 index 409553c..0000000 --- a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/degraded_badurl.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: cdi.kubevirt.io/v1beta1 -kind: DataVolume -metadata: - creationTimestamp: "2021-10-25T22:23:10Z" - generation: 14 - name: example-badimport-dv - namespace: default - resourceVersion: "44636962" - uid: 8d55b149-d418-47d6-b60b-48d823142418 -spec: - pvc: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - source: - http: - url: https://download.fedoraproject.org/pub/no-such-image.xz -status: - conditions: - - lastHeartbeatTime: "2021-10-25T22:23:15Z" - lastTransitionTime: "2021-10-25T22:23:15Z" - message: PVC example-badimport-dv Bound - reason: Bound - status: "True" - type: Bound - - lastHeartbeatTime: "2021-10-25T22:23:47Z" - lastTransitionTime: "2021-10-25T22:23:10Z" - status: "False" - type: Ready - - lastHeartbeatTime: "2021-10-25T22:23:47Z" - lastTransitionTime: "2021-10-25T22:23:47Z" - message: 'Unable to connect to http data source: expected status code 200, got - 404. Status: 404 Not Found' - reason: Error - status: "False" - type: Running - phase: ImportInProgress - progress: N/A - restartCount: 2 diff --git a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/healthy_succeeded.yaml b/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/healthy_succeeded.yaml deleted file mode 100644 index f15a5ae..0000000 --- a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/healthy_succeeded.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: cdi.kubevirt.io/v1beta1 -kind: DataVolume -metadata: - annotations: - cdi.kubevirt.io/storage.bind.immediate.requested: "true" - kubevirt.ui/provider: fedora - labels: - app.kubernetes.io/instance: datavolumes - name: fedora - namespace: openshift-virtualization-os-images -spec: - pvc: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 20Gi - volumeMode: Filesystem - source: - http: - url: https://mirror.arizona.edu/fedora/linux/releases/34/Cloud/x86_64/images/Fedora-Cloud-Base-34-1.2.x86_64.raw.xz -status: - conditions: - - lastHeartbeatTime: "2021-08-30T21:31:52Z" - lastTransitionTime: "2021-08-30T21:31:52Z" - message: PVC fedora Bound - reason: Bound - status: "True" - type: Bound - - lastHeartbeatTime: "2021-08-30T21:34:36Z" - lastTransitionTime: "2021-08-30T21:34:36Z" - status: "True" - type: Ready - - lastHeartbeatTime: "2021-08-30T21:34:36Z" - lastTransitionTime: "2021-08-30T21:34:36Z" - message: Import Complete - reason: Completed - status: "False" - type: Running - phase: Succeeded - progress: 100.0% diff --git a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/progressing_containercreating.yaml b/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/progressing_containercreating.yaml deleted file mode 100644 index b4bf917..0000000 --- a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/progressing_containercreating.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: cdi.kubevirt.io/v1beta1 -kind: DataVolume -metadata: - creationTimestamp: "2021-10-25T22:23:10Z" - name: example-badimport-dv - namespace: default -spec: - pvc: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - source: - http: - url: https://download.fedoraproject.org/pub/no-such-image.xz -status: - conditions: - - lastHeartbeatTime: "2021-10-25T22:23:15Z" - lastTransitionTime: "2021-10-25T22:23:15Z" - message: PVC example-badimport-dv Bound - reason: Bound - status: "True" - type: Bound - - lastHeartbeatTime: "2021-10-25T22:23:10Z" - lastTransitionTime: "2021-10-25T22:23:10Z" - status: "False" - type: Ready - - lastHeartbeatTime: "2021-10-25T22:23:15Z" - lastTransitionTime: "2021-10-25T22:23:10Z" - reason: ContainerCreating - status: "False" - type: Running - phase: ImportScheduled - progress: N/A diff --git a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/progressing_importing.yaml b/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/progressing_importing.yaml deleted file mode 100644 index 86da35f..0000000 --- a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/progressing_importing.yaml +++ /dev/null @@ -1,42 +0,0 @@ -apiVersion: cdi.kubevirt.io/v1beta1 -kind: DataVolume -metadata: - annotations: - cdi.kubevirt.io/storage.bind.immediate.requested: "true" - kubevirt.ui/provider: centos - labels: - app.kubernetes.io/instance: datavolumes - name: centos8 - namespace: openshift-virtualization-os-images -spec: - pvc: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 20Gi - volumeMode: Filesystem - source: - http: - url: https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-20210603.0.x86_64.qcow2 -status: - conditions: - - lastHeartbeatTime: "2021-09-07T15:24:46Z" - lastTransitionTime: "2021-09-07T15:24:46Z" - message: PVC centos8 Bound - reason: Bound - status: "True" - type: Bound - - lastHeartbeatTime: "2021-09-07T15:25:33Z" - lastTransitionTime: "2021-09-07T15:24:37Z" - reason: TransferRunning - status: "False" - type: Ready - - lastHeartbeatTime: "2021-09-07T15:24:55Z" - lastTransitionTime: "2021-09-07T15:24:55Z" - reason: Pod is running - status: "True" - type: Running - phase: ImportInProgress - progress: 2.00% - diff --git a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/progressing_nostatus.yaml b/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/progressing_nostatus.yaml deleted file mode 100644 index a7c6f0f..0000000 --- a/pkg/resource_customizations/cdi.kubevirt.io/DataVolume/testdata/progressing_nostatus.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: cdi.kubevirt.io/v1beta1 -kind: DataVolume -metadata: - annotations: - cdi.kubevirt.io/storage.bind.immediate.requested: "true" - kubevirt.ui/provider: centos - labels: - app.kubernetes.io/instance: datavolumes - name: centos8 - namespace: openshift-virtualization-os-images -spec: - pvc: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 20Gi - volumeMode: Filesystem - source: - http: - url: https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-20210603.0.x86_64.qcow2 -status: {} diff --git a/pkg/resource_customizations/cert-manager.io/Certificate/health.lua b/pkg/resource_customizations/cert-manager.io/Certificate/health.lua deleted file mode 100644 index 209ebb5..0000000 --- a/pkg/resource_customizations/cert-manager.io/Certificate/health.lua +++ /dev/null @@ -1,26 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Issuing" and condition.status == "True" then - hs.status = "Progressing" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "False" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - end - end -end - -hs.status = "Progressing" -hs.message = "Waiting for certificate" -return hs diff --git a/pkg/resource_customizations/cert-manager.io/Certificate/health_test.yaml b/pkg/resource_customizations/cert-manager.io/Certificate/health_test.yaml deleted file mode 100644 index ebf8e75..0000000 --- a/pkg/resource_customizations/cert-manager.io/Certificate/health_test.yaml +++ /dev/null @@ -1,22 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: Waiting for certificate - inputPath: testdata/progressing_noStatus.yaml -- healthStatus: - status: Progressing - message: Issuing certificate as Secret does not exist - inputPath: testdata/progressing_issuing.yaml -- healthStatus: - status: Degraded - message: 'Resource validation failed: spec.acme.config: Required value: no ACME - solver configuration specified for domain "cd.apps.argoproj.io"' - inputPath: testdata/degraded_configError.yaml -- healthStatus: - status: Healthy - message: 'Certificate issued successfully' - inputPath: testdata/healthy_issued.yaml -- healthStatus: - status: Healthy - message: 'Certificate renewed successfully' - inputPath: testdata/healthy_renewed.yaml diff --git a/pkg/resource_customizations/cert-manager.io/Certificate/testdata/degraded_configError.yaml b/pkg/resource_customizations/cert-manager.io/Certificate/testdata/degraded_configError.yaml deleted file mode 100644 index 335d42f..0000000 --- a/pkg/resource_customizations/cert-manager.io/Certificate/testdata/degraded_configError.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: cert-manager.io/v1alpha2 -kind: Certificate -metadata: - annotations: - kubectl.kubernetes.io/last-applied-configuration: | - {"apiVersion":"cert-manager.io/v1alpha2","kind":"Certificate","metadata":{"annotations":{},"name":"test-cert","namespace":"argocd"},"spec":{"acme":{"config":[{"domains":["cd.apps.argoproj.io"],"http01":{"ingress":"http01"}}]},"commonName":"cd.apps.argoproj.io","dnsNames":["cd.apps.argoproj.io"],"issuerRef":{"kind":"Issuer","name":"argo-cd-issuer"}}} - creationTimestamp: "2019-02-15T18:17:06Z" - generation: 1 - name: test-cert - namespace: argocd - resourceVersion: "68338442" - selfLink: /apis/cert-manager.io/v1alpha2/namespaces/argocd/certificates/test-cert - uid: e6cfba50-314d-11e9-be3f-42010a800011 -spec: - acme: - config: - - domains: - - cd.apps.argoproj.io123 - http01: - ingress: http01 - commonName: cd.apps.argoproj.io - dnsNames: - - cd.apps.argoproj.io - issuerRef: - kind: Issuer - name: argo-cd-issuer - secretName: test-secret -status: - conditions: - - lastTransitionTime: "2019-02-15T18:26:37Z" - message: 'Resource validation failed: spec.acme.config: Required value: no ACME - solver configuration specified for domain "cd.apps.argoproj.io"' - reason: ConfigError - status: "False" - type: Ready diff --git a/pkg/resource_customizations/cert-manager.io/Certificate/testdata/healthy_issued.yaml b/pkg/resource_customizations/cert-manager.io/Certificate/testdata/healthy_issued.yaml deleted file mode 100644 index c6c2b90..0000000 --- a/pkg/resource_customizations/cert-manager.io/Certificate/testdata/healthy_issued.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: cert-manager.io/v1alpha2 -kind: Certificate -metadata: - creationTimestamp: "2019-02-15T18:17:06Z" - generation: 1 - name: test-cert - namespace: argocd - resourceVersion: "68337322" - selfLink: /apis/cert-manager.io/v1alpha2/namespaces/argocd/certificates/test-cert - uid: e6cfba50-314d-11e9-be3f-42010a800011 -spec: - acme: - config: - - domains: - - cd.apps.argoproj.io - http01: - ingress: http01 - commonName: cd.apps.argoproj.io - dnsNames: - - cd.apps.argoproj.io - issuerRef: - kind: Issuer - name: argo-cd-issuer - secretName: test-secret -status: - acme: - order: - url: https://acme-v02.api.letsencrypt.org/acme/order/45250083/316944902 - conditions: - - lastTransitionTime: "2019-02-15T18:21:10Z" - message: Order validated - reason: OrderValidated - status: "False" - type: ValidateFailed - - lastTransitionTime: null - message: Certificate issued successfully - reason: CertIssued - status: "True" - type: Ready diff --git a/pkg/resource_customizations/cert-manager.io/Certificate/testdata/healthy_renewed.yaml b/pkg/resource_customizations/cert-manager.io/Certificate/testdata/healthy_renewed.yaml deleted file mode 100644 index 7bc66f2..0000000 --- a/pkg/resource_customizations/cert-manager.io/Certificate/testdata/healthy_renewed.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: cert-manager.io/v1alpha2 -kind: Certificate -metadata: - creationTimestamp: '2018-11-07T00:06:12Z' - generation: 1 - name: test-cert - namespace: argocd - resourceVersion: '64763033' - selfLink: /apis/cert-manager.io/v1alpha2/namespaces/argocd/certificates/test-cert - uid: e6cfba50-314d-11e9-be3f-42010a800011 -spec: - acme: - config: - - domains: - - cd.apps.argoproj.io - http01: - ingress: http01 - commonName: cd.apps.argoproj.io - dnsNames: - - cd.apps.argoproj.io - issuerRef: - kind: Issuer - name: argo-cd-issuer - secretName: test-secret -status: - acme: - order: - url: 'https://acme-v02.api.letsencrypt.org/acme/order/45250083/298963150' - conditions: - - lastTransitionTime: '2019-02-03T09:48:13Z' - message: Certificate renewed successfully - reason: CertRenewed - status: 'True' - type: Ready - - lastTransitionTime: '2019-02-03T09:48:11Z' - message: Order validated - reason: OrderValidated - status: 'False' - type: ValidateFailed diff --git a/pkg/resource_customizations/cert-manager.io/Certificate/testdata/progressing_issuing.yaml b/pkg/resource_customizations/cert-manager.io/Certificate/testdata/progressing_issuing.yaml deleted file mode 100644 index acde21e..0000000 --- a/pkg/resource_customizations/cert-manager.io/Certificate/testdata/progressing_issuing.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: cert-manager.io/v1alpha2 -kind: Certificate -metadata: - creationTimestamp: '2018-11-07T00:06:12Z' - generation: 1 - name: test-cert - namespace: argocd - resourceVersion: '64763033' - selfLink: /apis/cert-manager.io/v1alpha2/namespaces/argocd/certificates/test-cert - uid: e6cfba50-314d-11e9-be3f-42010a800011 -spec: - acme: - config: - - domains: - - cd.apps.argoproj.io - http01: - ingress: http01 - commonName: cd.apps.argoproj.io - dnsNames: - - cd.apps.argoproj.io - issuerRef: - kind: Issuer - name: argo-cd-issuer - secretName: test-secret -status: - conditions: - - lastTransitionTime: '2021-09-15T02:10:00Z' - message: Issuing certificate as Secret does not exist - reason: DoesNotExist - status: 'True' - type: Issuing - - lastTransitionTime: '2021-09-15T02:10:00Z' - message: Issuing certificate as Secret does not exist - reason: DoesNotExist - status: 'False' - type: Ready - diff --git a/pkg/resource_customizations/cert-manager.io/Certificate/testdata/progressing_noStatus.yaml b/pkg/resource_customizations/cert-manager.io/Certificate/testdata/progressing_noStatus.yaml deleted file mode 100644 index 1d8edfc..0000000 --- a/pkg/resource_customizations/cert-manager.io/Certificate/testdata/progressing_noStatus.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: cert-manager.io/v1alpha2 -kind: Certificate -metadata: - creationTimestamp: '2018-11-07T00:06:12Z' - generation: 1 - name: test-cert - namespace: argocd - resourceVersion: '64763033' - selfLink: /apis/cert-manager.io/v1alpha2/namespaces/argocd/certificates/test-cert - uid: e6cfba50-314d-11e9-be3f-42010a800011 -spec: - acme: - config: - - domains: - - cd.apps.argoproj.io - http01: - ingress: http01 - commonName: cd.apps.argoproj.io - dnsNames: - - cd.apps.argoproj.io - issuerRef: - kind: Issuer - name: argo-cd-issuer - secretName: test-secret diff --git a/pkg/resource_customizations/cert-manager.io/ClusterIssuer/health.lua b/pkg/resource_customizations/cert-manager.io/ClusterIssuer/health.lua deleted file mode 100644 index 79945c4..0000000 --- a/pkg/resource_customizations/cert-manager.io/ClusterIssuer/health.lua +++ /dev/null @@ -1,21 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" and condition.status == "False" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - end - end -end - -hs.status = "Progressing" -hs.message = "Initializing ClusterIssuer" -return hs diff --git a/pkg/resource_customizations/cert-manager.io/ClusterIssuer/health_test.yaml b/pkg/resource_customizations/cert-manager.io/ClusterIssuer/health_test.yaml deleted file mode 100644 index 1eda5cf..0000000 --- a/pkg/resource_customizations/cert-manager.io/ClusterIssuer/health_test.yaml +++ /dev/null @@ -1,14 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: Initializing ClusterIssuer - inputPath: testdata/progressing_noStatus.yaml -- healthStatus: - status: Healthy - message: The ACME account was registered with the ACME server - inputPath: testdata/healthy_registered.yaml -- healthStatus: - status: Degraded - message: "Failed to verify ACME account: acme: : 404 page not found\n" - inputPath: testdata/degraded_acmeFailed.yaml - diff --git a/pkg/resource_customizations/cert-manager.io/ClusterIssuer/testdata/degraded_acmeFailed.yaml b/pkg/resource_customizations/cert-manager.io/ClusterIssuer/testdata/degraded_acmeFailed.yaml deleted file mode 100644 index 75a249f..0000000 --- a/pkg/resource_customizations/cert-manager.io/ClusterIssuer/testdata/degraded_acmeFailed.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: ClusterIssuer -metadata: - creationTimestamp: "2019-02-15T19:23:48Z" - generation: 1 - name: test-issuer - resourceVersion: "68352438" - uid: 37f408e3-3157-11e9-be3f-42010a800011 -spec: - acme: - email: myemail@test.com - http01: {} - privateKeySecretRef: - key: "" - name: letsencrypt - server: https://acme-v02.api.letsencrypt.org/directory124 -status: - acme: - uri: "" - conditions: - - lastTransitionTime: "2019-02-15T19:23:53Z" - message: | - Failed to verify ACME account: acme: : 404 page not found - reason: ErrRegisterACMEAccount - status: "False" - type: Ready diff --git a/pkg/resource_customizations/cert-manager.io/ClusterIssuer/testdata/healthy_registered.yaml b/pkg/resource_customizations/cert-manager.io/ClusterIssuer/testdata/healthy_registered.yaml deleted file mode 100644 index edad502..0000000 --- a/pkg/resource_customizations/cert-manager.io/ClusterIssuer/testdata/healthy_registered.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: ClusterIssuer -metadata: - creationTimestamp: "2018-11-06T23:14:18Z" - generation: 1 - name: test-issuer - resourceVersion: "48889060" - uid: b0045219-e219-11e8-9f93-42010a80021d -spec: - acme: - email: myemail@test.com - http01: {} - privateKeySecretRef: - key: "" - name: letsencrypt - server: https://acme-v02.api.letsencrypt.org/directory -status: - acme: - uri: https://acme-v02.api.letsencrypt.org/acme/acct/45250083 - conditions: - - lastTransitionTime: "2018-12-06T06:42:59Z" - message: The ACME account was registered with the ACME server - reason: ACMEAccountRegistered - status: "True" - type: Ready diff --git a/pkg/resource_customizations/cert-manager.io/ClusterIssuer/testdata/progressing_noStatus.yaml b/pkg/resource_customizations/cert-manager.io/ClusterIssuer/testdata/progressing_noStatus.yaml deleted file mode 100644 index b05c4ae..0000000 --- a/pkg/resource_customizations/cert-manager.io/ClusterIssuer/testdata/progressing_noStatus.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: ClusterIssuer -metadata: - creationTimestamp: "2018-11-06T23:14:18Z" - generation: 1 - name: test-issuer - resourceVersion: "48889060" - uid: b0045219-e219-11e8-9f93-42010a80021d -spec: - acme: - email: myemail@test.com - http01: {} - privateKeySecretRef: - key: "" - name: letsencrypt - server: https://acme-v02.api.letsencrypt.org/directory diff --git a/pkg/resource_customizations/cert-manager.io/Issuer/health.lua b/pkg/resource_customizations/cert-manager.io/Issuer/health.lua deleted file mode 100644 index 2626e18..0000000 --- a/pkg/resource_customizations/cert-manager.io/Issuer/health.lua +++ /dev/null @@ -1,21 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" and condition.status == "False" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - end - end -end - -hs.status = "Progressing" -hs.message = "Initializing issuer" -return hs diff --git a/pkg/resource_customizations/cert-manager.io/Issuer/health_test.yaml b/pkg/resource_customizations/cert-manager.io/Issuer/health_test.yaml deleted file mode 100644 index e48df5e..0000000 --- a/pkg/resource_customizations/cert-manager.io/Issuer/health_test.yaml +++ /dev/null @@ -1,14 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: Initializing issuer - inputPath: testdata/progressing_noStatus.yaml -- healthStatus: - status: Healthy - message: The ACME account was registered with the ACME server - inputPath: testdata/healthy_registered.yaml -- healthStatus: - status: Degraded - message: "Failed to verify ACME account: acme: : 404 page not found\n" - inputPath: testdata/degraded_acmeFailed.yaml - diff --git a/pkg/resource_customizations/cert-manager.io/Issuer/testdata/degraded_acmeFailed.yaml b/pkg/resource_customizations/cert-manager.io/Issuer/testdata/degraded_acmeFailed.yaml deleted file mode 100644 index 62226e3..0000000 --- a/pkg/resource_customizations/cert-manager.io/Issuer/testdata/degraded_acmeFailed.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: cert-manager.io/v1alpha2 -kind: Issuer -metadata: - creationTimestamp: "2019-02-15T19:23:48Z" - generation: 1 - name: test-issuer - namespace: argocd - resourceVersion: "68352438" - selfLink: /apis/cert-manager.io/v1alpha2/namespaces/argocd/issuers/test-issuer - uid: 37f408e3-3157-11e9-be3f-42010a800011 -spec: - acme: - email: myemail@test.com - http01: {} - privateKeySecretRef: - key: "" - name: letsencrypt - server: https://acme-v02.api.letsencrypt.org/directory124 -status: - acme: - uri: "" - conditions: - - lastTransitionTime: "2019-02-15T19:23:53Z" - message: | - Failed to verify ACME account: acme: : 404 page not found - reason: ErrRegisterACMEAccount - status: "False" - type: Ready diff --git a/pkg/resource_customizations/cert-manager.io/Issuer/testdata/healthy_registered.yaml b/pkg/resource_customizations/cert-manager.io/Issuer/testdata/healthy_registered.yaml deleted file mode 100644 index 08b9639..0000000 --- a/pkg/resource_customizations/cert-manager.io/Issuer/testdata/healthy_registered.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: cert-manager.io/v1alpha2 -kind: Issuer -metadata: - creationTimestamp: "2018-11-06T23:14:18Z" - generation: 1 - name: test-issuer - namespace: argocd - resourceVersion: "48889060" - selfLink: /apis/cert-manager.io/v1alpha2/namespaces/argocd/issuers/argo-cd-issuer - uid: b0045219-e219-11e8-9f93-42010a80021d -spec: - acme: - email: myemail@test.com - http01: {} - privateKeySecretRef: - key: "" - name: letsencrypt - server: https://acme-v02.api.letsencrypt.org/directory -status: - acme: - uri: https://acme-v02.api.letsencrypt.org/acme/acct/45250083 - conditions: - - lastTransitionTime: "2018-12-06T06:42:59Z" - message: The ACME account was registered with the ACME server - reason: ACMEAccountRegistered - status: "True" - type: Ready diff --git a/pkg/resource_customizations/cert-manager.io/Issuer/testdata/progressing_noStatus.yaml b/pkg/resource_customizations/cert-manager.io/Issuer/testdata/progressing_noStatus.yaml deleted file mode 100644 index 820182e..0000000 --- a/pkg/resource_customizations/cert-manager.io/Issuer/testdata/progressing_noStatus.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: cert-manager.io/v1alpha2 -kind: Issuer -metadata: - creationTimestamp: "2018-11-06T23:14:18Z" - generation: 1 - name: test-issuer - namespace: argocd - resourceVersion: "48889060" - selfLink: /apis/cert-manager.io/v1alpha2/namespaces/argocd/issuers/argo-cd-issuer - uid: b0045219-e219-11e8-9f93-42010a80021d -spec: - acme: - email: myemail@test.com - http01: {} - privateKeySecretRef: - key: "" - name: letsencrypt - server: https://acme-v02.api.letsencrypt.org/directory diff --git a/pkg/resource_customizations/certmanager.k8s.io/Certificate/health.lua b/pkg/resource_customizations/certmanager.k8s.io/Certificate/health.lua deleted file mode 100644 index 61b28c8..0000000 --- a/pkg/resource_customizations/certmanager.k8s.io/Certificate/health.lua +++ /dev/null @@ -1,21 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" and condition.status == "False" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - end - end -end - -hs.status = "Progressing" -hs.message = "Waiting for certificate" -return hs diff --git a/pkg/resource_customizations/certmanager.k8s.io/Certificate/health_test.yaml b/pkg/resource_customizations/certmanager.k8s.io/Certificate/health_test.yaml deleted file mode 100644 index 9b00429..0000000 --- a/pkg/resource_customizations/certmanager.k8s.io/Certificate/health_test.yaml +++ /dev/null @@ -1,18 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: Waiting for certificate - inputPath: testdata/progressing_noStatus.yaml -- healthStatus: - status: Degraded - message: 'Resource validation failed: spec.acme.config: Required value: no ACME - solver configuration specified for domain "cd.apps.argoproj.io"' - inputPath: testdata/degraded_configError.yaml -- healthStatus: - status: Healthy - message: 'Certificate issued successfully' - inputPath: testdata/healthy_issued.yaml -- healthStatus: - status: Healthy - message: 'Certificate renewed successfully' - inputPath: testdata/healthy_renewed.yaml diff --git a/pkg/resource_customizations/certmanager.k8s.io/Certificate/testdata/degraded_configError.yaml b/pkg/resource_customizations/certmanager.k8s.io/Certificate/testdata/degraded_configError.yaml deleted file mode 100644 index 1680571..0000000 --- a/pkg/resource_customizations/certmanager.k8s.io/Certificate/testdata/degraded_configError.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: certmanager.k8s.io/v1alpha1 -kind: Certificate -metadata: - annotations: - kubectl.kubernetes.io/last-applied-configuration: | - {"apiVersion":"certmanager.k8s.io/v1alpha1","kind":"Certificate","metadata":{"annotations":{},"name":"test-cert","namespace":"argocd"},"spec":{"acme":{"config":[{"domains":["cd.apps.argoproj.io"],"http01":{"ingress":"http01"}}]},"commonName":"cd.apps.argoproj.io","dnsNames":["cd.apps.argoproj.io"],"issuerRef":{"kind":"Issuer","name":"argo-cd-issuer"}}} - creationTimestamp: "2019-02-15T18:17:06Z" - generation: 1 - name: test-cert - namespace: argocd - resourceVersion: "68338442" - selfLink: /apis/certmanager.k8s.io/v1alpha1/namespaces/argocd/certificates/test-cert - uid: e6cfba50-314d-11e9-be3f-42010a800011 -spec: - acme: - config: - - domains: - - cd.apps.argoproj.io123 - http01: - ingress: http01 - commonName: cd.apps.argoproj.io - dnsNames: - - cd.apps.argoproj.io - issuerRef: - kind: Issuer - name: argo-cd-issuer - secretName: test-secret -status: - conditions: - - lastTransitionTime: "2019-02-15T18:26:37Z" - message: 'Resource validation failed: spec.acme.config: Required value: no ACME - solver configuration specified for domain "cd.apps.argoproj.io"' - reason: ConfigError - status: "False" - type: Ready diff --git a/pkg/resource_customizations/certmanager.k8s.io/Certificate/testdata/healthy_issued.yaml b/pkg/resource_customizations/certmanager.k8s.io/Certificate/testdata/healthy_issued.yaml deleted file mode 100644 index d61f84f..0000000 --- a/pkg/resource_customizations/certmanager.k8s.io/Certificate/testdata/healthy_issued.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: certmanager.k8s.io/v1alpha1 -kind: Certificate -metadata: - creationTimestamp: "2019-02-15T18:17:06Z" - generation: 1 - name: test-cert - namespace: argocd - resourceVersion: "68337322" - selfLink: /apis/certmanager.k8s.io/v1alpha1/namespaces/argocd/certificates/test-cert - uid: e6cfba50-314d-11e9-be3f-42010a800011 -spec: - acme: - config: - - domains: - - cd.apps.argoproj.io - http01: - ingress: http01 - commonName: cd.apps.argoproj.io - dnsNames: - - cd.apps.argoproj.io - issuerRef: - kind: Issuer - name: argo-cd-issuer - secretName: test-secret -status: - acme: - order: - url: https://acme-v02.api.letsencrypt.org/acme/order/45250083/316944902 - conditions: - - lastTransitionTime: "2019-02-15T18:21:10Z" - message: Order validated - reason: OrderValidated - status: "False" - type: ValidateFailed - - lastTransitionTime: null - message: Certificate issued successfully - reason: CertIssued - status: "True" - type: Ready diff --git a/pkg/resource_customizations/certmanager.k8s.io/Certificate/testdata/healthy_renewed.yaml b/pkg/resource_customizations/certmanager.k8s.io/Certificate/testdata/healthy_renewed.yaml deleted file mode 100644 index 877f050..0000000 --- a/pkg/resource_customizations/certmanager.k8s.io/Certificate/testdata/healthy_renewed.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: certmanager.k8s.io/v1alpha1 -kind: Certificate -metadata: - creationTimestamp: '2018-11-07T00:06:12Z' - generation: 1 - name: test-cert - namespace: argocd - resourceVersion: '64763033' - selfLink: /apis/certmanager.k8s.io/v1alpha1/namespaces/argocd/certificates/test-cert - uid: e6cfba50-314d-11e9-be3f-42010a800011 -spec: - acme: - config: - - domains: - - cd.apps.argoproj.io - http01: - ingress: http01 - commonName: cd.apps.argoproj.io - dnsNames: - - cd.apps.argoproj.io - issuerRef: - kind: Issuer - name: argo-cd-issuer - secretName: test-secret -status: - acme: - order: - url: 'https://acme-v02.api.letsencrypt.org/acme/order/45250083/298963150' - conditions: - - lastTransitionTime: '2019-02-03T09:48:13Z' - message: Certificate renewed successfully - reason: CertRenewed - status: 'True' - type: Ready - - lastTransitionTime: '2019-02-03T09:48:11Z' - message: Order validated - reason: OrderValidated - status: 'False' - type: ValidateFailed diff --git a/pkg/resource_customizations/certmanager.k8s.io/Certificate/testdata/progressing_noStatus.yaml b/pkg/resource_customizations/certmanager.k8s.io/Certificate/testdata/progressing_noStatus.yaml deleted file mode 100644 index 4fa2fea..0000000 --- a/pkg/resource_customizations/certmanager.k8s.io/Certificate/testdata/progressing_noStatus.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: certmanager.k8s.io/v1alpha1 -kind: Certificate -metadata: - creationTimestamp: '2018-11-07T00:06:12Z' - generation: 1 - name: test-cert - namespace: argocd - resourceVersion: '64763033' - selfLink: /apis/certmanager.k8s.io/v1alpha1/namespaces/argocd/certificates/test-cert - uid: e6cfba50-314d-11e9-be3f-42010a800011 -spec: - acme: - config: - - domains: - - cd.apps.argoproj.io - http01: - ingress: http01 - commonName: cd.apps.argoproj.io - dnsNames: - - cd.apps.argoproj.io - issuerRef: - kind: Issuer - name: argo-cd-issuer - secretName: test-secret diff --git a/pkg/resource_customizations/certmanager.k8s.io/Issuer/health.lua b/pkg/resource_customizations/certmanager.k8s.io/Issuer/health.lua deleted file mode 100644 index 2626e18..0000000 --- a/pkg/resource_customizations/certmanager.k8s.io/Issuer/health.lua +++ /dev/null @@ -1,21 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" and condition.status == "False" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - end - end -end - -hs.status = "Progressing" -hs.message = "Initializing issuer" -return hs diff --git a/pkg/resource_customizations/certmanager.k8s.io/Issuer/health_test.yaml b/pkg/resource_customizations/certmanager.k8s.io/Issuer/health_test.yaml deleted file mode 100644 index e48df5e..0000000 --- a/pkg/resource_customizations/certmanager.k8s.io/Issuer/health_test.yaml +++ /dev/null @@ -1,14 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: Initializing issuer - inputPath: testdata/progressing_noStatus.yaml -- healthStatus: - status: Healthy - message: The ACME account was registered with the ACME server - inputPath: testdata/healthy_registered.yaml -- healthStatus: - status: Degraded - message: "Failed to verify ACME account: acme: : 404 page not found\n" - inputPath: testdata/degraded_acmeFailed.yaml - diff --git a/pkg/resource_customizations/certmanager.k8s.io/Issuer/testdata/degraded_acmeFailed.yaml b/pkg/resource_customizations/certmanager.k8s.io/Issuer/testdata/degraded_acmeFailed.yaml deleted file mode 100644 index dbd819c..0000000 --- a/pkg/resource_customizations/certmanager.k8s.io/Issuer/testdata/degraded_acmeFailed.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: certmanager.k8s.io/v1alpha1 -kind: Issuer -metadata: - creationTimestamp: "2019-02-15T19:23:48Z" - generation: 1 - name: test-issuer - namespace: argocd - resourceVersion: "68352438" - selfLink: /apis/certmanager.k8s.io/v1alpha1/namespaces/argocd/issuers/test-issuer - uid: 37f408e3-3157-11e9-be3f-42010a800011 -spec: - acme: - email: myemail@test.com - http01: {} - privateKeySecretRef: - key: "" - name: letsencrypt - server: https://acme-v02.api.letsencrypt.org/directory124 -status: - acme: - uri: "" - conditions: - - lastTransitionTime: "2019-02-15T19:23:53Z" - message: | - Failed to verify ACME account: acme: : 404 page not found - reason: ErrRegisterACMEAccount - status: "False" - type: Ready diff --git a/pkg/resource_customizations/certmanager.k8s.io/Issuer/testdata/healthy_registered.yaml b/pkg/resource_customizations/certmanager.k8s.io/Issuer/testdata/healthy_registered.yaml deleted file mode 100644 index db0a81b..0000000 --- a/pkg/resource_customizations/certmanager.k8s.io/Issuer/testdata/healthy_registered.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: certmanager.k8s.io/v1alpha1 -kind: Issuer -metadata: - creationTimestamp: "2018-11-06T23:14:18Z" - generation: 1 - name: test-issuer - namespace: argocd - resourceVersion: "48889060" - selfLink: /apis/certmanager.k8s.io/v1alpha1/namespaces/argocd/issuers/argo-cd-issuer - uid: b0045219-e219-11e8-9f93-42010a80021d -spec: - acme: - email: myemail@test.com - http01: {} - privateKeySecretRef: - key: "" - name: letsencrypt - server: https://acme-v02.api.letsencrypt.org/directory -status: - acme: - uri: https://acme-v02.api.letsencrypt.org/acme/acct/45250083 - conditions: - - lastTransitionTime: "2018-12-06T06:42:59Z" - message: The ACME account was registered with the ACME server - reason: ACMEAccountRegistered - status: "True" - type: Ready diff --git a/pkg/resource_customizations/certmanager.k8s.io/Issuer/testdata/progressing_noStatus.yaml b/pkg/resource_customizations/certmanager.k8s.io/Issuer/testdata/progressing_noStatus.yaml deleted file mode 100644 index 68f35fa..0000000 --- a/pkg/resource_customizations/certmanager.k8s.io/Issuer/testdata/progressing_noStatus.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: certmanager.k8s.io/v1alpha1 -kind: Issuer -metadata: - creationTimestamp: "2018-11-06T23:14:18Z" - generation: 1 - name: test-issuer - namespace: argocd - resourceVersion: "48889060" - selfLink: /apis/certmanager.k8s.io/v1alpha1/namespaces/argocd/issuers/argo-cd-issuer - uid: b0045219-e219-11e8-9f93-42010a80021d -spec: - acme: - email: myemail@test.com - http01: {} - privateKeySecretRef: - key: "" - name: letsencrypt - server: https://acme-v02.api.letsencrypt.org/directory diff --git a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/health.lua b/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/health_test.yaml b/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/dependency_not_found.yaml b/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/dependency_not_found.yaml deleted file mode 100644 index 75887c8..0000000 --- a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: cloudfunctions.cnrm.cloud.google.com/v1beta1 -kind: CloudFunctionsFunction -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/dependency_not_ready.yaml deleted file mode 100644 index ef86c23..0000000 --- a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: cloudfunctions.cnrm.cloud.google.com/v1beta1 -kind: CloudFunctionsFunction -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/up_to_date.yaml b/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/up_to_date.yaml deleted file mode 100644 index d889f3a..0000000 --- a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: cloudfunctions.cnrm.cloud.google.com/v1beta1 -kind: CloudFunctionsFunction -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/update_failed.yaml b/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/update_failed.yaml deleted file mode 100644 index 59b953e..0000000 --- a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: cloudfunctions.cnrm.cloud.google.com/v1beta1 -kind: CloudFunctionsFunction -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/update_in_progress.yaml b/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/update_in_progress.yaml deleted file mode 100644 index 4fa4cd1..0000000 --- a/pkg/resource_customizations/cloudfunctions.cnrm.cloud.google.com/CloudFunctionsFunction/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: cloudfunctions.cnrm.cloud.google.com/v1beta1 -kind: CloudFunctionsFunction -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/health.lua b/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/health_test.yaml b/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/dependency_not_found.yaml b/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/dependency_not_found.yaml deleted file mode 100644 index 7dd2e9b..0000000 --- a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: cloudscheduler.cnrm.cloud.google.com/v1beta1 -kind: CloudSchedulerJob -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/dependency_not_ready.yaml deleted file mode 100644 index f66433e..0000000 --- a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: cloudscheduler.cnrm.cloud.google.com/v1beta1 -kind: CloudSchedulerJob -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/up_to_date.yaml b/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/up_to_date.yaml deleted file mode 100644 index 63803d1..0000000 --- a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: cloudscheduler.cnrm.cloud.google.com/v1beta1 -kind: CloudSchedulerJob -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/update_failed.yaml b/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/update_failed.yaml deleted file mode 100644 index b568387..0000000 --- a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: cloudscheduler.cnrm.cloud.google.com/v1beta1 -kind: CloudSchedulerJob -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/update_in_progress.yaml b/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/update_in_progress.yaml deleted file mode 100644 index 3b90692..0000000 --- a/pkg/resource_customizations/cloudscheduler.cnrm.cloud.google.com/CloudSchedulerJob/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: cloudscheduler.cnrm.cloud.google.com/v1beta1 -kind: CloudSchedulerJob -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/health.lua b/pkg/resource_customizations/cluster.x-k8s.io/Cluster/health.lua deleted file mode 100644 index 3d3f1c4..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/health.lua +++ /dev/null @@ -1,40 +0,0 @@ -function getStatusBasedOnPhase(obj, hs) - hs.status = "Progressing" - hs.message = "Waiting for clusters" - if obj.status ~= nil and obj.status.phase ~= nil then - if obj.status.phase == "Provisioned" then - hs.status = "Healthy" - hs.message = "Cluster is running" - end - if obj.status.phase == "Failed" then - hs.status = "Degraded" - hs.message = "" - end - end - return hs -end - -function getReadyContitionStatus(obj, hs) - if obj.status ~= nil and obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" and condition.status == "False" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - end - end - return hs -end - -hs = {} -if obj.spec.paused ~= nil and obj.spec.paused then - hs.status = "Suspended" - hs.message = "Cluster is paused" - return hs -end - -getStatusBasedOnPhase(obj, hs) -getReadyContitionStatus(obj, hs) - -return hs diff --git a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/health_test.yaml b/pkg/resource_customizations/cluster.x-k8s.io/Cluster/health_test.yaml deleted file mode 100644 index f147587..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: 'Waiting for clusters' - inputPath: testdata/progressing_provisioning.yaml -- healthStatus: - status: Degraded - message: 'Error message' - inputPath: testdata/degraded_failed.yaml -- healthStatus: - status: Suspended - message: 'Cluster is paused' - inputPath: testdata/suspended_paused.yaml -- healthStatus: - status: Healthy - message: 'Cluster is running' - inputPath: testdata/healthy_provisioned.yaml -- healthStatus: - status: Degraded - message: 'Post "https://tvc01.foo.bar/sdk": host "tvc01.foo.bar:443" thumbprint does not match "0A:21:BD:FC:71:40:BD:96"' - inputPath: testdata/error_provisioned.yaml diff --git a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/degraded_failed.yaml b/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/degraded_failed.yaml deleted file mode 100644 index 1ee7467..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/degraded_failed.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha3 -kind: Cluster -metadata: - labels: - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/version: 0.3.11 - argocd.argoproj.io/instance: test - cluster.x-k8s.io/cluster-name: test - name: test - namespace: test -spec: - clusterNetwork: - pods: - cidrBlocks: - - 10.20.10.0/19 - services: - cidrBlocks: - - 10.10.10.0/19 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 - kind: KubeadmControlPlane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 - kind: VSphereCluster -status: - conditions: - - lastTransitionTime: '2020-12-21T07:41:10Z' - status: 'False' - message: "Error message" - type: Ready - - lastTransitionTime: '2020-12-29T09:16:28Z' - status: 'True' - type: ControlPlaneReady - - lastTransitionTime: '2020-11-24T09:15:24Z' - status: 'True' - type: InfrastructureReady - controlPlaneInitialized: true - controlPlaneReady: true - infrastructureReady: true - observedGeneration: 4 - phase: Failed diff --git a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/error_provisioned.yaml b/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/error_provisioned.yaml deleted file mode 100644 index e58123a..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/error_provisioned.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha3 -kind: Cluster -metadata: - labels: - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/version: 0.3.11 - argocd.argoproj.io/instance: test - cluster.x-k8s.io/cluster-name: test - name: test - namespace: test -spec: - clusterNetwork: - pods: - cidrBlocks: - - 10.20.10.0/19 - services: - cidrBlocks: - - 10.10.10.0/19 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 - kind: KubeadmControlPlane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 - kind: VSphereCluster -status: - conditions: - - lastTransitionTime: '2022-12-14T07:45:14Z' - message: >- - Post "https://tvc01.foo.bar/sdk": host "tvc01.foo.bar:443" - thumbprint does not match - "0A:21:BD:FC:71:40:BD:96" - reason: VCenterUnreachable - severity: Error - status: 'False' - type: Ready - - lastTransitionTime: '2022-11-30T12:04:22Z' - status: 'True' - type: ControlPlaneInitialized - - lastTransitionTime: '2022-11-30T12:10:30Z' - status: 'True' - type: ControlPlaneReady - - lastTransitionTime: '2022-12-14T07:45:14Z' - message: >- - Post "https://tvc01.foo.bar/sdk": host "tvc01.foo.bar:443" - thumbprint does not match - "0A:21:BD:FC:71:40:BD:96" - reason: VCenterUnreachable - severity: Error - status: 'False' - type: InfrastructureReady - controlPlaneReady: true - infrastructureReady: true - observedGeneration: 2 - phase: Provisioned diff --git a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/healthy_provisioned.yaml b/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/healthy_provisioned.yaml deleted file mode 100644 index 43c6f76..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/healthy_provisioned.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha3 -kind: Cluster -metadata: - labels: - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/version: 0.3.11 - argocd.argoproj.io/instance: test - cluster.x-k8s.io/cluster-name: test - name: test - namespace: test -spec: - clusterNetwork: - pods: - cidrBlocks: - - 10.20.10.0/19 - services: - cidrBlocks: - - 10.10.10.0/19 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 - kind: KubeadmControlPlane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 - kind: VSphereCluster -status: - conditions: - - lastTransitionTime: '2020-12-29T09:16:28Z' - status: 'True' - type: Ready - - lastTransitionTime: '2020-12-29T09:16:28Z' - status: 'True' - type: ControlPlaneReady - - lastTransitionTime: '2020-11-24T09:15:24Z' - status: 'True' - type: InfrastructureReady - controlPlaneInitialized: true - controlPlaneReady: true - infrastructureReady: true - observedGeneration: 4 - phase: Provisioned diff --git a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/progressing_provisioning.yaml b/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/progressing_provisioning.yaml deleted file mode 100644 index f0befbe..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/progressing_provisioning.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha3 -kind: Cluster -metadata: - labels: - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/version: 0.3.11 - argocd.argoproj.io/instance: test - cluster.x-k8s.io/cluster-name: test - name: test - namespace: test -spec: - clusterNetwork: - pods: - cidrBlocks: - - 10.20.10.0/19 - services: - cidrBlocks: - - 10.10.10.0/19 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 - kind: KubeadmControlPlane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 - kind: VSphereCluster -status: - conditions: - - lastTransitionTime: '2020-12-29T09:16:28Z' - status: 'True' - type: Ready - - lastTransitionTime: '2020-12-29T09:16:28Z' - status: 'True' - type: ControlPlaneReady - - lastTransitionTime: '2020-11-24T09:15:24Z' - status: 'True' - type: InfrastructureReady - controlPlaneInitialized: true - controlPlaneReady: true - infrastructureReady: true - observedGeneration: 4 - phase: Provisioning diff --git a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/suspended_paused.yaml b/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/suspended_paused.yaml deleted file mode 100644 index 97db878..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/Cluster/testdata/suspended_paused.yaml +++ /dev/null @@ -1,42 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha3 -kind: Cluster -metadata: - labels: - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/version: 0.3.11 - argocd.argoproj.io/instance: test - cluster.x-k8s.io/cluster-name: test - name: test - namespace: test -spec: - paused: true - clusterNetwork: - pods: - cidrBlocks: - - 10.20.10.0/19 - services: - cidrBlocks: - - 10.10.10.0/19 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 - kind: KubeadmControlPlane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 - kind: VSphereCluster -status: - conditions: - - lastTransitionTime: '2020-12-21T07:41:10Z' - status: 'False' - message: "Error message" - type: Ready - - lastTransitionTime: '2020-12-29T09:16:28Z' - status: 'True' - type: ControlPlaneReady - - lastTransitionTime: '2020-11-24T09:15:24Z' - status: 'True' - type: InfrastructureReady - controlPlaneInitialized: true - controlPlaneReady: true - infrastructureReady: true - observedGeneration: 4 - phase: Failed diff --git a/pkg/resource_customizations/cluster.x-k8s.io/Machine/health.lua b/pkg/resource_customizations/cluster.x-k8s.io/Machine/health.lua deleted file mode 100644 index 2b52a43..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/Machine/health.lua +++ /dev/null @@ -1,34 +0,0 @@ -function getStatusBasedOnPhase(obj) - hs = {} - hs.status = "Progressing" - hs.message = "Waiting for machines" - if obj.status ~= nil and obj.status.phase ~= nil then - if obj.status.phase == "Running" then - hs.status = "Healthy" - hs.message = "Machine is running" - end - if obj.status.phase == "Failed" then - hs.status = "Degraded" - hs.message = "" - end - end - return hs -end - -function getReadyContitionMessage(obj) - if obj.status ~= nil and obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" and condition.status == "False" then - return condition.message - end - end - end - return "Condition is unknown" -end - -hs = getStatusBasedOnPhase(obj) -if hs.status ~= "Healthy" then - hs.message = getReadyContitionMessage(obj) -end - -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/cluster.x-k8s.io/Machine/health_test.yaml b/pkg/resource_customizations/cluster.x-k8s.io/Machine/health_test.yaml deleted file mode 100644 index bd1a878..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/Machine/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: '1 of 2 completed' - inputPath: testdata/progressing_boot.yaml -- healthStatus: - status: Degraded - message: 'Error message' - inputPath: testdata/degraded_failed.yaml -- healthStatus: - status: Healthy - message: 'Machine is running' - inputPath: testdata/healthy_running.yaml diff --git a/pkg/resource_customizations/cluster.x-k8s.io/Machine/testdata/degraded_failed.yaml b/pkg/resource_customizations/cluster.x-k8s.io/Machine/testdata/degraded_failed.yaml deleted file mode 100644 index 472f967..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/Machine/testdata/degraded_failed.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha3 -kind: Machine -metadata: - labels: - cluster.x-k8s.io/cluster-name: test - name: test-md-0-6cb7d48f56-frtdw - namespace: test -spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 - kind: KubeadmConfig - clusterName: test - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 - kind: VSphereMachine - version: v1.18.10 -status: - addresses: - - address: 10.10.10.10 - type: ExternalIP - bootstrapReady: true - conditions: - - lastTransitionTime: '2020-12-21T07:41:10Z' - status: 'False' - message: "Error message" - type: Ready - - lastTransitionTime: '2020-12-21T07:37:54Z' - status: 'True' - type: BootstrapReady - - lastTransitionTime: '2020-12-21T07:41:10Z' - status: 'True' - type: InfrastructureReady - - lastTransitionTime: '2020-12-21T07:42:11Z' - status: 'True' - type: NodeHealthy - infrastructureReady: true - lastUpdated: '2020-12-21T07:41:32Z' - nodeRef: - apiVersion: v1 - kind: Node - name: test-md-0-6cb7d48f56-frtdw - observedGeneration: 3 - phase: Failed diff --git a/pkg/resource_customizations/cluster.x-k8s.io/Machine/testdata/healthy_running.yaml b/pkg/resource_customizations/cluster.x-k8s.io/Machine/testdata/healthy_running.yaml deleted file mode 100644 index acd9b90..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/Machine/testdata/healthy_running.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha3 -kind: Machine -metadata: - labels: - cluster.x-k8s.io/cluster-name: test - name: test-md-0-6cb7d48f56-frtdw - namespace: test -spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 - kind: KubeadmConfig - clusterName: test-cl2 - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 - kind: VSphereMachine - version: v1.18.10 -status: - addresses: - - address: 10.10.10.10 - type: ExternalIP - bootstrapReady: true - conditions: - - lastTransitionTime: '2020-12-21T07:41:10Z' - status: 'True' - type: Ready - - lastTransitionTime: '2020-12-21T07:37:54Z' - status: 'True' - type: BootstrapReady - - lastTransitionTime: '2020-12-21T07:41:10Z' - status: 'True' - type: InfrastructureReady - - lastTransitionTime: '2020-12-21T07:42:11Z' - status: 'True' - type: NodeHealthy - infrastructureReady: true - lastUpdated: '2020-12-21T07:41:32Z' - nodeRef: - apiVersion: v1 - kind: Node - name: test-md-0-6cb7d48f56-frtdw - observedGeneration: 3 - phase: Running diff --git a/pkg/resource_customizations/cluster.x-k8s.io/Machine/testdata/progressing_boot.yaml b/pkg/resource_customizations/cluster.x-k8s.io/Machine/testdata/progressing_boot.yaml deleted file mode 100644 index bd6cb55..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/Machine/testdata/progressing_boot.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha3 -kind: Machine -metadata: - labels: - cluster.x-k8s.io/cluster-name: test - name: test-md-0-6cb7d48f56-frtdw - namespace: test -spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 - kind: KubeadmConfig - clusterName: test-cl2 - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 - kind: VSphereMachine - version: v1.18.10 -status: - addresses: - - address: 10.10.10.10 - type: ExternalIP - bootstrapReady: true - conditions: - - lastTransitionTime: '2020-12-29T09:41:28Z' - message: 1 of 2 completed - reason: Cloning - severity: Info - status: 'False' - type: Ready - - lastTransitionTime: '2020-12-21T07:37:54Z' - status: 'True' - type: BootstrapReady - - lastTransitionTime: '2020-12-21T07:41:10Z' - status: 'True' - type: InfrastructureReady - - lastTransitionTime: '2020-12-21T07:42:11Z' - status: 'True' - type: NodeHealthy - infrastructureReady: true - lastUpdated: '2020-12-21T07:41:32Z' - nodeRef: - apiVersion: v1 - kind: Node - name: test-md-0-6cb7d48f56-frtdw - observedGeneration: 3 - phase: Provisioning diff --git a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/health.lua b/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/health.lua deleted file mode 100644 index 0ac402c..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/health.lua +++ /dev/null @@ -1,30 +0,0 @@ -hs = {} -hs.status = "Progressing" -hs.message = "Waiting for machines" - -if obj.spec.paused ~= nil and obj.spec.paused then - hs.status = "Suspended" - hs.message = "MachineDeployment is paused" - return hs -end - -if obj.status ~= nil and obj.status.phase ~= nil then - if obj.status.phase == "Running" then - hs.status = "Healthy" - hs.message = "Machines are running under this deployment" - end - if obj.status.phase == "ScalingUp" then - hs.status = "Progressing" - hs.message = "Cluster is spawning machines" - end - if obj.status.phase == "ScalingDown" then - hs.status = "Progressing" - hs.message = "Cluster is stopping machines" - end - if obj.status.phase == "Failed" then - hs.status = "Degraded" - hs.message = "MachineDeployment is failed" - end -end - -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/health_test.yaml b/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/health_test.yaml deleted file mode 100644 index 351811e..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: 'Cluster is spawning machines' - inputPath: testdata/progressing_ScalingUp.yaml -- healthStatus: - status: Progressing - message: 'Cluster is stopping machines' - inputPath: testdata/progressing_ScalingDown.yaml -- healthStatus: - status: Degraded - message: 'MachineDeployment is failed' - inputPath: testdata/degraded_failed.yaml -- healthStatus: - status: Suspended - message: 'MachineDeployment is paused' - inputPath: testdata/suspended_paused.yaml -- healthStatus: - status: Healthy - message: 'Machines are running under this deployment' - inputPath: testdata/healthy_provisioned.yaml diff --git a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/degraded_failed.yaml b/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/degraded_failed.yaml deleted file mode 100644 index ba10af5..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/degraded_failed.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha3 -kind: MachineDeployment -metadata: - generation: 3 - labels: - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/version: 0.3.11 - argocd.argoproj.io/instance: test - cluster.x-k8s.io/cluster-name: test - name: test-md-0 - namespace: test -spec: - clusterName: test - minReadySeconds: 0 - progressDeadlineSeconds: 600 - replicas: 5 - revisionHistoryLimit: 1 - selector: - matchLabels: - cluster.x-k8s.io/cluster-name: test - cluster.x-k8s.io/deployment-name: teszst-md-0 - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - type: RollingUpdate - template: - metadata: - labels: - cluster.x-k8s.io/cluster-name: test - cluster.x-k8s.io/deployment-name: teszst-md-0 - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 - kind: KubeadmConfigTemplate - clusterName: test - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 - kind: VSphereMachineTemplate - version: v1.18.10 -status: - availableReplicas: 5 - observedGeneration: 3 - phase: Failed - readyReplicas: 5 - replicas: 5 - updatedReplicas: 5 diff --git a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/healthy_provisioned.yaml b/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/healthy_provisioned.yaml deleted file mode 100644 index c165d49..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/healthy_provisioned.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha3 -kind: MachineDeployment -metadata: - generation: 3 - labels: - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/version: 0.3.11 - argocd.argoproj.io/instance: test - cluster.x-k8s.io/cluster-name: test - name: test-md-0 - namespace: test -spec: - clusterName: test - minReadySeconds: 0 - progressDeadlineSeconds: 600 - replicas: 5 - revisionHistoryLimit: 1 - selector: - matchLabels: - cluster.x-k8s.io/cluster-name: test - cluster.x-k8s.io/deployment-name: teszst-md-0 - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - type: RollingUpdate - template: - metadata: - labels: - cluster.x-k8s.io/cluster-name: test - cluster.x-k8s.io/deployment-name: teszst-md-0 - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 - kind: KubeadmConfigTemplate - clusterName: test - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 - kind: VSphereMachineTemplate - version: v1.18.10 -status: - availableReplicas: 5 - observedGeneration: 3 - phase: Running - readyReplicas: 5 - replicas: 5 - updatedReplicas: 5 diff --git a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/progressing_ScalingDown.yaml b/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/progressing_ScalingDown.yaml deleted file mode 100644 index ccbb34e..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/progressing_ScalingDown.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha3 -kind: MachineDeployment -metadata: - generation: 3 - labels: - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/version: 0.3.11 - argocd.argoproj.io/instance: test - cluster.x-k8s.io/cluster-name: test - name: test-md-0 - namespace: test -spec: - clusterName: test - minReadySeconds: 0 - progressDeadlineSeconds: 600 - replicas: 5 - revisionHistoryLimit: 1 - selector: - matchLabels: - cluster.x-k8s.io/cluster-name: test - cluster.x-k8s.io/deployment-name: teszst-md-0 - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - type: RollingUpdate - template: - metadata: - labels: - cluster.x-k8s.io/cluster-name: test - cluster.x-k8s.io/deployment-name: teszst-md-0 - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 - kind: KubeadmConfigTemplate - clusterName: test - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 - kind: VSphereMachineTemplate - version: v1.18.10 -status: - availableReplicas: 6 - observedGeneration: 3 - phase: ScalingDown - readyReplicas: 6 - replicas: 5 - updatedReplicas: 5 diff --git a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/progressing_ScalingUp.yaml b/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/progressing_ScalingUp.yaml deleted file mode 100644 index af4af99..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/progressing_ScalingUp.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha3 -kind: MachineDeployment -metadata: - generation: 3 - labels: - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/version: 0.3.11 - argocd.argoproj.io/instance: test - cluster.x-k8s.io/cluster-name: test - name: test-md-0 - namespace: test -spec: - clusterName: test - minReadySeconds: 0 - progressDeadlineSeconds: 600 - replicas: 5 - revisionHistoryLimit: 1 - selector: - matchLabels: - cluster.x-k8s.io/cluster-name: test - cluster.x-k8s.io/deployment-name: teszst-md-0 - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - type: RollingUpdate - template: - metadata: - labels: - cluster.x-k8s.io/cluster-name: test - cluster.x-k8s.io/deployment-name: teszst-md-0 - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 - kind: KubeadmConfigTemplate - clusterName: test - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 - kind: VSphereMachineTemplate - version: v1.18.10 -status: - availableReplicas: 4 - observedGeneration: 3 - phase: ScalingUp - readyReplicas: 4 - replicas: 5 - updatedReplicas: 5 diff --git a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/suspended_paused.yaml b/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/suspended_paused.yaml deleted file mode 100644 index d297f57..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/MachineDeployment/testdata/suspended_paused.yaml +++ /dev/null @@ -1,49 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha3 -kind: MachineDeployment -metadata: - generation: 3 - labels: - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/version: 0.3.11 - argocd.argoproj.io/instance: test - cluster.x-k8s.io/cluster-name: test - name: test-md-0 - namespace: test -spec: - paused: true - clusterName: test - minReadySeconds: 0 - progressDeadlineSeconds: 600 - replicas: 5 - revisionHistoryLimit: 1 - selector: - matchLabels: - cluster.x-k8s.io/cluster-name: test - cluster.x-k8s.io/deployment-name: teszst-md-0 - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - type: RollingUpdate - template: - metadata: - labels: - cluster.x-k8s.io/cluster-name: test - cluster.x-k8s.io/deployment-name: teszst-md-0 - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 - kind: KubeadmConfigTemplate - clusterName: test - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 - kind: VSphereMachineTemplate - version: v1.18.10 -status: - availableReplicas: 5 - observedGeneration: 3 - phase: Running - readyReplicas: 5 - replicas: 5 - updatedReplicas: 5 diff --git a/pkg/resource_customizations/cluster.x-k8s.io/MachineHealthCheck/health.lua b/pkg/resource_customizations/cluster.x-k8s.io/MachineHealthCheck/health.lua deleted file mode 100644 index 1884040..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/MachineHealthCheck/health.lua +++ /dev/null @@ -1,14 +0,0 @@ -hs = {} - -hs.status = "Progressing" -hs.message = "" - -if obj.status ~= nil and obj.status.currentHealthy ~= nil then - if obj.status.expectedMachines == obj.status.currentHealthy then - hs.status = "Healthy" - else - hs.status = "Degraded" - end -end - -return hs diff --git a/pkg/resource_customizations/cluster.x-k8s.io/MachineHealthCheck/health_test.yaml b/pkg/resource_customizations/cluster.x-k8s.io/MachineHealthCheck/health_test.yaml deleted file mode 100644 index af03a34..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/MachineHealthCheck/health_test.yaml +++ /dev/null @@ -1,9 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: '' - inputPath: testdata/degraded_expectedMachines.yaml -- healthStatus: - status: Healthy - message: '' - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/cluster.x-k8s.io/MachineHealthCheck/testdata/degraded_expectedMachines.yaml b/pkg/resource_customizations/cluster.x-k8s.io/MachineHealthCheck/testdata/degraded_expectedMachines.yaml deleted file mode 100644 index 8e1bc9b..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/MachineHealthCheck/testdata/degraded_expectedMachines.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineHealthCheck -metadata: - labels: - cluster.x-k8s.io/cluster-name: test - name: test-node-unhealthy-5m -spec: - clusterName: test - maxUnhealthy: 100% - nodeStartupTimeout: 10m0s - selector: - matchLabels: - cluster.x-k8s.io/deployment-name: test-md-workers-0 - unhealthyConditions: - - status: Unknown - timeout: 5m - type: Ready - - status: "False" - timeout: 5m - type: Ready -status: - conditions: - - lastTransitionTime: "2022-10-07T10:33:46Z" - status: "True" - type: RemediationAllowed - currentHealthy: 1 - expectedMachines: 3 - observedGeneration: 3 - remediationsAllowed: 1 - targets: - - test-md-workers-0-76f7db5786-8nl6m - - test-md-workers-0-76f7db5786-jjzvf - - test-md-workers-0-76f7db5786-l4vfb diff --git a/pkg/resource_customizations/cluster.x-k8s.io/MachineHealthCheck/testdata/healthy.yaml b/pkg/resource_customizations/cluster.x-k8s.io/MachineHealthCheck/testdata/healthy.yaml deleted file mode 100644 index cc2e490..0000000 --- a/pkg/resource_customizations/cluster.x-k8s.io/MachineHealthCheck/testdata/healthy.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineHealthCheck -metadata: - labels: - cluster.x-k8s.io/cluster-name: test - name: test-node-unhealthy-5m -spec: - clusterName: test - maxUnhealthy: 100% - nodeStartupTimeout: 10m0s - selector: - matchLabels: - cluster.x-k8s.io/deployment-name: test-md-workers-0 - unhealthyConditions: - - status: Unknown - timeout: 5m - type: Ready - - status: "False" - timeout: 5m - type: Ready -status: - conditions: - - lastTransitionTime: "2022-10-07T10:33:46Z" - status: "True" - type: RemediationAllowed - currentHealthy: 3 - expectedMachines: 3 - observedGeneration: 3 - remediationsAllowed: 1 - targets: - - test-md-workers-0-76f7db5786-8nl6m - - test-md-workers-0-76f7db5786-jjzvf - - test-md-workers-0-76f7db5786-l4vfb diff --git a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/health.lua b/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/health_test.yaml b/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/dependency_not_found.yaml b/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/dependency_not_found.yaml deleted file mode 100644 index 0a20522..0000000 --- a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: compute.cnrm.cloud.google.com/v1beta1 -kind: ComputeDisk -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/dependency_not_ready.yaml deleted file mode 100644 index abc75e5..0000000 --- a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: compute.cnrm.cloud.google.com/v1beta1 -kind: ComputeDisk -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/up_to_date.yaml b/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/up_to_date.yaml deleted file mode 100644 index 42d206c..0000000 --- a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: compute.cnrm.cloud.google.com/v1beta1 -kind: ComputeDisk -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/update_failed.yaml b/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/update_failed.yaml deleted file mode 100644 index e2bb1e6..0000000 --- a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: compute.cnrm.cloud.google.com/v1beta1 -kind: ComputeDisk -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/update_in_progress.yaml b/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/update_in_progress.yaml deleted file mode 100644 index 6149df1..0000000 --- a/pkg/resource_customizations/compute.cnrm.cloud.google.com/ComputeDisk/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: compute.cnrm.cloud.google.com/v1beta1 -kind: ComputeDisk -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/health.lua b/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/health.lua deleted file mode 100644 index 2670862..0000000 --- a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/health.lua +++ /dev/null @@ -1,48 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.availableNodes ~= nil then - local sum = 0 - for _,node in pairs(obj.spec.nodeSets) do - sum = sum + node.count - end - if obj.status.availableNodes < sum then - hs.status = "Progressing" - hs.message = "The desired amount of availableNodes is " .. sum .. " but the current amount is " .. obj.status.availableNodes - return hs - elseif obj.status.availableNodes == sum then - if obj.status.phase ~= nil and obj.status.health ~= nil then - if obj.status.phase == "Ready" then - if obj.status.health == "green" then - hs.status = "Healthy" - hs.message = "Elasticsearch Cluster status is Green" - return hs - elseif obj.status.health == "yellow" then - hs.status = "Progressing" - hs.message = "Elasticsearch Cluster status is Yellow. Check the status of indices, replicas and shards" - return hs - elseif obj.status.health == "red" then - hs.status = "Degraded" - hs.message = "Elasticsearch Cluster status is Red. Check the status of indices, replicas and shards" - return hs - end - elseif obj.status.phase == "ApplyingChanges" then - hs.status = "Progressing" - hs.message = "Elasticsearch phase is ApplyingChanges" - return hs - elseif obj.status.phase == "MigratingData" then - hs.status = "Progressing" - hs.message = "Elasticsearch phase is MigratingData" - return hs - elseif obj.status.phase == "Invalid" then - hs.status = "Degraded" - hs.message = "Elasticsearch phase is Invalid" - return hs - end - end - end - end -end - -hs.status = "Unknown" -hs.message = "Elasticsearch Cluster status is unknown. Ensure your ArgoCD is current and then check for/file a bug report: https://github.com/argoproj/argo-cd/issues" -return hs diff --git a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/health_test.yaml b/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/health_test.yaml deleted file mode 100644 index 015bc14..0000000 --- a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/health_test.yaml +++ /dev/null @@ -1,33 +0,0 @@ -tests: -- healthStatus: - status: Healthy - message: "Elasticsearch Cluster status is Green" - inputPath: testdata/ready_green.yaml -- healthStatus: - status: Progressing - message: "Elasticsearch Cluster status is Yellow. Check the status of indices, replicas and shards" - inputPath: testdata/ready_yellow.yaml -- healthStatus: - status: Degraded - message: "Elasticsearch Cluster status is Red. Check the status of indices, replicas and shards" - inputPath: testdata/ready_red.yaml -- healthStatus: - status: Progressing - message: "Elasticsearch phase is ApplyingChanges" - inputPath: testdata/applyingchanges.yaml -- healthStatus: - status: Progressing - message: "Elasticsearch phase is MigratingData" - inputPath: testdata/migratingdata.yaml -- healthStatus: - status: Degraded - message: "Elasticsearch phase is Invalid" - inputPath: testdata/invalid.yaml -- healthStatus: - status: Progressing - message: "The desired amount of availableNodes is 5 but the current amount is 3" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Unknown - message: "Elasticsearch Cluster status is unknown. Ensure your ArgoCD is current and then check for/file a bug report: https://github.com/argoproj/argo-cd/issues" - inputPath: testdata/unknown.yaml diff --git a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/applyingchanges.yaml b/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/applyingchanges.yaml deleted file mode 100644 index af0a98e..0000000 --- a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/applyingchanges.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: elasticsearch.k8s.elastic.co/v1 -kind: Elasticsearch -metadata: - name: quickstart -spec: - version: 7.12.0 - nodeSets: - - name: default - count: 3 - config: - node.store.allow_mmap: false -status: - availableNodes: 3 - health: green - phase: ApplyingChanges diff --git a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/invalid.yaml b/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/invalid.yaml deleted file mode 100644 index 3636f1a..0000000 --- a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/invalid.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: elasticsearch.k8s.elastic.co/v1 -kind: Elasticsearch -metadata: - name: quickstart -spec: - version: 7.12.0 - nodeSets: - - name: default - count: 3 - config: - node.store.allow_mmap: false -status: - availableNodes: 3 - health: red - phase: Invalid diff --git a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/migratingdata.yaml b/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/migratingdata.yaml deleted file mode 100644 index 6fc34cb..0000000 --- a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/migratingdata.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: elasticsearch.k8s.elastic.co/v1 -kind: Elasticsearch -metadata: - name: quickstart -spec: - version: 7.12.0 - nodeSets: - - name: default - count: 3 - config: - node.store.allow_mmap: false -status: - availableNodes: 3 - health: green - phase: MigratingData diff --git a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/progressing.yaml b/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/progressing.yaml deleted file mode 100644 index 43de512..0000000 --- a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/progressing.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: elasticsearch.k8s.elastic.co/v1 -kind: Elasticsearch -metadata: - name: quickstart -spec: - version: 7.12.0 - nodeSets: - # 3 dedicated master nodes - - name: master - count: 3 - config: - node.roles: ["master"] - node.remote_cluster_client: false - # 2 ingest-data nodes - - name: ingest-data - count: 2 - config: - node.roles: ["data", "ingest"] -status: - availableNodes: 3 - health: green - phase: Ready diff --git a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/ready_green.yaml b/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/ready_green.yaml deleted file mode 100644 index 3db55bb..0000000 --- a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/ready_green.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: elasticsearch.k8s.elastic.co/v1 -kind: Elasticsearch -metadata: - name: quickstart -spec: - version: 7.12.0 - nodeSets: - - name: default - count: 3 - config: - node.store.allow_mmap: false -status: - availableNodes: 3 - health: green - phase: Ready diff --git a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/ready_red.yaml b/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/ready_red.yaml deleted file mode 100644 index 35b0aa0..0000000 --- a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/ready_red.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: elasticsearch.k8s.elastic.co/v1 -kind: Elasticsearch -metadata: - name: quickstart -spec: - version: 7.12.0 - nodeSets: - - name: default - count: 3 - config: - node.store.allow_mmap: false -status: - availableNodes: 3 - health: red - phase: Ready diff --git a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/ready_yellow.yaml b/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/ready_yellow.yaml deleted file mode 100644 index c655f19..0000000 --- a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/ready_yellow.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: elasticsearch.k8s.elastic.co/v1 -kind: Elasticsearch -metadata: - name: quickstart -spec: - version: 7.12.0 - nodeSets: - - name: default - count: 3 - config: - node.store.allow_mmap: false -status: - availableNodes: 3 - health: yellow - phase: Ready diff --git a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/unknown.yaml b/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/unknown.yaml deleted file mode 100644 index 9aac9e0..0000000 --- a/pkg/resource_customizations/elasticsearch.k8s.elastic.co/Elasticsearch/testdata/unknown.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: elasticsearch.k8s.elastic.co/v1 -kind: Elasticsearch -metadata: - name: quickstart -spec: - version: 7.12.0 - nodeSets: - - name: default - count: 3 - config: - node.store.allow_mmap: false -status: {} diff --git a/pkg/resource_customizations/embed.go b/pkg/resource_customizations/embed.go deleted file mode 100644 index 251b122..0000000 --- a/pkg/resource_customizations/embed.go +++ /dev/null @@ -1,9 +0,0 @@ -package resource_customizations - -import ( - "embed" -) - -// Embedded contains embedded resource customization -//go:embed * -var Embedded embed.FS diff --git a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/health.lua b/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/health.lua deleted file mode 100644 index 2157b5c..0000000 --- a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/health.lua +++ /dev/null @@ -1,25 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - -- For ClusterExternalSecret, new statuses are appended to the end of the list - lastStatus = obj.status.conditions[#obj.status.conditions] - if lastStatus.type == "Ready" and lastStatus.status == "True" then - hs.status = "Healthy" - hs.message = lastStatus.message - return hs - end - if lastStatus.type == "PartiallyReady" and lastStatus.status == "True" then - hs.status = "Degraded" - hs.message = lastStatus.message - return hs - end - if lastStatus.type == "NotReady" and lastStatus.status == "True" then - hs.status = "Degraded" - hs.message = lastStatus.message - return hs - end - end -end -hs.status = "Progressing" -hs.message = "Waiting for ClusterExternalSecret" -return hs diff --git a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/health_test.yaml b/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/health_test.yaml deleted file mode 100644 index 52e4c7c..0000000 --- a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: Waiting for ClusterExternalSecret - inputPath: testdata/progressing.yaml - - healthStatus: - status: Degraded - message: 'one or more namespaces failed' - inputPath: testdata/notready.yaml - - healthStatus: - status: Degraded - message: 'one or more namespaces failed' - inputPath: testdata/partiallyready.yaml - - healthStatus: - status: Degraded - message: 'one or more namespaces failed' - inputPath: testdata/partiallyready-multiple-conditions.yaml - - healthStatus: - status: Healthy - message: '' - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/healthy.yaml b/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/healthy.yaml deleted file mode 100644 index 1a5f61b..0000000 --- a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/healthy.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: ClusterExternalSecret -metadata: - name: ces -spec: - externalSecretName: hello-world-es - externalSecretSpec: - data: - - remoteRef: - conversionStrategy: Default - decodingStrategy: None - key: /foo - property: key - secretKey: mykey - refreshInterval: 1h - secretStoreRef: - kind: ClusterSecretStore - name: secretmanager - target: - creationPolicy: Owner - deletionPolicy: Retain - name: mysecret - template: - data: - somekey: '{{ .somecreds }}' - engineVersion: v2 - type: Opaque - namespaceSelector: - matchLabels: - cool: label -status: - conditions: - - message: one or more namespaces failed - status: "True" - type: PartiallyReady - - status: "True" - type: Ready diff --git a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/notready.yaml b/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/notready.yaml deleted file mode 100644 index eeea306..0000000 --- a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/notready.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: ClusterExternalSecret -metadata: - name: ces -spec: - externalSecretName: hello-world-es - externalSecretSpec: - data: - - remoteRef: - conversionStrategy: Default - decodingStrategy: None - key: /foo - property: key - secretKey: mykey - refreshInterval: 1h - secretStoreRef: - kind: ClusterSecretStore - name: secretmanager - target: - creationPolicy: Owner - deletionPolicy: Retain - name: mysecret - template: - data: - somekey: '{{ .somecreds }}' - engineVersion: v2 - type: Opaque - namespaceSelector: - matchLabels: - cool: label -status: - conditions: - - message: one or more namespaces failed - status: "True" - type: NotReady - failedNamespaces: - - namespace: default - reason: external secret already exists in namespace diff --git a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/partiallyready-multiple-conditions.yaml b/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/partiallyready-multiple-conditions.yaml deleted file mode 100644 index 52f6141..0000000 --- a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/partiallyready-multiple-conditions.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: ClusterExternalSecret -metadata: - name: ces -spec: - externalSecretName: hello-world-es - externalSecretSpec: - data: - - remoteRef: - conversionStrategy: Default - decodingStrategy: None - key: /foo - property: key - secretKey: mykey - refreshInterval: 1h - secretStoreRef: - kind: ClusterSecretStore - name: secretmanager - target: - creationPolicy: Owner - deletionPolicy: Retain - name: mysecret - template: - data: - somekey: '{{ .somecreds }}' - engineVersion: v2 - type: Opaque - namespaceSelector: - matchLabels: - cool: label -status: - conditions: - - message: one or more namespaces failed - status: "True" - type: NotReady - - message: one or more namespaces failed - status: "True" - type: PartiallyReady - failedNamespaces: - - namespace: default - reason: external secret already exists in namespace - provisionedNamespaces: - - other-namespace diff --git a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/partiallyready.yaml b/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/partiallyready.yaml deleted file mode 100644 index f6a2915..0000000 --- a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/partiallyready.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: ClusterExternalSecret -metadata: - name: ces -spec: - externalSecretName: hello-world-es - externalSecretSpec: - data: - - remoteRef: - conversionStrategy: Default - decodingStrategy: None - key: /foo - property: key - secretKey: mykey - refreshInterval: 1h - secretStoreRef: - kind: ClusterSecretStore - name: secretmanager - target: - creationPolicy: Owner - deletionPolicy: Retain - name: mysecret - template: - data: - somekey: '{{ .somecreds }}' - engineVersion: v2 - type: Opaque - namespaceSelector: - matchLabels: - cool: label -status: - conditions: - - message: one or more namespaces failed - status: "True" - type: PartiallyReady - failedNamespaces: - - namespace: default - reason: external secret already exists in namespace - provisionedNamespaces: - - other-namespace diff --git a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/progressing.yaml b/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/progressing.yaml deleted file mode 100644 index 8e326e4..0000000 --- a/pkg/resource_customizations/external-secrets.io/ClusterExternalSecret/testdata/progressing.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: ClusterExternalSecret -metadata: - name: ces -spec: - externalSecretName: hello-world-es - externalSecretSpec: - data: - - remoteRef: - conversionStrategy: Default - decodingStrategy: None - key: /foo - property: key - secretKey: mykey - refreshInterval: 1h - secretStoreRef: - kind: ClusterSecretStore - name: secretmanager - target: - creationPolicy: Owner - deletionPolicy: Retain - name: mysecret - template: - data: - somekey: '{{ .somecreds }}' - engineVersion: v2 - type: Opaque - namespaceSelector: - matchLabels: - cool: label diff --git a/pkg/resource_customizations/external-secrets.io/ClusterSecretStore/health.lua b/pkg/resource_customizations/external-secrets.io/ClusterSecretStore/health.lua deleted file mode 100644 index 14a77a7..0000000 --- a/pkg/resource_customizations/external-secrets.io/ClusterSecretStore/health.lua +++ /dev/null @@ -1,20 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" and condition.status == "False" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - end - end -end -hs.status = "Progressing" -hs.message = "Waiting for ClusterSecretStore" -return hs diff --git a/pkg/resource_customizations/external-secrets.io/ClusterSecretStore/health_test.yaml b/pkg/resource_customizations/external-secrets.io/ClusterSecretStore/health_test.yaml deleted file mode 100644 index 6e69215..0000000 --- a/pkg/resource_customizations/external-secrets.io/ClusterSecretStore/health_test.yaml +++ /dev/null @@ -1,9 +0,0 @@ -tests: - - healthStatus: - status: Degraded - message: 'unable to validate store' - inputPath: testdata/degraded.yaml - - healthStatus: - status: Healthy - message: 'store validated' - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/external-secrets.io/ClusterSecretStore/testdata/degraded.yaml b/pkg/resource_customizations/external-secrets.io/ClusterSecretStore/testdata/degraded.yaml deleted file mode 100644 index 1f00cc4..0000000 --- a/pkg/resource_customizations/external-secrets.io/ClusterSecretStore/testdata/degraded.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: ClusterSecretStore -metadata: - name: secretmanager -spec: - provider: - aws: - region: us-east-1 - service: SecretsManager -status: - conditions: - - lastTransitionTime: "2023-03-21T22:58:01Z" - message: unable to validate store - reason: ValidationFailed - status: "False" - type: Ready diff --git a/pkg/resource_customizations/external-secrets.io/ClusterSecretStore/testdata/healthy.yaml b/pkg/resource_customizations/external-secrets.io/ClusterSecretStore/testdata/healthy.yaml deleted file mode 100644 index 8c99de1..0000000 --- a/pkg/resource_customizations/external-secrets.io/ClusterSecretStore/testdata/healthy.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: ClusterSecretStore -metadata: - name: secretmanager -spec: - provider: - aws: - region: us-east-1 - service: SecretsManager -status: - capabilities: ReadWrite - conditions: - - lastTransitionTime: "2023-03-22T04:51:03Z" - message: store validated - reason: Valid - status: "True" - type: Ready diff --git a/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/action_test.yaml b/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/action_test.yaml deleted file mode 100644 index 83f49fc..0000000 --- a/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/action_test.yaml +++ /dev/null @@ -1,4 +0,0 @@ -actionTests: - - action: refresh - inputPath: testdata/external-secret.yaml - expectedOutputPath: testdata/external-secret-updated.yaml diff --git a/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/discovery.lua b/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/discovery.lua deleted file mode 100644 index cfac448..0000000 --- a/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/discovery.lua +++ /dev/null @@ -1,3 +0,0 @@ -actions = {} -actions["refresh"] = {["disabled"] = false} -return actions diff --git a/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/refresh/action.lua b/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/refresh/action.lua deleted file mode 100644 index fa29c48..0000000 --- a/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/refresh/action.lua +++ /dev/null @@ -1,6 +0,0 @@ -local os = require("os") -if obj.metadata.annotations == nil then - obj.metadata.annotations = {} -end -obj.metadata.annotations["force-sync"] = os.date("!%Y-%m-%dT%XZ") -return obj diff --git a/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/testdata/external-secret-updated.yaml b/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/testdata/external-secret-updated.yaml deleted file mode 100644 index 4266e9a..0000000 --- a/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/testdata/external-secret-updated.yaml +++ /dev/null @@ -1,56 +0,0 @@ -apiVersion: external-secrets.io/v1alpha1 -kind: ExternalSecret -metadata: - annotations: - force-sync: '0001-01-01T00:00:00Z' - creationTimestamp: '2021-11-16T21:59:33Z' - generation: 1 - name: test-healthy - namespace: argocd - resourceVersion: '136487331' - selfLink: /apis/external-secrets.io/v1alpha1/namespaces/argocd/externalsecrets/test-healthy - uid: 1e754a7e-0781-4d57-932d-4651d5b19586 -spec: - data: - - remoteRef: - key: secret/sa/example - property: api.address - secretKey: url - - remoteRef: - key: secret/sa/example - property: ca.crt - secretKey: ca - - remoteRef: - key: secret/sa/example - property: token - secretKey: token - refreshInterval: 1m - secretStoreRef: - kind: SecretStore - name: example - target: - creationPolicy: Owner - template: - data: - config: | - { - "bearerToken": "{{ .token | base64decode | toString }}", - "tlsClientConfig": { - "insecure": false, - "caData": "{{ .ca | toString }}" - } - } - name: cluster-test - server: '{{ .url | toString }}' - metadata: - labels: - argocd.argoproj.io/secret-type: cluster -status: - conditions: - - lastTransitionTime: '2021-11-16T21:59:34Z' - message: Secret was synced - reason: SecretSynced - status: 'True' - type: Ready - refreshTime: '2021-11-29T18:32:24Z' - syncedResourceVersion: 1-519a61da0dc68b2575b4f8efada70e42 diff --git a/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/testdata/external-secret.yaml b/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/testdata/external-secret.yaml deleted file mode 100644 index da17edb..0000000 --- a/pkg/resource_customizations/external-secrets.io/ExternalSecret/actions/testdata/external-secret.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: external-secrets.io/v1alpha1 -kind: ExternalSecret -metadata: - creationTimestamp: '2021-11-16T21:59:33Z' - generation: 1 - name: test-healthy - namespace: argocd - resourceVersion: '136487331' - selfLink: /apis/external-secrets.io/v1alpha1/namespaces/argocd/externalsecrets/test-healthy - uid: 1e754a7e-0781-4d57-932d-4651d5b19586 -spec: - data: - - remoteRef: - key: secret/sa/example - property: api.address - secretKey: url - - remoteRef: - key: secret/sa/example - property: ca.crt - secretKey: ca - - remoteRef: - key: secret/sa/example - property: token - secretKey: token - refreshInterval: 1m - secretStoreRef: - kind: SecretStore - name: example - target: - creationPolicy: Owner - template: - data: - config: | - { - "bearerToken": "{{ .token | base64decode | toString }}", - "tlsClientConfig": { - "insecure": false, - "caData": "{{ .ca | toString }}" - } - } - name: cluster-test - server: '{{ .url | toString }}' - metadata: - labels: - argocd.argoproj.io/secret-type: cluster -status: - conditions: - - lastTransitionTime: '2021-11-16T21:59:34Z' - message: Secret was synced - reason: SecretSynced - status: 'True' - type: Ready - refreshTime: '2021-11-29T18:32:24Z' - syncedResourceVersion: 1-519a61da0dc68b2575b4f8efada70e42 diff --git a/pkg/resource_customizations/external-secrets.io/ExternalSecret/health.lua b/pkg/resource_customizations/external-secrets.io/ExternalSecret/health.lua deleted file mode 100644 index 889c924..0000000 --- a/pkg/resource_customizations/external-secrets.io/ExternalSecret/health.lua +++ /dev/null @@ -1,20 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" and condition.status == "False" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - end - end -end -hs.status = "Progressing" -hs.message = "Waiting for ExternalSecret" -return hs diff --git a/pkg/resource_customizations/external-secrets.io/ExternalSecret/health_test.yaml b/pkg/resource_customizations/external-secrets.io/ExternalSecret/health_test.yaml deleted file mode 100644 index 059dfe2..0000000 --- a/pkg/resource_customizations/external-secrets.io/ExternalSecret/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: Waiting for ExternalSecret - inputPath: testdata/progressing.yaml - - healthStatus: - status: Degraded - message: 'could not get secret data from provider: key "secret/sa/example" from ExternalSecret "test-degraded"' - inputPath: testdata/degraded.yaml - - healthStatus: - status: Healthy - message: 'Secret was synced' - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/external-secrets.io/ExternalSecret/testdata/degraded.yaml b/pkg/resource_customizations/external-secrets.io/ExternalSecret/testdata/degraded.yaml deleted file mode 100644 index db98801..0000000 --- a/pkg/resource_customizations/external-secrets.io/ExternalSecret/testdata/degraded.yaml +++ /dev/null @@ -1,52 +0,0 @@ -apiVersion: external-secrets.io/v1alpha1 -kind: ExternalSecret -metadata: - creationTimestamp: '2021-11-16T21:59:33Z' - generation: 1 - name: test-degraded - namespace: argocd - resourceVersion: '136487331' - selfLink: /apis/external-secrets.io/v1alpha1/namespaces/argocd/externalsecrets/test-degraded - uid: 1e754a7e-0781-4d57-932d-4651d5b19586 -spec: - data: - - remoteRef: - key: secret/sa/example - property: api.address - secretKey: url - - remoteRef: - key: secret/sa/example - property: ca.crt - secretKey: ca - - remoteRef: - key: secret/sa/example - property: token - secretKey: token - refreshInterval: 1m - secretStoreRef: - kind: SecretStore - name: example - target: - creationPolicy: Owner - template: - data: - config: | - { - "bearerToken": "{{ .token | base64decode | toString }}", - "tlsClientConfig": { - "insecure": false, - "caData": "{{ .ca | toString }}" - } - } - name: cluster-test - server: '{{ .url | toString }}' - metadata: - labels: - argocd.argoproj.io/secret-type: cluster -status: - conditions: - - lastTransitionTime: '2021-11-16T21:59:34Z' - message: 'could not get secret data from provider: key "secret/sa/example" from ExternalSecret "test-degraded"' - reason: SecretSyncedError - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/external-secrets.io/ExternalSecret/testdata/healthy.yaml b/pkg/resource_customizations/external-secrets.io/ExternalSecret/testdata/healthy.yaml deleted file mode 100644 index da17edb..0000000 --- a/pkg/resource_customizations/external-secrets.io/ExternalSecret/testdata/healthy.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: external-secrets.io/v1alpha1 -kind: ExternalSecret -metadata: - creationTimestamp: '2021-11-16T21:59:33Z' - generation: 1 - name: test-healthy - namespace: argocd - resourceVersion: '136487331' - selfLink: /apis/external-secrets.io/v1alpha1/namespaces/argocd/externalsecrets/test-healthy - uid: 1e754a7e-0781-4d57-932d-4651d5b19586 -spec: - data: - - remoteRef: - key: secret/sa/example - property: api.address - secretKey: url - - remoteRef: - key: secret/sa/example - property: ca.crt - secretKey: ca - - remoteRef: - key: secret/sa/example - property: token - secretKey: token - refreshInterval: 1m - secretStoreRef: - kind: SecretStore - name: example - target: - creationPolicy: Owner - template: - data: - config: | - { - "bearerToken": "{{ .token | base64decode | toString }}", - "tlsClientConfig": { - "insecure": false, - "caData": "{{ .ca | toString }}" - } - } - name: cluster-test - server: '{{ .url | toString }}' - metadata: - labels: - argocd.argoproj.io/secret-type: cluster -status: - conditions: - - lastTransitionTime: '2021-11-16T21:59:34Z' - message: Secret was synced - reason: SecretSynced - status: 'True' - type: Ready - refreshTime: '2021-11-29T18:32:24Z' - syncedResourceVersion: 1-519a61da0dc68b2575b4f8efada70e42 diff --git a/pkg/resource_customizations/external-secrets.io/ExternalSecret/testdata/progressing.yaml b/pkg/resource_customizations/external-secrets.io/ExternalSecret/testdata/progressing.yaml deleted file mode 100644 index 5e55797..0000000 --- a/pkg/resource_customizations/external-secrets.io/ExternalSecret/testdata/progressing.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: external-secrets.io/v1alpha1 -kind: ExternalSecret -metadata: - creationTimestamp: '2021-11-16T21:59:33Z' - generation: 1 - name: test-progressing - namespace: argocd - resourceVersion: '136487331' - selfLink: /apis/external-secrets.io/v1alpha1/namespaces/argocd/externalsecrets/test-progressing - uid: 1e754a7e-0781-4d57-932d-4651d5b19586 -spec: - data: - - remoteRef: - key: secret/sa/example - property: api.address - secretKey: url - - remoteRef: - key: secret/sa/example - property: ca.crt - secretKey: ca - - remoteRef: - key: secret/sa/example - property: token - secretKey: token - refreshInterval: 1m - secretStoreRef: - kind: SecretStore - name: example - target: - creationPolicy: Owner - template: - data: - config: | - { - "bearerToken": "{{ .token | base64decode | toString }}", - "tlsClientConfig": { - "insecure": false, - "caData": "{{ .ca | toString }}" - } - } - name: cluster-test - server: '{{ .url | toString }}' - metadata: - labels: - argocd.argoproj.io/secret-type: cluster diff --git a/pkg/resource_customizations/external-secrets.io/SecretStore/health.lua b/pkg/resource_customizations/external-secrets.io/SecretStore/health.lua deleted file mode 100644 index 5c58908..0000000 --- a/pkg/resource_customizations/external-secrets.io/SecretStore/health.lua +++ /dev/null @@ -1,20 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" and condition.status == "False" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - end - end -end -hs.status = "Progressing" -hs.message = "Waiting for SecretStore" -return hs diff --git a/pkg/resource_customizations/external-secrets.io/SecretStore/health_test.yaml b/pkg/resource_customizations/external-secrets.io/SecretStore/health_test.yaml deleted file mode 100644 index 6e69215..0000000 --- a/pkg/resource_customizations/external-secrets.io/SecretStore/health_test.yaml +++ /dev/null @@ -1,9 +0,0 @@ -tests: - - healthStatus: - status: Degraded - message: 'unable to validate store' - inputPath: testdata/degraded.yaml - - healthStatus: - status: Healthy - message: 'store validated' - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/external-secrets.io/SecretStore/testdata/degraded.yaml b/pkg/resource_customizations/external-secrets.io/SecretStore/testdata/degraded.yaml deleted file mode 100644 index 6fe5150..0000000 --- a/pkg/resource_customizations/external-secrets.io/SecretStore/testdata/degraded.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: SecretStore -metadata: - name: vault -spec: - provider: - kubernetes: - auth: - serviceAccount: - name: vault - remoteNamespace: vault - server: - caProvider: - key: ca.crt - name: kube-root-ca.crt - type: ConfigMap - url: https://kubernetes.default -status: - conditions: - - lastTransitionTime: "2022-10-05T13:59:22Z" - message: unable to validate store - reason: ValidationFailed - status: "False" - type: Ready diff --git a/pkg/resource_customizations/external-secrets.io/SecretStore/testdata/healthy.yaml b/pkg/resource_customizations/external-secrets.io/SecretStore/testdata/healthy.yaml deleted file mode 100644 index e93ca88..0000000 --- a/pkg/resource_customizations/external-secrets.io/SecretStore/testdata/healthy.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: SecretStore -metadata: - name: vault -spec: - provider: - vault: - auth: - kubernetes: - mountPath: foobar - role: vault - secretRef: - key: token - name: vault - caBundle: foobar - namespace: pki - path: secret - server: https://foo.bar - version: v2 - retrySettings: - maxRetries: 5 - retryInterval: 10s -status: - conditions: - - lastTransitionTime: "2022-10-06T15:48:42Z" - message: store validated - reason: Valid - status: "True" - type: Ready diff --git a/pkg/resource_customizations/flagger.app/Canary/health.lua b/pkg/resource_customizations/flagger.app/Canary/health.lua deleted file mode 100644 index 8687255..0000000 --- a/pkg/resource_customizations/flagger.app/Canary/health.lua +++ /dev/null @@ -1,31 +0,0 @@ -sep = " --- " -hs = {} -if obj.status ~= nil then - message = "" - if tonumber(obj.status.canaryWeight) > 0 then - message = "Canary Weight: " .. obj.status.canaryWeight .. " %" - end - for i, condition in ipairs(obj.status.conditions) do - if message ~= "" then - message = message .. sep - end - message = message .. condition.message - end - if obj.status.phase == "Failed" then - hs.status = "Degraded" - elseif ( obj.status.phase == "Progressing" or - obj.status.phase == "Finalising" or - obj.status.phase == "Promoting" ) then - hs.status = "Progressing" - elseif ( obj.status.phase == "Succeeded" or - obj.status.phase == "Initialized" ) then - hs.status = "Healthy" - else - hs.status = "Unknown" - end - hs.message = obj.status.phase .. sep .. message - return hs -end -hs.status = "Unknown" -hs.message = "No status" -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/flagger.app/Canary/health_test.yaml b/pkg/resource_customizations/flagger.app/Canary/health_test.yaml deleted file mode 100644 index 7851abb..0000000 --- a/pkg/resource_customizations/flagger.app/Canary/health_test.yaml +++ /dev/null @@ -1,25 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Progressing --- Canary Weight: 10 % --- New revision detected, progressing canary analysis." - inputPath: testdata/progressing.yaml -- healthStatus: - status: Progressing - message: "Finalising --- Canary analysis completed, routing all traffic to primary." - inputPath: testdata/finalising.yaml -- healthStatus: - status: Progressing - message: "Promoting --- Canary analysis completed, starting primary rolling update." - inputPath: testdata/promoting.yaml -- healthStatus: - status: Degraded - message: "Failed --- Canary analysis failed, Deployment scaled to zero." - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: "Succeeded --- Canary analysis completed successfully, promotion finished." - inputPath: testdata/succeeded.yaml -- healthStatus: - status: Healthy - message: "Initialized --- Installation successful." - inputPath: testdata/initialized.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/flagger.app/Canary/testdata/degraded.yaml b/pkg/resource_customizations/flagger.app/Canary/testdata/degraded.yaml deleted file mode 100644 index 3d374a2..0000000 --- a/pkg/resource_customizations/flagger.app/Canary/testdata/degraded.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: flagger.app/v1beta1 -kind: Canary -metadata: - generation: 1 - labels: - app.kubernetes.io/instance: podinfo - name: podinfo - namespace: default - resourceVersion: "2268395" - selfLink: /apis/flagger.app/v1beta1/namespaces/default/canaries/podinfo - uid: 82df0136-0248-4a95-9c60-3184792614ea -spec: {} -status: - canaryWeight: 0 - conditions: - - lastTransitionTime: "2020-07-03T19:13:47Z" - lastUpdateTime: "2020-07-03T19:13:47Z" - message: Canary analysis failed, Deployment scaled to zero. - reason: Failed - status: "False" - type: Promoted - failedChecks: 0 - iterations: 0 - lastAppliedSpec: 765c47b8f7 - lastPromotedSpec: fc74df5fc - lastTransitionTime: "2020-07-03T19:13:47Z" - phase: Failed - trackedConfigs: {} - diff --git a/pkg/resource_customizations/flagger.app/Canary/testdata/finalising.yaml b/pkg/resource_customizations/flagger.app/Canary/testdata/finalising.yaml deleted file mode 100644 index f495888..0000000 --- a/pkg/resource_customizations/flagger.app/Canary/testdata/finalising.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: flagger.app/v1beta1 -kind: Canary -metadata: - generation: 1 - labels: - app.kubernetes.io/instance: podinfo - name: podinfo - namespace: default - resourceVersion: "2268395" - selfLink: /apis/flagger.app/v1beta1/namespaces/default/canaries/podinfo - uid: 82df0136-0248-4a95-9c60-3184792614ea -spec: {} -status: - canaryWeight: 0 - conditions: - - lastTransitionTime: "2020-07-03T18:53:02Z" - lastUpdateTime: "2020-07-03T18:55:12Z" - message: Canary analysis completed, routing all traffic to primary. - reason: Finalising - status: Unknown - type: Promoted - failedChecks: 0 - iterations: 0 - lastAppliedSpec: fc74df5fc - lastPromotedSpec: 744b467645 - lastTransitionTime: "2020-07-03T18:55:12Z" - phase: Finalising - trackedConfigs: {} \ No newline at end of file diff --git a/pkg/resource_customizations/flagger.app/Canary/testdata/initialized.yaml b/pkg/resource_customizations/flagger.app/Canary/testdata/initialized.yaml deleted file mode 100644 index effd8f8..0000000 --- a/pkg/resource_customizations/flagger.app/Canary/testdata/initialized.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: flagger.app/v1beta1 -kind: Canary -metadata: - generation: 1 - labels: - app.kubernetes.io/instance: podinfo - name: podinfo - namespace: default - resourceVersion: "2268395" - selfLink: /apis/flagger.app/v1beta1/namespaces/default/canaries/podinfo - uid: 82df0136-0248-4a95-9c60-3184792614ea -spec: {} -status: - canaryWeight: 0 - conditions: - - lastTransitionTime: "2020-07-03T13:36:22Z" - lastUpdateTime: "2020-07-03T13:36:22Z" - message: Installation successful. - reason: Initialized - status: "True" - type: Promoted - failedChecks: 0 - iterations: 0 - lastAppliedSpec: 658bbf784f - lastPromotedSpec: 658bbf784f - lastTransitionTime: "2020-07-03T13:36:22Z" - phase: Initialized - trackedConfigs: {} diff --git a/pkg/resource_customizations/flagger.app/Canary/testdata/progressing.yaml b/pkg/resource_customizations/flagger.app/Canary/testdata/progressing.yaml deleted file mode 100644 index 771d4b3..0000000 --- a/pkg/resource_customizations/flagger.app/Canary/testdata/progressing.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: flagger.app/v1beta1 -kind: Canary -metadata: - generation: 1 - labels: - app.kubernetes.io/instance: podinfo - name: podinfo - namespace: default - resourceVersion: "2268395" - selfLink: /apis/flagger.app/v1beta1/namespaces/default/canaries/podinfo - uid: 82df0136-0248-4a95-9c60-3184792614ea -spec: {} -status: - canaryWeight: 10 - conditions: - - lastTransitionTime: "2020-07-03T18:46:52Z" - lastUpdateTime: "2020-07-03T18:46:52Z" - message: New revision detected, progressing canary analysis. - reason: Progressing - status: Unknown - type: Promoted - failedChecks: 0 - iterations: 0 - lastAppliedSpec: 5c75b466fb - lastPromotedSpec: 658bbf784f - lastTransitionTime: "2020-07-03T18:47:02Z" - phase: Progressing - trackedConfigs: {} diff --git a/pkg/resource_customizations/flagger.app/Canary/testdata/promoting.yaml b/pkg/resource_customizations/flagger.app/Canary/testdata/promoting.yaml deleted file mode 100644 index 6486b1c..0000000 --- a/pkg/resource_customizations/flagger.app/Canary/testdata/promoting.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: flagger.app/v1beta1 -kind: Canary -metadata: - generation: 1 - labels: - app.kubernetes.io/instance: podinfo - name: podinfo - namespace: default - resourceVersion: "2268395" - selfLink: /apis/flagger.app/v1beta1/namespaces/default/canaries/podinfo - uid: 82df0136-0248-4a95-9c60-3184792614ea -spec: {} -status: - canaryWeight: 0 - conditions: - - lastTransitionTime: "2020-07-03T18:53:02Z" - lastUpdateTime: "2020-07-03T18:55:02Z" - message: Canary analysis completed, starting primary rolling update. - reason: Promoting - status: Unknown - type: Promoted - failedChecks: 0 - iterations: 0 - lastAppliedSpec: fc74df5fc - lastPromotedSpec: 744b467645 - lastTransitionTime: "2020-07-03T18:55:02Z" - phase: Promoting - trackedConfigs: {} \ No newline at end of file diff --git a/pkg/resource_customizations/flagger.app/Canary/testdata/succeeded.yaml b/pkg/resource_customizations/flagger.app/Canary/testdata/succeeded.yaml deleted file mode 100644 index 5ccc01f..0000000 --- a/pkg/resource_customizations/flagger.app/Canary/testdata/succeeded.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: flagger.app/v1beta1 -kind: Canary -metadata: - generation: 1 - labels: - app.kubernetes.io/instance: podinfo - name: podinfo - namespace: default - resourceVersion: "2268395" - selfLink: /apis/flagger.app/v1beta1/namespaces/default/canaries/podinfo - uid: 82df0136-0248-4a95-9c60-3184792614ea -spec: {} -status: - canaryWeight: 0 - conditions: - - lastTransitionTime: "2020-07-03T13:36:22Z" - lastUpdateTime: "2020-07-03T13:36:22Z" - message: Canary analysis completed successfully, promotion finished. - reason: Succeeded - status: "True" - type: Promoted - failedChecks: 0 - iterations: 0 - lastAppliedSpec: 658bbf784f - lastPromotedSpec: 658bbf784f - lastTransitionTime: "2020-07-03T13:36:22Z" - phase: Succeeded - trackedConfigs: {} diff --git a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/health.lua b/pkg/resource_customizations/flink.apache.org/FlinkDeployment/health.lua deleted file mode 100644 index 64c0782..0000000 --- a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/health.lua +++ /dev/null @@ -1,24 +0,0 @@ -health_status = {} - -if obj.status ~= nil and obj.status.reconciliationStatus ~= nil then - if obj.status.reconciliationStatus.success then - health_status.status = "Healthy" - return health_status - end - - if obj.status.jobManagerDeploymentStatus == "DEPLOYED_NOT_READY" or obj.status.jobManagerDeploymentStatus == "DEPLOYING" then - health_status.status = "Progressing" - health_status.message = "Waiting for deploying" - return health_status - end - - if obj.status.jobManagerDeploymentStatus == "ERROR" then - health_status.status = "Degraded" - health_status.message = obj.status.reconciliationStatus.error - return health_status - end -end - -health_status.status = "Progressing" -health_status.message = "Waiting for Flink operator" -return health_status diff --git a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/health_test.yaml b/pkg/resource_customizations/flink.apache.org/FlinkDeployment/health_test.yaml deleted file mode 100644 index 1e8cb55..0000000 --- a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/health_test.yaml +++ /dev/null @@ -1,19 +0,0 @@ -tests: -- healthStatus: - status: Healthy - inputPath: testdata/healthy_running.yaml -- healthStatus: - status: Healthy - inputPath: testdata/healthy_suspended.yaml -- healthStatus: - status: Progressing - message: Waiting for deploying - inputPath: testdata/progressing_deployedNotReady.yaml -- healthStatus: - status: Progressing - message: Waiting for deploying - inputPath: testdata/progressing_deploying.yaml -- healthStatus: - status: Degraded - message: "org.apache.flink.configuration.IllegalConfigurationException: TaskManager memory configuration failed: Cannot read memory size from config option ''taskmanager.memory.network.max''." - inputPath: testdata/degraded_error.yaml diff --git a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/degraded_error.yaml b/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/degraded_error.yaml deleted file mode 100644 index dc9ce97..0000000 --- a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/degraded_error.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: flink.apache.org/v1alpha1 -kind: FlinkDeployment -spec: {} -status: - jobManagerDeploymentStatus: ERROR - reconciliationStatus: - error: "org.apache.flink.configuration.IllegalConfigurationException: TaskManager memory configuration failed: Cannot read memory size from config option ''taskmanager.memory.network.max''." - success: false diff --git a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/healthy_running.yaml b/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/healthy_running.yaml deleted file mode 100644 index 879dc34..0000000 --- a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/healthy_running.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: flink.apache.org/v1alpha1 -kind: FlinkDeployment -spec: - job: - state: running -status: - jobManagerDeploymentStatus: READY - jobStatus: - state: RUNNING - reconciliationStatus: - success: true diff --git a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/healthy_suspended.yaml b/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/healthy_suspended.yaml deleted file mode 100644 index b49b313..0000000 --- a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/healthy_suspended.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: flink.apache.org/v1alpha1 -kind: FlinkDeployment -spec: - job: - state: suspended -status: - jobManagerDeploymentStatus: MISSING - jobStatus: - state: SUSPENDED - reconciliationStatus: - success: true diff --git a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/progressing_deployedNotReady.yaml b/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/progressing_deployedNotReady.yaml deleted file mode 100644 index 33bee63..0000000 --- a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/progressing_deployedNotReady.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: flink.apache.org/v1alpha1 -kind: FlinkDeployment -spec: {} -status: - jobManagerDeploymentStatus: DEPLOYED_NOT_READY - reconciliationStatus: {} diff --git a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/progressing_deploying.yaml b/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/progressing_deploying.yaml deleted file mode 100644 index 7792c69..0000000 --- a/pkg/resource_customizations/flink.apache.org/FlinkDeployment/testdata/progressing_deploying.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: flink.apache.org/v1alpha1 -kind: FlinkDeployment -spec: {} -status: - jobManagerDeploymentStatus: DEPLOYING - reconciliationStatus: {} diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/health.lua b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/health_test.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/dependency_not_found.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/dependency_not_found.yaml deleted file mode 100644 index 556376c..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPartialPolicy -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/dependency_not_ready.yaml deleted file mode 100644 index 6667133..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPartialPolicy -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/up_to_date.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/up_to_date.yaml deleted file mode 100644 index 93b5886..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPartialPolicy -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/update_failed.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/update_failed.yaml deleted file mode 100644 index d1de92b..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPartialPolicy -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/update_in_progress.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/update_in_progress.yaml deleted file mode 100644 index fd8d422..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPartialPolicy/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPartialPolicy -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/health.lua b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/health_test.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/dependency_not_found.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/dependency_not_found.yaml deleted file mode 100644 index 439546a..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPolicy -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/dependency_not_ready.yaml deleted file mode 100644 index 03d48f0..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPolicy -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/up_to_date.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/up_to_date.yaml deleted file mode 100644 index 1b1b946..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPolicy -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/update_failed.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/update_failed.yaml deleted file mode 100644 index 786f2e5..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPolicy -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/update_in_progress.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/update_in_progress.yaml deleted file mode 100644 index d218393..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicy/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPolicy -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/health.lua b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/health_test.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/dependency_not_found.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/dependency_not_found.yaml deleted file mode 100644 index f822d7e..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPolicyMember -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/dependency_not_ready.yaml deleted file mode 100644 index e5e3e6a..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPolicyMember -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/up_to_date.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/up_to_date.yaml deleted file mode 100644 index 35575a1..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPolicyMember -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/update_failed.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/update_failed.yaml deleted file mode 100644 index 8c89620..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPolicyMember -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/update_in_progress.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/update_in_progress.yaml deleted file mode 100644 index 8d7208e..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMPolicyMember/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMPolicyMember -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/health.lua b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/health_test.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/dependency_not_found.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/dependency_not_found.yaml deleted file mode 100644 index f05d74c..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMServiceAccount -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/dependency_not_ready.yaml deleted file mode 100644 index 0e7962f..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMServiceAccount -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/up_to_date.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/up_to_date.yaml deleted file mode 100644 index 6124232..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMServiceAccount -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/update_failed.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/update_failed.yaml deleted file mode 100644 index f6c6e05..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMServiceAccount -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/update_in_progress.yaml b/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/update_in_progress.yaml deleted file mode 100644 index f313ba6..0000000 --- a/pkg/resource_customizations/iam.cnrm.cloud.google.com/IAMServiceAccount/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: iam.cnrm.cloud.google.com/v1beta1 -kind: IAMServiceAccount -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/install.istio.io/IstioOperator/health.lua b/pkg/resource_customizations/install.istio.io/IstioOperator/health.lua deleted file mode 100644 index e2538de..0000000 --- a/pkg/resource_customizations/install.istio.io/IstioOperator/health.lua +++ /dev/null @@ -1,33 +0,0 @@ -health_status = {} -if obj.status ~= nil then - if obj.status.status ~= nil then - if obj.status.status == 0 or obj.status.status == "NONE" then - health_status.status = "Unknown" - health_status.message = "Component is not present." - return health_status - end - if obj.status.status == 1 or obj.status.status == "UPDATING" then - health_status.status = "Progressing" - health_status.message = "Component is being updated to a different version." - return health_status - end - if obj.status.status == 2 or obj.status.status == "RECONCILING" then - health_status.status = "Progressing" - health_status.message = "Controller has started but not yet completed reconciliation loop for the component." - return health_status - end - if obj.status.status == 3 or obj.status.status == "HEALTHY" then - health_status.status = "Healthy" - health_status.message = "Component is healthy." - return health_status - end - if obj.status.status == 4 or obj.status.status == "ERROR" then - health_status.status = "Degraded" - health_status.message = "Component is in an error state." - return health_status - end - end -end -health_status.status = "Progressing" -health_status.message = "Waiting for Istio Control Plane" -return health_status \ No newline at end of file diff --git a/pkg/resource_customizations/install.istio.io/IstioOperator/health_test.yaml b/pkg/resource_customizations/install.istio.io/IstioOperator/health_test.yaml deleted file mode 100644 index 689b66b..0000000 --- a/pkg/resource_customizations/install.istio.io/IstioOperator/health_test.yaml +++ /dev/null @@ -1,17 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Component is being updated to a different version." - inputPath: testdata/progressing_updating.yaml -- healthStatus: - status: Progressing - message: "Controller has started but not yet completed reconciliation loop for the component." - inputPath: testdata/progressing_reconciling.yaml -- healthStatus: - status: Degraded - message: "Component is in an error state." - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: "Component is healthy." - inputPath: testdata/healthy.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/install.istio.io/IstioOperator/testdata/degraded.yaml b/pkg/resource_customizations/install.istio.io/IstioOperator/testdata/degraded.yaml deleted file mode 100644 index f2a5d5e..0000000 --- a/pkg/resource_customizations/install.istio.io/IstioOperator/testdata/degraded.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: install.istio.io/v1alpha1 -kind: IstioOperator -metadata: - finalizers: - - istio-finalizer.install.istio.io - generation: 1 - labels: - argocd.argoproj.io/instance: istio-default - name: istio-control-plane - namespace: istio-system - resourceVersion: "270068" - selfLink: /apis/install.istio.io/v1alpha1/namespaces/istio-system/istiooperators/istio-control-plane - uid: d4ff8619-f3b0-4fb3-8bdb-a44ff44a401a -spec: {} -status: - componentStatus: - AddonComponents: - status: HEALTHY - Base: - status: ERROR - IngressGateways: - status: HEALTHY - Pilot: - status: HEALTHY - status: ERROR \ No newline at end of file diff --git a/pkg/resource_customizations/install.istio.io/IstioOperator/testdata/healthy.yaml b/pkg/resource_customizations/install.istio.io/IstioOperator/testdata/healthy.yaml deleted file mode 100644 index 3f47d94..0000000 --- a/pkg/resource_customizations/install.istio.io/IstioOperator/testdata/healthy.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: install.istio.io/v1alpha1 -kind: IstioOperator -metadata: - creationTimestamp: "2020-06-04T17:46:57Z" - finalizers: - - istio-finalizer.install.istio.io - generation: 1 - labels: - argocd.argoproj.io/instance: istio-default - name: istio-control-plane - namespace: istio-system - resourceVersion: "270068" - selfLink: /apis/install.istio.io/v1alpha1/namespaces/istio-system/istiooperators/istio-control-plane - uid: d4ff8619-f3b0-4fb3-8bdb-a44ff44a401a -spec: {} -status: - componentStatus: - AddonComponents: - status: HEALTHY - Base: - status: HEALTHY - IngressGateways: - status: HEALTHY - Pilot: - status: HEALTHY - status: HEALTHY \ No newline at end of file diff --git a/pkg/resource_customizations/install.istio.io/IstioOperator/testdata/progressing_reconciling.yaml b/pkg/resource_customizations/install.istio.io/IstioOperator/testdata/progressing_reconciling.yaml deleted file mode 100644 index d7c69fb..0000000 --- a/pkg/resource_customizations/install.istio.io/IstioOperator/testdata/progressing_reconciling.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: install.istio.io/v1alpha1 -kind: IstioOperator -metadata: - creationTimestamp: "2020-06-04T17:46:57Z" - finalizers: - - istio-finalizer.install.istio.io - generation: 1 - labels: - argocd.argoproj.io/instance: istio-default - name: istio-control-plane - namespace: istio-system - resourceVersion: "270068" - selfLink: /apis/install.istio.io/v1alpha1/namespaces/istio-system/istiooperators/istio-control-plane - uid: d4ff8619-f3b0-4fb3-8bdb-a44ff44a401a -spec: {} -status: - componentStatus: - AddonComponents: - status: HEALTHY - Base: - status: RECONCILING - IngressGateways: - status: HEALTHY - Pilot: - status: HEALTHY - status: RECONCILING \ No newline at end of file diff --git a/pkg/resource_customizations/install.istio.io/IstioOperator/testdata/progressing_updating.yaml b/pkg/resource_customizations/install.istio.io/IstioOperator/testdata/progressing_updating.yaml deleted file mode 100644 index 499c0c0..0000000 --- a/pkg/resource_customizations/install.istio.io/IstioOperator/testdata/progressing_updating.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: install.istio.io/v1alpha1 -kind: IstioOperator -metadata: - finalizers: - - istio-finalizer.install.istio.io - generation: 1 - labels: - argocd.argoproj.io/instance: istio-default - name: istio-control-plane - namespace: istio-system - resourceVersion: "270068" - selfLink: /apis/install.istio.io/v1alpha1/namespaces/istio-system/istiooperators/istio-control-plane - uid: d4ff8619-f3b0-4fb3-8bdb-a44ff44a401a -spec: {} -status: - componentStatus: - AddonComponents: - status: HEALTHY - Base: - status: HEALTHY - IngressGateways: - status: UPDATING - Pilot: - status: HEALTHY - status: UPDATING \ No newline at end of file diff --git a/pkg/resource_customizations/jaegertracing.io/Jaeger/health.lua b/pkg/resource_customizations/jaegertracing.io/Jaeger/health.lua deleted file mode 100644 index 71f1043..0000000 --- a/pkg/resource_customizations/jaegertracing.io/Jaeger/health.lua +++ /dev/null @@ -1,16 +0,0 @@ -health_status = {} -if obj.status ~= nil then - if obj.status.phase == "Running" then - health_status.status = "Healthy" - health_status.message = "Jaeger is Running" - return health_status - end - if obj.status.phase == "Failed" then - health_status.status = "Degraded" - health_status.message = "Jaeger Failed For Some Reason" - return health_status - end -end -health_status.status = "Progressing" -health_status.message = "Waiting for Jaeger" -return health_status \ No newline at end of file diff --git a/pkg/resource_customizations/jaegertracing.io/Jaeger/health_test.yaml b/pkg/resource_customizations/jaegertracing.io/Jaeger/health_test.yaml deleted file mode 100644 index 60cfa92..0000000 --- a/pkg/resource_customizations/jaegertracing.io/Jaeger/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Waiting for Jaeger" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Degraded - message: "Jaeger Failed For Some Reason" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: "Jaeger is Running" - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/jaegertracing.io/Jaeger/testdata/degraded.yaml b/pkg/resource_customizations/jaegertracing.io/Jaeger/testdata/degraded.yaml deleted file mode 100644 index f84ccc3..0000000 --- a/pkg/resource_customizations/jaegertracing.io/Jaeger/testdata/degraded.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: jaegertracing.io/v1 -kind: Jaeger -metadata: - generation: 3 - labels: - argocd.argoproj.io/instance: jaeger-operator-default - name: jaeger - namespace: jaeger - resourceVersion: "226432" - selfLink: /apis/jaegertracing.io/v1/namespaces/2269-jaeger/jaegers/jaeger - uid: 48d186c8-47d7-494b-8b6a-435747e406a4 -spec: {} -status: - phase: Failed - version: 1.17.0 \ No newline at end of file diff --git a/pkg/resource_customizations/jaegertracing.io/Jaeger/testdata/healthy.yaml b/pkg/resource_customizations/jaegertracing.io/Jaeger/testdata/healthy.yaml deleted file mode 100644 index 0f3fd4a..0000000 --- a/pkg/resource_customizations/jaegertracing.io/Jaeger/testdata/healthy.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: jaegertracing.io/v1 -kind: Jaeger -metadata: - generation: 3 - labels: - argocd.argoproj.io/instance: jaeger-operator-default - name: jaeger - namespace: jaeger - resourceVersion: "226432" - selfLink: /apis/jaegertracing.io/v1/namespaces/2269-jaeger/jaegers/jaeger - uid: 48d186c8-47d7-494b-8b6a-435747e406a4 -spec: {} -status: - phase: Running - version: 1.17.0 \ No newline at end of file diff --git a/pkg/resource_customizations/jaegertracing.io/Jaeger/testdata/progressing.yaml b/pkg/resource_customizations/jaegertracing.io/Jaeger/testdata/progressing.yaml deleted file mode 100644 index 7318564..0000000 --- a/pkg/resource_customizations/jaegertracing.io/Jaeger/testdata/progressing.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: jaegertracing.io/v1 -kind: Jaeger -metadata: - generation: 3 - labels: - argocd.argoproj.io/instance: jaeger-operator-default - name: jaeger - namespace: jaeger - resourceVersion: "226432" - selfLink: /apis/jaegertracing.io/v1/namespaces/2269-jaeger/jaegers/jaeger - uid: 48d186c8-47d7-494b-8b6a-435747e406a4 -spec: {} -status: {} \ No newline at end of file diff --git a/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/health.lua b/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/health.lua deleted file mode 100644 index 06082da..0000000 --- a/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/health.lua +++ /dev/null @@ -1,46 +0,0 @@ -health_status = {} -if obj.status ~= nil then - if obj.status.brokersState ~= nil then - counter = 0 - brokerReady = 0 - for i, broker in pairs(obj.status.brokersState) do - if (brokerReady <= tonumber(i)) then - brokerReady = tonumber(i)+1 - else - brokerReady = brokerReady - end - if broker.configurationState == "ConfigInSync" and broker.gracefulActionState.cruiseControlState == "GracefulUpscaleSucceeded" then - counter = counter + 1 - end - if broker.configurationState == "ConfigInSync" and broker.gracefulActionState.cruiseControlState == "GracefulDownscaleSucceeded" then - counter = counter + 1 - end - end - if counter == brokerReady then - if obj.status.cruiseControlTopicStatus == "CruiseControlTopicReady" and obj.status.state == "ClusterRunning" then - health_status.message = "Kafka Brokers, CruiseControl and cluster are in Healthy State." - health_status.status = "Healthy" - return health_status - end - if obj.status.cruiseControlTopicStatus == "CruiseControlTopicNotReady" or obj.status.cruiseControlTopicStatus == nil then - if obj.status.state == "ClusterReconciling" then - health_status.message = "Kafka Cluster is Reconciling." - health_status.status = "Progressing" - return health_status - end - if obj.status.state == "ClusterRollingUpgrading" then - health_status.message = "Kafka Cluster is Rolling Upgrading." - health_status.status = "Progressing" - return health_status - end - end - else - health_status.message = "Broker Config is out of Sync or CruiseControlState is not Ready" - health_status.status = "Degraded" - return health_status - end - end -end -health_status.status = "Progressing" -health_status.message = "Waiting for KafkaCluster" -return health_status \ No newline at end of file diff --git a/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/health_test.yaml b/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/health_test.yaml deleted file mode 100644 index 9446d88..0000000 --- a/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/health_test.yaml +++ /dev/null @@ -1,17 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Kafka Cluster is Reconciling." - inputPath: testdata/reconciling.yaml -- healthStatus: - status: Progressing - message: "Waiting for KafkaCluster" - inputPath: testdata/updating.yaml -- healthStatus: - status: Degraded - message: "Broker Config is out of Sync or CruiseControlState is not Ready" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: "Kafka Brokers, CruiseControl and cluster are in Healthy State." - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/degraded.yaml b/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/degraded.yaml deleted file mode 100644 index cbd14ce..0000000 --- a/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/degraded.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: kafka.banzaicloud.io/v1beta1 -kind: KafkaCluster -metadata: - finalizers: - - finalizer.kafkaclusters.kafka.banzaicloud.io - - topics.kafkaclusters.kafka.banzaicloud.io - - users.kafkaclusters.kafka.banzaicloud.io - generation: 4 - labels: - argocd.argoproj.io/instance: kafka-cluster - controller-tools.k8s.io: "1.0" - name: kafkacluster - namespace: kafka - name: kafkacluster - namespace: kafka - resourceVersion: "31935335" - selfLink: /apis/kafka.banzaicloud.io/v1beta1/namespaces/2269-kafka/kafkaclusters/kafkacluster - uid: c6affef0-651d-44c7-8bff-638961517c8d -spec: {} -status: - alertCount: 0 - brokersState: - "0": - configurationState: ConfigInSync - gracefulActionState: - cruiseControlState: GracefulUpscaleSucceeded - errorMessage: CruiseControl not yet ready - rackAwarenessState: | - broker.rack=us-east-1,us-east-1c - "1": - configurationState: ConfigInSync - gracefulActionState: - cruiseControlState: GracefulUpscaleSucceeded - errorMessage: CruiseControl not yet ready - rackAwarenessState: | - broker.rack=us-east-1,us-east-1b - "2": - configurationState: ConfigOutOfSync - gracefulActionState: - cruiseControlState: GracefulUpscaleSucceeded - errorMessage: CruiseControl not yet ready - rackAwarenessState: | - broker.rack=us-east-1,us-east-1a - cruiseControlTopicStatus: CruiseControlTopicReady - rollingUpgradeStatus: - errorCount: 0 - lastSuccess: "" - state: ClusterRunning \ No newline at end of file diff --git a/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/healthy.yaml b/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/healthy.yaml deleted file mode 100644 index 9dd791b..0000000 --- a/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/healthy.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: kafka.banzaicloud.io/v1beta1 -kind: KafkaCluster -metadata: - finalizers: - - finalizer.kafkaclusters.kafka.banzaicloud.io - - topics.kafkaclusters.kafka.banzaicloud.io - - users.kafkaclusters.kafka.banzaicloud.io - generation: 4 - labels: - argocd.argoproj.io/instance: kafka-cluster - controller-tools.k8s.io: "1.0" - name: kafkacluster - namespace: kafka - name: kafkacluster - namespace: kafka - resourceVersion: "31935335" - selfLink: /apis/kafka.banzaicloud.io/v1beta1/namespaces/2269-kafka/kafkaclusters/kafkacluster - uid: c6affef0-651d-44c7-8bff-638961517c8d -spec: {} -status: - alertCount: 0 - brokersState: - "0": - configurationState: ConfigInSync - gracefulActionState: - cruiseControlState: GracefulUpscaleSucceeded - errorMessage: CruiseControl not yet ready - rackAwarenessState: | - broker.rack=us-east-1,us-east-1c - "1": - configurationState: ConfigInSync - gracefulActionState: - cruiseControlState: GracefulUpscaleSucceeded - errorMessage: CruiseControl not yet ready - rackAwarenessState: | - broker.rack=us-east-1,us-east-1b - "2": - configurationState: ConfigInSync - gracefulActionState: - cruiseControlState: GracefulUpscaleSucceeded - errorMessage: CruiseControl not yet ready - rackAwarenessState: | - broker.rack=us-east-1,us-east-1a - cruiseControlTopicStatus: CruiseControlTopicReady - rollingUpgradeStatus: - errorCount: 0 - lastSuccess: "" - state: ClusterRunning \ No newline at end of file diff --git a/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/reconciling.yaml b/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/reconciling.yaml deleted file mode 100644 index 8283358..0000000 --- a/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/reconciling.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: kafka.banzaicloud.io/v1beta1 -kind: KafkaCluster -metadata: - finalizers: - - finalizer.kafkaclusters.kafka.banzaicloud.io - - topics.kafkaclusters.kafka.banzaicloud.io - - users.kafkaclusters.kafka.banzaicloud.io - generation: 4 - labels: - argocd.argoproj.io/instance: kafka-cluster - controller-tools.k8s.io: "1.0" - name: kafkacluster - namespace: kafka - name: kafkacluster - namespace: kafka - resourceVersion: "31935335" - selfLink: /apis/kafka.banzaicloud.io/v1beta1/namespaces/2269-kafka/kafkaclusters/kafkacluster - uid: c6affef0-651d-44c7-8bff-638961517c8d -spec: {} -status: - alertCount: 0 - brokersState: - "0": - configurationState: ConfigInSync - gracefulActionState: - cruiseControlState: GracefulUpscaleSucceeded - errorMessage: CruiseControl not yet ready - rackAwarenessState: | - broker.rack=us-east-1,us-east-1c - "1": - configurationState: ConfigInSync - gracefulActionState: - cruiseControlState: GracefulUpscaleSucceeded - errorMessage: CruiseControl not yet ready - rackAwarenessState: | - broker.rack=us-east-1,us-east-1b - "2": - configurationState: ConfigInSync - gracefulActionState: - cruiseControlState: GracefulUpscaleSucceeded - errorMessage: CruiseControl not yet ready - rackAwarenessState: | - broker.rack=us-east-1,us-east-1a - cruiseControlTopicStatus: CruiseControlTopicNotReady - rollingUpgradeStatus: - errorCount: 0 - lastSuccess: "" - state: ClusterReconciling \ No newline at end of file diff --git a/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/updating.yaml b/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/updating.yaml deleted file mode 100644 index 21459d2..0000000 --- a/pkg/resource_customizations/kafka.banzaicloud.io/KafkaCluster/testdata/updating.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: kafka.banzaicloud.io/v1beta1 -kind: KafkaCluster -metadata: - finalizers: - - finalizer.kafkaclusters.kafka.banzaicloud.io - - topics.kafkaclusters.kafka.banzaicloud.io - - users.kafkaclusters.kafka.banzaicloud.io - generation: 4 - labels: - argocd.argoproj.io/instance: kafka-cluster - controller-tools.k8s.io: "1.0" - name: kafkacluster - namespace: kafka - name: kafkacluster - namespace: kafka - resourceVersion: "31935335" - selfLink: /apis/kafka.banzaicloud.io/v1beta1/namespaces/2269-kafka/kafkaclusters/kafkacluster - uid: c6affef0-651d-44c7-8bff-638961517c8d -spec: {} -status: - alertCount: 0 - brokersState: - "0": - configurationState: ConfigInSync - gracefulActionState: - cruiseControlState: GracefulUpscaleSucceeded - errorMessage: CruiseControl not yet ready - rackAwarenessState: | - broker.rack=us-east-1,us-east-1c - "1": - configurationState: ConfigInSync - gracefulActionState: - cruiseControlState: GracefulUpscaleSucceeded - errorMessage: CruiseControl not yet ready - rackAwarenessState: | - broker.rack=us-east-1,us-east-1b - "2": - configurationState: ConfigInSync - gracefulActionState: - cruiseControlState: GracefulUpscaleSucceeded - errorMessage: CruiseControl not yet ready - rackAwarenessState: | - broker.rack=us-east-1,us-east-1a - cruiseControlTopicStatus: ClusterRollingUpgrading - rollingUpgradeStatus: - errorCount: 0 - lastSuccess: "" - state: ClusterRunning \ No newline at end of file diff --git a/pkg/resource_customizations/kafka.strimzi.io/Kafka/health.lua b/pkg/resource_customizations/kafka.strimzi.io/Kafka/health.lua deleted file mode 100644 index 759f94a..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/Kafka/health.lua +++ /dev/null @@ -1,21 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "NotReady" and condition.status == "True" and condition.reason ~= "Creating" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "True" then - hs.status = "Healthy" - hs.message = "" - return hs - end - end - end -end - -hs.status = "Progressing" -hs.message = "Waiting for Kafka Cluster" -return hs diff --git a/pkg/resource_customizations/kafka.strimzi.io/Kafka/health_test.yaml b/pkg/resource_customizations/kafka.strimzi.io/Kafka/health_test.yaml deleted file mode 100644 index 0038036..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/Kafka/health_test.yaml +++ /dev/null @@ -1,12 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Waiting for Kafka Cluster" - inputPath: testdata/progressing_noStatus.yaml -- healthStatus: - status: Degraded - message: "Exceeded timeout of 300000ms while waiting for StatefulSet resource my-cluster-zookeeper in namespace default to be ready" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/kafka.strimzi.io/Kafka/testdata/degraded.yaml b/pkg/resource_customizations/kafka.strimzi.io/Kafka/testdata/degraded.yaml deleted file mode 100644 index f4d585c..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/Kafka/testdata/degraded.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: kafka.strimzi.io/v1beta1 -kind: Kafka -metadata: - creationTimestamp: "2021-02-22T15:59:14Z" - generation: 1 - name: my-cluster - namespace: default - resourceVersion: "134745509" - selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/default/kafkas/my-cluster - uid: 69de4987-371b-4300-a3cc-545bfab1dc87 -spec: - entityOperator: - topicOperator: {} - userOperator: {} - kafka: - config: - inter.broker.protocol.version: "2.7" - log.message.format.version: "2.7" - offsets.topics.replication.factor: 1 - transaction.state.log.min.isr: 1 - transaction.state.log.replication.factor: 1 - listeners: - - name: plain - port: 9092 - tls: false - type: internal - - name: tls - port: 9093 - tls: false - type: internal - replicas: 1 - storage: - type: ephemeral - zookeeper: - replicas: 1 - storage: - type: ephemeral -status: - clusterId: 463lY141TCqd6DDvPj5EDw - conditions: - - lastTransitionTime: 2021-02-22T16:05:43+0000 - message: Exceeded timeout of 300000ms while waiting for StatefulSet resource my-cluster-zookeeper - in namespace default to be ready - reason: TimeoutException - status: "True" - type: NotReady - observedGeneration: 1 diff --git a/pkg/resource_customizations/kafka.strimzi.io/Kafka/testdata/healthy.yaml b/pkg/resource_customizations/kafka.strimzi.io/Kafka/testdata/healthy.yaml deleted file mode 100644 index dc05490..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/Kafka/testdata/healthy.yaml +++ /dev/null @@ -1,61 +0,0 @@ -apiVersion: kafka.strimzi.io/v1beta1 -kind: Kafka -metadata: - creationTimestamp: "2021-02-22T15:59:14Z" - generation: 1 - name: my-cluster - namespace: default - resourceVersion: "134745509" - selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/default/kafkas/my-cluster - uid: 69de4987-371b-4300-a3cc-545bfab1dc87 -spec: - entityOperator: - topicOperator: {} - userOperator: {} - kafka: - config: - inter.broker.protocol.version: "2.7" - log.message.format.version: "2.7" - offsets.topics.replication.factor: 1 - transaction.state.log.min.isr: 1 - transaction.state.log.replication.factor: 1 - listeners: - - name: plain - port: 9092 - tls: false - type: internal - - name: tls - port: 9093 - tls: false - type: internal - replicas: 1 - storage: - type: ephemeral - zookeeper: - replicas: 1 - storage: - type: ephemeral -status: - clusterId: 463lY141TCqd6DDvPj5EDw - conditions: - - lastTransitionTime: 2021-02-22T16:05:43+0000 - message: A Kafka cluster with a single replica and ephemeral storage will lose - topic messages after any restart or rolling update - reason: KafkaStorage - status: "True" - type: Warning - - lastTransitionTime: 2021-02-22T16:05:47+0000 - status: "True" - type: Ready - listeners: - - addresses: - - host: my-cluster-kafka-bootstrap.default.svc - port: 9092 - bootstrapServers: my-cluster-kafka-bootstrap.default.svc:9092 - type: plain - - addresses: - - host: my-cluster-kafka-bootstrap.default.svc - port: 9093 - bootstrapServers: my-cluster-kafka-bootstrap.default.svc:9093 - type: tls - observedGeneration: 1 diff --git a/pkg/resource_customizations/kafka.strimzi.io/Kafka/testdata/progressing_noStatus.yaml b/pkg/resource_customizations/kafka.strimzi.io/Kafka/testdata/progressing_noStatus.yaml deleted file mode 100644 index 0dba63e..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/Kafka/testdata/progressing_noStatus.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: kafka.strimzi.io/v1beta1 -kind: Kafka -metadata: - creationTimestamp: "2021-02-22T15:59:14Z" - generation: 1 - name: my-cluster - namespace: default - resourceVersion: "134745509" - selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/default/kafkas/my-cluster - uid: 69de4987-371b-4300-a3cc-545bfab1dc87 -spec: - entityOperator: - topicOperator: {} - userOperator: {} - kafka: - config: - inter.broker.protocol.version: "2.7" - log.message.format.version: "2.7" - offsets.topics.replication.factor: 1 - transaction.state.log.min.isr: 1 - transaction.state.log.replication.factor: 1 - listeners: - - name: plain - port: 9092 - tls: false - type: internal - - name: tls - port: 9093 - tls: false - type: internal - replicas: 1 - storage: - type: ephemeral - zookeeper: - replicas: 1 - storage: - type: ephemeral diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/health.lua b/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/health.lua deleted file mode 100644 index f12158d..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/health.lua +++ /dev/null @@ -1,21 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "NotReady" and condition.status == "True" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "True" then - hs.status = "Healthy" - hs.message = "" - return hs - end - end - end -end - -hs.status = "Progressing" -hs.message = "Waiting for Kafka Connect" -return hs diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/health_test.yaml b/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/health_test.yaml deleted file mode 100644 index 96b56b2..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/health_test.yaml +++ /dev/null @@ -1,12 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Waiting for Kafka Connect" - inputPath: testdata/progressing_noStatus.yaml -- healthStatus: - status: Degraded - message: "Error" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/testdata/degraded.yaml b/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/testdata/degraded.yaml deleted file mode 100644 index b7c9d15..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/testdata/degraded.yaml +++ /dev/null @@ -1,104 +0,0 @@ -apiVersion: kafka.strimzi.io/v1beta1 -kind: KafkaConnect -metadata: - creationTimestamp: "2020-02-13T14:03:15Z" - deletionGracePeriodSeconds: 0 - deletionTimestamp: "2020-05-28T10:29:44Z" - finalizers: - - foregroundDeletion - generation: 25 - labels: - app.kubernetes.io/instance: kafka-connect - name: kafka - namespace: strimzi - resourceVersion: "43088521" - selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/strimzi/kafkaconnects/kafka - uid: 941ae21d-4e69-11ea-a53d-06e66a171f98 -spec: - bootstrapServers: PLAINTEXT://b-1.kafka.eu-west-1.amazonaws.com:9092, - PLAINTEXT://b-2.kafka.eu-west-1.amazonaws.com:9092, PLAINTEXT://b-3.kafka.eu-west-1.amazonaws.com:9092 - config: - config.providers: file - config.providers.file.class: org.apache.kafka.common.config.provider.FileConfigProvider - config.storage.topic: connect-configs - connector.client.config.override.policy: All - group.id: connect-cluster - internal.key.converter: org.apache.kafka.connect.json.JsonConverter - internal.key.converter.schemas.enable: "false" - internal.value.converter: org.apache.kafka.connect.json.JsonConverter - internal.value.converter.schemas.enable: "false" - key.converter: org.apache.kafka.connect.storage.StringConverter - key.converter.schemas.enable: "false" - offset.storage.topic: connect-offsets - schema.registry.url: http://kafka-schema-registry:8081 - status.storage.topic: connect-statuses - task.shutdown.graceful.timeout.ms: 30000 - value.converter: io.confluent.connect.avro.AvroConverter - value.converter.schema.registry.url: http://kafka-schema-registry:8081 - value.converter.schemas.enable: "true" - externalConfiguration: - volumes: - - name: kafka-connect-credentials - secret: - secretName: kafka-connect-credentials - image: strimzi/kafka-connect:strimzi_0.17.0_kafka_2.3.1-2 - jvmOptions: - -Xms: 8000m - -Xmx: 8000m - gcLoggingEnabled: false - logging: - type: inline - replicas: 5 - resources: - limits: - cpu: "1" - memory: 7Gi - requests: - cpu: "1" - memory: 5Gi - template: - connectContainer: - env: - - name: JMX_PORT - value: "9999" - pod: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - podAffinityTerm: - labelSelector: - matchExpressions: - - key: strimzi.io/name - operator: In - values: - - kafka-connect - topologyKey: kubernetes.io/hostname - weight: 100 - - podAffinityTerm: - labelSelector: - matchExpressions: - - key: strimzi.io/name - operator: In - values: - - kafka-connect - topologyKey: topology.kubernetes.io/zone - weight: 100 - metadata: - annotations: - prometheus.io/path: / - prometheus.io/port: "9404" - prometheus.io/scrape: true - priorityClassName: kafka-connect - tolerations: - - effect: NoSchedule - key: dynamic-node - operator: Equal - value: "true" -status: - conditions: - - lastTransitionTime: "2020-05-28T13:43:05.813Z" - status: "True" - type: NotReady - message: "Error" - observedGeneration: 25 - url: http://kafka-connect-api.strimzi.svc:8083 diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/testdata/healthy.yaml b/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/testdata/healthy.yaml deleted file mode 100644 index 1d03d3b..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/testdata/healthy.yaml +++ /dev/null @@ -1,103 +0,0 @@ -apiVersion: kafka.strimzi.io/v1beta1 -kind: KafkaConnect -metadata: - creationTimestamp: "2020-02-13T14:03:15Z" - deletionGracePeriodSeconds: 0 - deletionTimestamp: "2020-05-28T10:29:44Z" - finalizers: - - foregroundDeletion - generation: 25 - labels: - app.kubernetes.io/instance: kafka-connect - name: kafka - namespace: strimzi - resourceVersion: "43088521" - selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/strimzi/kafkaconnects/kafka - uid: 941ae21d-4e69-11ea-a53d-06e66a171f98 -spec: - bootstrapServers: PLAINTEXT://b-1.kafka.eu-west-1.amazonaws.com:9092, - PLAINTEXT://b-2.kafka.eu-west-1.amazonaws.com:9092, PLAINTEXT://b-3.kafka.eu-west-1.amazonaws.com:9092 - config: - config.providers: file - config.providers.file.class: org.apache.kafka.common.config.provider.FileConfigProvider - config.storage.topic: connect-configs - connector.client.config.override.policy: All - group.id: connect-cluster - internal.key.converter: org.apache.kafka.connect.json.JsonConverter - internal.key.converter.schemas.enable: "false" - internal.value.converter: org.apache.kafka.connect.json.JsonConverter - internal.value.converter.schemas.enable: "false" - key.converter: org.apache.kafka.connect.storage.StringConverter - key.converter.schemas.enable: "false" - offset.storage.topic: connect-offsets - schema.registry.url: http://kafka-schema-registry:8081 - status.storage.topic: connect-statuses - task.shutdown.graceful.timeout.ms: 30000 - value.converter: io.confluent.connect.avro.AvroConverter - value.converter.schema.registry.url: http://kafka-schema-registry:8081 - value.converter.schemas.enable: "true" - externalConfiguration: - volumes: - - name: kafka-connect-credentials - secret: - secretName: kafka-connect-credentials - image: strimzi/kafka-connect:strimzi_0.17.0_kafka_2.3.1-2 - jvmOptions: - -Xms: 8000m - -Xmx: 8000m - gcLoggingEnabled: false - logging: - type: inline - replicas: 5 - resources: - limits: - cpu: "1" - memory: 7Gi - requests: - cpu: "1" - memory: 5Gi - template: - connectContainer: - env: - - name: JMX_PORT - value: "9999" - pod: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - podAffinityTerm: - labelSelector: - matchExpressions: - - key: strimzi.io/name - operator: In - values: - - kafka-connect - topologyKey: kubernetes.io/hostname - weight: 100 - - podAffinityTerm: - labelSelector: - matchExpressions: - - key: strimzi.io/name - operator: In - values: - - kafka-connect - topologyKey: topology.kubernetes.io/zone - weight: 100 - metadata: - annotations: - prometheus.io/path: / - prometheus.io/port: "9404" - prometheus.io/scrape: true - priorityClassName: kafka-connect - tolerations: - - effect: NoSchedule - key: dynamic-node - operator: Equal - value: "true" -status: - conditions: - - lastTransitionTime: "2020-05-28T13:43:05.813Z" - status: "True" - type: Ready - observedGeneration: 25 - url: http://kafka-connect-api.strimzi.svc:8083 diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/testdata/progressing_noStatus.yaml b/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/testdata/progressing_noStatus.yaml deleted file mode 100644 index 7f21852..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaConnect/testdata/progressing_noStatus.yaml +++ /dev/null @@ -1,96 +0,0 @@ -apiVersion: kafka.strimzi.io/v1beta1 -kind: KafkaConnect -metadata: - creationTimestamp: "2020-02-13T14:03:15Z" - deletionGracePeriodSeconds: 0 - deletionTimestamp: "2020-05-28T10:29:44Z" - finalizers: - - foregroundDeletion - generation: 25 - labels: - app.kubernetes.io/instance: kafka-connect - name: kafka - namespace: strimzi - resourceVersion: "43088521" - selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/strimzi/kafkaconnects/kafka - uid: 941ae21d-4e69-11ea-a53d-06e66a171f98 -spec: - bootstrapServers: PLAINTEXT://b-1.kafka.eu-west-1.amazonaws.com:9092, - PLAINTEXT://b-2.kafka.eu-west-1.amazonaws.com:9092, PLAINTEXT://b-3.kafka.eu-west-1.amazonaws.com:9092 - config: - config.providers: file - config.providers.file.class: org.apache.kafka.common.config.provider.FileConfigProvider - config.storage.topic: connect-configs - connector.client.config.override.policy: All - group.id: connect-cluster - internal.key.converter: org.apache.kafka.connect.json.JsonConverter - internal.key.converter.schemas.enable: "false" - internal.value.converter: org.apache.kafka.connect.json.JsonConverter - internal.value.converter.schemas.enable: "false" - key.converter: org.apache.kafka.connect.storage.StringConverter - key.converter.schemas.enable: "false" - offset.storage.topic: connect-offsets - schema.registry.url: http://kafka-schema-registry:8081 - status.storage.topic: connect-statuses - task.shutdown.graceful.timeout.ms: 30000 - value.converter: io.confluent.connect.avro.AvroConverter - value.converter.schema.registry.url: http://kafka-schema-registry:8081 - value.converter.schemas.enable: "true" - externalConfiguration: - volumes: - - name: kafka-connect-credentials - secret: - secretName: kafka-connect-credentials - image: strimzi/kafka-connect:strimzi_0.17.0_kafka_2.3.1-2 - jvmOptions: - -Xms: 8000m - -Xmx: 8000m - gcLoggingEnabled: false - logging: - type: inline - replicas: 5 - resources: - limits: - cpu: "1" - memory: 7Gi - requests: - cpu: "1" - memory: 5Gi - template: - connectContainer: - env: - - name: JMX_PORT - value: "9999" - pod: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - podAffinityTerm: - labelSelector: - matchExpressions: - - key: strimzi.io/name - operator: In - values: - - kafka-connect - topologyKey: kubernetes.io/hostname - weight: 100 - - podAffinityTerm: - labelSelector: - matchExpressions: - - key: strimzi.io/name - operator: In - values: - - kafka-connect - topologyKey: topology.kubernetes.io/zone - weight: 100 - metadata: - annotations: - prometheus.io/path: / - prometheus.io/port: "9404" - prometheus.io/scrape: true - priorityClassName: kafka-connect - tolerations: - - effect: NoSchedule - key: dynamic-node - operator: Equal - value: "true" diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/health.lua b/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/health.lua deleted file mode 100644 index 36509c7..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/health.lua +++ /dev/null @@ -1,21 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "NotReady" and condition.status == "True" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "True" then - hs.status = "Healthy" - hs.message = "" - return hs - end - end - end -end - -hs.status = "Progressing" -hs.message = "Waiting for Kafka Topic" -return hs diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/health_test.yaml b/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/health_test.yaml deleted file mode 100644 index 9da08aa..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/health_test.yaml +++ /dev/null @@ -1,12 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Waiting for Kafka Topic" - inputPath: testdata/progressing_noStatus.yaml -- healthStatus: - status: Degraded - message: "Invalid value abcd for configuration retention.ms: Not a number of type LONG" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/testdata/degraded.yaml b/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/testdata/degraded.yaml deleted file mode 100644 index 6d22021..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/testdata/degraded.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: kafka.strimzi.io/v1beta1 -kind: KafkaTopic -metadata: - creationTimestamp: "2021-02-22T16:10:54Z" - generation: 1 - labels: - strimzi.io/cluster: my-cluster - name: my-topic - namespace: default - resourceVersion: "134751516" - selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/default/kafkatopics/my-topic - uid: 13b7644a-ec46-4f24-a198-18962fda4b85 -spec: - config: - retention.ms: 7200000 - segment.bytes: 1073741824 - partitions: 1 - replicas: 1 -status: - conditions: - - lastTransitionTime: "2021-02-22T16:10:55.003372Z" - message: 'Invalid value abcd for configuration retention.ms: Not a number of type - LONG' - reason: InvalidConfigurationException - status: "True" - type: NotReady - observedGeneration: 1 diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/testdata/healthy.yaml b/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/testdata/healthy.yaml deleted file mode 100644 index 0a57875..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/testdata/healthy.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: kafka.strimzi.io/v1beta1 -kind: KafkaTopic -metadata: - creationTimestamp: "2021-02-22T16:10:54Z" - generation: 1 - labels: - strimzi.io/cluster: my-cluster - name: my-topic - namespace: default - resourceVersion: "134751516" - selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/default/kafkatopics/my-topic - uid: 13b7644a-ec46-4f24-a198-18962fda4b85 -spec: - config: - retention.ms: 7200000 - segment.bytes: 1073741824 - partitions: 1 - replicas: 1 -status: - conditions: - - lastTransitionTime: "2021-02-22T16:10:55.003372Z" - status: "True" - type: Ready - observedGeneration: 1 diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/testdata/progressing_noStatus.yaml b/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/testdata/progressing_noStatus.yaml deleted file mode 100644 index 5c39e2a..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaTopic/testdata/progressing_noStatus.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: kafka.strimzi.io/v1beta1 -kind: KafkaTopic -metadata: - creationTimestamp: "2021-02-22T16:10:54Z" - generation: 1 - labels: - strimzi.io/cluster: my-cluster - name: my-topic - namespace: default - resourceVersion: "134751516" - selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/default/kafkatopics/my-topic - uid: 13b7644a-ec46-4f24-a198-18962fda4b85 -spec: - config: - retention.ms: 7200000 - segment.bytes: 1073741824 - partitions: 1 - replicas: 1 diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/health.lua b/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/health.lua deleted file mode 100644 index ad25d41..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/health.lua +++ /dev/null @@ -1,21 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "NotReady" and condition.status == "True" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "True" then - hs.status = "Healthy" - hs.message = "" - return hs - end - end - end -end - -hs.status = "Progressing" -hs.message = "Waiting for Kafka User" -return hs diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/health_test.yaml b/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/health_test.yaml deleted file mode 100644 index 8178431..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/health_test.yaml +++ /dev/null @@ -1,12 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Waiting for Kafka User" - inputPath: testdata/progressing_noStatus.yaml -- healthStatus: - status: Degraded - message: "Authorization needs to be enabled in the Kafka custom resource" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/testdata/degraded.yaml b/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/testdata/degraded.yaml deleted file mode 100644 index 0129b34..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/testdata/degraded.yaml +++ /dev/null @@ -1,58 +0,0 @@ -apiVersion: kafka.strimzi.io/v1beta1 -kind: KafkaUser -metadata: - creationTimestamp: "2021-02-22T15:59:18Z" - generation: 1 - labels: - strimzi.io/cluster: my-cluster - name: my-user - namespace: default - resourceVersion: "134744742" - selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/default/kafkausers/my-user - uid: 4610a4d8-bd73-4ab9-bed8-971ee5dabf7d -spec: - authentication: - type: tls - authorization: - acls: - - host: '*' - operation: Read - resource: - name: my-topic - patternType: literal - type: topic - - host: '*' - operation: Describe - resource: - name: my-topic - patternType: literal - type: topic - - host: '*' - operation: Read - resource: - name: my-group - patternType: literal - type: group - - host: '*' - operation: Write - resource: - name: my-topic - patternType: literal - type: topic - - host: '*' - operation: Create - resource: - name: my-topic - patternType: literal - type: topic - type: simple -status: - conditions: - - lastTransitionTime: "2021-02-22T16:05:09.386834Z" - message: Authorization needs to be enabled in the Kafka custom resource - reason: InvalidResourceException - status: "True" - type: NotReady - observedGeneration: 1 - secret: my-user - username: CN=my-user diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/testdata/healthy.yaml b/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/testdata/healthy.yaml deleted file mode 100644 index 147acde..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/testdata/healthy.yaml +++ /dev/null @@ -1,56 +0,0 @@ -apiVersion: kafka.strimzi.io/v1beta1 -kind: KafkaUser -metadata: - creationTimestamp: "2021-02-22T15:59:18Z" - generation: 1 - labels: - strimzi.io/cluster: my-cluster - name: my-user - namespace: default - resourceVersion: "134744742" - selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/default/kafkausers/my-user - uid: 4610a4d8-bd73-4ab9-bed8-971ee5dabf7d -spec: - authentication: - type: tls - authorization: - acls: - - host: '*' - operation: Read - resource: - name: my-topic - patternType: literal - type: topic - - host: '*' - operation: Describe - resource: - name: my-topic - patternType: literal - type: topic - - host: '*' - operation: Read - resource: - name: my-group - patternType: literal - type: group - - host: '*' - operation: Write - resource: - name: my-topic - patternType: literal - type: topic - - host: '*' - operation: Create - resource: - name: my-topic - patternType: literal - type: topic - type: simple -status: - conditions: - - lastTransitionTime: "2021-02-22T16:05:09.386834Z" - status: "True" - type: Ready - observedGeneration: 1 - secret: my-user - username: CN=my-user diff --git a/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/testdata/progressing_noStatus.yaml b/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/testdata/progressing_noStatus.yaml deleted file mode 100644 index d58bc69..0000000 --- a/pkg/resource_customizations/kafka.strimzi.io/KafkaUser/testdata/progressing_noStatus.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: kafka.strimzi.io/v1beta1 -kind: KafkaUser -metadata: - creationTimestamp: "2021-02-22T15:59:18Z" - generation: 1 - labels: - strimzi.io/cluster: my-cluster - name: my-user - namespace: default - resourceVersion: "134744742" - selfLink: /apis/kafka.strimzi.io/v1beta1/namespaces/default/kafkausers/my-user - uid: 4610a4d8-bd73-4ab9-bed8-971ee5dabf7d -spec: - authentication: - type: tls - authorization: - acls: - - host: '*' - operation: Read - resource: - name: my-topic - patternType: literal - type: topic - - host: '*' - operation: Describe - resource: - name: my-topic - patternType: literal - type: topic - - host: '*' - operation: Read - resource: - name: my-group - patternType: literal - type: group - - host: '*' - operation: Write - resource: - name: my-topic - patternType: literal - type: topic - - host: '*' - operation: Create - resource: - name: my-topic - patternType: literal - type: topic - type: simple diff --git a/pkg/resource_customizations/kiali.io/Kiali/health.lua b/pkg/resource_customizations/kiali.io/Kiali/health.lua deleted file mode 100644 index 6820b12..0000000 --- a/pkg/resource_customizations/kiali.io/Kiali/health.lua +++ /dev/null @@ -1,23 +0,0 @@ -health_status = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - health_status.message = condition.message - if condition.type == "Successful" and condition.status == "True" then - health_status.status = "Healthy" - return health_status - end - if condition.type == "Failure" and condition.status == "True" then - health_status.status = "Degraded" - return health_status - end - if condition.type == "Running" and condition.reason == "Running" then - health_status.status = "Progressing" - return health_status - end - end - end -end -health_status.status = "Progressing" -health_status.message = "Waiting for Kiali" -return health_status diff --git a/pkg/resource_customizations/kiali.io/Kiali/health_test.yaml b/pkg/resource_customizations/kiali.io/Kiali/health_test.yaml deleted file mode 100644 index 9c4b5b4..0000000 --- a/pkg/resource_customizations/kiali.io/Kiali/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Reconciling" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Degraded - message: "Error Reconciling" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: "Last reconciliation succeeded" - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/kiali.io/Kiali/testdata/degraded.yaml b/pkg/resource_customizations/kiali.io/Kiali/testdata/degraded.yaml deleted file mode 100644 index 8c5f242..0000000 --- a/pkg/resource_customizations/kiali.io/Kiali/testdata/degraded.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: kiali.io/v1alpha1 -kind: Kiali -metadata: - finalizers: - - finalizer.kiali - generation: 1 - labels: - argocd.argoproj.io/instance: kiali-default - name: kiali - namespace: kiali - resourceVersion: "344752" - selfLink: /apis/kiali.io/v1alpha1/namespaces/2269-kiali/kialis/kiali - uid: a59d8dac-900b-4e05-9cb7-cf96a0bf4b6b -spec: {} -status: - conditions: - - lastTransitionTime: '2022-10-19T09:44:32Z' - message: '' - reason: '' - status: 'False' - type: Failure - - ansibleResult: - changed: 18 - completion: '2022-10-19T09:44:32.289505' - failures: 0 - ok: 101 - skipped: 101 - lastTransitionTime: '2022-10-19T09:43:39Z' - message: Awaiting next reconciliation - reason: Successful - status: 'True' - type: Running - - lastTransitionTime: '2022-10-19T09:44:32Z' - message: Error Reconciling - reason: Failure - status: 'True' - type: Failure diff --git a/pkg/resource_customizations/kiali.io/Kiali/testdata/healthy.yaml b/pkg/resource_customizations/kiali.io/Kiali/testdata/healthy.yaml deleted file mode 100644 index 807843d..0000000 --- a/pkg/resource_customizations/kiali.io/Kiali/testdata/healthy.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: kiali.io/v1alpha1 -kind: Kiali -metadata: - finalizers: - - finalizer.kiali - generation: 1 - labels: - argocd.argoproj.io/instance: kiali-default - name: kiali - namespace: kiali - resourceVersion: "344752" - selfLink: /apis/kiali.io/v1alpha1/namespaces/2269-kiali/kialis/kiali - uid: a59d8dac-900b-4e05-9cb7-cf96a0bf4b6b -spec: {} -status: - conditions: - - lastTransitionTime: '2022-10-19T09:44:32Z' - message: '' - reason: '' - status: 'False' - type: Failure - - ansibleResult: - changed: 18 - completion: '2022-10-19T09:44:32.289505' - failures: 0 - ok: 101 - skipped: 101 - lastTransitionTime: '2022-10-19T09:43:39Z' - message: Awaiting next reconciliation - reason: Successful - status: 'True' - type: Running - - lastTransitionTime: '2022-10-19T09:44:32Z' - message: Last reconciliation succeeded - reason: Successful - status: 'True' - type: Successful diff --git a/pkg/resource_customizations/kiali.io/Kiali/testdata/progressing.yaml b/pkg/resource_customizations/kiali.io/Kiali/testdata/progressing.yaml deleted file mode 100644 index d50ab4f..0000000 --- a/pkg/resource_customizations/kiali.io/Kiali/testdata/progressing.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: kiali.io/v1alpha1 -kind: Kiali -metadata: - finalizers: - - finalizer.kiali - generation: 1 - labels: - argocd.argoproj.io/instance: kiali-default - name: kiali - namespace: kiali - resourceVersion: "344752" - selfLink: /apis/kiali.io/v1alpha1/namespaces/2269-kiali/kialis/kiali - uid: a59d8dac-900b-4e05-9cb7-cf96a0bf4b6b -spec: {} -status: - conditions: - - ansibleResult: - changed: 1 - completion: 2020-06-08T13:41:20.133525 - failures: 0 - ok: 56 - skipped: 82 - lastTransitionTime: "2020-06-04T17:47:31Z" - message: Reconciling - reason: Running - status: "True" - type: Running \ No newline at end of file diff --git a/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/health.lua b/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/health.lua deleted file mode 100644 index 697a0b9..0000000 --- a/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/health.lua +++ /dev/null @@ -1,17 +0,0 @@ -health_status = {} -if obj.status ~= nil then - if obj.status.status == "SUCCESS" then - health_status.status = "Healthy" - health_status.message = "Fetched ExternalSecret." - elseif obj.status.status:find('^ERROR') ~= nil then - health_status.status = "Degraded" - health_status.message = obj.status.status:gsub("ERROR, ", "") - else - health_status.status = "Progressing" - health_status.message = "Waiting for ExternalSecret." - end - return health_status -end -health_status.status = "Progressing" -health_status.message = "Waiting for ExternalSecret." -return health_status \ No newline at end of file diff --git a/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/health_test.yaml b/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/health_test.yaml deleted file mode 100644 index 2c83bde..0000000 --- a/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Waiting for ExternalSecret." - inputPath: testdata/progressing.yaml -- healthStatus: - status: Degraded - message: "Secrets Manager can't find the specified secret." - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: "Fetched ExternalSecret." - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/testdata/degraded.yaml b/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/testdata/degraded.yaml deleted file mode 100644 index dc8de97..0000000 --- a/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/testdata/degraded.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: kubernetes-client.io/v1 -kind: ExternalSecret -metadata: - name: external-secret - namespace: external-secret -spec: - backendType: secretsManager - data: - - key: /external/secret/name - name: EXTERNAL_SECRET_NAME -status: - lastSync: "2021-02-06T21:44:40.631Z" - observedGeneration: 1 - status: ERROR, Secrets Manager can't find the specified secret. diff --git a/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/testdata/healthy.yaml b/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/testdata/healthy.yaml deleted file mode 100644 index 7b03309..0000000 --- a/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/testdata/healthy.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: kubernetes-client.io/v1 -kind: ExternalSecret -metadata: - name: external-secret - namespace: external-secret -spec: - backendType: secretsManager - data: - - key: /external/secret/name - name: EXTERNAL_SECRET_NAME -status: - lastSync: "2021-02-06T21:44:40.631Z" - observedGeneration: 1 - status: SUCCESS diff --git a/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/testdata/progressing.yaml b/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/testdata/progressing.yaml deleted file mode 100644 index 180104b..0000000 --- a/pkg/resource_customizations/kubernetes-client.io/ExternalSecret/testdata/progressing.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: kubernetes-client.io/v1 -kind: ExternalSecret -metadata: - name: external-secret - namespace: external-secret -spec: - backendType: secretsManager - data: - - key: /external/secret/name - name: EXTERNAL_SECRET_NAME diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachine/health.lua b/pkg/resource_customizations/kubevirt.io/VirtualMachine/health.lua deleted file mode 100644 index d9e0ebd..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachine/health.lua +++ /dev/null @@ -1,29 +0,0 @@ -hs = { status="Progressing", message="No status available"} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Paused" and condition.status == "True" then - hs.status = "Suspended" - hs.message = "Paused" - return hs - end - if condition.type == "Ready" then - if condition.status == "True" then - hs.status="Healthy" - hs.message="Running" - else - if obj.status.created then - hs.message = "Starting" - else - hs.status = "Suspended" - hs.message = "Stopped" - end - end - end - end - end - if obj.status.printableStatus ~= nil then - hs.message = obj.status.printableStatus - end -end -return hs diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachine/health_test.yaml b/pkg/resource_customizations/kubevirt.io/VirtualMachine/health_test.yaml deleted file mode 100644 index abe0040..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachine/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "No status available" - inputPath: testdata/progressing_nostatus.yaml -- healthStatus: - status: Healthy - message: "Running" - inputPath: testdata/healthy_ready.yaml -- healthStatus: - status: Suspended - message: "Stopped" - inputPath: testdata/suspended_stopped.yaml -- healthStatus: - status: Progressing - message: "Starting" - inputPath: testdata/progressing_starting.yaml -- healthStatus: - status: Suspended - message: "Paused" - inputPath: testdata/suspended_paused.yaml diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/healthy_ready.yaml b/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/healthy_ready.yaml deleted file mode 100644 index 5834e15..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/healthy_ready.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: kubevirt.io/v1 -kind: VirtualMachine -metadata: - annotations: - kubevirt.io/latest-observed-api-version: v1 - kubevirt.io/storage-observed-api-version: v1alpha3 - name: testvm - namespace: default - resourceVersion: "10971" - selfLink: /apis/kubevirt.io/v1/namespaces/default/virtualmachines/testvm - uid: 8cfec9a9-d736-4c10-8d91-bd3cafb69cb3 -spec: - running: true - template: - metadata: - creationTimestamp: null - labels: - kubevirt.io/domain: testvm - kubevirt.io/size: small - spec: - domain: - devices: - disks: - - disk: - bus: virtio - name: containerdisk - - disk: - bus: virtio - name: cloudinitdisk - interfaces: - - masquerade: {} - name: default - machine: - type: q35 - resources: - requests: - memory: 64M - networks: - - name: default - pod: {} - volumes: - - containerDisk: - image: quay.io/kubevirt/cirros-container-disk-demo - name: containerdisk - - cloudInitNoCloud: - userDataBase64: SGkuXG4= - name: cloudinitdisk -status: - conditions: - - lastProbeTime: null - lastTransitionTime: "2021-09-10T16:17:44Z" - status: "True" - type: Ready - created: true - printableStatus: Running - ready: true - volumeSnapshotStatuses: - - enabled: false - name: containerdisk - reason: Snapshot is not supported for this volumeSource type [containerdisk] - - enabled: false - name: cloudinitdisk - reason: Snapshot is not supported for this volumeSource type [cloudinitdisk] diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/progressing_nostatus.yaml b/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/progressing_nostatus.yaml deleted file mode 100644 index 0e93bdc..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/progressing_nostatus.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: kubevirt.io/v1 -kind: VirtualMachine -metadata: - annotations: - creationTimestamp: "2021-07-16T00:41:10Z" - labels: - app.kubernetes.io/instance: testv - name: testvm - namespace: testvm -spec: - running: true - template: - metadata: - creationTimestamp: null - labels: - kubevirt.io/domain: testvm - kubevirt.io/size: small - spec: - domain: - devices: - disks: - - disk: - bus: virtio - name: containerdisk - - disk: - bus: virtio - name: cloudinitdisk - interfaces: - - masquerade: {} - name: default - machine: - type: pc-q35-rhel8.4.0 - resources: - requests: - memory: 64M - networks: - - name: default - pod: {} - volumes: - - containerDisk: - image: quay.io/kubevirt/cirros-container-disk-demo - name: containerdisk - - cloudInitNoCloud: - userDataBase64: SGkuXG4= - name: cloudinitdisk -status: - volumeSnapshotStatuses: - - enabled: false - name: containerdisk - reason: Volume type has no StorageClass defined - - enabled: false - name: cloudinitdisk - reason: Volume type has no StorageClass defined - diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/progressing_starting.yaml b/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/progressing_starting.yaml deleted file mode 100644 index d52e44d..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/progressing_starting.yaml +++ /dev/null @@ -1,61 +0,0 @@ -apiVersion: kubevirt.io/v1 -kind: VirtualMachine -metadata: - annotations: - kubevirt.io/latest-observed-api-version: v1 - kubevirt.io/storage-observed-api-version: v1alpha3 - name: testvm - namespace: default -spec: - running: false - template: - metadata: - creationTimestamp: null - labels: - kubevirt.io/domain: testvm - kubevirt.io/size: small - spec: - domain: - devices: - disks: - - disk: - bus: virtio - name: containerdisk - - disk: - bus: virtio - name: cloudinitdisk - interfaces: - - masquerade: {} - name: default - machine: - type: q35 - resources: - requests: - memory: 64M - networks: - - name: default - pod: {} - volumes: - - containerDisk: - image: quay.io/kubevirt/cirros-container-disk-demo - name: containerdisk - - cloudInitNoCloud: - userDataBase64: SGkuXG4= - name: cloudinitdisk -status: - conditions: - - lastProbeTime: "2021-09-10T16:17:33Z" - lastTransitionTime: "2021-09-10T16:17:33Z" - message: Guest VM is not reported as running - reason: GuestNotRunning - status: "False" - type: Ready - created: true - printableStatus: Starting - volumeSnapshotStatuses: - - enabled: false - name: containerdisk - reason: Snapshot is not supported for this volumeSource type [containerdisk] - - enabled: false - name: cloudinitdisk - reason: Snapshot is not supported for this volumeSource type [cloudinitdisk] diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/suspended_paused.yaml b/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/suspended_paused.yaml deleted file mode 100644 index 0ad92d6..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/suspended_paused.yaml +++ /dev/null @@ -1,67 +0,0 @@ -apiVersion: kubevirt.io/v1 -kind: VirtualMachine -metadata: - annotations: - kubevirt.io/latest-observed-api-version: v1 - kubevirt.io/storage-observed-api-version: v1alpha3 - creationTimestamp: "2021-09-14T22:15:10Z" - name: testvm - namespace: default -spec: - running: true - template: - metadata: - creationTimestamp: null - labels: - kubevirt.io/domain: testvm - kubevirt.io/size: small - spec: - domain: - devices: - disks: - - disk: - bus: virtio - name: containerdisk - - disk: - bus: virtio - name: cloudinitdisk - interfaces: - - masquerade: {} - name: default - machine: - type: q35 - resources: - requests: - memory: 64M - networks: - - name: default - pod: {} - volumes: - - containerDisk: - image: quay.io/kubevirt/cirros-container-disk-demo - name: containerdisk - - cloudInitNoCloud: - userDataBase64: SGkuXG4= - name: cloudinitdisk -status: - conditions: - - lastProbeTime: null - lastTransitionTime: "2021-09-24T18:45:01Z" - status: "True" - type: Ready - - lastProbeTime: "2021-09-24T18:48:57Z" - lastTransitionTime: "2021-09-24T18:48:57Z" - message: VMI was paused by user - reason: PausedByUser - status: "True" - type: Paused - created: true - printableStatus: Paused - ready: true - volumeSnapshotStatuses: - - enabled: false - name: containerdisk - reason: Snapshot is not supported for this volumeSource type [containerdisk] - - enabled: false - name: cloudinitdisk - reason: Snapshot is not supported for this volumeSource type [cloudinitdisk] diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/suspended_stopped.yaml b/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/suspended_stopped.yaml deleted file mode 100644 index ee62dbd..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachine/testdata/suspended_stopped.yaml +++ /dev/null @@ -1,60 +0,0 @@ -apiVersion: kubevirt.io/v1 -kind: VirtualMachine -metadata: - annotations: - kubevirt.io/latest-observed-api-version: v1 - kubevirt.io/storage-observed-api-version: v1alpha3 - name: testvm - namespace: default -spec: - running: false - template: - metadata: - creationTimestamp: null - labels: - kubevirt.io/domain: testvm - kubevirt.io/size: small - spec: - domain: - devices: - disks: - - disk: - bus: virtio - name: containerdisk - - disk: - bus: virtio - name: cloudinitdisk - interfaces: - - masquerade: {} - name: default - machine: - type: q35 - resources: - requests: - memory: 64M - networks: - - name: default - pod: {} - volumes: - - containerDisk: - image: quay.io/kubevirt/cirros-container-disk-demo - name: containerdisk - - cloudInitNoCloud: - userDataBase64: SGkuXG4= - name: cloudinitdisk -status: - conditions: - - lastProbeTime: "2021-09-10T16:11:53Z" - lastTransitionTime: "2021-09-10T16:11:53Z" - message: VMI does not exist - reason: VMINotExists - status: "False" - type: Ready - printableStatus: Stopped - volumeSnapshotStatuses: - - enabled: false - name: containerdisk - reason: Snapshot is not supported for this volumeSource type [containerdisk] - - enabled: false - name: cloudinitdisk - reason: Snapshot is not supported for this volumeSource type [cloudinitdisk] diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/health.lua b/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/health.lua deleted file mode 100644 index 30264cf..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/health.lua +++ /dev/null @@ -1,36 +0,0 @@ -hs = { status="Progressing", message="No status available"} -if obj.status ~= nil then - if obj.status.phase ~= nil then - hs.message = obj.status.phase - if hs.message == "Failed" then - hs.status = "Degraded" - return hs - elseif hs.message == "Pending" or hs.message == "Scheduling" or hs.message == "Scheduled" then - return hs - elseif hs.message == "Succeeded" then - hs.status = "Suspended" - return hs - elseif hs.message == "Unknown" then - hs.status = "Unknown" - return hs - end - end - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" then - if condition.status == "True" then - hs.status = "Healthy" - hs.message = "Running" - else - hs.status = "Degraded" - hs.message = condition.message - end - elseif condition.type == "Paused" and condition.status == "True" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/health_test.yaml b/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/health_test.yaml deleted file mode 100644 index bc6a9c8..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "No status available" - inputPath: testdata/progressing_nostatus.yaml -- healthStatus: - status: Progressing - message: "Scheduled" - inputPath: testdata/progressing_scheduling.yaml -- healthStatus: - status: Healthy - message: "Running" - inputPath: testdata/healthy_ready.yaml -- healthStatus: - status: "Suspended" - message: "Succeeded" - inputPath: testdata/suspended_succeeded.yaml -- healthStatus: - status: "Suspended" - message: "VMI was paused by user" - inputPath: testdata/suspended_paused.yaml diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/healthy_ready.yaml b/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/healthy_ready.yaml deleted file mode 100644 index 5f321b1..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/healthy_ready.yaml +++ /dev/null @@ -1,104 +0,0 @@ -apiVersion: kubevirt.io/v1 -kind: VirtualMachineInstance -metadata: - annotations: - kubevirt.io/latest-observed-api-version: v1 - kubevirt.io/storage-observed-api-version: v1alpha3 - creationTimestamp: "2021-09-14T23:39:01Z" - finalizers: - - kubevirt.io/virtualMachineControllerFinalize - - foregroundDeleteVirtualMachine - generation: 8 - labels: - kubevirt.io/domain: testvm - kubevirt.io/nodeName: minikube - kubevirt.io/size: small - name: testvm - namespace: default - ownerReferences: - - apiVersion: kubevirt.io/v1 - blockOwnerDeletion: true - controller: true - kind: VirtualMachine - name: testvm - uid: 40e44180-3dfb-4813-ace6-9f2d2c76c326 - resourceVersion: "602262" - uid: 18648b62-36b6-4b86-bd16-a288aa132203 -spec: - domain: - cpu: - cores: 1 - sockets: 1 - threads: 1 - devices: - disks: - - disk: - bus: virtio - name: containerdisk - - disk: - bus: virtio - name: cloudinitdisk - interfaces: - - masquerade: {} - name: default - features: - acpi: - enabled: true - firmware: - uuid: 5a9fc181-957e-5c32-9e5a-2de5e9673531 - machine: - type: q35 - resources: - requests: - cpu: 100m - memory: 64M - networks: - - name: default - pod: {} - volumes: - - containerDisk: - image: quay.io/kubevirt/cirros-container-disk-demo - imagePullPolicy: Always - name: containerdisk - - cloudInitNoCloud: - userDataBase64: SGkuXG4= - name: cloudinitdisk -status: - activePods: - 6f699622-20ba-4be2-b84c-aea8141b65b2: minikube - conditions: - - lastProbeTime: null - lastTransitionTime: "2021-09-14T23:39:06Z" - status: "True" - type: Ready - - lastProbeTime: null - lastTransitionTime: null - status: "True" - type: LiveMigratable - guestOSInfo: {} - interfaces: - - ipAddress: 172.17.0.11 - ipAddresses: - - 172.17.0.11 - mac: 52:54:00:b1:18:f3 - name: default - launcherContainerImageVersion: quay.io/kubevirt/virt-launcher:v0.45.0 - migrationMethod: BlockMigration - nodeName: minikube - phase: Running - phaseTransitionTimestamps: - - phase: Pending - phaseTransitionTimestamp: "2021-09-14T23:39:01Z" - - phase: Scheduling - phaseTransitionTimestamp: "2021-09-14T23:39:01Z" - - phase: Scheduled - phaseTransitionTimestamp: "2021-09-14T23:39:06Z" - - phase: Running - phaseTransitionTimestamp: "2021-09-14T23:39:08Z" - qosClass: Burstable - virtualMachineRevisionName: revision-start-vm-40e44180-3dfb-4813-ace6-9f2d2c76c326-6 - volumeStatus: - - name: cloudinitdisk - target: vdb - - name: containerdisk - target: vda diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/progressing_nostatus.yaml b/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/progressing_nostatus.yaml deleted file mode 100644 index 87f91d1..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/progressing_nostatus.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: kubevirt.io/v1 -kind: VirtualMachineInstance -metadata: - labels: - kubevirt.io/domain: fedora-gitops1 - name: fedora-testvm - namespace: default -spec: - domain: - cpu: - cores: 1 - sockets: 1 - threads: 1 - devices: - disks: - - disk: - bus: virtio - name: fedora - interfaces: - - macAddress: 02:d6:2b:00:00:02 - masquerade: {} - name: default - networkInterfaceMultiqueue: true - rng: {} - features: - acpi: - enabled: true - firmware: - uuid: 15c031fd-7655-53c8-96d1-25810660149a - machine: - type: pc-q35-rhel8.4.0 - resources: - requests: - cpu: 100m - memory: 2Gi - evictionStrategy: LiveMigrate - networks: - - name: default - pod: {} - terminationGracePeriodSeconds: 180 - volumes: - - dataVolume: - name: fedora - name: fedora -status: {} diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/progressing_pending.yaml b/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/progressing_pending.yaml deleted file mode 100644 index 8839268..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/progressing_pending.yaml +++ /dev/null @@ -1,74 +0,0 @@ -apiVersion: v1 -items: -- apiVersion: kubevirt.io/v1 - kind: VirtualMachineInstance - metadata: - creationTimestamp: "2021-09-14T23:39:01Z" - finalizers: - - kubevirt.io/virtualMachineControllerFinalize - - foregroundDeleteVirtualMachine - generation: 1 - labels: - kubevirt.io/domain: testvm - kubevirt.io/size: small - name: testvm - namespace: default - ownerReferences: - - apiVersion: kubevirt.io/v1 - blockOwnerDeletion: true - controller: true - kind: VirtualMachine - name: testvm - uid: 40e44180-3dfb-4813-ace6-9f2d2c76c326 - resourceVersion: "602212" - uid: 18648b62-36b6-4b86-bd16-a288aa132203 - spec: - domain: - cpu: - cores: 1 - sockets: 1 - threads: 1 - devices: - disks: - - disk: - bus: virtio - name: containerdisk - - disk: - bus: virtio - name: cloudinitdisk - interfaces: - - masquerade: {} - name: default - features: - acpi: - enabled: true - firmware: - uuid: 5a9fc181-957e-5c32-9e5a-2de5e9673531 - machine: - type: q35 - resources: - requests: - cpu: 100m - memory: 64M - networks: - - name: default - pod: {} - volumes: - - containerDisk: - image: quay.io/kubevirt/cirros-container-disk-demo - imagePullPolicy: Always - name: containerdisk - - cloudInitNoCloud: - userDataBase64: SGkuXG4= - name: cloudinitdisk - status: - guestOSInfo: {} - phase: Pending - phaseTransitionTimestamps: - - phase: Pending - phaseTransitionTimestamp: "2021-09-14T23:39:01Z" - virtualMachineRevisionName: revision-start-vm-40e44180-3dfb-4813-ace6-9f2d2c76c326-6 -kind: List -metadata: - resourceVersion: "" - selfLink: "" diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/progressing_scheduling.yaml b/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/progressing_scheduling.yaml deleted file mode 100644 index 4fb6df1..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/progressing_scheduling.yaml +++ /dev/null @@ -1,92 +0,0 @@ -apiVersion: kubevirt.io/v1 -kind: VirtualMachineInstance -metadata: - annotations: - kubevirt.io/latest-observed-api-version: v1 - kubevirt.io/storage-observed-api-version: v1alpha3 - creationTimestamp: "2021-09-14T23:39:01Z" - finalizers: - - kubevirt.io/virtualMachineControllerFinalize - - foregroundDeleteVirtualMachine - generation: 5 - labels: - kubevirt.io/domain: testvm - kubevirt.io/nodeName: minikube - kubevirt.io/size: small - name: testvm - namespace: default - ownerReferences: - - apiVersion: kubevirt.io/v1 - blockOwnerDeletion: true - controller: true - kind: VirtualMachine - name: testvm - uid: 40e44180-3dfb-4813-ace6-9f2d2c76c326 - resourceVersion: "602255" - uid: 18648b62-36b6-4b86-bd16-a288aa132203 -spec: - domain: - cpu: - cores: 1 - sockets: 1 - threads: 1 - devices: - disks: - - disk: - bus: virtio - name: containerdisk - - disk: - bus: virtio - name: cloudinitdisk - interfaces: - - masquerade: {} - name: default - features: - acpi: - enabled: true - firmware: - uuid: 5a9fc181-957e-5c32-9e5a-2de5e9673531 - machine: - type: q35 - resources: - requests: - cpu: 100m - memory: 64M - networks: - - name: default - pod: {} - volumes: - - containerDisk: - image: quay.io/kubevirt/cirros-container-disk-demo - imagePullPolicy: Always - name: containerdisk - - cloudInitNoCloud: - userDataBase64: SGkuXG4= - name: cloudinitdisk -status: - activePods: - 6f699622-20ba-4be2-b84c-aea8141b65b2: minikube - conditions: - - lastProbeTime: "2021-09-14T23:39:01Z" - lastTransitionTime: "2021-09-14T23:39:01Z" - message: Guest VM is not reported as running - reason: GuestNotRunning - status: "False" - type: Ready - guestOSInfo: {} - nodeName: minikube - phase: Scheduled - phaseTransitionTimestamps: - - phase: Pending - phaseTransitionTimestamp: "2021-09-14T23:39:01Z" - - phase: Scheduling - phaseTransitionTimestamp: "2021-09-14T23:39:01Z" - - phase: Scheduled - phaseTransitionTimestamp: "2021-09-14T23:39:06Z" - qosClass: Burstable - virtualMachineRevisionName: revision-start-vm-40e44180-3dfb-4813-ace6-9f2d2c76c326-6 - volumeStatus: - - name: cloudinitdisk - target: "" - - name: containerdisk - target: "" diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/suspended_paused.yaml b/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/suspended_paused.yaml deleted file mode 100644 index 2263935..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/suspended_paused.yaml +++ /dev/null @@ -1,110 +0,0 @@ -apiVersion: kubevirt.io/v1 -kind: VirtualMachineInstance -metadata: - annotations: - kubevirt.io/latest-observed-api-version: v1 - kubevirt.io/storage-observed-api-version: v1alpha3 - creationTimestamp: "2021-09-24T18:44:53Z" - finalizers: - - kubevirt.io/virtualMachineControllerFinalize - - foregroundDeleteVirtualMachine - generation: 9 - labels: - kubevirt.io/domain: testvm - kubevirt.io/nodeName: minikube - kubevirt.io/size: small - name: testvm - namespace: default - ownerReferences: - - apiVersion: kubevirt.io/v1 - blockOwnerDeletion: true - controller: true - kind: VirtualMachine - name: testvm - uid: 40e44180-3dfb-4813-ace6-9f2d2c76c326 - resourceVersion: "867783" - uid: 280e9c9c-1c43-4cfa-8098-c70f74dae01d -spec: - domain: - cpu: - cores: 1 - sockets: 1 - threads: 1 - devices: - disks: - - disk: - bus: virtio - name: containerdisk - - disk: - bus: virtio - name: cloudinitdisk - interfaces: - - masquerade: {} - name: default - features: - acpi: - enabled: true - firmware: - uuid: 5a9fc181-957e-5c32-9e5a-2de5e9673531 - machine: - type: q35 - resources: - requests: - cpu: 100m - memory: 64M - networks: - - name: default - pod: {} - volumes: - - containerDisk: - image: quay.io/kubevirt/cirros-container-disk-demo - imagePullPolicy: Always - name: containerdisk - - cloudInitNoCloud: - userDataBase64: SGkuXG4= - name: cloudinitdisk -status: - activePods: - 8689d878-8688-45eb-9676-da41bac5b935: minikube - conditions: - - lastProbeTime: null - lastTransitionTime: "2021-09-24T18:45:01Z" - status: "True" - type: Ready - - lastProbeTime: null - lastTransitionTime: null - status: "True" - type: LiveMigratable - - lastProbeTime: "2021-09-24T18:48:57Z" - lastTransitionTime: "2021-09-24T18:48:57Z" - message: VMI was paused by user - reason: PausedByUser - status: "True" - type: Paused - guestOSInfo: {} - interfaces: - - ipAddress: 172.17.0.11 - ipAddresses: - - 172.17.0.11 - mac: 52:54:00:c9:c9:b1 - name: default - launcherContainerImageVersion: quay.io/kubevirt/virt-launcher:v0.45.0 - migrationMethod: BlockMigration - nodeName: minikube - phase: Running - phaseTransitionTimestamps: - - phase: Pending - phaseTransitionTimestamp: "2021-09-24T18:44:53Z" - - phase: Scheduling - phaseTransitionTimestamp: "2021-09-24T18:44:53Z" - - phase: Scheduled - phaseTransitionTimestamp: "2021-09-24T18:45:01Z" - - phase: Running - phaseTransitionTimestamp: "2021-09-24T18:45:02Z" - qosClass: Burstable - virtualMachineRevisionName: revision-start-vm-40e44180-3dfb-4813-ace6-9f2d2c76c326-6 - volumeStatus: - - name: cloudinitdisk - target: vdb - - name: containerdisk - target: vda diff --git a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/suspended_succeeded.yaml b/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/suspended_succeeded.yaml deleted file mode 100644 index 273efb2..0000000 --- a/pkg/resource_customizations/kubevirt.io/VirtualMachineInstance/testdata/suspended_succeeded.yaml +++ /dev/null @@ -1,100 +0,0 @@ -apiVersion: kubevirt.io/v1 -kind: VirtualMachineInstance -metadata: - annotations: - kubevirt.io/latest-observed-api-version: v1 - kubevirt.io/storage-observed-api-version: v1alpha3 - creationTimestamp: "2021-09-14T22:27:08Z" - deletionGracePeriodSeconds: 0 - deletionTimestamp: "2021-09-14T23:07:57Z" - finalizers: - - foregroundDeleteVirtualMachine - generation: 11 - labels: - kubevirt.io/domain: testvm - kubevirt.io/nodeName: minikube - kubevirt.io/size: small - name: testvm - namespace: default -spec: - domain: - cpu: - cores: 1 - sockets: 1 - threads: 1 - devices: - disks: - - disk: - bus: virtio - name: containerdisk - - disk: - bus: virtio - name: cloudinitdisk - interfaces: - - masquerade: {} - name: default - features: - acpi: - enabled: true - firmware: - uuid: 5a9fc181-957e-5c32-9e5a-2de5e9673531 - machine: - type: q35 - resources: - requests: - cpu: 100m - memory: 64M - networks: - - name: default - pod: {} - volumes: - - containerDisk: - image: quay.io/kubevirt/cirros-container-disk-demo - imagePullPolicy: Always - name: containerdisk - - cloudInitNoCloud: - userDataBase64: SGkuXG4= - name: cloudinitdisk -status: - activePods: - 8190c35b-95ef-42a8-ab18-77dcfb729e79: minikube - conditions: - - lastProbeTime: "2021-09-14T23:07:57Z" - lastTransitionTime: "2021-09-14T23:07:57Z" - message: virt-launcher pod is terminating - reason: PodTerminating - status: "False" - type: Ready - - lastProbeTime: null - lastTransitionTime: null - status: "True" - type: LiveMigratable - guestOSInfo: {} - interfaces: - - ipAddress: 172.17.0.11 - ipAddresses: - - 172.17.0.11 - mac: 52:54:00:ea:73:fd - name: default - launcherContainerImageVersion: quay.io/kubevirt/virt-launcher:v0.45.0 - migrationMethod: BlockMigration - nodeName: minikube - phase: Succeeded - phaseTransitionTimestamps: - - phase: Pending - phaseTransitionTimestamp: "2021-09-14T22:27:08Z" - - phase: Scheduling - phaseTransitionTimestamp: "2021-09-14T22:27:08Z" - - phase: Scheduled - phaseTransitionTimestamp: "2021-09-14T22:27:15Z" - - phase: Running - phaseTransitionTimestamp: "2021-09-14T22:27:16Z" - - phase: Succeeded - phaseTransitionTimestamp: "2021-09-14T23:08:00Z" - qosClass: Burstable - virtualMachineRevisionName: revision-start-vm-40e44180-3dfb-4813-ace6-9f2d2c76c326-4 - volumeStatus: - - name: cloudinitdisk - target: vdb - - name: containerdisk - target: vda diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/health.lua b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/health.lua deleted file mode 100644 index daf3168..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/health.lua +++ /dev/null @@ -1,14 +0,0 @@ -hs = {} -if obj.status.status == "Succeeded" then - hs.status = "Healthy" - hs.message = "KeptnAppVersion is healthy" - return hs -end -if obj.status.status == "Failed" then - hs.status = "Degraded" - hs.message = "KeptnAppVersion is degraded" - return hs -end -hs.status = "Progressing" -hs.message = "KeptnAppVersion is progressing" -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/health_test.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/health_test.yaml deleted file mode 100644 index 67f34f1..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: "KeptnAppVersion is progressing" - inputPath: testdata/progressing.yaml - - healthStatus: - status: Degraded - message: "KeptnAppVersion is degraded" - inputPath: testdata/degraded.yaml - - healthStatus: - status: Healthy - message: "KeptnAppVersion is healthy" - inputPath: testdata/healthy.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/testdata/degraded.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/testdata/degraded.yaml deleted file mode 100644 index 0473257..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/testdata/degraded.yaml +++ /dev/null @@ -1,93 +0,0 @@ -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnAppVersion -metadata: - annotations: - traceparent: 00-adc84f15413da737240dde75de2248fb-e3fcbc6fbdd05b1c-01 - creationTimestamp: "2022-12-14T13:17:36Z" - generation: 1 - name: podtato-head-0.1.1 - namespace: podtato-kubectl - ownerReferences: - - apiVersion: lifecycle.keptn.sh/v1alpha2 - blockOwnerDeletion: true - controller: true - kind: KeptnApp - name: podtato-head - uid: b0e9773a-3dc7-4639-a4bd-64c8bb3d33ab - resourceVersion: "226500" - uid: 9ae27184-c63d-4e50-bbc7-18e5e289e85c -spec: - appName: podtato-head - preDeploymentEvaluations: - - app-pre-deploy-eval-2 - revision: "1" - traceId: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-3777b2225e0d2dc3-01 - version: 0.1.1 - workloads: - - name: podtato-head-left-arm - version: 0.2.7 - - name: podtato-head-left-leg - version: 0.2.7 - - name: podtato-head-entry - version: 0.2.7 - - name: podtato-head-right-arm - version: 0.1.0 - - name: podtato-head-right-leg - version: 0.2.7 - - name: podtato-head-hat - version: 0.1.0 -status: - currentPhase: Completed - endTime: "2022-12-14T13:19:06Z" - phaseTraceIDs: - "": - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-d566f50faad914b0-01 - AppDeploy: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0ae50f2d844888ab-01 - AppPostDeployEvaluations: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-f3dd12be90fc6c55-01 - AppPostDeployTasks: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0ebcfa51b9b3a08b-01 - AppPreDeployEvaluations: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-b5838bedd1703826-01 - AppPreDeployTasks: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-b1c3977a55236160-01 - postDeploymentEvaluationStatus: Succeeded - postDeploymentStatus: Succeeded - preDeploymentEvaluationStatus: Succeeded - preDeploymentEvaluationTaskStatus: - - endTime: "2022-12-14T13:17:41Z" - evaluationDefinitionName: app-pre-deploy-eval-2 - evaluationName: pre-eval-app-pre-deploy-eval-2-48925 - startTime: "2022-12-14T13:17:36Z" - status: Succeeded - preDeploymentStatus: Succeeded - startTime: "2022-12-14T13:17:36Z" - status: Failed - workloadOverallStatus: Failed - workloadStatus: - - status: Failed - workload: - name: podtato-head-left-arm - version: 0.2.7 - - status: Progressing - workload: - name: podtato-head-left-leg - version: 0.2.7 - - status: Succeeded - workload: - name: podtato-head-entry - version: 0.2.7 - - status: Succeeded - workload: - name: podtato-head-right-arm - version: 0.1.0 - - status: Succeeded - workload: - name: podtato-head-right-leg - version: 0.2.7 - - status: Succeeded - workload: - name: podtato-head-hat - version: 0.1.0 \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/testdata/healthy.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/testdata/healthy.yaml deleted file mode 100644 index 214a2c2..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/testdata/healthy.yaml +++ /dev/null @@ -1,93 +0,0 @@ -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnAppVersion -metadata: - annotations: - traceparent: 00-adc84f15413da737240dde75de2248fb-e3fcbc6fbdd05b1c-01 - creationTimestamp: "2022-12-14T13:17:36Z" - generation: 1 - name: podtato-head-0.1.1 - namespace: podtato-kubectl - ownerReferences: - - apiVersion: lifecycle.keptn.sh/v1alpha2 - blockOwnerDeletion: true - controller: true - kind: KeptnApp - name: podtato-head - uid: b0e9773a-3dc7-4639-a4bd-64c8bb3d33ab - resourceVersion: "226500" - uid: 9ae27184-c63d-4e50-bbc7-18e5e289e85c -spec: - appName: podtato-head - preDeploymentEvaluations: - - app-pre-deploy-eval-2 - revision: "1" - traceId: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-3777b2225e0d2dc3-01 - version: 0.1.1 - workloads: - - name: podtato-head-left-arm - version: 0.2.7 - - name: podtato-head-left-leg - version: 0.2.7 - - name: podtato-head-entry - version: 0.2.7 - - name: podtato-head-right-arm - version: 0.1.0 - - name: podtato-head-right-leg - version: 0.2.7 - - name: podtato-head-hat - version: 0.1.0 -status: - currentPhase: Completed - endTime: "2022-12-14T13:19:06Z" - phaseTraceIDs: - "": - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-d566f50faad914b0-01 - AppDeploy: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0ae50f2d844888ab-01 - AppPostDeployEvaluations: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-f3dd12be90fc6c55-01 - AppPostDeployTasks: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0ebcfa51b9b3a08b-01 - AppPreDeployEvaluations: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-b5838bedd1703826-01 - AppPreDeployTasks: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-b1c3977a55236160-01 - postDeploymentEvaluationStatus: Succeeded - postDeploymentStatus: Succeeded - preDeploymentEvaluationStatus: Succeeded - preDeploymentEvaluationTaskStatus: - - endTime: "2022-12-14T13:17:41Z" - evaluationDefinitionName: app-pre-deploy-eval-2 - evaluationName: pre-eval-app-pre-deploy-eval-2-48925 - startTime: "2022-12-14T13:17:36Z" - status: Succeeded - preDeploymentStatus: Succeeded - startTime: "2022-12-14T13:17:36Z" - status: Succeeded - workloadOverallStatus: Succeeded - workloadStatus: - - status: Succeeded - workload: - name: podtato-head-left-arm - version: 0.2.7 - - status: Succeeded - workload: - name: podtato-head-left-leg - version: 0.2.7 - - status: Succeeded - workload: - name: podtato-head-entry - version: 0.2.7 - - status: Succeeded - workload: - name: podtato-head-right-arm - version: 0.1.0 - - status: Succeeded - workload: - name: podtato-head-right-leg - version: 0.2.7 - - status: Succeeded - workload: - name: podtato-head-hat - version: 0.1.0 \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/testdata/progressing.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/testdata/progressing.yaml deleted file mode 100644 index c9b80e7..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnAppVersion/testdata/progressing.yaml +++ /dev/null @@ -1,93 +0,0 @@ -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnAppVersion -metadata: - annotations: - traceparent: 00-adc84f15413da737240dde75de2248fb-e3fcbc6fbdd05b1c-01 - creationTimestamp: "2022-12-14T13:17:36Z" - generation: 1 - name: podtato-head-0.1.1 - namespace: podtato-kubectl - ownerReferences: - - apiVersion: lifecycle.keptn.sh/v1alpha2 - blockOwnerDeletion: true - controller: true - kind: KeptnApp - name: podtato-head - uid: b0e9773a-3dc7-4639-a4bd-64c8bb3d33ab - resourceVersion: "226500" - uid: 9ae27184-c63d-4e50-bbc7-18e5e289e85c -spec: - appName: podtato-head - preDeploymentEvaluations: - - app-pre-deploy-eval-2 - revision: "1" - traceId: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-3777b2225e0d2dc3-01 - version: 0.1.1 - workloads: - - name: podtato-head-left-arm - version: 0.2.7 - - name: podtato-head-left-leg - version: 0.2.7 - - name: podtato-head-entry - version: 0.2.7 - - name: podtato-head-right-arm - version: 0.1.0 - - name: podtato-head-right-leg - version: 0.2.7 - - name: podtato-head-hat - version: 0.1.0 -status: - currentPhase: Completed - endTime: "2022-12-14T13:19:06Z" - phaseTraceIDs: - "": - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-d566f50faad914b0-01 - AppDeploy: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0ae50f2d844888ab-01 - AppPostDeployEvaluations: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-f3dd12be90fc6c55-01 - AppPostDeployTasks: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0ebcfa51b9b3a08b-01 - AppPreDeployEvaluations: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-b5838bedd1703826-01 - AppPreDeployTasks: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-b1c3977a55236160-01 - postDeploymentEvaluationStatus: Succeeded - postDeploymentStatus: Succeeded - preDeploymentEvaluationStatus: Succeeded - preDeploymentEvaluationTaskStatus: - - endTime: "2022-12-14T13:17:41Z" - evaluationDefinitionName: app-pre-deploy-eval-2 - evaluationName: pre-eval-app-pre-deploy-eval-2-48925 - startTime: "2022-12-14T13:17:36Z" - status: Succeeded - preDeploymentStatus: Succeeded - startTime: "2022-12-14T13:17:36Z" - status: Progressing - workloadOverallStatus: Progressing - workloadStatus: - - status: Progressing - workload: - name: podtato-head-left-arm - version: 0.2.7 - - status: Succeeded - workload: - name: podtato-head-left-leg - version: 0.2.7 - - status: Succeeded - workload: - name: podtato-head-entry - version: 0.2.7 - - status: Succeeded - workload: - name: podtato-head-right-arm - version: 0.1.0 - - status: Succeeded - workload: - name: podtato-head-right-leg - version: 0.2.7 - - status: Succeeded - workload: - name: podtato-head-hat - version: 0.1.0 \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/health.lua b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/health.lua deleted file mode 100644 index 2ea65e9..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/health.lua +++ /dev/null @@ -1,14 +0,0 @@ -hs = {} -if obj.status.overallStatus == "Succeeded" then - hs.status = "Healthy" - hs.message = "KeptnEvaluation is healthy" - return hs -end -if obj.status.overallStatus == "Failed" then - hs.status = "Degraded" - hs.message = "KeptnEvaluation is degraded" - return hs -end -hs.status = "Progressing" -hs.message = "KeptnEvaluation is progressing" -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/health_test.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/health_test.yaml deleted file mode 100644 index dd0378e..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: "KeptnEvaluation is progressing" - inputPath: testdata/progressing.yaml - - healthStatus: - status: Degraded - message: "KeptnEvaluation is degraded" - inputPath: testdata/degraded.yaml - - healthStatus: - status: Healthy - message: "KeptnEvaluation is healthy" - inputPath: testdata/healthy.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/testdata/degraded.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/testdata/degraded.yaml deleted file mode 100644 index 3054376..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/testdata/degraded.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnEvaluation -metadata: - creationTimestamp: "2022-12-14T13:17:36Z" - generation: 1 - name: pre-eval-app-pre-deploy-eval-2-48925 - namespace: podtato-kubectl - ownerReferences: - - apiVersion: lifecycle.keptn.sh/v1alpha2 - blockOwnerDeletion: true - controller: true - kind: KeptnAppVersion - name: podtato-head-0.1.1 - uid: 9ae27184-c63d-4e50-bbc7-18e5e289e85c - resourceVersion: "225737" - uid: 84acabb8-9dca-46ab-b099-4799a732ba43 -spec: - appName: podtato-head - appVersion: 0.1.1 - checkType: pre-eval - evaluationDefinition: app-pre-deploy-eval-2 - retries: 10 - retryInterval: 5s - workloadVersion: "" -status: - endTime: "2022-12-14T13:17:36Z" - evaluationStatus: - available-cpus: - status: Failed - value: "0.25" - overallStatus: Failed - retryCount: 1 - startTime: "2022-12-14T13:17:36Z" \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/testdata/healthy.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/testdata/healthy.yaml deleted file mode 100644 index 8c74e31..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/testdata/healthy.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnEvaluation -metadata: - creationTimestamp: "2022-12-14T13:17:36Z" - generation: 1 - name: pre-eval-app-pre-deploy-eval-2-48925 - namespace: podtato-kubectl - ownerReferences: - - apiVersion: lifecycle.keptn.sh/v1alpha2 - blockOwnerDeletion: true - controller: true - kind: KeptnAppVersion - name: podtato-head-0.1.1 - uid: 9ae27184-c63d-4e50-bbc7-18e5e289e85c - resourceVersion: "225737" - uid: 84acabb8-9dca-46ab-b099-4799a732ba43 -spec: - appName: podtato-head - appVersion: 0.1.1 - checkType: pre-eval - evaluationDefinition: app-pre-deploy-eval-2 - retries: 10 - retryInterval: 5s - workloadVersion: "" -status: - endTime: "2022-12-14T13:17:36Z" - evaluationStatus: - available-cpus: - status: Succeeded - value: "1.3100000000000005" - overallStatus: Succeeded - retryCount: 1 - startTime: "2022-12-14T13:17:36Z" \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/testdata/progressing.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/testdata/progressing.yaml deleted file mode 100644 index ba50406..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnEvaluation/testdata/progressing.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnEvaluation -metadata: - creationTimestamp: "2022-12-14T13:17:36Z" - generation: 1 - name: pre-eval-app-pre-deploy-eval-2-48925 - namespace: podtato-kubectl - ownerReferences: - - apiVersion: lifecycle.keptn.sh/v1alpha2 - blockOwnerDeletion: true - controller: true - kind: KeptnAppVersion - name: podtato-head-0.1.1 - uid: 9ae27184-c63d-4e50-bbc7-18e5e289e85c - resourceVersion: "225737" - uid: 84acabb8-9dca-46ab-b099-4799a732ba43 -spec: - appName: podtato-head - appVersion: 0.1.1 - checkType: pre-eval - evaluationDefinition: app-pre-deploy-eval-2 - retries: 10 - retryInterval: 5s - workloadVersion: "" -status: - endTime: "2022-12-14T13:17:36Z" - evaluationStatus: - available-cpus: - status: Progressing - value: "" - overallStatus: Progressing - retryCount: 1 - startTime: "2022-12-14T13:17:36Z" \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/health.lua b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/health.lua deleted file mode 100644 index e22de12..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/health.lua +++ /dev/null @@ -1,14 +0,0 @@ -hs = {} -if obj.status.status == "Succeeded" then - hs.status = "Healthy" - hs.message = "KeptnTask is healthy" - return hs -end -if obj.status.status == "Failed" then - hs.status = "Degraded" - hs.message = "KeptnTask is degraded" - return hs -end -hs.status = "Progressing" -hs.message = "KeptnTask is progressing" -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/health_test.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/health_test.yaml deleted file mode 100644 index 3d07164..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: "KeptnTask is progressing" - inputPath: testdata/progressing.yaml - - healthStatus: - status: Degraded - message: "KeptnTask is degraded" - inputPath: testdata/degraded.yaml - - healthStatus: - status: Healthy - message: "KeptnTask is healthy" - inputPath: testdata/healthy.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/testdata/degraded.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/testdata/degraded.yaml deleted file mode 100644 index 4055a56..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/testdata/degraded.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnTask -metadata: - creationTimestamp: "2022-12-14T13:17:56Z" - generation: 1 - name: pre-pre-deployment-check-entry-31363 - namespace: podtato-kubectl - ownerReferences: - - apiVersion: lifecycle.keptn.sh/v1alpha2 - blockOwnerDeletion: true - controller: true - kind: KeptnWorkloadInstance - name: podtato-head-podtato-head-left-leg-0.2.7 - uid: 1376ab23-43d7-4304-89b3-1eea3a895a2d - resourceVersion: "226304" - uid: 2e89a2e6-44ba-47ed-8800-c0194e549ee0 -spec: - app: podtato-head - appVersion: "" - checkType: pre - context: - appName: "" - appVersion: "" - objectType: "" - taskType: "" - workloadName: "" - workloadVersion: "" - parameters: {} - secureParameters: {} - taskDefinition: pre-deployment-check-entry - workload: podtato-head-podtato-head-left-leg - workloadVersion: 0.2.7 -status: - jobName: klc-pre-pre-deployment-check--44910 - startTime: "2022-12-14T13:17:56Z" - status: Failed \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/testdata/healthy.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/testdata/healthy.yaml deleted file mode 100644 index 4939df9..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/testdata/healthy.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnTask -metadata: - creationTimestamp: "2022-12-14T13:17:56Z" - generation: 1 - name: pre-pre-deployment-check-entry-31363 - namespace: podtato-kubectl - ownerReferences: - - apiVersion: lifecycle.keptn.sh/v1alpha2 - blockOwnerDeletion: true - controller: true - kind: KeptnWorkloadInstance - name: podtato-head-podtato-head-left-leg-0.2.7 - uid: 1376ab23-43d7-4304-89b3-1eea3a895a2d - resourceVersion: "226304" - uid: 2e89a2e6-44ba-47ed-8800-c0194e549ee0 -spec: - app: podtato-head - appVersion: "" - checkType: pre - context: - appName: "" - appVersion: "" - objectType: "" - taskType: "" - workloadName: "" - workloadVersion: "" - parameters: {} - secureParameters: {} - taskDefinition: pre-deployment-check-entry - workload: podtato-head-podtato-head-left-leg - workloadVersion: 0.2.7 -status: - endTime: "2022-12-14T13:18:46Z" - jobName: klc-pre-pre-deployment-check--44910 - startTime: "2022-12-14T13:17:56Z" - status: Succeeded \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/testdata/progressing.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/testdata/progressing.yaml deleted file mode 100644 index 342365c..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnTask/testdata/progressing.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnTask -metadata: - creationTimestamp: "2022-12-14T13:17:56Z" - generation: 1 - name: pre-pre-deployment-check-entry-31363 - namespace: podtato-kubectl - ownerReferences: - - apiVersion: lifecycle.keptn.sh/v1alpha2 - blockOwnerDeletion: true - controller: true - kind: KeptnWorkloadInstance - name: podtato-head-podtato-head-left-leg-0.2.7 - uid: 1376ab23-43d7-4304-89b3-1eea3a895a2d - resourceVersion: "226304" - uid: 2e89a2e6-44ba-47ed-8800-c0194e549ee0 -spec: - app: podtato-head - appVersion: "" - checkType: pre - context: - appName: "" - appVersion: "" - objectType: "" - taskType: "" - workloadName: "" - workloadVersion: "" - parameters: {} - secureParameters: {} - taskDefinition: pre-deployment-check-entry - workload: podtato-head-podtato-head-left-leg - workloadVersion: 0.2.7 -status: - jobName: klc-pre-pre-deployment-check--44910 - startTime: "2022-12-14T13:17:56Z" - status: Progressing \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/health.lua b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/health.lua deleted file mode 100644 index 6400201..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/health.lua +++ /dev/null @@ -1,14 +0,0 @@ -hs = {} -if obj.status.status == "Succeeded" then - hs.status = "Healthy" - hs.message = "KeptnWorkloadInstance is healthy" - return hs -end -if obj.status.status == "Failed" then - hs.status = "Degraded" - hs.message = "KeptnWorkloadInstance is degraded" - return hs -end -hs.status = "Progressing" -hs.message = "KeptnWorkloadInstance is progressing" -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/health_test.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/health_test.yaml deleted file mode 100644 index f27bad6..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: "KeptnWorkloadInstance is progressing" - inputPath: testdata/progressing.yaml - - healthStatus: - status: Degraded - message: "KeptnWorkloadInstance is degraded" - inputPath: testdata/degraded.yaml - - healthStatus: - status: Healthy - message: "KeptnWorkloadInstance is healthy" - inputPath: testdata/healthy.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/testdata/degraded.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/testdata/degraded.yaml deleted file mode 100644 index 324e4e0..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/testdata/degraded.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnWorkloadInstance -metadata: - annotations: - traceparent: 00-5050e556a9aaf22814aa689d0518f4d3-cbcff966a6d32c39-01 - creationTimestamp: "2022-12-14T13:17:36Z" - generation: 2 - name: podtato-head-podtato-head-entry-0.2.7 - namespace: podtato-kubectl - ownerReferences: - - apiVersion: lifecycle.keptn.sh/v1alpha2 - blockOwnerDeletion: true - controller: true - kind: KeptnWorkload - name: podtato-head-podtato-head-entry - uid: dcafe814-7f9d-4d50-9a66-f61c81bfe764 - resourceVersion: "226253" - uid: 6987404b-c7b9-40f5-95e9-d5aad55a3f3b -spec: - app: podtato-head - resourceReference: - kind: ReplicaSet - name: podtato-head-entry-6fc8964846 - uid: 2b6e44bf-27e3-4305-a9fb-65d2f412936b - traceId: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0ae50f2d844888ab-01 - version: 0.2.7 - workloadName: podtato-head-podtato-head-entry -status: - currentPhase: PreDeployTasks - deploymentStatus: Succeeded - phaseTraceIDs: - "": - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-ca249d3f6e024547-01 - WorkloadDeploy: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-3be53185e6024eb4-01 - WorkloadPostDeployEvaluations: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0dc305a08a0ccf14-01 - WorkloadPostDeployTasks: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-4c7cf78cbbc40e14-01 - WorkloadPreDeployEvaluations: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-5eed0ec5420cfc89-01 - WorkloadPreDeployTasks: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-bef05615fc0138ac-01 - postDeploymentEvaluationStatus: Progressing - postDeploymentStatus: Progressing - preDeploymentEvaluationStatus: Failed - preDeploymentStatus: Failed - startTime: "2022-12-14T13:17:57Z" - status: Failed \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/testdata/healthy.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/testdata/healthy.yaml deleted file mode 100644 index 491501a..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/testdata/healthy.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnWorkloadInstance -metadata: - annotations: - traceparent: 00-5050e556a9aaf22814aa689d0518f4d3-cbcff966a6d32c39-01 - creationTimestamp: "2022-12-14T13:17:36Z" - generation: 2 - name: podtato-head-podtato-head-entry-0.2.7 - namespace: podtato-kubectl - ownerReferences: - - apiVersion: lifecycle.keptn.sh/v1alpha2 - blockOwnerDeletion: true - controller: true - kind: KeptnWorkload - name: podtato-head-podtato-head-entry - uid: dcafe814-7f9d-4d50-9a66-f61c81bfe764 - resourceVersion: "226253" - uid: 6987404b-c7b9-40f5-95e9-d5aad55a3f3b -spec: - app: podtato-head - resourceReference: - kind: ReplicaSet - name: podtato-head-entry-6fc8964846 - uid: 2b6e44bf-27e3-4305-a9fb-65d2f412936b - traceId: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0ae50f2d844888ab-01 - version: 0.2.7 - workloadName: podtato-head-podtato-head-entry -status: - currentPhase: Completed - deploymentStatus: Succeeded - endTime: "2022-12-14T13:18:41Z" - phaseTraceIDs: - "": - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-ca249d3f6e024547-01 - WorkloadDeploy: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-3be53185e6024eb4-01 - WorkloadPostDeployEvaluations: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0dc305a08a0ccf14-01 - WorkloadPostDeployTasks: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-4c7cf78cbbc40e14-01 - WorkloadPreDeployEvaluations: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-5eed0ec5420cfc89-01 - WorkloadPreDeployTasks: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-bef05615fc0138ac-01 - postDeploymentEvaluationStatus: Succeeded - postDeploymentStatus: Succeeded - preDeploymentEvaluationStatus: Succeeded - preDeploymentStatus: Succeeded - startTime: "2022-12-14T13:17:57Z" - status: Succeeded \ No newline at end of file diff --git a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/testdata/progressing.yaml b/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/testdata/progressing.yaml deleted file mode 100644 index b263c95..0000000 --- a/pkg/resource_customizations/lifecycle.keptn.sh/KeptnWorkloadInstance/testdata/progressing.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: lifecycle.keptn.sh/v1alpha2 -kind: KeptnWorkloadInstance -metadata: - annotations: - traceparent: 00-5050e556a9aaf22814aa689d0518f4d3-cbcff966a6d32c39-01 - creationTimestamp: "2022-12-14T13:17:36Z" - generation: 2 - name: podtato-head-podtato-head-entry-0.2.7 - namespace: podtato-kubectl - ownerReferences: - - apiVersion: lifecycle.keptn.sh/v1alpha2 - blockOwnerDeletion: true - controller: true - kind: KeptnWorkload - name: podtato-head-podtato-head-entry - uid: dcafe814-7f9d-4d50-9a66-f61c81bfe764 - resourceVersion: "226253" - uid: 6987404b-c7b9-40f5-95e9-d5aad55a3f3b -spec: - app: podtato-head - resourceReference: - kind: ReplicaSet - name: podtato-head-entry-6fc8964846 - uid: 2b6e44bf-27e3-4305-a9fb-65d2f412936b - traceId: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0ae50f2d844888ab-01 - version: 0.2.7 - workloadName: podtato-head-podtato-head-entry -status: - currentPhase: Completed - deploymentStatus: Succeeded - phaseTraceIDs: - "": - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-ca249d3f6e024547-01 - WorkloadDeploy: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-3be53185e6024eb4-01 - WorkloadPostDeployEvaluations: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-0dc305a08a0ccf14-01 - WorkloadPostDeployTasks: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-4c7cf78cbbc40e14-01 - WorkloadPreDeployEvaluations: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-5eed0ec5420cfc89-01 - WorkloadPreDeployTasks: - traceparent: 00-ecdd1f5a7e1068ac9b0d044aa165ca4c-bef05615fc0138ac-01 - postDeploymentEvaluationStatus: Progressing - postDeploymentStatus: Progressing - preDeploymentEvaluationStatus: Succeeded - preDeploymentStatus: Succeeded - startTime: "2022-12-14T13:17:57Z" - status: Progressing \ No newline at end of file diff --git a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/health.lua b/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/health.lua deleted file mode 100644 index 60f2386..0000000 --- a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/health.lua +++ /dev/null @@ -1,25 +0,0 @@ -health_status = {} - -if obj.status ~= nil and obj.status.conditions ~= nil then - - for i, condition in ipairs(obj.status.conditions) do - - health_status.message = condition.message - - if condition.status == "False" then - if condition.reason == "Failed" then - health_status.status = "Degraded" - return health_status - end - health_status.status = "Progressing" - return health_status - end - end - - health_status.status = "Healthy" - return health_status -end - -health_status.status = "Progressing" -health_status.message = "No status info available" -return health_status diff --git a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/health_test.yaml b/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/health_test.yaml deleted file mode 100644 index f3dba1a..0000000 --- a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/health_test.yaml +++ /dev/null @@ -1,25 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "No status info available" - inputPath: testdata/no_status.yaml -- healthStatus: - status: Healthy - message: "Running" - inputPath: testdata/statefulset_ready.yaml -- healthStatus: - status: Progressing - message: "Not ready" - inputPath: testdata/statefulset_not_ready.yaml -- healthStatus: - status: Healthy - message: "Running" - inputPath: testdata/restore_complete.yaml -- healthStatus: - status: Progressing - message: "Restoring backup" - inputPath: testdata/restore_not_complete.yaml -- healthStatus: - status: Degraded - message: "Error creating ConfigMap" - inputPath: testdata/mariadb_error.yaml diff --git a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/mariadb_error.yaml b/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/mariadb_error.yaml deleted file mode 100644 index 030391d..0000000 --- a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/mariadb_error.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: mariadb.mmontes.io/v1alpha1 -kind: MariaDB -metadata: - name: mariadb-server -spec: - rootPasswordSecretKeyRef: - name: mariadb - key: root-password - image: - repository: mariadb - tag: "10.7.4" - pullPolicy: IfNotPresent - port: 3306 - volumeClaimTemplate: - resources: - requests: - storage: 100Mi - storageClassName: standard - accessModes: - - ReadWriteOnce -status: - conditions: - - lastTransitionTime: '2023-04-20T15:31:15Z' - message: Error creating ConfigMap - reason: Failed - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/no_status.yaml b/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/no_status.yaml deleted file mode 100644 index 276d09b..0000000 --- a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/no_status.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: mariadb.mmontes.io/v1alpha1 -kind: MariaDB -metadata: - name: mariadb-server -spec: - rootPasswordSecretKeyRef: - name: mariadb - key: root-password - image: - repository: mariadb - tag: "10.7.4" - pullPolicy: IfNotPresent - port: 3306 - volumeClaimTemplate: - resources: - requests: - storage: 100Mi - storageClassName: standard - accessModes: - - ReadWriteOnce -status: - revision: 0 diff --git a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/restore_complete.yaml b/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/restore_complete.yaml deleted file mode 100644 index 7a9358c..0000000 --- a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/restore_complete.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: mariadb.mmontes.io/v1alpha1 -kind: MariaDB -metadata: - name: mariadb-server -spec: - rootPasswordSecretKeyRef: - name: mariadb - key: root-password - image: - repository: mariadb - tag: "10.7.4" - pullPolicy: IfNotPresent - port: 3306 - volumeClaimTemplate: - resources: - requests: - storage: 100Mi - storageClassName: standard - accessModes: - - ReadWriteOnce -status: - conditions: - - lastTransitionTime: "2023-04-05T14:18:01Z" - message: Ready - reason: RestoreComplete - status: "True" - type: Bootstrapped - - lastTransitionTime: "2023-04-05T14:18:02Z" - message: Running - reason: RestoreComplete - status: "True" - type: Ready diff --git a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/restore_not_complete.yaml b/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/restore_not_complete.yaml deleted file mode 100644 index a3f600e..0000000 --- a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/restore_not_complete.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: mariadb.mmontes.io/v1alpha1 -kind: MariaDB -metadata: - name: mariadb-server -spec: - rootPasswordSecretKeyRef: - name: mariadb - key: root-password - image: - repository: mariadb - tag: "10.7.4" - pullPolicy: IfNotPresent - port: 3306 - volumeClaimTemplate: - resources: - requests: - storage: 100Mi - storageClassName: standard - accessModes: - - ReadWriteOnce -status: - conditions: - - lastTransitionTime: "2023-04-05T14:18:01Z" - message: Restoring backup - reason: RestoreNotComplete - status: "False" - type: Ready - - lastTransitionTime: "2023-04-05T14:18:02Z" - message: Not ready - reason: RestoreNotComplete - status: "False" - type: Bootstrapped diff --git a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/statefulset_not_ready.yaml b/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/statefulset_not_ready.yaml deleted file mode 100644 index 96d46b4..0000000 --- a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/statefulset_not_ready.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: mariadb.mmontes.io/v1alpha1 -kind: MariaDB -metadata: - name: mariadb-server -spec: - rootPasswordSecretKeyRef: - name: mariadb - key: root-password - image: - repository: mariadb - tag: "10.7.4" - pullPolicy: IfNotPresent - port: 3306 - volumeClaimTemplate: - resources: - requests: - storage: 100Mi - storageClassName: standard - accessModes: - - ReadWriteOnce -status: - conditions: - - lastTransitionTime: "2023-04-05T14:18:01Z" - message: Not ready - reason: StatefulSetNotReady - status: "False" - type: Ready diff --git a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/statefulset_ready.yaml b/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/statefulset_ready.yaml deleted file mode 100644 index e4870b0..0000000 --- a/pkg/resource_customizations/mariadb.mmontes.io/MariaDB/testdata/statefulset_ready.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: mariadb.mmontes.io/v1alpha1 -kind: MariaDB -metadata: - name: mariadb-server -spec: - rootPasswordSecretKeyRef: - name: mariadb - key: root-password - image: - repository: mariadb - tag: "10.7.4" - pullPolicy: IfNotPresent - port: 3306 - volumeClaimTemplate: - resources: - requests: - storage: 100Mi - storageClassName: standard - accessModes: - - ReadWriteOnce -status: - conditions: - - lastTransitionTime: "2023-04-05T14:18:01Z" - message: Running - reason: StatefulSetReady - status: "True" - type: Ready diff --git a/pkg/resource_customizations/minio.min.io/Tenant/health.lua b/pkg/resource_customizations/minio.min.io/Tenant/health.lua deleted file mode 100644 index 088d70a..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/health.lua +++ /dev/null @@ -1,61 +0,0 @@ -health_status = {} -if obj.status ~= nil then - if obj.status.currentState ~= nil then - if obj.status.currentState == "Initialized" then - health_status.status = "Healthy" - health_status.message = obj.status.currentState - return health_status - end - if obj.status.currentState:find("^Provisioning") ~= nil then - health_status.status = "Progressing" - health_status.message = obj.status.currentState - return health_status - end - if obj.status.currentState:find("^Waiting") ~= nil then - health_status.status = "Progressing" - health_status.message = obj.status.currentState - return health_status - end - if obj.status.currentState:find("^Updating") ~= nil then - health_status.status = "Progressing" - health_status.message = obj.status.currentState - return health_status - end - if obj.status.currentState == "Restarting MinIO" then - health_status.status = "Progressing" - health_status.message = obj.status.currentState - return health_status - end - if obj.status.currentState == "Statefulset not controlled by operator" then - health_status.status = "Degraded" - health_status.message = obj.status.currentState - return health_status - end - if obj.status.currentState == "Another MinIO Tenant already exists in the namespace" then - health_status.status = "Degraded" - health_status.message = obj.status.currentState - return health_status - end - if obj.status.currentState == "Tenant credentials are not set properly" then - health_status.status = "Degraded" - health_status.message = obj.status.currentState - return health_status - end - if obj.status.currentState == "Different versions across MinIO Pools" then - health_status.status = "Degraded" - health_status.message = obj.status.currentState - return health_status - end - if obj.status.currentState == "Pool Decommissioning Not Allowed" then - health_status.status = "Degraded" - health_status.message = obj.status.currentState - return health_status - end - health_status.status = "Progressing" - health_status.message = obj.status.currentState - return health_status - end -end -health_status.status = "Progressing" -health_status.message = "No status info available" -return health_status diff --git a/pkg/resource_customizations/minio.min.io/Tenant/health_test.yaml b/pkg/resource_customizations/minio.min.io/Tenant/health_test.yaml deleted file mode 100644 index c20b410..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/health_test.yaml +++ /dev/null @@ -1,45 +0,0 @@ -tests: -- healthStatus: - status: Healthy - message: "Initialized" - inputPath: testdata/initialized.yaml -- healthStatus: - status: Progressing - message: "Provisioning MinIO Cluster IP Service" - inputPath: testdata/provisioning.yaml -- healthStatus: - status: Progressing - message: "Waiting for Pods to be ready" - inputPath: testdata/waiting.yaml -- healthStatus: - status: Progressing - message: "Updating MinIO Version" - inputPath: testdata/updating.yaml -- healthStatus: - status: Degraded - message: "Statefulset not controlled by operator" - inputPath: testdata/out_of_control.yaml -- healthStatus: - status: Degraded - message: "Another MinIO Tenant already exists in the namespace" - inputPath: testdata/another_tenant_exists.yaml -- healthStatus: - status: Degraded - message: "Tenant credentials are not set properly" - inputPath: testdata/incorrect_tenant_credentials.yaml -- healthStatus: - status: Degraded - message: "Different versions across MinIO Pools" - inputPath: testdata/versions_mismatch.yaml -- healthStatus: - status: Degraded - message: "Pool Decommissioning Not Allowed" - inputPath: testdata/pool_decommissioning_not_allowed.yaml -- healthStatus: - status: Progressing - message: "" - inputPath: testdata/unknown_status_message.yaml -- healthStatus: - status: Progressing - message: "No status info available" - inputPath: testdata/no_status.yaml diff --git a/pkg/resource_customizations/minio.min.io/Tenant/testdata/another_tenant_exists.yaml b/pkg/resource_customizations/minio.min.io/Tenant/testdata/another_tenant_exists.yaml deleted file mode 100644 index 5ca4d78..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/testdata/another_tenant_exists.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: minio.min.io/v2 -kind: Tenant -metadata: - name: minio-tenant -spec: - image: minio/minio:latest - pools: - - name: pool-0 - servers: 1 - volumesPerServer: 4 -status: - revision: 0 - currentState: Another MinIO Tenant already exists in the namespace diff --git a/pkg/resource_customizations/minio.min.io/Tenant/testdata/incorrect_tenant_credentials.yaml b/pkg/resource_customizations/minio.min.io/Tenant/testdata/incorrect_tenant_credentials.yaml deleted file mode 100644 index 52b2711..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/testdata/incorrect_tenant_credentials.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: minio.min.io/v2 -kind: Tenant -metadata: - name: minio-tenant -spec: - image: minio/minio:latest - pools: - - name: pool-0 - servers: 1 - volumesPerServer: 4 -status: - revision: 0 - currentState: Tenant credentials are not set properly diff --git a/pkg/resource_customizations/minio.min.io/Tenant/testdata/initialized.yaml b/pkg/resource_customizations/minio.min.io/Tenant/testdata/initialized.yaml deleted file mode 100644 index 74018d3..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/testdata/initialized.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: minio.min.io/v2 -kind: Tenant -metadata: - name: minio-tenant -spec: - image: minio/minio:latest - pools: - - name: pool-0 - servers: 1 - volumesPerServer: 4 -status: - revision: 0 - currentState: Initialized diff --git a/pkg/resource_customizations/minio.min.io/Tenant/testdata/no_status.yaml b/pkg/resource_customizations/minio.min.io/Tenant/testdata/no_status.yaml deleted file mode 100644 index 3e58e86..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/testdata/no_status.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: minio.min.io/v2 -kind: Tenant -metadata: - name: minio-tenant -spec: - image: minio/minio:latest - pools: - - name: pool-0 - servers: 1 - volumesPerServer: 4 -status: - revision: 0 diff --git a/pkg/resource_customizations/minio.min.io/Tenant/testdata/out_of_control.yaml b/pkg/resource_customizations/minio.min.io/Tenant/testdata/out_of_control.yaml deleted file mode 100644 index ea25763..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/testdata/out_of_control.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: minio.min.io/v2 -kind: Tenant -metadata: - name: minio-tenant -spec: - image: minio/minio:latest - pools: - - name: pool-0 - servers: 1 - volumesPerServer: 4 -status: - revision: 0 - currentState: Statefulset not controlled by operator diff --git a/pkg/resource_customizations/minio.min.io/Tenant/testdata/pool_decommissioning_not_allowed.yaml b/pkg/resource_customizations/minio.min.io/Tenant/testdata/pool_decommissioning_not_allowed.yaml deleted file mode 100644 index fcd181c..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/testdata/pool_decommissioning_not_allowed.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: minio.min.io/v2 -kind: Tenant -metadata: - name: minio-tenant -spec: - image: minio/minio:latest - pools: - - name: pool-0 - servers: 1 - volumesPerServer: 4 -status: - revision: 0 - currentState: Pool Decommissioning Not Allowed diff --git a/pkg/resource_customizations/minio.min.io/Tenant/testdata/provisioning.yaml b/pkg/resource_customizations/minio.min.io/Tenant/testdata/provisioning.yaml deleted file mode 100644 index 05c9ba3..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/testdata/provisioning.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: minio.min.io/v2 -kind: Tenant -metadata: - name: minio-tenant -spec: - image: minio/minio:latest - pools: - - name: pool-0 - servers: 1 - volumesPerServer: 4 -status: - revision: 0 - currentState: Provisioning MinIO Cluster IP Service diff --git a/pkg/resource_customizations/minio.min.io/Tenant/testdata/restarting_minio.yaml b/pkg/resource_customizations/minio.min.io/Tenant/testdata/restarting_minio.yaml deleted file mode 100644 index 11c37d5..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/testdata/restarting_minio.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: minio.min.io/v2 -kind: Tenant -metadata: - name: minio-tenant -spec: - image: minio/minio:latest - pools: - - name: pool-0 - servers: 1 - volumesPerServer: 4 -status: - revision: 0 - currentState: Restarting MinIO diff --git a/pkg/resource_customizations/minio.min.io/Tenant/testdata/unknown_status_message.yaml b/pkg/resource_customizations/minio.min.io/Tenant/testdata/unknown_status_message.yaml deleted file mode 100644 index 862560e..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/testdata/unknown_status_message.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: minio.min.io/v2 -kind: Tenant -metadata: - name: minio-tenant -spec: - image: minio/minio:latest - pools: - - name: pool-0 - servers: 1 - volumesPerServer: 4 -status: - revision: 0 - currentState: diff --git a/pkg/resource_customizations/minio.min.io/Tenant/testdata/updating.yaml b/pkg/resource_customizations/minio.min.io/Tenant/testdata/updating.yaml deleted file mode 100644 index a32c18d..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/testdata/updating.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: minio.min.io/v2 -kind: Tenant -metadata: - name: minio-tenant -spec: - image: minio/minio:latest - pools: - - name: pool-0 - servers: 1 - volumesPerServer: 4 -status: - revision: 0 - currentState: Updating MinIO Version diff --git a/pkg/resource_customizations/minio.min.io/Tenant/testdata/versions_mismatch.yaml b/pkg/resource_customizations/minio.min.io/Tenant/testdata/versions_mismatch.yaml deleted file mode 100644 index 31f79d7..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/testdata/versions_mismatch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: minio.min.io/v2 -kind: Tenant -metadata: - name: minio-tenant -spec: - image: minio/minio:latest - pools: - - name: pool-0 - servers: 1 - volumesPerServer: 4 -status: - revision: 0 - currentState: Different versions across MinIO Pools diff --git a/pkg/resource_customizations/minio.min.io/Tenant/testdata/waiting.yaml b/pkg/resource_customizations/minio.min.io/Tenant/testdata/waiting.yaml deleted file mode 100644 index 3476622..0000000 --- a/pkg/resource_customizations/minio.min.io/Tenant/testdata/waiting.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: minio.min.io/v2 -kind: Tenant -metadata: - name: minio-tenant -spec: - image: minio/minio:latest - pools: - - name: pool-0 - servers: 1 - volumesPerServer: 4 -status: - revision: 0 - currentState: Waiting for Pods to be ready diff --git a/pkg/resource_customizations/monitoring.coreos.com/Prometheus/health.lua b/pkg/resource_customizations/monitoring.coreos.com/Prometheus/health.lua deleted file mode 100644 index 34fddd1..0000000 --- a/pkg/resource_customizations/monitoring.coreos.com/Prometheus/health.lua +++ /dev/null @@ -1,23 +0,0 @@ -hs={ status = "Progressing", message = "Waiting for initialization" } - -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - if condition.type == "Available" and condition.status ~= "True" then - if condition.reason == "SomePodsNotReady" then - hs.status = "Progressing" - else - hs.status = "Degraded" - end - hs.message = condition.message or condition.reason - end - if condition.type == "Available" and condition.status == "True" then - hs.status = "Healthy" - hs.message = "All instances are available" - end - end - end -end - -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/monitoring.coreos.com/Prometheus/health_test.yaml b/pkg/resource_customizations/monitoring.coreos.com/Prometheus/health_test.yaml deleted file mode 100644 index 91e135e..0000000 --- a/pkg/resource_customizations/monitoring.coreos.com/Prometheus/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: - - healthStatus: - status: Healthy - message: "All instances are available" - inputPath: testdata/healthy.yaml - - healthStatus: - status: Progressing - message: "SomePodsNotReady" - inputPath: testdata/progressing.yaml - - healthStatus: - status: Degraded - message: "shard 0: pod prometheus-prometheus-stack-kube-prom-prometheus-0: 0/5 nodes are available: 2 node(s) didn't match Pod's node affinity/selector, 3 node(s) were unschedulable.\nshard 0: pod prometheus-prometheus-stack-kube-prom-prometheus-1: 0/5 nodes are available: 2 node(s) didn't match Pod's node affinity/selector, 3 node(s) were unschedulable." - inputPath: testdata/degraded.yaml diff --git a/pkg/resource_customizations/monitoring.coreos.com/Prometheus/testdata/degraded.yaml b/pkg/resource_customizations/monitoring.coreos.com/Prometheus/testdata/degraded.yaml deleted file mode 100644 index f588ee4..0000000 --- a/pkg/resource_customizations/monitoring.coreos.com/Prometheus/testdata/degraded.yaml +++ /dev/null @@ -1,142 +0,0 @@ -apiVersion: monitoring.coreos.com/v1 -kind: Prometheus -metadata: - annotations: - argocd.argoproj.io/tracking-id: >- - prometheus-stack:monitoring.coreos.com/Prometheus:prometheus/prometheus-stack-kube-prom-prometheus - creationTimestamp: '2021-12-09T15:51:10Z' - generation: 46 - labels: - app: kube-prometheus-stack-prometheus - app.kubernetes.io/instance: prometheus-stack - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/part-of: kube-prometheus-stack - app.kubernetes.io/version: 39.11.0 - chart: kube-prometheus-stack-39.11.0 - heritage: Helm - release: prometheus-stack - name: prometheus-stack-kube-prom-prometheus - namespace: prometheus - resourceVersion: '200320271' - uid: 6f2e1016-926d-44e7-945b-dec4c975595b -spec: - additionalScrapeConfigs: - key: prometheus-additional.yaml - name: additional-scrape-configs - alerting: - alertmanagers: - - apiVersion: v2 - name: prometheus-stack-kube-prom-alertmanager - namespace: prometheus - pathPrefix: / - port: http-web - containers: - - name: prometheus - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - - name: config-reloader - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - enableAdminAPI: false - evaluationInterval: 30s - externalUrl: 'http://prometheus-stack-kube-prom-prometheus.prometheus:9090' - image: 'quay.io/prometheus/prometheus:v2.37.0' - imagePullSecrets: - - name: mcps-registry-image-pull-secret - initContainers: - - name: init-config-reloader - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - listenLocal: false - logFormat: logfmt - logLevel: info - paused: false - podMonitorNamespaceSelector: {} - podMonitorSelector: {} - portName: http-web - probeNamespaceSelector: {} - probeSelector: {} - replicas: 2 - resources: - requests: - memory: 700Mi - retention: 6h - routePrefix: / - ruleNamespaceSelector: {} - ruleSelector: {} - scrapeInterval: 10s - securityContext: - fsGroup: 2000 - runAsGroup: 2000 - runAsNonRoot: true - runAsUser: 1000 - serviceAccountName: prometheus-stack-kube-prom-prometheus - serviceMonitorNamespaceSelector: {} - serviceMonitorSelector: {} - shards: 1 - storage: - volumeClaimTemplate: - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Gi - storageClassName: default - topologySpreadConstraints: - - labelSelector: - matchLabels: - app.kubernetes.io/name: prometheus - maxSkew: 1 - topologyKey: kubernetes.io/hostname - whenUnsatisfiable: ScheduleAnyway - - labelSelector: - matchLabels: - app.kubernetes.io/name: prometheus - maxSkew: 1 - topologyKey: topology.kubernetes.io/zone - whenUnsatisfiable: DoNotSchedule - version: v2.37.0 -status: - availableReplicas: 0 - conditions: - - lastTransitionTime: '2022-09-02T14:55:03Z' - message: >- - shard 0: pod prometheus-prometheus-stack-kube-prom-prometheus-0: 0/5 - nodes are available: 2 node(s) didn't match Pod's node - affinity/selector, 3 node(s) were unschedulable. - - shard 0: pod prometheus-prometheus-stack-kube-prom-prometheus-1: 0/5 - nodes are available: 2 node(s) didn't match Pod's node - affinity/selector, 3 node(s) were unschedulable. - reason: NoPodReady - status: 'False' - type: Available - - lastTransitionTime: '2022-09-02T09:57:03Z' - status: 'True' - type: Reconciled - paused: false - replicas: 2 - shardStatuses: - - availableReplicas: 0 - replicas: 2 - shardID: '0' - unavailableReplicas: 2 - updatedReplicas: 2 - unavailableReplicas: 2 - updatedReplicas: 2 diff --git a/pkg/resource_customizations/monitoring.coreos.com/Prometheus/testdata/healthy.yaml b/pkg/resource_customizations/monitoring.coreos.com/Prometheus/testdata/healthy.yaml deleted file mode 100644 index 6aa6aba..0000000 --- a/pkg/resource_customizations/monitoring.coreos.com/Prometheus/testdata/healthy.yaml +++ /dev/null @@ -1,130 +0,0 @@ -apiVersion: monitoring.coreos.com/v1 -kind: Prometheus -metadata: - annotations: - argocd.argoproj.io/tracking-id: prometheus-stack:monitoring.coreos.com/Prometheus:prometheus/prometheus-stack-kube-prom-prometheus - creationTimestamp: "2021-12-09T15:51:10Z" - generation: 46 - labels: - app: kube-prometheus-stack-prometheus - app.kubernetes.io/instance: prometheus-stack - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/part-of: kube-prometheus-stack - app.kubernetes.io/version: 39.11.0 - chart: kube-prometheus-stack-39.11.0 - heritage: Helm - release: prometheus-stack - name: prometheus-stack-kube-prom-prometheus - namespace: prometheus - resourceVersion: "200165695" - uid: 6f2e1016-926d-44e7-945b-dec4c975595b -spec: - additionalScrapeConfigs: - key: prometheus-additional.yaml - name: additional-scrape-configs - alerting: - alertmanagers: - - apiVersion: v2 - name: prometheus-stack-kube-prom-alertmanager - namespace: prometheus - pathPrefix: / - port: http-web - containers: - - name: prometheus - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - - name: config-reloader - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - enableAdminAPI: false - evaluationInterval: 30s - externalUrl: http://prometheus-stack-kube-prom-prometheus.prometheus:9090 - image: quay.io/prometheus/prometheus:v2.37.0 - initContainers: - - name: init-config-reloader - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - listenLocal: false - logFormat: logfmt - logLevel: info - paused: false - podMonitorNamespaceSelector: {} - podMonitorSelector: {} - portName: http-web - probeNamespaceSelector: {} - probeSelector: {} - replicas: 2 - resources: - requests: - memory: 700Mi - retention: 6h - routePrefix: / - ruleNamespaceSelector: {} - ruleSelector: {} - scrapeInterval: 10s - securityContext: - fsGroup: 2000 - runAsGroup: 2000 - runAsNonRoot: true - runAsUser: 1000 - serviceAccountName: prometheus-stack-kube-prom-prometheus - serviceMonitorNamespaceSelector: {} - serviceMonitorSelector: {} - shards: 1 - storage: - volumeClaimTemplate: - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Gi - storageClassName: default - topologySpreadConstraints: - - labelSelector: - matchLabels: - app.kubernetes.io/name: prometheus - maxSkew: 1 - topologyKey: kubernetes.io/hostname - whenUnsatisfiable: ScheduleAnyway - - labelSelector: - matchLabels: - app.kubernetes.io/name: prometheus - maxSkew: 1 - topologyKey: topology.kubernetes.io/zone - whenUnsatisfiable: DoNotSchedule - version: v2.37.0 -status: - availableReplicas: 2 - conditions: - - lastTransitionTime: "2022-09-01T19:54:00Z" - status: "True" - type: Available - - lastTransitionTime: "2022-09-02T09:57:03Z" - status: "True" - type: Reconciled - paused: false - replicas: 2 - shardStatuses: - - availableReplicas: 2 - replicas: 2 - shardID: "0" - unavailableReplicas: 0 - updatedReplicas: 2 - unavailableReplicas: 0 - updatedReplicas: 2 diff --git a/pkg/resource_customizations/monitoring.coreos.com/Prometheus/testdata/progressing.yaml b/pkg/resource_customizations/monitoring.coreos.com/Prometheus/testdata/progressing.yaml deleted file mode 100644 index db84b3c..0000000 --- a/pkg/resource_customizations/monitoring.coreos.com/Prometheus/testdata/progressing.yaml +++ /dev/null @@ -1,132 +0,0 @@ -apiVersion: monitoring.coreos.com/v1 -kind: Prometheus -metadata: - annotations: - argocd.argoproj.io/tracking-id: >- - prometheus-stack:monitoring.coreos.com/Prometheus:prometheus/prometheus-stack-kube-prom-prometheus - creationTimestamp: '2021-12-09T15:51:10Z' - generation: 46 - labels: - app: kube-prometheus-stack-prometheus - app.kubernetes.io/instance: prometheus-stack - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/part-of: kube-prometheus-stack - app.kubernetes.io/version: 39.11.0 - chart: kube-prometheus-stack-39.11.0 - heritage: Helm - release: prometheus-stack - name: prometheus-stack-kube-prom-prometheus - namespace: prometheus - resourceVersion: '200307978' - uid: 6f2e1016-926d-44e7-945b-dec4c975595b -spec: - additionalScrapeConfigs: - key: prometheus-additional.yaml - name: additional-scrape-configs - alerting: - alertmanagers: - - apiVersion: v2 - name: prometheus-stack-kube-prom-alertmanager - namespace: prometheus - pathPrefix: / - port: http-web - containers: - - name: prometheus - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - - name: config-reloader - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - enableAdminAPI: false - evaluationInterval: 30s - externalUrl: 'http://prometheus-stack-kube-prom-prometheus.prometheus:9090' - image: 'quay.io/prometheus/prometheus:v2.37.0' - initContainers: - - name: init-config-reloader - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - ALL - readOnlyRootFilesystem: true - runAsNonRoot: true - listenLocal: false - logFormat: logfmt - logLevel: info - paused: false - podMonitorNamespaceSelector: {} - podMonitorSelector: {} - portName: http-web - probeNamespaceSelector: {} - probeSelector: {} - replicas: 2 - resources: - requests: - memory: 700Mi - retention: 6h - routePrefix: / - ruleNamespaceSelector: {} - ruleSelector: {} - scrapeInterval: 10s - securityContext: - fsGroup: 2000 - runAsGroup: 2000 - runAsNonRoot: true - runAsUser: 1000 - serviceAccountName: prometheus-stack-kube-prom-prometheus - serviceMonitorNamespaceSelector: {} - serviceMonitorSelector: {} - shards: 1 - storage: - volumeClaimTemplate: - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 100Gi - storageClassName: default - topologySpreadConstraints: - - labelSelector: - matchLabels: - app.kubernetes.io/name: prometheus - maxSkew: 1 - topologyKey: kubernetes.io/hostname - whenUnsatisfiable: ScheduleAnyway - - labelSelector: - matchLabels: - app.kubernetes.io/name: prometheus - maxSkew: 1 - topologyKey: topology.kubernetes.io/zone - whenUnsatisfiable: DoNotSchedule - version: v2.37.0 -status: - availableReplicas: 1 - conditions: - - lastTransitionTime: '2022-09-02T14:34:39Z' - reason: SomePodsNotReady - status: Degraded - type: Available - - lastTransitionTime: '2022-09-02T09:57:03Z' - status: 'True' - type: Reconciled - paused: false - replicas: 2 - shardStatuses: - - availableReplicas: 1 - replicas: 2 - shardID: '0' - unavailableReplicas: 1 - updatedReplicas: 1 - unavailableReplicas: 1 - updatedReplicas: 1 diff --git a/pkg/resource_customizations/networking.gke.io/ManagedCertificate/health.lua b/pkg/resource_customizations/networking.gke.io/ManagedCertificate/health.lua deleted file mode 100644 index 9f0f3e1..0000000 --- a/pkg/resource_customizations/networking.gke.io/ManagedCertificate/health.lua +++ /dev/null @@ -1,23 +0,0 @@ -hs = {} - -if obj.status ~= nil then - if obj.status.domainStatus ~= nil then - for i, domainStatus in ipairs(obj.status.domainStatus) do - if domainStatus.status == "FailedNotVisible" then - hs.status = "Degraded" - hs.message = "At least one certificate has failed to be provisioned" - return hs - end - end - end -end - -if obj.status ~= nil and obj.status.certificateStatus == "Active" then - hs.status = "Healthy" - hs.message = "All certificates are active" - return hs -end - -hs.status = "Progressing" -hs.message = "At least one certificate is still being provisioned" -return hs diff --git a/pkg/resource_customizations/networking.gke.io/ManagedCertificate/health_test.yaml b/pkg/resource_customizations/networking.gke.io/ManagedCertificate/health_test.yaml deleted file mode 100644 index 5dbc1fb..0000000 --- a/pkg/resource_customizations/networking.gke.io/ManagedCertificate/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: "At least one certificate is still being provisioned" - inputPath: testdata/provisioning.yaml - - healthStatus: - status: Degraded - message: "At least one certificate has failed to be provisioned" - inputPath: testdata/failed.yaml - - healthStatus: - status: Healthy - message: "All certificates are active" - inputPath: testdata/active.yaml diff --git a/pkg/resource_customizations/networking.gke.io/ManagedCertificate/testdata/active.yaml b/pkg/resource_customizations/networking.gke.io/ManagedCertificate/testdata/active.yaml deleted file mode 100644 index f28aec6..0000000 --- a/pkg/resource_customizations/networking.gke.io/ManagedCertificate/testdata/active.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: networking.gke.io/v1beta2 -kind: ManagedCertificate -metadata: - annotations: - kubectl.kubernetes.io/last-applied-configuration: | - {"apiVersion":"networking.gke.io/v1beta2","kind":"ManagedCertificate","metadata":{"annotations":{},"name":"web","namespace":"default"},"spec":{"domains":["argocdtest.micke.me", "argocdtest2.micke.me", "argocdtest3.micke.me"]}} - creationTimestamp: "2020-05-16T19:35:14Z" - generation: 2 - name: web - namespace: default - resourceVersion: "2387" - selfLink: /apis/networking.gke.io/v1beta2/namespaces/default/managedcertificates/web - uid: 8011785f-233f-4e29-a68d-81945a342f08 -spec: - domains: - - argocdtest.micke.me - - argocdtest2.micke.me - - argocdtest3.micke.me -status: - certificateName: mcrt-0a994e84-76b2-4ba3-9819-2a4ec5c0637e - certificateStatus: Active - domainStatus: - - domain: argocdtest.micke.me - status: Active - - domain: argocdtest2.micke.me - status: Active - - domain: argocdtest3.micke.me - status: Active - expireTime: "2020-06-21T00:33:40.000-07:00" diff --git a/pkg/resource_customizations/networking.gke.io/ManagedCertificate/testdata/failed.yaml b/pkg/resource_customizations/networking.gke.io/ManagedCertificate/testdata/failed.yaml deleted file mode 100644 index 0343e46..0000000 --- a/pkg/resource_customizations/networking.gke.io/ManagedCertificate/testdata/failed.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: networking.gke.io/v1beta2 -kind: ManagedCertificate -metadata: - annotations: - kubectl.kubernetes.io/last-applied-configuration: | - {"apiVersion":"networking.gke.io/v1beta2","kind":"ManagedCertificate","metadata":{"annotations":{},"name":"web","namespace":"default"},"spec":{"domains":["argocdtest.micke.me", "argocdtest2.micke.me", "argocdtest3.micke.me"]}} - creationTimestamp: "2020-05-16T19:35:14Z" - generation: 2 - name: web - namespace: default - resourceVersion: "2387" - selfLink: /apis/networking.gke.io/v1beta2/namespaces/default/managedcertificates/web - uid: 8011785f-233f-4e29-a68d-81945a342f08 -spec: - domains: - - argocdtest.micke.me - - argocdtest2.micke.me - - argocdtest3.micke.me -status: - certificateName: mcrt-0a994e84-76b2-4ba3-9819-2a4ec5c0637e - certificateStatus: Provisioning - domainStatus: - - domain: argocdtest.micke.me - status: Active - - domain: argocdtest2.micke.me - status: Provisioning - - domain: argocdtest3.micke.me - status: FailedNotVisible diff --git a/pkg/resource_customizations/networking.gke.io/ManagedCertificate/testdata/provisioning.yaml b/pkg/resource_customizations/networking.gke.io/ManagedCertificate/testdata/provisioning.yaml deleted file mode 100644 index 37e20cc..0000000 --- a/pkg/resource_customizations/networking.gke.io/ManagedCertificate/testdata/provisioning.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: networking.gke.io/v1beta2 -kind: ManagedCertificate -metadata: - annotations: - kubectl.kubernetes.io/last-applied-configuration: | - {"apiVersion":"networking.gke.io/v1beta2","kind":"ManagedCertificate","metadata":{"annotations":{},"name":"web","namespace":"default"},"spec":{"domains":["argocdtest.micke.me", "argocdtest2.micke.me", "argocdtest3.micke.me"]}} - creationTimestamp: "2020-05-16T19:35:14Z" - generation: 2 - name: web - namespace: default - resourceVersion: "2387" - selfLink: /apis/networking.gke.io/v1beta2/namespaces/default/managedcertificates/web - uid: 8011785f-233f-4e29-a68d-81945a342f08 -spec: - domains: - - argocdtest.micke.me - - argocdtest2.micke.me - - argocdtest3.micke.me -status: - certificateName: mcrt-0a994e84-76b2-4ba3-9819-2a4ec5c0637e - certificateStatus: Provisioning - domainStatus: - - domain: argocdtest.micke.me - status: Active - - domain: argocdtest2.micke.me - status: Active - - domain: argocdtest3.micke.me - status: Provisioning diff --git a/pkg/resource_customizations/onepassword.com/OnePasswordItem/health.lua b/pkg/resource_customizations/onepassword.com/OnePasswordItem/health.lua deleted file mode 100644 index ee46c99..0000000 --- a/pkg/resource_customizations/onepassword.com/OnePasswordItem/health.lua +++ /dev/null @@ -1,21 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Ready" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - if condition.type == "Ready" and condition.status == "False" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - end - end -end - -hs.status = "Progressing" -hs.message = "Waiting for controller to report status" -return hs diff --git a/pkg/resource_customizations/onepassword.com/OnePasswordItem/health_test.yaml b/pkg/resource_customizations/onepassword.com/OnePasswordItem/health_test.yaml deleted file mode 100644 index 614f588..0000000 --- a/pkg/resource_customizations/onepassword.com/OnePasswordItem/health_test.yaml +++ /dev/null @@ -1,12 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: Waiting for controller to report status - inputPath: testdata/new.yaml -- healthStatus: - status: Degraded - message: Error - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/onepassword.com/OnePasswordItem/testdata/degraded.yaml b/pkg/resource_customizations/onepassword.com/OnePasswordItem/testdata/degraded.yaml deleted file mode 100644 index 4f78f5d..0000000 --- a/pkg/resource_customizations/onepassword.com/OnePasswordItem/testdata/degraded.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: onepassword.com/v1 -kind: OnePasswordItem -metadata: - name: degraded-item - namespace: test-namespace -spec: - itemPath: vaults/Test Vault/items/Test Item -status: - conditions: - - lastTransitionTime: '2022-09-24T01:11:54Z' - message: Error - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/onepassword.com/OnePasswordItem/testdata/healthy.yaml b/pkg/resource_customizations/onepassword.com/OnePasswordItem/testdata/healthy.yaml deleted file mode 100644 index efc9d48..0000000 --- a/pkg/resource_customizations/onepassword.com/OnePasswordItem/testdata/healthy.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: onepassword.com/v1 -kind: OnePasswordItem -metadata: - name: healthy-item - namespace: test-namespace -spec: - itemPath: vaults/Test Vault/items/Test Item -status: - conditions: - - lastTransitionTime: '2022-09-24T01:11:54Z' - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/onepassword.com/OnePasswordItem/testdata/new.yaml b/pkg/resource_customizations/onepassword.com/OnePasswordItem/testdata/new.yaml deleted file mode 100644 index 0164ebc..0000000 --- a/pkg/resource_customizations/onepassword.com/OnePasswordItem/testdata/new.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: onepassword.com/v1 -kind: OnePasswordItem -metadata: - name: new-item - namespace: test-namespace -spec: - itemPath: vaults/Test Vault/items/Test Item diff --git a/pkg/resource_customizations/operator.knative.dev/KnativeEventing/health.lua b/pkg/resource_customizations/operator.knative.dev/KnativeEventing/health.lua deleted file mode 100644 index f9cb103..0000000 --- a/pkg/resource_customizations/operator.knative.dev/KnativeEventing/health.lua +++ /dev/null @@ -1,36 +0,0 @@ -health_status = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - numTrue = 0 - numFalse = 0 - msg = "" - for i, condition in pairs(obj.status.conditions) do - msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. "\n" - if condition.type == "Ready" and condition.status == "True" then - numTrue = numTrue + 1 - elseif condition.type == "InstallSucceeded" and condition.status == "True" then - numTrue = numTrue + 1 - elseif condition.type == "Ready" and condition.status == "False" then - numFalse = numFalse + 1 - elseif condition.status == "Unknown" then - numFalse = numFalse + 1 - end - end - if(numFalse > 0) then - health_status.message = msg - health_status.status = "Progressing" - return health_status - elseif(numTrue == 2) then - health_status.message = "KnativeEventing is healthy." - health_status.status = "Healthy" - return health_status - else - health_status.message = msg - health_status.status = "Degraded" - return health_status - end - end -end -health_status.status = "Progressing" -health_status.message = "Waiting for KnativeEventing" -return health_status \ No newline at end of file diff --git a/pkg/resource_customizations/operator.knative.dev/KnativeEventing/health_test.yaml b/pkg/resource_customizations/operator.knative.dev/KnativeEventing/health_test.yaml deleted file mode 100644 index e8d9c4a..0000000 --- a/pkg/resource_customizations/operator.knative.dev/KnativeEventing/health_test.yaml +++ /dev/null @@ -1,17 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "1: InstallSucceeded | True\n2: Ready | Unknown\n" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Progressing - message: "1: InstallSucceeded | True\n2: Ready | False\n" - inputPath: testdata/progressing_ready_false.yaml -- healthStatus: - status: Degraded - message: "1: InstallSucceeded | True\n2: Ready | randomstatus\n" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: "KnativeEventing is healthy." - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/operator.knative.dev/KnativeEventing/testdata/degraded.yaml b/pkg/resource_customizations/operator.knative.dev/KnativeEventing/testdata/degraded.yaml deleted file mode 100644 index 396692a..0000000 --- a/pkg/resource_customizations/operator.knative.dev/KnativeEventing/testdata/degraded.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: operator.knative.dev/v1alpha1 -kind: KnativeEventing -metadata: - finalizers: - - delete-knative-eventing-manifest - generation: 3 - labels: - app: knative-eventing - argocd.argoproj.io/instance: knative-eventing - version: 0.14.1 - name: knative-eventing - namespace: knative-eventing - resourceVersion: "31707154" - selfLink: /apis/operator.knative.dev/v1alpha1/namespaces/knative-eventing/knativeeventings/knative-eventing - uid: bbcb2872-4304-4541-9811-7ce5125ceadf -spec: {} -status: - conditions: - - lastTransitionTime: "2020-04-29T04:52:05Z" - status: "True" - type: InstallSucceeded - - lastTransitionTime: "2020-06-08T10:53:44Z" - status: "randomstatus" - type: Ready - version: 0.14.1 \ No newline at end of file diff --git a/pkg/resource_customizations/operator.knative.dev/KnativeEventing/testdata/healthy.yaml b/pkg/resource_customizations/operator.knative.dev/KnativeEventing/testdata/healthy.yaml deleted file mode 100644 index 2bba2e1..0000000 --- a/pkg/resource_customizations/operator.knative.dev/KnativeEventing/testdata/healthy.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: operator.knative.dev/v1alpha1 -kind: KnativeEventing -metadata: - finalizers: - - delete-knative-eventing-manifest - generation: 3 - labels: - app: knative-eventing - argocd.argoproj.io/instance: knative-eventing - version: 0.14.1 - name: knative-eventing - namespace: knative-eventing - resourceVersion: "31707154" - selfLink: /apis/operator.knative.dev/v1alpha1/namespaces/knative-eventing/knativeeventings/knative-eventing - uid: bbcb2872-4304-4541-9811-7ce5125ceadf -spec: {} -status: - conditions: - - lastTransitionTime: "2020-04-29T04:52:05Z" - status: "True" - type: InstallSucceeded - - lastTransitionTime: "2020-06-08T10:53:44Z" - status: "True" - type: Ready - version: 0.14.1 \ No newline at end of file diff --git a/pkg/resource_customizations/operator.knative.dev/KnativeEventing/testdata/progressing.yaml b/pkg/resource_customizations/operator.knative.dev/KnativeEventing/testdata/progressing.yaml deleted file mode 100644 index 9c1cadb..0000000 --- a/pkg/resource_customizations/operator.knative.dev/KnativeEventing/testdata/progressing.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: operator.knative.dev/v1alpha1 -kind: KnativeEventing -metadata: - finalizers: - - delete-knative-eventing-manifest - generation: 3 - labels: - app: knative-eventing - argocd.argoproj.io/instance: knative-eventing - version: 0.14.1 - name: knative-eventing - namespace: knative-eventing - resourceVersion: "31707154" - selfLink: /apis/operator.knative.dev/v1alpha1/namespaces/knative-eventing/knativeeventings/knative-eventing - uid: bbcb2872-4304-4541-9811-7ce5125ceadf -spec: {} -status: - conditions: - - lastTransitionTime: "2020-04-29T04:52:05Z" - status: "True" - type: InstallSucceeded - - lastTransitionTime: "2020-06-08T10:53:44Z" - status: "Unknown" - type: Ready - version: 0.14.1 \ No newline at end of file diff --git a/pkg/resource_customizations/operator.knative.dev/KnativeEventing/testdata/progressing_ready_false.yaml b/pkg/resource_customizations/operator.knative.dev/KnativeEventing/testdata/progressing_ready_false.yaml deleted file mode 100644 index 5236b57..0000000 --- a/pkg/resource_customizations/operator.knative.dev/KnativeEventing/testdata/progressing_ready_false.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: operator.knative.dev/v1alpha1 -kind: KnativeEventing -metadata: - finalizers: - - delete-knative-eventing-manifest - generation: 3 - labels: - app: knative-eventing - argocd.argoproj.io/instance: knative-eventing - version: 0.14.1 - name: knative-eventing - namespace: knative-eventing - resourceVersion: "31707154" - selfLink: /apis/operator.knative.dev/v1alpha1/namespaces/knative-eventing/knativeeventings/knative-eventing - uid: bbcb2872-4304-4541-9811-7ce5125ceadf -spec: {} -status: - conditions: - - lastTransitionTime: "2020-04-29T04:52:05Z" - status: "True" - type: InstallSucceeded - - lastTransitionTime: "2020-06-08T10:53:44Z" - status: "False" - type: Ready - version: 0.14.1 \ No newline at end of file diff --git a/pkg/resource_customizations/operator.knative.dev/KnativeServing/health.lua b/pkg/resource_customizations/operator.knative.dev/KnativeServing/health.lua deleted file mode 100644 index 9903f98..0000000 --- a/pkg/resource_customizations/operator.knative.dev/KnativeServing/health.lua +++ /dev/null @@ -1,42 +0,0 @@ -health_status = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - numTrue = 0 - numFalse = 0 - msg = "" - for i, condition in pairs(obj.status.conditions) do - msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. "\n" - if condition.type == "Ready" and condition.status == "True" then - numTrue = numTrue + 1 - elseif condition.type == "InstallSucceeded" and condition.status == "True" then - numTrue = numTrue + 1 - elseif condition.type == "DependenciesInstalled" and condition.status == "True" then - numTrue = numTrue + 1 - elseif condition.type == "DeploymentsAvailable" and condition.status == "True" then - numTrue = numTrue + 1 - elseif condition.type == "Ready" and condition.status == "False" then - numFalse = numFalse + 1 - elseif condition.type == "DeploymentsAvailable" and condition.status == "False" then - numFalse = numFalse + 1 - elseif condition.status == "Unknown" then - numFalse = numFalse + 1 - end - end - if(numFalse > 0) then - health_status.message = msg - health_status.status = "Progressing" - return health_status - elseif(numTrue == 4) then - health_status.message = "KnativeServing is healthy." - health_status.status = "Healthy" - return health_status - else - health_status.message = msg - health_status.status = "Degraded" - return health_status - end - end -end -health_status.status = "Progressing" -health_status.message = "Waiting for KnativeServing" -return health_status \ No newline at end of file diff --git a/pkg/resource_customizations/operator.knative.dev/KnativeServing/health_test.yaml b/pkg/resource_customizations/operator.knative.dev/KnativeServing/health_test.yaml deleted file mode 100644 index 61fb179..0000000 --- a/pkg/resource_customizations/operator.knative.dev/KnativeServing/health_test.yaml +++ /dev/null @@ -1,17 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "1: DependenciesInstalled | True\n2: DeploymentsAvailable | True\n3: InstallSucceeded | True\n4: Ready | Unknown\n" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Progressing - message: "1: DependenciesInstalled | True\n2: DeploymentsAvailable | True\n3: InstallSucceeded | True\n4: Ready | False\n" - inputPath: testdata/progressing_ready_false.yaml -- healthStatus: - status: Degraded - message: "1: DependenciesInstalled | True\n2: DeploymentsAvailable | True\n3: InstallSucceeded | True\n4: Ready | randomstatus\n" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: "KnativeServing is healthy." - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/operator.knative.dev/KnativeServing/testdata/degraded.yaml b/pkg/resource_customizations/operator.knative.dev/KnativeServing/testdata/degraded.yaml deleted file mode 100644 index fe73fcf..0000000 --- a/pkg/resource_customizations/operator.knative.dev/KnativeServing/testdata/degraded.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: operator.knative.dev/v1alpha1 -kind: KnativeServing -metadata: - finalizers: - - knativeservings.operator.knative.dev - - delete-knative-serving-manifest - generation: 2 - labels: - app: knative-serving - argocd.argoproj.io/instance: knative-serving - version: 0.14.1 - name: knative-serving - namespace: knative-serving - resourceVersion: "31845507" - selfLink: /apis/operator.knative.dev/v1alpha1/namespaces/knative-serving/knativeservings/knative-serving - uid: ccbe43aa-ad72-4c2b-a5bb-21b3815d8a9b -spec: {} -status: - conditions: - - lastTransitionTime: "2020-05-18T18:21:29Z" - status: "True" - type: DependenciesInstalled - - lastTransitionTime: "2020-06-08T15:28:11Z" - status: "True" - type: DeploymentsAvailable - - lastTransitionTime: "2020-05-18T18:21:29Z" - status: "True" - type: InstallSucceeded - - lastTransitionTime: "2020-06-08T15:28:11Z" - status: "randomstatus" - type: Ready - version: 0.14.0 \ No newline at end of file diff --git a/pkg/resource_customizations/operator.knative.dev/KnativeServing/testdata/healthy.yaml b/pkg/resource_customizations/operator.knative.dev/KnativeServing/testdata/healthy.yaml deleted file mode 100644 index 8001044..0000000 --- a/pkg/resource_customizations/operator.knative.dev/KnativeServing/testdata/healthy.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: operator.knative.dev/v1alpha1 -kind: KnativeServing -metadata: - finalizers: - - knativeservings.operator.knative.dev - - delete-knative-serving-manifest - generation: 2 - labels: - app: knative-serving - argocd.argoproj.io/instance: knative-serving - version: 0.14.1 - name: knative-serving - namespace: knative-serving - resourceVersion: "31845507" - selfLink: /apis/operator.knative.dev/v1alpha1/namespaces/knative-serving/knativeservings/knative-serving - uid: ccbe43aa-ad72-4c2b-a5bb-21b3815d8a9b -spec: {} -status: - conditions: - - lastTransitionTime: "2020-05-18T18:21:29Z" - status: "True" - type: DependenciesInstalled - - lastTransitionTime: "2020-06-08T15:28:11Z" - status: "True" - type: DeploymentsAvailable - - lastTransitionTime: "2020-05-18T18:21:29Z" - status: "True" - type: InstallSucceeded - - lastTransitionTime: "2020-06-08T15:28:11Z" - status: "True" - type: Ready - version: 0.14.0 \ No newline at end of file diff --git a/pkg/resource_customizations/operator.knative.dev/KnativeServing/testdata/progressing.yaml b/pkg/resource_customizations/operator.knative.dev/KnativeServing/testdata/progressing.yaml deleted file mode 100644 index 83a9c69..0000000 --- a/pkg/resource_customizations/operator.knative.dev/KnativeServing/testdata/progressing.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: operator.knative.dev/v1alpha1 -kind: KnativeServing -metadata: - finalizers: - - knativeservings.operator.knative.dev - - delete-knative-serving-manifest - generation: 2 - labels: - app: knative-serving - argocd.argoproj.io/instance: knative-serving - version: 0.14.1 - name: knative-serving - namespace: knative-serving - resourceVersion: "31845507" - selfLink: /apis/operator.knative.dev/v1alpha1/namespaces/knative-serving/knativeservings/knative-serving - uid: ccbe43aa-ad72-4c2b-a5bb-21b3815d8a9b -spec: {} -status: - conditions: - - lastTransitionTime: "2020-05-18T18:21:29Z" - status: "True" - type: DependenciesInstalled - - lastTransitionTime: "2020-06-08T15:28:11Z" - status: "True" - type: DeploymentsAvailable - - lastTransitionTime: "2020-05-18T18:21:29Z" - status: "True" - type: InstallSucceeded - - lastTransitionTime: "2020-06-08T15:28:11Z" - status: "Unknown" - type: Ready - version: 0.14.0 \ No newline at end of file diff --git a/pkg/resource_customizations/operator.knative.dev/KnativeServing/testdata/progressing_ready_false.yaml b/pkg/resource_customizations/operator.knative.dev/KnativeServing/testdata/progressing_ready_false.yaml deleted file mode 100644 index 3900245..0000000 --- a/pkg/resource_customizations/operator.knative.dev/KnativeServing/testdata/progressing_ready_false.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: operator.knative.dev/v1alpha1 -kind: KnativeServing -metadata: - finalizers: - - knativeservings.operator.knative.dev - - delete-knative-serving-manifest - generation: 2 - labels: - app: knative-serving - argocd.argoproj.io/instance: knative-serving - version: 0.14.1 - name: knative-serving - namespace: knative-serving - resourceVersion: "31845507" - selfLink: /apis/operator.knative.dev/v1alpha1/namespaces/knative-serving/knativeservings/knative-serving - uid: ccbe43aa-ad72-4c2b-a5bb-21b3815d8a9b -spec: {} -status: - conditions: - - lastTransitionTime: "2020-05-18T18:21:29Z" - status: "True" - type: DependenciesInstalled - - lastTransitionTime: "2020-06-08T15:28:11Z" - status: "True" - type: DeploymentsAvailable - - lastTransitionTime: "2020-05-18T18:21:29Z" - status: "True" - type: InstallSucceeded - - lastTransitionTime: "2020-06-08T15:28:11Z" - status: "False" - type: Ready - version: 0.14.0 diff --git a/pkg/resource_customizations/operator.openshift.io/IngressController/health.lua b/pkg/resource_customizations/operator.openshift.io/IngressController/health.lua deleted file mode 100644 index cd0d982..0000000 --- a/pkg/resource_customizations/operator.openshift.io/IngressController/health.lua +++ /dev/null @@ -1,31 +0,0 @@ --- healthcheck for IngressController resources -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - -- if the status conditions are present, iterate over them and check their status - for _, condition in pairs(obj.status.conditions) do - if condition.type == "Degraded" and condition.status == "True" then - hs.status = "Degraded" - hs.message = condition.message - return hs - elseif condition.type == "DeploymentReplicasAllAvailable" and condition.status == "False" then - hs.status = "Progressing" - hs.message = condition.message - return hs - elseif condition.type == "Progressing" and condition.status == "True" then - hs.status = "Progressing" - hs.message = condition.reason - return hs - elseif condition.type == "Available" and condition.status == "True" then - hs.status = "Healthy" - hs.message = "IngressController is available" - return hs - end - end - end -end - --- default status when none of the previous condition matches -hs.status = "Progressing" -hs.message = "Status of IngressController is not known yet" -return hs diff --git a/pkg/resource_customizations/operator.openshift.io/IngressController/health_test.yaml b/pkg/resource_customizations/operator.openshift.io/IngressController/health_test.yaml deleted file mode 100644 index 761d0d6..0000000 --- a/pkg/resource_customizations/operator.openshift.io/IngressController/health_test.yaml +++ /dev/null @@ -1,17 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Status of IngressController is not known yet" - inputPath: testdata/progressing_initialization.yaml -- healthStatus: - status: Progressing - message: "0/1 of replicas are available" - inputPath: testdata/progressing_pod_rollout.yaml -- healthStatus: - status: Degraded - message: "One or more other status conditions indicate a degraded state." - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: "IngressController is available" - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/operator.openshift.io/IngressController/testdata/degraded.yaml b/pkg/resource_customizations/operator.openshift.io/IngressController/testdata/degraded.yaml deleted file mode 100644 index 73c7c89..0000000 --- a/pkg/resource_customizations/operator.openshift.io/IngressController/testdata/degraded.yaml +++ /dev/null @@ -1,103 +0,0 @@ ---- -apiVersion: operator.openshift.io/v1 -kind: IngressController -metadata: - name: default - namespace: openshift-ingress-operator -spec: - domain: openshift.example.com - endpointPublishingStrategy: - hostNetwork: - httpPort: 80 - httpsPort: 443 - statsPort: 1936 - type: HostNetwork - nodePlacement: - nodeSelector: - matchLabels: - node-role.kubernetes.io/worker: "" - replicas: 1 -status: - availableReplicas: 0 - conditions: - - lastTransitionTime: "2023-01-28T10:05:06Z" - reason: Valid - status: "True" - type: Admitted - - lastTransitionTime: "2023-01-28T10:09:15Z" - status: "True" - type: PodsScheduled - - lastTransitionTime: "2023-01-28T10:05:06Z" - message: The configured endpoint publishing strategy does not include a managed - load balancer - reason: EndpointPublishingStrategyExcludesManagedLoadBalancer - status: "False" - type: LoadBalancerManaged - - lastTransitionTime: "2023-01-28T10:05:06Z" - message: No DNS zones are defined in the cluster dns config. - reason: NoDNSZones - status: "False" - type: DNSManaged - - lastTransitionTime: "2023-01-28T10:05:06Z" - status: "False" - type: Progressing - - lastTransitionTime: "2023-01-28T10:13:55Z" - message: "One or more other status conditions indicate a degraded state." - # message: 'One or more other status conditions indicate a degraded state: CanaryChecksSucceeding=False - # (CanaryChecksRepetitiveFailures: Canary route checks for the default ingress - # controller are failing)' - reason: DegradedConditions - status: "True" - type: Degraded - - lastTransitionTime: "2023-01-28T10:05:06Z" - message: IngressController is upgradeable. - reason: Upgradeable - status: "True" - type: Upgradeable - - lastTransitionTime: "2023-01-28T10:12:55Z" - message: Canary route checks for the default ingress controller are failing - reason: CanaryChecksRepetitiveFailures - status: "False" - type: CanaryChecksSucceeding - domain: openshift.example.com - endpointPublishingStrategy: - hostNetwork: - httpPort: 80 - httpsPort: 443 - protocol: TCP - statsPort: 1936 - type: HostNetwork - namespaceSelector: {} - observedGeneration: 2 - routeSelector: {} - selector: ingresscontroller.operator.openshift.io/deployment-ingresscontroller=default - tlsProfile: - ciphers: - - ECDHE-ECDSA-CHACHA20-POLY1305 - - ECDHE-RSA-CHACHA20-POLY1305 - - ECDHE-ECDSA-AES128-GCM-SHA256 - - ECDHE-RSA-AES128-GCM-SHA256 - - ECDHE-ECDSA-AES256-GCM-SHA384 - - ECDHE-RSA-AES256-GCM-SHA384 - - DHE-RSA-AES128-GCM-SHA256 - - DHE-RSA-AES256-GCM-SHA384 - - ECDHE-ECDSA-AES128-SHA256 - - ECDHE-RSA-AES128-SHA256 - - ECDHE-ECDSA-AES128-SHA - - ECDHE-RSA-AES256-SHA384 - - ECDHE-RSA-AES128-SHA - - ECDHE-ECDSA-AES256-SHA384 - - ECDHE-ECDSA-AES256-SHA - - ECDHE-RSA-AES256-SHA - - DHE-RSA-AES128-SHA256 - - DHE-RSA-AES128-SHA - - DHE-RSA-AES256-SHA256 - - DHE-RSA-AES256-SHA - - AES128-GCM-SHA256 - - AES256-GCM-SHA384 - - AES128-SHA256 - - AES256-SHA256 - - AES128-SHA - - AES256-SHA - - '!DSS' - minTLSVersion: VersionTLS11 diff --git a/pkg/resource_customizations/operator.openshift.io/IngressController/testdata/healthy.yaml b/pkg/resource_customizations/operator.openshift.io/IngressController/testdata/healthy.yaml deleted file mode 100644 index 4c7ad76..0000000 --- a/pkg/resource_customizations/operator.openshift.io/IngressController/testdata/healthy.yaml +++ /dev/null @@ -1,93 +0,0 @@ ---- -apiVersion: operator.openshift.io/v1 -kind: IngressController -metadata: - name: apps-shard-2 - namespace: openshift-ingress-operator -spec: - domain: openshift-apps-shard-2.example.com - endpointPublishingStrategy: - hostNetwork: - httpPort: 80 - httpsPort: 443 - statsPort: 1936 - type: HostNetwork - nodePlacement: - nodeSelector: - matchLabels: - node-role.kubernetes.io/worker: "" - replicas: 1 -status: - availableReplicas: 1 - conditions: - - lastTransitionTime: "2023-01-28T09:34:36Z" - reason: Valid - status: "True" - type: Admitted - - lastTransitionTime: "2023-01-28T09:43:42Z" - status: "True" - type: PodsScheduled - - lastTransitionTime: "2023-01-28T09:34:36Z" - message: The deployment has Available status condition set to True - reason: DeploymentAvailable - status: "True" - type: DeploymentAvailable - - lastTransitionTime: "2023-01-28T09:34:36Z" - message: Minimum replicas requirement is met - reason: DeploymentMinimumReplicasMet - status: "True" - type: DeploymentReplicasMinAvailable - - lastTransitionTime: "2023-01-28T09:44:36Z" - message: All replicas are available - reason: DeploymentReplicasAvailable - status: "True" - type: DeploymentReplicasAllAvailable - - lastTransitionTime: "2023-01-28T09:34:36Z" - message: The configured endpoint publishing strategy does not include a managed - load balancer - reason: EndpointPublishingStrategyExcludesManagedLoadBalancer - status: "False" - type: LoadBalancerManaged - - lastTransitionTime: "2023-01-28T09:34:36Z" - message: No DNS zones are defined in the cluster dns config. - reason: NoDNSZones - status: "False" - type: DNSManaged - - lastTransitionTime: "2023-01-28T09:34:36Z" - status: "True" - type: Available - - lastTransitionTime: "2023-01-28T09:34:36Z" - status: "False" - type: Progressing - - lastTransitionTime: "2023-01-28T09:34:36Z" - status: "False" - type: Degraded - - lastTransitionTime: "2023-01-28T09:34:36Z" - message: IngressController is upgradeable. - reason: Upgradeable - status: "True" - type: Upgradeable - domain: openshift-apps-shard-2.example.com - endpointPublishingStrategy: - hostNetwork: - httpPort: 80 - httpsPort: 443 - protocol: TCP - statsPort: 1936 - type: HostNetwork - observedGeneration: 5 - selector: ingresscontroller.operator.openshift.io/deployment-ingresscontroller=apps-shard-2 - tlsProfile: - ciphers: - - ECDHE-ECDSA-AES128-GCM-SHA256 - - ECDHE-RSA-AES128-GCM-SHA256 - - ECDHE-ECDSA-AES256-GCM-SHA384 - - ECDHE-RSA-AES256-GCM-SHA384 - - ECDHE-ECDSA-CHACHA20-POLY1305 - - ECDHE-RSA-CHACHA20-POLY1305 - - DHE-RSA-AES128-GCM-SHA256 - - DHE-RSA-AES256-GCM-SHA384 - - TLS_AES_128_GCM_SHA256 - - TLS_AES_256_GCM_SHA384 - - TLS_CHACHA20_POLY1305_SHA256 - minTLSVersion: VersionTLS12 diff --git a/pkg/resource_customizations/operator.openshift.io/IngressController/testdata/progressing_initialization.yaml b/pkg/resource_customizations/operator.openshift.io/IngressController/testdata/progressing_initialization.yaml deleted file mode 100644 index 470216e..0000000 --- a/pkg/resource_customizations/operator.openshift.io/IngressController/testdata/progressing_initialization.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -apiVersion: operator.openshift.io/v1 -kind: IngressController -metadata: - name: apps-shard-2 - namespace: openshift-ingress-operator -spec: - domain: openshift-apps-shard-2.example.com - endpointPublishingStrategy: - hostNetwork: - httpPort: 80 - httpsPort: 443 - statsPort: 1936 - type: HostNetwork - nodePlacement: - nodeSelector: - matchLabels: - node-role.kubernetes.io/worker: "" - replicas: 1 -status: - availableReplicas: 0 - conditions: - - lastTransitionTime: "2023-01-28T09:34:36Z" - reason: Valid - status: "True" - type: Admitted - domain: openshift-apps-shard-2.example.com - endpointPublishingStrategy: - hostNetwork: - httpPort: 80 - httpsPort: 443 - protocol: TCP - statsPort: 1936 - type: HostNetwork - observedGeneration: 1 - selector: "" diff --git a/pkg/resource_customizations/operator.openshift.io/IngressController/testdata/progressing_pod_rollout.yaml b/pkg/resource_customizations/operator.openshift.io/IngressController/testdata/progressing_pod_rollout.yaml deleted file mode 100644 index 73a33ae..0000000 --- a/pkg/resource_customizations/operator.openshift.io/IngressController/testdata/progressing_pod_rollout.yaml +++ /dev/null @@ -1,101 +0,0 @@ ---- -apiVersion: operator.openshift.io/v1 -kind: IngressController -metadata: - name: apps-shard-2 - namespace: openshift-ingress-operator -spec: - domain: openshift-apps-shard-2.example.com - endpointPublishingStrategy: - hostNetwork: - httpPort: 80 - httpsPort: 443 - statsPort: 1936 - type: HostNetwork - nodePlacement: - nodeSelector: - matchLabels: - node-role.kubernetes.io/worker: "" - replicas: 1 -status: - availableReplicas: 0 - conditions: - - lastTransitionTime: "2023-01-28T09:34:36Z" - reason: Valid - status: "True" - type: Admitted - - lastTransitionTime: "2023-01-28T09:34:36Z" - message: 'Some pods are not scheduled: Pod "router-apps-shard-2-7b5cb5f98d-gk4hj" - cannot be scheduled: 0/6 nodes are available: 2 node(s) didn''t have free ports - for the requested pod ports, 3 node(s) had untolerated taint {node-role.kubernetes.io/master: - }, 5 node(s) didn''t match Pod''s node affinity/selector. preemption: 0/6 nodes - are available: 1 node(s) didn''t have free ports for the requested pod ports, - 5 Preemption is not helpful for scheduling. Make sure you have sufficient worker - nodes.' - reason: PodsNotScheduled - status: "False" - type: PodsScheduled - - lastTransitionTime: "2023-01-28T09:34:36Z" - message: The deployment has Available status condition set to True - reason: DeploymentAvailable - status: "True" - type: DeploymentAvailable - - lastTransitionTime: "2023-01-28T09:34:36Z" - message: Minimum replicas requirement is met - reason: DeploymentMinimumReplicasMet - status: "True" - type: DeploymentReplicasMinAvailable - - lastTransitionTime: "2023-01-28T09:34:36Z" - message: 0/1 of replicas are available - reason: DeploymentReplicasNotAvailable - status: "False" - type: DeploymentReplicasAllAvailable - - lastTransitionTime: "2023-01-28T09:34:36Z" - message: The configured endpoint publishing strategy does not include a managed - load balancer - reason: EndpointPublishingStrategyExcludesManagedLoadBalancer - status: "False" - type: LoadBalancerManaged - - lastTransitionTime: "2023-01-28T09:34:36Z" - message: No DNS zones are defined in the cluster dns config. - reason: NoDNSZones - status: "False" - type: DNSManaged - - lastTransitionTime: "2023-01-28T09:34:36Z" - status: "True" - type: Available - - lastTransitionTime: "2023-01-28T09:34:36Z" - status: "False" - type: Progressing - - lastTransitionTime: "2023-01-28T09:34:36Z" - status: "False" - type: Degraded - - lastTransitionTime: "2023-01-28T09:34:36Z" - message: IngressController is upgradeable. - reason: Upgradeable - status: "True" - type: Upgradeable - domain: openshift-apps-shard-2.example.com - endpointPublishingStrategy: - hostNetwork: - httpPort: 80 - httpsPort: 443 - protocol: TCP - statsPort: 1936 - type: HostNetwork - observedGeneration: 2 - selector: ingresscontroller.operator.openshift.io/deployment-ingresscontroller=apps-shard-2 - tlsProfile: - ciphers: - - ECDHE-ECDSA-AES128-GCM-SHA256 - - ECDHE-RSA-AES128-GCM-SHA256 - - ECDHE-ECDSA-AES256-GCM-SHA384 - - ECDHE-RSA-AES256-GCM-SHA384 - - ECDHE-ECDSA-CHACHA20-POLY1305 - - ECDHE-RSA-CHACHA20-POLY1305 - - DHE-RSA-AES128-GCM-SHA256 - - DHE-RSA-AES256-GCM-SHA384 - - TLS_AES_128_GCM_SHA256 - - TLS_AES_256_GCM_SHA384 - - TLS_CHACHA20_POLY1305_SHA256 - minTLSVersion: VersionTLS12 diff --git a/pkg/resource_customizations/operators.coreos.com/Subscription/health.lua b/pkg/resource_customizations/operators.coreos.com/Subscription/health.lua deleted file mode 100644 index 41da0ee..0000000 --- a/pkg/resource_customizations/operators.coreos.com/Subscription/health.lua +++ /dev/null @@ -1,34 +0,0 @@ -health_status = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - numDegraded = 0 - numPending = 0 - msg = "" - for i, condition in pairs(obj.status.conditions) do - msg = msg .. i .. ": " .. condition.type .. " | " .. condition.status .. "\n" - if condition.type == "InstallPlanPending" and condition.status == "True" then - numPending = numPending + 1 - elseif (condition.type == "InstallPlanMissing" and condition.reason ~= "ReferencedInstallPlanNotFound") then - numDegraded = numDegraded + 1 - elseif (condition.type == "CatalogSourcesUnhealthy" or condition.type == "InstallPlanFailed" or condition.type == "ResolutionFailed") and condition.status == "True" then - numDegraded = numDegraded + 1 - end - end - if numDegraded == 0 and numPending == 0 then - health_status.status = "Healthy" - health_status.message = msg - return health_status - elseif numPending > 0 and numDegraded == 0 then - health_status.status = "Progressing" - health_status.message = "An install plan for a subscription is pending installation" - return health_status - else - health_status.status = "Degraded" - health_status.message = msg - return health_status - end - end -end -health_status.status = "Progressing" -health_status.message = "An install plan for a subscription is pending installation" -return health_status \ No newline at end of file diff --git a/pkg/resource_customizations/operators.coreos.com/Subscription/health_test.yaml b/pkg/resource_customizations/operators.coreos.com/Subscription/health_test.yaml deleted file mode 100644 index 11f8390..0000000 --- a/pkg/resource_customizations/operators.coreos.com/Subscription/health_test.yaml +++ /dev/null @@ -1,25 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "An install plan for a subscription is pending installation" - inputPath: testdata/install_plan_pending.yaml -- healthStatus: - status: Degraded - message: "1: CatalogSourcesUnhealthy | True\n" - inputPath: testdata/catalog_sources_unhealthy.yaml -- healthStatus: - status: Healthy - message: "1: CatalogSourcesUnhealthy | False\n2: InstallPlanMissing | True\n" - inputPath: testdata/install_plan_missing.yaml -- healthStatus: - status: Degraded - message: "1: CatalogSourcesUnhealthy | False\n2: InstallPlanFailed | True\n" - inputPath: testdata/install_plan_failed.yaml -- healthStatus: - status: Degraded - message: "1: CatalogSourcesUnhealthy | True\n2: ResolutionFailed | True\n" - inputPath: testdata/resolution_failed.yaml -- healthStatus: - status: Healthy - message: "1: CatalogSourcesUnhealthy | False\n" - inputPath: testdata/healthy.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/catalog_sources_unhealthy.yaml b/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/catalog_sources_unhealthy.yaml deleted file mode 100644 index 2221bbb..0000000 --- a/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/catalog_sources_unhealthy.yaml +++ /dev/null @@ -1,58 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: openshift-gitops-operator - namespace: openshift-operators - labels: - operators.coreos.com/openshift-gitops-operator.openshift-operators: '' -spec: - channel: stable - name: openshift-gitops-operator - source: redhat-op - sourceNamespace: openshift-marketplace - startingCSV: openshift-gitops-operator.v1.10 -status: - catalogHealth: - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: certified-operators - namespace: openshift-marketplace - resourceVersion: '767930' - uid: dba4fefa-78fa-45c2-9801-d551a086a229 - healthy: true - lastUpdated: '2021-08-25T21:16:59Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: community-operators - namespace: openshift-marketplace - resourceVersion: '769392' - uid: 3e16e348-5b8c-4382-bd71-30fd97836a6c - healthy: true - lastUpdated: '2021-08-25T21:16:59Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: redhat-marketplace - namespace: openshift-marketplace - resourceVersion: '766585' - uid: 04003c1c-5414-43e7-ba5e-738addfa2443 - healthy: true - lastUpdated: '2021-08-25T21:16:59Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: redhat-operators - namespace: openshift-marketplace - resourceVersion: '766000' - uid: 4cff9c98-14aa-4ebf-a238-2fb8fc48edb6 - healthy: true - lastUpdated: '2021-08-25T21:16:59Z' - conditions: - - lastTransitionTime: '2021-08-25T21:16:59Z' - message: targeted catalogsource openshift-marketplace/redhat-op missing - reason: UnhealthyCatalogSourceFound - status: 'True' - type: CatalogSourcesUnhealthy - lastUpdated: '2021-08-25T21:16:59Z' diff --git a/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/healthy.yaml b/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/healthy.yaml deleted file mode 100644 index 1aee820..0000000 --- a/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/healthy.yaml +++ /dev/null @@ -1,75 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - labels: - operators.coreos.com/openshift-gitops-operator.openshift-operators: '' - name: openshift-gitops-operator - namespace: openshift-operators -spec: - channel: stable - installPlanApproval: Automatic - name: openshift-gitops-operator - source: redhat-operators - sourceNamespace: openshift-marketplace - startingCSV: openshift-gitops-operator.v1.2.0 -status: - conditions: - - lastTransitionTime: '2021-08-23T16:03:23Z' - message: all available catalogsources are healthy - reason: AllCatalogSourcesHealthy - status: 'False' - type: CatalogSourcesUnhealthy - installplan: - apiVersion: operators.coreos.com/v1alpha1 - kind: InstallPlan - name: install-m7wvs - uuid: 5dfc3b72-b1a7-49b1-868a-c288ccefc667 - lastUpdated: '2021-08-23T16:03:53Z' - installedCSV: openshift-gitops-operator.v1.2.0 - currentCSV: openshift-gitops-operator.v1.2.0 - installPlanRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: InstallPlan - name: install-m7wvs - namespace: openshift-operators - resourceVersion: '49175' - uid: 5dfc3b72-b1a7-49b1-868a-c288ccefc667 - state: AtLatestKnown - catalogHealth: - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: certified-operators - namespace: openshift-marketplace - resourceVersion: '47199' - uid: 1182e96f-bd44-4555-bcae-22ca5545d52f - healthy: true - lastUpdated: '2021-08-23T16:03:23Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: community-operators - namespace: openshift-marketplace - resourceVersion: '45598' - uid: fa39c2ee-af6d-4dbb-a62e-cd20c9e8f19b - healthy: true - lastUpdated: '2021-08-23T16:03:23Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: redhat-marketplace - namespace: openshift-marketplace - resourceVersion: '47712' - uid: b4d1171a-ec94-4be9-aa26-237bf4aed0f5 - healthy: true - lastUpdated: '2021-08-23T16:03:23Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: redhat-operators - namespace: openshift-marketplace - resourceVersion: '46728' - uid: a1712fa4-1159-4a9b-8e40-fe605ecbb2e5 - healthy: true - lastUpdated: '2021-08-23T16:03:23Z' - installPlanGeneration: 1 diff --git a/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/install_plan_failed.yaml b/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/install_plan_failed.yaml deleted file mode 100644 index 347bc1a..0000000 --- a/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/install_plan_failed.yaml +++ /dev/null @@ -1,86 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - labels: - operators.coreos.com/openshift-gitops-operator.openshift-operators: '' - name: openshift-gitops-operator - namespace: openshift-operators -spec: - channel: stable - installPlanApproval: Automatic - name: openshift-gitops-operator - source: redhat-operators - sourceNamespace: openshift-marketplace - startingCSV: openshift-gitops-operator.v1.2.0 -status: - installplan: - apiVersion: operators.coreos.com/v1alpha1 - kind: InstallPlan - name: install-rzdwt - uuid: 7a772cec-f487-4cf9-8689-7c533c212c82 - lastUpdated: '2021-08-24T03:46:16Z' - installedCSV: openshift-gitops-operator.v1.2.0 - currentCSV: openshift-gitops-operator.v1.2.0 - installPlanRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: InstallPlan - name: install-rzdwt - namespace: openshift-operators - resourceVersion: '50025' - uid: 7a772cec-f487-4cf9-8689-7c533c212c82 - state: AtLatestKnown - catalogHealth: - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: certified-operators - namespace: openshift-marketplace - resourceVersion: '48843' - uid: 6c1dc387-00b4-4bb7-86f3-9e349a55abf0 - healthy: true - lastUpdated: '2021-08-24T02:43:15Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: community-operators - namespace: openshift-marketplace - resourceVersion: '47352' - uid: 7d63bae9-06a9-434b-be50-af60fc73c19d - healthy: true - lastUpdated: '2021-08-24T02:43:15Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: redhat-marketplace - namespace: openshift-marketplace - resourceVersion: '48061' - uid: ef6d3590-a326-4ceb-bced-e180c50ff314 - healthy: true - lastUpdated: '2021-08-24T02:43:15Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: redhat-operators - namespace: openshift-marketplace - resourceVersion: '46591' - uid: 1a6025d8-c166-4a9a-a608-c051cfc904a8 - healthy: true - lastUpdated: '2021-08-24T02:43:15Z' - conditions: - - lastTransitionTime: '2021-08-24T02:43:15Z' - message: all available catalogsources are healthy - reason: AllCatalogSourcesHealthy - status: 'False' - type: CatalogSourcesUnhealthy - - lastTransitionTime: '2021-08-24T02:53:03Z' - message: >- - api-server resource not found installing CustomResourceDefinition - gitopsservices.pipelines.openshift.io: GroupVersionKind - apiextensions.k8s.io/v1beta1, Kind=CustomResourceDefinition not found on - the cluster. This API may have been deprecated and removed, see - https://kubernetes.io/docs/reference/using-api/deprecation-guide/ for - more information. - reason: InstallComponentFailed - status: 'True' - type: InstallPlanFailed - installPlanGeneration: 1 diff --git a/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/install_plan_missing.yaml b/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/install_plan_missing.yaml deleted file mode 100644 index c3a6490..0000000 --- a/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/install_plan_missing.yaml +++ /dev/null @@ -1,139 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - selfLink: >- - /apis/operators.coreos.com/v1alpha1/namespaces/openshift-operators/subscriptions/openshift-gitops-operator - resourceVersion: '147969' - name: openshift-gitops-operator - uid: 59318244-d23a-47c1-9f23-38a3ccaaf6f8 - creationTimestamp: '2021-08-30T21:43:17Z' - generation: 1 - managedFields: - - apiVersion: operators.coreos.com/v1alpha1 - fieldsType: FieldsV1 - fieldsV1: - 'f:spec': - .: {} - 'f:channel': {} - 'f:installPlanApproval': {} - 'f:name': {} - 'f:source': {} - 'f:sourceNamespace': {} - 'f:startingCSV': {} - manager: Mozilla - operation: Update - time: '2021-08-30T21:43:17Z' - - apiVersion: operators.coreos.com/v1alpha1 - fieldsType: FieldsV1 - fieldsV1: - 'f:metadata': - 'f:labels': - .: {} - 'f:operators.coreos.com/openshift-gitops-operator.openshift-operators': {} - manager: olm - operation: Update - time: '2021-08-30T21:43:17Z' - - apiVersion: operators.coreos.com/v1alpha1 - fieldsType: FieldsV1 - fieldsV1: - 'f:status': - 'f:installedCSV': {} - 'f:currentCSV': {} - 'f:catalogHealth': {} - 'f:installPlanRef': - .: {} - 'f:apiVersion': {} - 'f:kind': {} - 'f:name': {} - 'f:namespace': {} - 'f:resourceVersion': {} - 'f:uid': {} - 'f:installPlanGeneration': {} - 'f:conditions': {} - .: {} - 'f:installplan': - .: {} - 'f:apiVersion': {} - 'f:kind': {} - 'f:name': {} - 'f:uuid': {} - 'f:lastUpdated': {} - 'f:state': {} - manager: catalog - operation: Update - time: '2021-08-30T21:43:19Z' - namespace: openshift-operators - labels: - operators.coreos.com/openshift-gitops-operator.openshift-operators: '' -spec: - channel: stable - installPlanApproval: Automatic - name: openshift-gitops-operator - source: redhat-operators - sourceNamespace: openshift-marketplace - startingCSV: openshift-gitops-operator.v1.2.0 -status: - installplan: - apiVersion: operators.coreos.com/v1alpha1 - kind: InstallPlan - name: install-jx26v - uuid: 8566ad1f-c3ea-4367-aba5-db021b8cef45 - lastUpdated: '2021-08-30T21:43:30Z' - installedCSV: openshift-gitops-operator.v1.2.0 - currentCSV: openshift-gitops-operator.v1.2.0 - installPlanRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: InstallPlan - name: install-jx26v - namespace: openshift-operators - resourceVersion: '147595' - uid: 8566ad1f-c3ea-4367-aba5-db021b8cef45 - state: AtLatestKnown - catalogHealth: - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: certified-operators - namespace: openshift-marketplace - resourceVersion: '145894' - uid: 12fb6b00-6839-4360-89ea-0ed98cdc94f1 - healthy: true - lastUpdated: '2021-08-30T21:43:17Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: community-operators - namespace: openshift-marketplace - resourceVersion: '145058' - uid: e8913c52-5002-404f-92a4-d7b6eb35ea54 - healthy: true - lastUpdated: '2021-08-30T21:43:17Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: redhat-marketplace - namespace: openshift-marketplace - resourceVersion: '143953' - uid: 5bc9368c-50ee-4079-b66c-e32c8f75fa52 - healthy: true - lastUpdated: '2021-08-30T21:43:17Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: redhat-operators - namespace: openshift-marketplace - resourceVersion: '143604' - uid: 57a67470-3344-48db-8790-91853b62b650 - healthy: true - lastUpdated: '2021-08-30T21:43:17Z' - conditions: - - lastTransitionTime: '2021-08-30T21:43:17Z' - message: all available catalogsources are healthy - reason: AllCatalogSourcesHealthy - status: 'False' - type: CatalogSourcesUnhealthy - - lastTransitionTime: '2021-08-30T21:43:30Z' - reason: ReferencedInstallPlanNotFound - status: 'True' - type: InstallPlanMissing - installPlanGeneration: 1 diff --git a/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/install_plan_pending.yaml b/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/install_plan_pending.yaml deleted file mode 100644 index c581e32..0000000 --- a/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/install_plan_pending.yaml +++ /dev/null @@ -1,78 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: openshift-gitops-operator - namespace: openshift-operators - labels: - operators.coreos.com/openshift-gitops-operator.openshift-operators: '' -spec: - channel: stable - installPlanApproval: Automatic - name: openshift-gitops-operator - source: redhat-operators - sourceNamespace: openshift-marketplace - startingCSV: openshift-gitops-operator.v1.2.0 -status: - catalogHealth: - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: certified-operators - namespace: openshift-marketplace - resourceVersion: '720254' - uid: dba4fefa-78fa-45c2-9801-d551a086a229 - healthy: true - lastUpdated: '2021-08-25T20:55:30Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: community-operators - namespace: openshift-marketplace - resourceVersion: '720253' - uid: 3e16e348-5b8c-4382-bd71-30fd97836a6c - healthy: true - lastUpdated: '2021-08-25T20:55:30Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: redhat-marketplace - namespace: openshift-marketplace - resourceVersion: '707692' - uid: 04003c1c-5414-43e7-ba5e-738addfa2443 - healthy: true - lastUpdated: '2021-08-25T20:55:30Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: redhat-operators - namespace: openshift-marketplace - resourceVersion: '716643' - uid: 4cff9c98-14aa-4ebf-a238-2fb8fc48edb6 - healthy: true - lastUpdated: '2021-08-25T20:55:30Z' - conditions: - - lastTransitionTime: '2021-08-25T20:55:30Z' - message: all available catalogsources are healthy - reason: AllCatalogSourcesHealthy - status: 'False' - type: CatalogSourcesUnhealthy - - lastTransitionTime: '2021-08-25T20:55:36Z' - reason: Installing - status: 'True' - type: InstallPlanPending - currentCSV: openshift-gitops-operator.v1.2.0 - installPlanGeneration: 2 - installPlanRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: InstallPlan - name: install-gldzx - namespace: openshift-operators - resourceVersion: '736450' - uid: cc3edd24-ae7c-4ddf-b924-aee1611ff4a1 - installplan: - apiVersion: operators.coreos.com/v1alpha1 - kind: InstallPlan - name: install-gldzx - uuid: cc3edd24-ae7c-4ddf-b924-aee1611ff4a1 - lastUpdated: '2021-08-25T20:55:36Z' - state: UpgradePending diff --git a/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/resolution_failed.yaml b/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/resolution_failed.yaml deleted file mode 100644 index 7c6e480..0000000 --- a/pkg/resource_customizations/operators.coreos.com/Subscription/testdata/resolution_failed.yaml +++ /dev/null @@ -1,72 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - creationTimestamp: '2021-08-31T17:39:09Z' - generation: 1 - labels: - operators.coreos.com/openshift-gitops-operator.openshift-operators: '' - operators.coreos.com/openshift-gitops123-operator.openshift-operators: '' - name: openshift-gitops123-operator - namespace: openshift-operators - resourceVersion: '83862' - uid: db43fe71-7937-47d4-84e9-382316c1403c -spec: - channel: stable - installPlanApproval: Automatic - name: openshift-gitops123-operator - source: redhat-operators66 - sourceNamespace: openshift-marketplace - startingCSV: openshift-gitops-operator.v1.2.0 -status: - catalogHealth: - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: certified-operators - namespace: openshift-marketplace - resourceVersion: '82603' - uid: 3bca2bd4-5376-4a66-929a-7374540011ab - healthy: true - lastUpdated: '2021-08-31T17:39:09Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: community-operators - namespace: openshift-marketplace - resourceVersion: '81603' - uid: de132714-31c7-441e-9a62-bcd2f3908b75 - healthy: true - lastUpdated: '2021-08-31T17:39:09Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: redhat-marketplace - namespace: openshift-marketplace - resourceVersion: '81610' - uid: 36652a07-cd6e-46a5-a53f-74520250b69a - healthy: true - lastUpdated: '2021-08-31T17:39:09Z' - - catalogSourceRef: - apiVersion: operators.coreos.com/v1alpha1 - kind: CatalogSource - name: redhat-operators - namespace: openshift-marketplace - resourceVersion: '81602' - uid: f73d6576-5955-4de2-bf4c-2b4c5c0a9077 - healthy: true - lastUpdated: '2021-08-31T17:39:09Z' - conditions: - - lastTransitionTime: '2021-08-31T17:39:09Z' - message: targeted catalogsource openshift-marketplace/redhat-operators66 missing - reason: UnhealthyCatalogSourceFound - status: 'True' - type: CatalogSourcesUnhealthy - - message: >- - constraints not satisfiable: no operators found from catalog - redhat-operators66 in namespace openshift-marketplace referenced by - subscription openshift-gitops123-operator, subscription - openshift-gitops123-operator exists - reason: ConstraintsNotSatisfiable - status: 'True' - type: ResolutionFailed - lastUpdated: '2021-08-31T17:39:12Z' diff --git a/pkg/resource_customizations/pkg.crossplane.io/Provider/health.lua b/pkg/resource_customizations/pkg.crossplane.io/Provider/health.lua deleted file mode 100644 index 04242d6..0000000 --- a/pkg/resource_customizations/pkg.crossplane.io/Provider/health.lua +++ /dev/null @@ -1,27 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - installed = false - healthy = false - for i, condition in ipairs(obj.status.conditions) do - if condition.type == "Installed" then - installed = condition.status == "True" - installed_message = condition.reason - elseif condition.type == "Healthy" then - healthy = condition.status == "True" - healthy_message = condition.reason - end - end - if installed and healthy then - hs.status = "Healthy" - else - hs.status = "Degraded" - end - hs.message = installed_message .. " " .. healthy_message - return hs - end -end - -hs.status = "Progressing" -hs.message = "Waiting for provider to be installed" -return hs diff --git a/pkg/resource_customizations/pkg.crossplane.io/Provider/health_test.yaml b/pkg/resource_customizations/pkg.crossplane.io/Provider/health_test.yaml deleted file mode 100644 index a772cf9..0000000 --- a/pkg/resource_customizations/pkg.crossplane.io/Provider/health_test.yaml +++ /dev/null @@ -1,17 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: Waiting for provider to be installed - inputPath: testdata/progressing_noStatus.yaml -- healthStatus: - status: Degraded - message: ActivePackageRevision UnhealthyPackageRevision - inputPath: testdata/degraded_installed.yaml -- healthStatus: - status: Degraded - message: UnpackingPackage HealthyPackageRevision - inputPath: testdata/degraded_healthy.yaml -- healthStatus: - status: Healthy - message: ActivePackageRevision HealthyPackageRevision - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/pkg.crossplane.io/Provider/testdata/degraded_healthy.yaml b/pkg/resource_customizations/pkg.crossplane.io/Provider/testdata/degraded_healthy.yaml deleted file mode 100644 index de416a6..0000000 --- a/pkg/resource_customizations/pkg.crossplane.io/Provider/testdata/degraded_healthy.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: pkg.crossplane.io/v1alpha1 -kind: Provider -metadata: - creationTimestamp: "2020-10-28T15:25:56Z" - generation: 2 - name: provider-helm - resourceVersion: "1664592" - selfLink: /apis/pkg.crossplane.io/v1alpha1/providers/provider-helm - uid: 6ce16954-64f1-48c5-8a80-e29af37fc736 -spec: - package: crossplane/provider-helm:v0.3.5error - revisionActivationPolicy: Automatic -status: - conditions: - - lastTransitionTime: "2020-11-06T12:37:16Z" - reason: UnpackingPackage - status: "False" - type: Installed - - lastTransitionTime: "2020-11-06T10:19:07Z" - reason: HealthyPackageRevision - status: "True" - type: Healthy - currentRevision: provider-helm-7f275162c62e diff --git a/pkg/resource_customizations/pkg.crossplane.io/Provider/testdata/degraded_installed.yaml b/pkg/resource_customizations/pkg.crossplane.io/Provider/testdata/degraded_installed.yaml deleted file mode 100644 index 705a44c..0000000 --- a/pkg/resource_customizations/pkg.crossplane.io/Provider/testdata/degraded_installed.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: pkg.crossplane.io/v1alpha1 -kind: Provider -metadata: - creationTimestamp: "2020-10-28T15:25:56Z" - generation: 4 - name: provider-helm - resourceVersion: "1666009" - selfLink: /apis/pkg.crossplane.io/v1alpha1/providers/provider-helm - uid: 6ce16954-64f1-48c5-8a80-e29af37fc736 -spec: - package: crossplane/provider-helm:v0.3.6 - revisionActivationPolicy: Automatic -status: - conditions: - - lastTransitionTime: "2020-11-06T12:44:22Z" - reason: ActivePackageRevision - status: "True" - type: Installed - - lastTransitionTime: "2020-11-06T12:44:21Z" - reason: UnhealthyPackageRevision - status: "False" - type: Healthy - currentRevision: provider-helm-61a254740524 diff --git a/pkg/resource_customizations/pkg.crossplane.io/Provider/testdata/healthy.yaml b/pkg/resource_customizations/pkg.crossplane.io/Provider/testdata/healthy.yaml deleted file mode 100644 index fab33d5..0000000 --- a/pkg/resource_customizations/pkg.crossplane.io/Provider/testdata/healthy.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: pkg.crossplane.io/v1alpha1 -kind: Provider -metadata: - creationTimestamp: "2020-10-28T15:25:56Z" - generation: 4 - name: provider-helm - resourceVersion: "1666154" - selfLink: /apis/pkg.crossplane.io/v1alpha1/providers/provider-helm - uid: 6ce16954-64f1-48c5-8a80-e29af37fc736 -spec: - package: crossplane/provider-helm:v0.3.6 - revisionActivationPolicy: Automatic -status: - conditions: - - lastTransitionTime: "2020-11-06T12:44:28Z" - reason: ActivePackageRevision - status: "True" - type: Installed - - lastTransitionTime: "2020-11-06T12:44:26Z" - reason: HealthyPackageRevision - status: "True" - type: Healthy - currentRevision: provider-helm-61a254740524 diff --git a/pkg/resource_customizations/pkg.crossplane.io/Provider/testdata/progressing_noStatus.yaml b/pkg/resource_customizations/pkg.crossplane.io/Provider/testdata/progressing_noStatus.yaml deleted file mode 100644 index 232c607..0000000 --- a/pkg/resource_customizations/pkg.crossplane.io/Provider/testdata/progressing_noStatus.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: pkg.crossplane.io/v1alpha1 -kind: Provider -metadata: - creationTimestamp: "2020-10-28T15:25:56Z" - generation: 4 - name: provider-helm - resourceVersion: "1666154" - selfLink: /apis/pkg.crossplane.io/v1alpha1/providers/provider-helm - uid: 6ce16954-64f1-48c5-8a80-e29af37fc736 -spec: - package: crossplane/provider-helm:v0.3.6 - revisionActivationPolicy: Automatic diff --git a/pkg/resource_customizations/platform.confluent.io/Connect/health.lua b/pkg/resource_customizations/platform.confluent.io/Connect/health.lua deleted file mode 100644 index 3295858..0000000 --- a/pkg/resource_customizations/platform.confluent.io/Connect/health.lua +++ /dev/null @@ -1,19 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.phase ~= nil then - if obj.status.phase == "RUNNING" then - hs.status = "Healthy" - hs.message = "Connect running" - return hs - end - if obj.status.phase == "PROVISIONING" then - hs.status = "Progressing" - hs.message = "Connect provisioning" - return hs - end - end -end - -hs.status = "Progressing" -hs.message = "Waiting for Connect" -return hs diff --git a/pkg/resource_customizations/platform.confluent.io/Connect/health_test.yaml b/pkg/resource_customizations/platform.confluent.io/Connect/health_test.yaml deleted file mode 100644 index 9cff61a..0000000 --- a/pkg/resource_customizations/platform.confluent.io/Connect/health_test.yaml +++ /dev/null @@ -1,9 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: Connect provisioning - inputPath: testdata/progressing.yaml - - healthStatus: - status: Healthy - message: Connect running - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/platform.confluent.io/Connect/testdata/healthy.yaml b/pkg/resource_customizations/platform.confluent.io/Connect/testdata/healthy.yaml deleted file mode 100644 index 92c46d9..0000000 --- a/pkg/resource_customizations/platform.confluent.io/Connect/testdata/healthy.yaml +++ /dev/null @@ -1,49 +0,0 @@ -apiVersion: platform.confluent.io/v1beta1 -kind: Connect -metadata: - finalizers: - - connect.finalizers.platform.confluent.io - generation: 1 - name: connect - namespace: confluent -spec: - dependencies: - kafka: - bootstrapEndpoint: kafka:9071 - replicas: 1 -status: - clusterName: connect - clusterNamespace: confluent - conditions: - - lastProbeTime: "2021-08-11T10:03:56Z" - lastTransitionTime: "2021-08-11T10:09:01Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: platform.confluent.io/statefulset-available - - lastProbeTime: "2021-08-11T10:03:56Z" - lastTransitionTime: "2021-08-11T10:09:01Z" - message: Kubernetes resources ready. - reason: KubernetesResourcesReady - status: "True" - type: platform.confluent.io/resources-ready - - lastProbeTime: "2021-08-11T10:03:56Z" - lastTransitionTime: "2021-08-11T10:03:56Z" - message: Cluster is not being garbage collected - reason: ClusterNotShrunk - status: "False" - type: platform.confluent.io/garbage-collecting - currentReplicas: 1 - groupId: confluent.connect - internalTopicNames: - - confluent.connect-offsets - - confluent.connect-configs - - confluent.connect-status - kafka: - bootstrapEndpoint: kafka:9071 - operatorVersion: v0.174.13 - phase: RUNNING - readyReplicas: 1 - replicas: 1 - restConfig: - internalEndpoint: http://connect.confluent.svc.cluster.local:8083 diff --git a/pkg/resource_customizations/platform.confluent.io/Connect/testdata/progressing.yaml b/pkg/resource_customizations/platform.confluent.io/Connect/testdata/progressing.yaml deleted file mode 100644 index 7402267..0000000 --- a/pkg/resource_customizations/platform.confluent.io/Connect/testdata/progressing.yaml +++ /dev/null @@ -1,49 +0,0 @@ -apiVersion: platform.confluent.io/v1beta1 -kind: Connect -metadata: - finalizers: - - connect.finalizers.platform.confluent.io - generation: 1 - name: connect - namespace: confluent -spec: - dependencies: - kafka: - bootstrapEndpoint: kafka:9071 - replicas: 1 -status: - clusterName: connect - clusterNamespace: confluent - conditions: - - lastProbeTime: "2021-08-11T10:03:56Z" - lastTransitionTime: "2021-08-11T10:09:01Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: platform.confluent.io/statefulset-available - - lastProbeTime: "2021-08-11T10:03:56Z" - lastTransitionTime: "2021-08-11T10:09:01Z" - message: Kubernetes resources ready. - reason: KubernetesResourcesReady - status: "True" - type: platform.confluent.io/resources-ready - - lastProbeTime: "2021-08-11T10:03:56Z" - lastTransitionTime: "2021-08-11T10:03:56Z" - message: Cluster is not being garbage collected - reason: ClusterNotShrunk - status: "False" - type: platform.confluent.io/garbage-collecting - currentReplicas: 1 - groupId: confluent.connect - internalTopicNames: - - confluent.connect-offsets - - confluent.connect-configs - - confluent.connect-status - kafka: - bootstrapEndpoint: kafka:9071 - operatorVersion: v0.174.13 - phase: PROVISIONING - readyReplicas: 1 - replicas: 1 - restConfig: - internalEndpoint: http://connect.confluent.svc.cluster.local:8083 diff --git a/pkg/resource_customizations/platform.confluent.io/ControlCenter/health.lua b/pkg/resource_customizations/platform.confluent.io/ControlCenter/health.lua deleted file mode 100644 index 6b54872..0000000 --- a/pkg/resource_customizations/platform.confluent.io/ControlCenter/health.lua +++ /dev/null @@ -1,19 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.phase ~= nil then - if obj.status.phase == "RUNNING" then - hs.status = "Healthy" - hs.message = "ControlCenter running" - return hs - end - if obj.status.phase == "PROVISIONING" then - hs.status = "Progressing" - hs.message = "ControlCenter provisioning" - return hs - end - end -end - -hs.status = "Progressing" -hs.message = "Waiting for ControlCenter" -return hs diff --git a/pkg/resource_customizations/platform.confluent.io/ControlCenter/health_test.yaml b/pkg/resource_customizations/platform.confluent.io/ControlCenter/health_test.yaml deleted file mode 100644 index b5f0170..0000000 --- a/pkg/resource_customizations/platform.confluent.io/ControlCenter/health_test.yaml +++ /dev/null @@ -1,9 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: ControlCenter provisioning - inputPath: testdata/progressing.yaml - - healthStatus: - status: Healthy - message: ControlCenter running - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/platform.confluent.io/ControlCenter/testdata/healthy.yaml b/pkg/resource_customizations/platform.confluent.io/ControlCenter/testdata/healthy.yaml deleted file mode 100644 index ae2e90e..0000000 --- a/pkg/resource_customizations/platform.confluent.io/ControlCenter/testdata/healthy.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: platform.confluent.io/v1beta1 -kind: ControlCenter -metadata: - finalizers: - - controlcenter.finalizers.platform.confluent.io - generation: 1 - name: controlcenter - namespace: confluent -spec: - dataVolumeCapacity: 10Gi - dependencies: - connect: - - name: connect - url: http://connect:8083 - ksqldb: - - name: ksqldb - url: http://ksqldb:8088 - schemaRegistry: - url: http://schemaregistry:8081 - replicas: 1 -status: - clusterName: controlcenter - clusterNamespace: confluent - conditions: - - lastProbeTime: "2021-08-11T10:08:37Z" - lastTransitionTime: "2021-08-11T10:10:37Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: platform.confluent.io/statefulset-available - - lastProbeTime: "2021-08-11T10:08:37Z" - lastTransitionTime: "2021-08-11T10:10:37Z" - message: Kubernetes resources ready. - reason: KubernetesResourcesReady - status: "True" - type: platform.confluent.io/resources-ready - controlCenterName: _confluent-controlcenter - currentReplicas: 1 - id: 0 - kafka: - bootstrapEndpoint: kafka.confluent.svc.cluster.local:9071 - operatorVersion: v0.174.13 - phase: RUNNING - readyReplicas: 1 - replicas: 1 - restConfig: - internalEndpoint: http://controlcenter.confluent.svc.cluster.local:9021 diff --git a/pkg/resource_customizations/platform.confluent.io/ControlCenter/testdata/progressing.yaml b/pkg/resource_customizations/platform.confluent.io/ControlCenter/testdata/progressing.yaml deleted file mode 100644 index be3c6ea..0000000 --- a/pkg/resource_customizations/platform.confluent.io/ControlCenter/testdata/progressing.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: platform.confluent.io/v1beta1 -kind: ControlCenter -metadata: - finalizers: - - controlcenter.finalizers.platform.confluent.io - generation: 1 - name: controlcenter - namespace: confluent -spec: - dataVolumeCapacity: 10Gi - dependencies: - connect: - - name: connect - url: http://connect:8083 - ksqldb: - - name: ksqldb - url: http://ksqldb:8088 - schemaRegistry: - url: http://schemaregistry:8081 - replicas: 1 -status: - clusterName: controlcenter - clusterNamespace: confluent - conditions: - - lastProbeTime: "2021-08-02T11:44:51Z" - lastTransitionTime: "2021-08-06T12:50:58Z" - message: Deployment does not have minimum availability. - reason: MinimumReplicasUnavailable - status: "False" - type: platform.confluent.io/statefulset-available - - lastProbeTime: "2021-08-02T11:44:51Z" - lastTransitionTime: "2021-08-06T12:50:58Z" - message: Kubernetes resources not ready. - reason: KubernetesResourcesNotReady - status: "False" - type: platform.confluent.io/resources-ready - controlCenterName: _confluent-controlcenter - currentReplicas: 1 - id: 0 - kafka: - bootstrapEndpoint: kafka.confluent.svc.cluster.local:9071 - operatorVersion: v0.174.13 - phase: PROVISIONING - replicas: 1 - restConfig: - internalEndpoint: http://controlcenter.confluent.svc.cluster.local:9021 diff --git a/pkg/resource_customizations/platform.confluent.io/Kafka/health.lua b/pkg/resource_customizations/platform.confluent.io/Kafka/health.lua deleted file mode 100644 index 00033fa..0000000 --- a/pkg/resource_customizations/platform.confluent.io/Kafka/health.lua +++ /dev/null @@ -1,19 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.phase ~= nil then - if obj.status.phase == "RUNNING" then - hs.status = "Healthy" - hs.message = "Kafka running" - return hs - end - if obj.status.phase == "PROVISIONING" then - hs.status = "Progressing" - hs.message = "Kafka provisioning" - return hs - end - end -end - -hs.status = "Progressing" -hs.message = "Waiting for Kafka" -return hs diff --git a/pkg/resource_customizations/platform.confluent.io/Kafka/health_test.yaml b/pkg/resource_customizations/platform.confluent.io/Kafka/health_test.yaml deleted file mode 100644 index 1fb857a..0000000 --- a/pkg/resource_customizations/platform.confluent.io/Kafka/health_test.yaml +++ /dev/null @@ -1,9 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: Kafka provisioning - inputPath: testdata/progressing.yaml - - healthStatus: - status: Healthy - message: Kafka running - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/platform.confluent.io/Kafka/testdata/healthy.yaml b/pkg/resource_customizations/platform.confluent.io/Kafka/testdata/healthy.yaml deleted file mode 100644 index 3388533..0000000 --- a/pkg/resource_customizations/platform.confluent.io/Kafka/testdata/healthy.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: platform.confluent.io/v1beta1 -kind: Kafka -metadata: - generation: 1 - name: kafka - namespace: confluent -spec: - dataVolumeCapacity: 10Gi - metricReporter: - enabled: true - replicas: 3 -status: - clusterName: kafka - clusterNamespace: confluent - conditions: - - lastProbeTime: "2021-08-11T10:06:58Z" - lastTransitionTime: "2021-08-11T10:08:42Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: platform.confluent.io/statefulset-available - - lastProbeTime: "2021-08-11T10:06:58Z" - lastTransitionTime: "2021-08-11T10:08:42Z" - message: Kubernetes resources ready. - reason: KubernetesResourcesReady - status: "True" - type: platform.confluent.io/resources-ready - - lastProbeTime: "2021-08-11T10:06:58Z" - lastTransitionTime: "2021-08-11T10:06:58Z" - message: Cluster is not rolling, ignore=false - reason: ClusterNotRolling - status: "False" - type: platform.confluent.io/rolling - - lastProbeTime: "2021-08-11T10:06:58Z" - lastTransitionTime: "2021-08-11T10:06:58Z" - message: Cluster is not being garbage collected - reason: ClusterNotShrunk - status: "False" - type: platform.confluent.io/garbage-collecting - currentReplicas: 3 - listeners: - external: - client: |- - bootstrap.servers=kafka.confluent.svc.cluster.local:9092 - security.protocol=PLAINTEXT - internalEndpoint: kafka.confluent.svc.cluster.local:9092 - internal: - client: |- - bootstrap.servers=kafka.confluent.svc.cluster.local:9071 - security.protocol=PLAINTEXT - internalEndpoint: kafka.confluent.svc.cluster.local:9071 - replication: - internalEndpoint: kafka.confluent.svc.cluster.local:9072 - minISR: 2 - operatorVersion: v0.174.13 - phase: RUNNING - readyReplicas: 3 - replicas: 3 - replicationFactor: 3 - services: - kafka-rest: - internalEndpoint: http://kafka.confluent.svc.cluster.local:8090 - zookeeperConnect: zookeeper.confluent.svc.cluster.local:2181/kafka-confluent diff --git a/pkg/resource_customizations/platform.confluent.io/Kafka/testdata/progressing.yaml b/pkg/resource_customizations/platform.confluent.io/Kafka/testdata/progressing.yaml deleted file mode 100644 index c276682..0000000 --- a/pkg/resource_customizations/platform.confluent.io/Kafka/testdata/progressing.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: platform.confluent.io/v1beta1 -kind: Kafka -metadata: - generation: 1 - name: kafka - namespace: confluent -spec: - dataVolumeCapacity: 10Gi - metricReporter: - enabled: true - replicas: 3 -status: - clusterName: kafka - clusterNamespace: confluent - conditions: - - lastProbeTime: "2021-08-11T10:06:58Z" - lastTransitionTime: "2021-08-11T10:08:42Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: platform.confluent.io/statefulset-available - - lastProbeTime: "2021-08-11T10:06:58Z" - lastTransitionTime: "2021-08-11T10:08:42Z" - message: Kubernetes resources ready. - reason: KubernetesResourcesReady - status: "True" - type: platform.confluent.io/resources-ready - - lastProbeTime: "2021-08-11T10:06:58Z" - lastTransitionTime: "2021-08-11T10:06:58Z" - message: Cluster is not rolling, ignore=false - reason: ClusterNotRolling - status: "False" - type: platform.confluent.io/rolling - - lastProbeTime: "2021-08-11T10:06:58Z" - lastTransitionTime: "2021-08-11T10:06:58Z" - message: Cluster is not being garbage collected - reason: ClusterNotShrunk - status: "False" - type: platform.confluent.io/garbage-collecting - currentReplicas: 3 - listeners: - external: - client: |- - bootstrap.servers=kafka.confluent.svc.cluster.local:9092 - security.protocol=PLAINTEXT - internalEndpoint: kafka.confluent.svc.cluster.local:9092 - internal: - client: |- - bootstrap.servers=kafka.confluent.svc.cluster.local:9071 - security.protocol=PLAINTEXT - internalEndpoint: kafka.confluent.svc.cluster.local:9071 - replication: - internalEndpoint: kafka.confluent.svc.cluster.local:9072 - minISR: 2 - operatorVersion: v0.174.13 - phase: PROVISIONING - readyReplicas: 3 - replicas: 3 - replicationFactor: 3 - services: - kafka-rest: - internalEndpoint: http://kafka.confluent.svc.cluster.local:8090 - zookeeperConnect: zookeeper.confluent.svc.cluster.local:2181/kafka-confluent diff --git a/pkg/resource_customizations/platform.confluent.io/KsqlDB/health.lua b/pkg/resource_customizations/platform.confluent.io/KsqlDB/health.lua deleted file mode 100644 index cfada56..0000000 --- a/pkg/resource_customizations/platform.confluent.io/KsqlDB/health.lua +++ /dev/null @@ -1,19 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.phase ~= nil then - if obj.status.phase == "RUNNING" then - hs.status = "Healthy" - hs.message = "KsqlDB running" - return hs - end - if obj.status.phase == "PROVISIONING" then - hs.status = "Progressing" - hs.message = "KsqlDB provisioning" - return hs - end - end -end - -hs.status = "Progressing" -hs.message = "Waiting for KsqlDB" -return hs diff --git a/pkg/resource_customizations/platform.confluent.io/KsqlDB/health_test.yaml b/pkg/resource_customizations/platform.confluent.io/KsqlDB/health_test.yaml deleted file mode 100644 index 70f1a0a..0000000 --- a/pkg/resource_customizations/platform.confluent.io/KsqlDB/health_test.yaml +++ /dev/null @@ -1,9 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: KsqlDB provisioning - inputPath: testdata/progressing.yaml - - healthStatus: - status: Healthy - message: KsqlDB running - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/platform.confluent.io/KsqlDB/testdata/healthy.yaml b/pkg/resource_customizations/platform.confluent.io/KsqlDB/testdata/healthy.yaml deleted file mode 100644 index be4a282..0000000 --- a/pkg/resource_customizations/platform.confluent.io/KsqlDB/testdata/healthy.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: platform.confluent.io/v1beta1 -kind: KsqlDB -metadata: - generation: 1 - name: ksqldb - namespace: confluent -spec: - dataVolumeCapacity: 10Gi - replicas: 1 -status: - clusterName: ksqldb - clusterNamespace: confluent - conditions: - - lastProbeTime: "2021-08-11T10:08:31Z" - lastTransitionTime: "2021-08-11T10:10:17Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: platform.confluent.io/statefulset-available - - lastProbeTime: "2021-08-11T10:08:31Z" - lastTransitionTime: "2021-08-11T10:10:17Z" - message: Kubernetes resources ready. - reason: KubernetesResourcesReady - status: "True" - type: platform.confluent.io/resources-ready - - lastProbeTime: "2021-08-11T10:08:31Z" - lastTransitionTime: "2021-08-11T10:08:31Z" - message: Cluster is not being garbage collected - reason: ClusterNotShrunk - status: "False" - type: platform.confluent.io/garbage-collecting - currentReplicas: 1 - internalTopicNames: - - _confluent-ksql-confluent.ksqldb__command_topic - - _confluent-ksql-confluent.ksqldb__configs - kafka: - bootstrapEndpoint: kafka.confluent.svc.cluster.local:9071 - operatorVersion: v0.174.13 - phase: RUNNING - readyReplicas: 1 - replicas: 1 - restConfig: - internalEndpoint: http://ksqldb.confluent.svc.cluster.local:8088 - serviceId: confluent.ksqldb_ diff --git a/pkg/resource_customizations/platform.confluent.io/KsqlDB/testdata/progressing.yaml b/pkg/resource_customizations/platform.confluent.io/KsqlDB/testdata/progressing.yaml deleted file mode 100644 index bcb6076..0000000 --- a/pkg/resource_customizations/platform.confluent.io/KsqlDB/testdata/progressing.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: platform.confluent.io/v1beta1 -kind: KsqlDB -metadata: - generation: 1 - name: ksqldb - namespace: confluent -spec: - dataVolumeCapacity: 10Gi - replicas: 1 -status: - clusterName: ksqldb - clusterNamespace: confluent - conditions: - - lastProbeTime: "2021-08-11T10:08:31Z" - lastTransitionTime: "2021-08-11T10:10:17Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: platform.confluent.io/statefulset-available - - lastProbeTime: "2021-08-11T10:08:31Z" - lastTransitionTime: "2021-08-11T10:10:17Z" - message: Kubernetes resources ready. - reason: KubernetesResourcesReady - status: "True" - type: platform.confluent.io/resources-ready - - lastProbeTime: "2021-08-11T10:08:31Z" - lastTransitionTime: "2021-08-11T10:08:31Z" - message: Cluster is not being garbage collected - reason: ClusterNotShrunk - status: "False" - type: platform.confluent.io/garbage-collecting - currentReplicas: 1 - internalTopicNames: - - _confluent-ksql-confluent.ksqldb__command_topic - - _confluent-ksql-confluent.ksqldb__configs - kafka: - bootstrapEndpoint: kafka.confluent.svc.cluster.local:9071 - operatorVersion: v0.174.13 - phase: PROVISIONING - readyReplicas: 1 - replicas: 1 - restConfig: - internalEndpoint: http://ksqldb.confluent.svc.cluster.local:8088 - serviceId: confluent.ksqldb_ diff --git a/pkg/resource_customizations/platform.confluent.io/SchemaRegistry/health.lua b/pkg/resource_customizations/platform.confluent.io/SchemaRegistry/health.lua deleted file mode 100644 index e5542ba..0000000 --- a/pkg/resource_customizations/platform.confluent.io/SchemaRegistry/health.lua +++ /dev/null @@ -1,19 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.phase ~= nil then - if obj.status.phase == "RUNNING" then - hs.status = "Healthy" - hs.message = "SchemaRegistry running" - return hs - end - if obj.status.phase == "PROVISIONING" then - hs.status = "Progressing" - hs.message = "SchemaRegistry provisioning" - return hs - end - end -end - -hs.status = "Progressing" -hs.message = "Waiting for SchemaRegistry" -return hs diff --git a/pkg/resource_customizations/platform.confluent.io/SchemaRegistry/health_test.yaml b/pkg/resource_customizations/platform.confluent.io/SchemaRegistry/health_test.yaml deleted file mode 100644 index 2d44f6a..0000000 --- a/pkg/resource_customizations/platform.confluent.io/SchemaRegistry/health_test.yaml +++ /dev/null @@ -1,9 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: SchemaRegistry provisioning - inputPath: testdata/progressing.yaml - - healthStatus: - status: Healthy - message: SchemaRegistry running - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/platform.confluent.io/SchemaRegistry/testdata/healthy.yaml b/pkg/resource_customizations/platform.confluent.io/SchemaRegistry/testdata/healthy.yaml deleted file mode 100644 index 8eca77e..0000000 --- a/pkg/resource_customizations/platform.confluent.io/SchemaRegistry/testdata/healthy.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: platform.confluent.io/v1beta1 -kind: SchemaRegistry -metadata: - finalizers: - - schemaregistry.finalizers.platform.confluent.io - generation: 1 - name: schemaregistry - namespace: confluent -spec: - replicas: 1 -status: - clusterName: schemaregistry - clusterNamespace: confluent - conditions: - - lastProbeTime: "2021-08-11T10:08:32Z" - lastTransitionTime: "2021-08-11T10:09:41Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: platform.confluent.io/statefulset-available - - lastProbeTime: "2021-08-11T10:08:32Z" - lastTransitionTime: "2021-08-11T10:09:41Z" - message: Kubernetes resources ready. - reason: KubernetesResourcesReady - status: "True" - type: platform.confluent.io/resources-ready - - lastProbeTime: "2021-08-11T10:08:32Z" - lastTransitionTime: "2021-08-11T10:08:32Z" - message: Cluster is not being garbage collected - reason: ClusterNotShrunk - status: "False" - type: platform.confluent.io/garbage-collecting - currentReplicas: 1 - groupId: id_schemaregistry_confluent - internalTopicNames: - - _schemas_schemaregistry_confluent - kafka: - bootstrapEndpoint: kafka.confluent.svc.cluster.local:9071 - metricPrefix: schemaregistry_confluent - operatorVersion: v0.174.13 - phase: RUNNING - readyReplicas: 1 - replicas: 1 - restConfig: - internalEndpoint: http://schemaregistry.confluent.svc.cluster.local:8081 diff --git a/pkg/resource_customizations/platform.confluent.io/SchemaRegistry/testdata/progressing.yaml b/pkg/resource_customizations/platform.confluent.io/SchemaRegistry/testdata/progressing.yaml deleted file mode 100644 index a12232b..0000000 --- a/pkg/resource_customizations/platform.confluent.io/SchemaRegistry/testdata/progressing.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: platform.confluent.io/v1beta1 -kind: SchemaRegistry -metadata: - finalizers: - - schemaregistry.finalizers.platform.confluent.io - generation: 1 - name: schemaregistry - namespace: confluent -spec: - replicas: 1 -status: - clusterName: schemaregistry - clusterNamespace: confluent - conditions: - - lastProbeTime: "2021-08-11T10:08:32Z" - lastTransitionTime: "2021-08-11T10:09:41Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: platform.confluent.io/statefulset-available - - lastProbeTime: "2021-08-11T10:08:32Z" - lastTransitionTime: "2021-08-11T10:09:41Z" - message: Kubernetes resources ready. - reason: KubernetesResourcesReady - status: "True" - type: platform.confluent.io/resources-ready - - lastProbeTime: "2021-08-11T10:08:32Z" - lastTransitionTime: "2021-08-11T10:08:32Z" - message: Cluster is not being garbage collected - reason: ClusterNotShrunk - status: "False" - type: platform.confluent.io/garbage-collecting - currentReplicas: 1 - groupId: id_schemaregistry_confluent - internalTopicNames: - - _schemas_schemaregistry_confluent - kafka: - bootstrapEndpoint: kafka.confluent.svc.cluster.local:9071 - metricPrefix: schemaregistry_confluent - operatorVersion: v0.174.13 - phase: PROVISIONING - readyReplicas: 1 - replicas: 1 - restConfig: - internalEndpoint: http://schemaregistry.confluent.svc.cluster.local:8081 diff --git a/pkg/resource_customizations/platform.confluent.io/Zookeeper/health.lua b/pkg/resource_customizations/platform.confluent.io/Zookeeper/health.lua deleted file mode 100644 index 20c0fa8..0000000 --- a/pkg/resource_customizations/platform.confluent.io/Zookeeper/health.lua +++ /dev/null @@ -1,19 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.phase ~= nil then - if obj.status.phase == "RUNNING" then - hs.status = "Healthy" - hs.message = "Zookeeper running" - return hs - end - if obj.status.phase == "PROVISIONING" then - hs.status = "Progressing" - hs.message = "Zookeeper provisioning" - return hs - end - end -end - -hs.status = "Progressing" -hs.message = "Waiting for Zookeeper" -return hs diff --git a/pkg/resource_customizations/platform.confluent.io/Zookeeper/health_test.yaml b/pkg/resource_customizations/platform.confluent.io/Zookeeper/health_test.yaml deleted file mode 100644 index 7251ec4..0000000 --- a/pkg/resource_customizations/platform.confluent.io/Zookeeper/health_test.yaml +++ /dev/null @@ -1,9 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: Zookeeper provisioning - inputPath: testdata/progressing.yaml - - healthStatus: - status: Healthy - message: Zookeeper running - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/platform.confluent.io/Zookeeper/testdata/healthy.yaml b/pkg/resource_customizations/platform.confluent.io/Zookeeper/testdata/healthy.yaml deleted file mode 100644 index 7bc00dc..0000000 --- a/pkg/resource_customizations/platform.confluent.io/Zookeeper/testdata/healthy.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: platform.confluent.io/v1beta1 -kind: Zookeeper -metadata: - finalizers: - - zookeeper.finalizers.platform.confluent.io - generation: 1 - name: zookeeper - namespace: confluent -spec: - dataVolumeCapacity: 10Gi - logVolumeCapacity: 10Gi - podTemplate: - annotations: - traffic.sidecar.istio.io/excludeInboundPorts: 2888,3888 - traffic.sidecar.istio.io/excludeOutboundPorts: 2888,3888 - replicas: 3 -status: - clusterName: zookeeper - clusterNamespace: confluent - conditions: - - lastProbeTime: "2021-08-11T10:04:53Z" - lastTransitionTime: "2021-08-11T10:06:48Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: platform.confluent.io/statefulset-available - - lastProbeTime: "2021-08-11T10:04:53Z" - lastTransitionTime: "2021-08-11T10:06:48Z" - message: Kubernetes resources ready. - reason: KubernetesResourcesReady - status: "True" - type: platform.confluent.io/resources-ready - - lastProbeTime: "2021-08-11T10:04:53Z" - lastTransitionTime: "2021-08-11T10:04:53Z" - message: Cluster is not being garbage collected - reason: ClusterNotShrunk - status: "False" - type: platform.confluent.io/garbage-collecting - currentReplicas: 3 - endpoint: zookeeper.confluent.svc.cluster.local:2181 - operatorVersion: v0.174.13 - phase: RUNNING - readyReplicas: 3 - replicas: 3 diff --git a/pkg/resource_customizations/platform.confluent.io/Zookeeper/testdata/progressing.yaml b/pkg/resource_customizations/platform.confluent.io/Zookeeper/testdata/progressing.yaml deleted file mode 100644 index be0496a..0000000 --- a/pkg/resource_customizations/platform.confluent.io/Zookeeper/testdata/progressing.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: platform.confluent.io/v1beta1 -kind: Zookeeper -metadata: - finalizers: - - zookeeper.finalizers.platform.confluent.io - generation: 1 - name: zookeeper - namespace: confluent -spec: - dataVolumeCapacity: 10Gi - logVolumeCapacity: 10Gi - podTemplate: - annotations: - traffic.sidecar.istio.io/excludeInboundPorts: 2888,3888 - traffic.sidecar.istio.io/excludeOutboundPorts: 2888,3888 - replicas: 3 -status: - clusterName: zookeeper - clusterNamespace: confluent - conditions: - - lastProbeTime: "2021-08-11T10:04:53Z" - lastTransitionTime: "2021-08-11T10:06:48Z" - message: Deployment has minimum availability. - reason: MinimumReplicasAvailable - status: "True" - type: platform.confluent.io/statefulset-available - - lastProbeTime: "2021-08-11T10:04:53Z" - lastTransitionTime: "2021-08-11T10:06:48Z" - message: Kubernetes resources ready. - reason: KubernetesResourcesReady - status: "True" - type: platform.confluent.io/resources-ready - - lastProbeTime: "2021-08-11T10:04:53Z" - lastTransitionTime: "2021-08-11T10:04:53Z" - message: Cluster is not being garbage collected - reason: ClusterNotShrunk - status: "False" - type: platform.confluent.io/garbage-collecting - currentReplicas: 3 - endpoint: zookeeper.confluent.svc.cluster.local:2181 - operatorVersion: v0.174.13 - phase: PROVISIONING - readyReplicas: 3 - replicas: 3 diff --git a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/health.lua b/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/health.lua deleted file mode 100644 index ca1e046..0000000 --- a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/health.lua +++ /dev/null @@ -1,29 +0,0 @@ -adopted = { status = "Unknown" } -advertised = { status = "Unknown" } -discovered = { status = "Unknown" } - -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, c in ipairs(obj.status.conditions) do - if c.type == "Adopted" then - adopted = c - elseif c.type == "Advertised" then - advertised = c - elseif c.type == "Discoverable" then - discovered = c - end - end - end -end - -if adopted.status == "False" then - return { status = "Degraded", message = adopted.message } -elseif advertised.reason == "AdvertiseError" or advertised.reason == "UnadvertiseError" then - return { status = "Degraded", message = advertised.message } -elseif discovered.reason == "DiscoveryError" then - return { status = "Unknown", message = discovered.message } -elseif discovered.status == "True" then - return { status = "Healthy", message = discovered.message } -else - return { status = "Progressing", message = discovered.message } -end diff --git a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/health_test.yaml b/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/health_test.yaml deleted file mode 100644 index 1b9b30c..0000000 --- a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/health_test.yaml +++ /dev/null @@ -1,29 +0,0 @@ -tests: - - healthStatus: - status: Healthy - message: DNS-SD browse and lookup results match the advertised DNS records - inputPath: testdata/healthy.yaml - - healthStatus: - status: Progressing - message: DNS-SD browse could not find this instance - inputPath: testdata/progressing_negativeBrowse.yaml - - healthStatus: - status: Progressing - message: DNS-SD lookup could not find this instance - inputPath: testdata/progressing_negativeLookup.yaml - - healthStatus: - status: Degraded - message: none of the configured providers can advertise on "example.org" - inputPath: testdata/degraded_notAdopted.yaml - - healthStatus: - status: Degraded - message: "" - inputPath: testdata/degraded_advertiseError.yaml - - healthStatus: - status: Degraded - message: "" - inputPath: testdata/degraded_unadvertiseError.yaml - - healthStatus: - status: Unknown - message: "" - inputPath: testdata/unknown_discoveryError.yaml diff --git a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/degraded_advertiseError.yaml b/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/degraded_advertiseError.yaml deleted file mode 100644 index 905b2e9..0000000 --- a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/degraded_advertiseError.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: proclaim.dogmatiq.io/v1 -kind: DNSSDServiceInstance -metadata: - creationTimestamp: "2023-03-20T01:47:37Z" - finalizers: - - proclaim.dogmatiq.io/unadvertise - generation: 2 - name: test-instance - namespace: proclaim - resourceVersion: "308914" - uid: 991a66a3-9b7e-4515-9a41-f7513e9b7b33 -spec: - instance: - attributes: - - baz: qux - flag: "" - foo: bar - - more: attrs - domain: example.org - name: test-instance - serviceType: _proclaim._tcp - targets: - - host: test.example.org - port: 8080 - priority: 0 - weight: 0 - ttl: 1m0s -status: - conditions: - - lastTransitionTime: "2023-03-20T01:47:40Z" - message: "" - observedGeneration: 2 - reason: AdvertiseError - status: "False" - type: Advertised diff --git a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/degraded_notAdopted.yaml b/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/degraded_notAdopted.yaml deleted file mode 100644 index efccdb2..0000000 --- a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/degraded_notAdopted.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: proclaim.dogmatiq.io/v1 -kind: DNSSDServiceInstance -metadata: - creationTimestamp: "2023-03-20T01:47:37Z" - finalizers: - - proclaim.dogmatiq.io/unadvertise - generation: 2 - name: test-instance - namespace: proclaim - resourceVersion: "308914" - uid: 991a66a3-9b7e-4515-9a41-f7513e9b7b33 -spec: - instance: - attributes: - - baz: qux - flag: "" - foo: bar - - more: attrs - domain: example.org - name: test-instance - serviceType: _proclaim._tcp - targets: - - host: test.example.org - port: 8080 - priority: 0 - weight: 0 - ttl: 1m0s -status: - conditions: - - lastTransitionTime: "2023-03-20T01:47:40Z" - message: none of the configured providers can advertise on "example.org" - observedGeneration: 2 - reason: InstanceIgnored - status: "False" - type: Adopted diff --git a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/degraded_unadvertiseError.yaml b/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/degraded_unadvertiseError.yaml deleted file mode 100644 index 552eadb..0000000 --- a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/degraded_unadvertiseError.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: proclaim.dogmatiq.io/v1 -kind: DNSSDServiceInstance -metadata: - creationTimestamp: "2023-03-20T01:47:37Z" - finalizers: - - proclaim.dogmatiq.io/unadvertise - generation: 2 - name: test-instance - namespace: proclaim - resourceVersion: "308914" - uid: 991a66a3-9b7e-4515-9a41-f7513e9b7b33 -spec: - instance: - attributes: - - baz: qux - flag: "" - foo: bar - - more: attrs - domain: example.org - name: test-instance - serviceType: _proclaim._tcp - targets: - - host: test.example.org - port: 8080 - priority: 0 - weight: 0 - ttl: 1m0s -status: - conditions: - - lastTransitionTime: "2023-03-20T01:47:40Z" - message: "" - observedGeneration: 2 - reason: UnadvertiseError - status: "False" - type: Advertised diff --git a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/healthy.yaml b/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/healthy.yaml deleted file mode 100644 index f8ad890..0000000 --- a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/healthy.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: proclaim.dogmatiq.io/v1 -kind: DNSSDServiceInstance -metadata: - creationTimestamp: "2023-03-20T01:47:37Z" - finalizers: - - proclaim.dogmatiq.io/unadvertise - generation: 2 - name: test-instance - namespace: proclaim - resourceVersion: "308914" - uid: 991a66a3-9b7e-4515-9a41-f7513e9b7b33 -spec: - instance: - attributes: - - baz: qux - flag: "" - foo: bar - - more: attrs - domain: example.org - name: test-instance - serviceType: _proclaim._tcp - targets: - - host: test.example.org - port: 8080 - priority: 0 - weight: 0 - ttl: 1m0s -status: - conditions: - - lastTransitionTime: "2023-03-20T01:47:40Z" - message: DNS-SD browse and lookup results match the advertised DNS records - observedGeneration: 2 - reason: Discovered - status: "True" - type: Discoverable diff --git a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/progressing_negativeBrowse.yaml b/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/progressing_negativeBrowse.yaml deleted file mode 100644 index e34e6c1..0000000 --- a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/progressing_negativeBrowse.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: proclaim.dogmatiq.io/v1 -kind: DNSSDServiceInstance -metadata: - creationTimestamp: "2023-03-20T01:47:37Z" - finalizers: - - proclaim.dogmatiq.io/unadvertise - generation: 2 - name: test-instance - namespace: proclaim - resourceVersion: "308914" - uid: 991a66a3-9b7e-4515-9a41-f7513e9b7b33 -spec: - instance: - attributes: - - baz: qux - flag: "" - foo: bar - - more: attrs - domain: example.org - name: test-instance - serviceType: _proclaim._tcp - targets: - - host: test.example.org - port: 8080 - priority: 0 - weight: 0 - ttl: 1m0s -status: - conditions: - - lastTransitionTime: "2023-03-20T01:47:40Z" - message: DNS-SD browse could not find this instance - observedGeneration: 2 - reason: NegativeBrowseResult - status: "False" - type: Discoverable diff --git a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/progressing_negativeLookup.yaml b/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/progressing_negativeLookup.yaml deleted file mode 100644 index a563e7c..0000000 --- a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/progressing_negativeLookup.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: proclaim.dogmatiq.io/v1 -kind: DNSSDServiceInstance -metadata: - creationTimestamp: "2023-03-20T01:47:37Z" - finalizers: - - proclaim.dogmatiq.io/unadvertise - generation: 2 - name: test-instance - namespace: proclaim - resourceVersion: "308914" - uid: 991a66a3-9b7e-4515-9a41-f7513e9b7b33 -spec: - instance: - attributes: - - baz: qux - flag: "" - foo: bar - - more: attrs - domain: example.org - name: test-instance - serviceType: _proclaim._tcp - targets: - - host: test.example.org - port: 8080 - priority: 0 - weight: 0 - ttl: 1m0s -status: - conditions: - - lastTransitionTime: "2023-03-20T01:47:40Z" - message: DNS-SD lookup could not find this instance - observedGeneration: 2 - reason: NegativeLookupResult - status: "False" - type: Discoverable diff --git a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/unknown_discoveryError.yaml b/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/unknown_discoveryError.yaml deleted file mode 100644 index c6139a5..0000000 --- a/pkg/resource_customizations/proclaim.dogmatiq.io/DNSSDServiceInstance/testdata/unknown_discoveryError.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: proclaim.dogmatiq.io/v1 -kind: DNSSDServiceInstance -metadata: - creationTimestamp: "2023-03-20T01:47:37Z" - finalizers: - - proclaim.dogmatiq.io/unadvertise - generation: 2 - name: test-instance - namespace: proclaim - resourceVersion: "308914" - uid: 991a66a3-9b7e-4515-9a41-f7513e9b7b33 -spec: - instance: - attributes: - - baz: qux - flag: "" - foo: bar - - more: attrs - domain: example.org - name: test-instance - serviceType: _proclaim._tcp - targets: - - host: test.example.org - port: 8080 - priority: 0 - weight: 0 - ttl: 1m0s -status: - conditions: - - lastTransitionTime: "2023-03-20T01:47:40Z" - message: "" - observedGeneration: 2 - reason: DiscoveryError - status: "Unknown" - type: Discoverable diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/health.lua b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/health_test.yaml b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/dependency_not_found.yaml b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/dependency_not_found.yaml deleted file mode 100644 index 380766d..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 -kind: PubSubSubscription -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/dependency_not_ready.yaml deleted file mode 100644 index eda7ae0..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 -kind: PubSubSubscription -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/up_to_date.yaml b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/up_to_date.yaml deleted file mode 100644 index f108481..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 -kind: PubSubSubscription -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/update_failed.yaml b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/update_failed.yaml deleted file mode 100644 index d949420..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 -kind: PubSubSubscription -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/update_in_progress.yaml b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/update_in_progress.yaml deleted file mode 100644 index 6e25db0..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubSubscription/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 -kind: PubSubSubscription -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/health.lua b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/health_test.yaml b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/dependency_not_found.yaml b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/dependency_not_found.yaml deleted file mode 100644 index 0c0c72b..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 -kind: PubSubTopic -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/dependency_not_ready.yaml deleted file mode 100644 index 4756b9f..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 -kind: PubSubTopic -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/up_to_date.yaml b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/up_to_date.yaml deleted file mode 100644 index 38e9479..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 -kind: PubSubTopic -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/update_failed.yaml b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/update_failed.yaml deleted file mode 100644 index b528af9..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 -kind: PubSubTopic -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/update_in_progress.yaml b/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/update_in_progress.yaml deleted file mode 100644 index fab67f5..0000000 --- a/pkg/resource_customizations/pubsub.cnrm.cloud.google.com/PubSubTopic/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: pubsub.cnrm.cloud.google.com/v1beta1 -kind: PubSubTopic -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/health.lua b/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/health.lua deleted file mode 100644 index e28ef99..0000000 --- a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/health.lua +++ /dev/null @@ -1,38 +0,0 @@ -hs = {} -if obj.status ~= nil then - - if obj.status.state == "initializing" then - hs.status = "Progressing" - hs.message = obj.status.ready .. "/" .. obj.status.size .. " node(s) are ready" - return hs - end - - if obj.status.state == "ready" then - hs.status = "Healthy" - hs.message = obj.status.ready .. "/" .. obj.status.size .. " node(s) are ready" - return hs - end - - if obj.status.state == "paused" then - hs.status = "Unknown" - hs.message = "Cluster is paused" - return hs - end - - if obj.status.state == "stopping" then - hs.status = "Degraded" - hs.message = "Cluster is stopping (" .. obj.status.ready .. "/" .. obj.status.size .. " node(s) are ready)" - return hs - end - - if obj.status.state == "error" then - hs.status = "Degraded" - hs.message = "Cluster is on error: " .. table.concat(obj.status.messages, ", ") - return hs - end - -end - -hs.status = "Unknown" -hs.message = "Cluster status is unknown. Ensure your ArgoCD is current and then check for/file a bug report: https://github.com/argoproj/argo-cd/issues" -return hs diff --git a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/health_test.yaml b/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/health_test.yaml deleted file mode 100644 index 73b9968..0000000 --- a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/health_test.yaml +++ /dev/null @@ -1,25 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "0/1 node(s) are ready" - inputPath: testdata/initializing.yaml -- healthStatus: - status: Healthy - message: "1/1 node(s) are ready" - inputPath: testdata/ready.yaml -- healthStatus: - status: Unknown - message: "Cluster is paused" - inputPath: testdata/paused.yaml -- healthStatus: - status: Degraded - message: "Cluster is stopping (1/2 node(s) are ready)" - inputPath: testdata/stopping.yaml -- healthStatus: - status: Degraded - message: "Cluster is on error: we lost node" - inputPath: testdata/error.yaml -- healthStatus: - status: Unknown - message: "Cluster status is unknown. Ensure your ArgoCD is current and then check for/file a bug report: https://github.com/argoproj/argo-cd/issues" - inputPath: testdata/unknown.yaml diff --git a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/error.yaml b/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/error.yaml deleted file mode 100644 index b6f1884..0000000 --- a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/error.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: pxc.percona.com/v1 -kind: PerconaXtraDBCluster -metadata: - name: quickstart -spec: {} -status: - backup: {} - haproxy: {} - host: pxc-mysql-pxc - logcollector: {} - observedGeneration: 1 - pmm: {} - proxysql: {} - pxc: - image: '' - ready: 1 - size: 2 - status: error - version: 8.0.21-12.1 - ready: 1 - size: 2 - state: error - messages: - - we lost node diff --git a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/initializing.yaml b/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/initializing.yaml deleted file mode 100644 index 11f3ff0..0000000 --- a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/initializing.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: pxc.percona.com/v1 -kind: PerconaXtraDBCluster -metadata: - name: quickstart -spec: {} -status: - backup: {} - haproxy: {} - host: pxc-mysql-pxc - logcollector: {} - observedGeneration: 1 - pmm: {} - proxysql: {} - pxc: - image: '' - ready: 0 - size: 1 - status: initializing - version: 8.0.21-12.1 - ready: 0 - size: 1 - state: initializing diff --git a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/paused.yaml b/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/paused.yaml deleted file mode 100644 index 46440a2..0000000 --- a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/paused.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: pxc.percona.com/v1 -kind: PerconaXtraDBCluster -metadata: - name: quickstart -spec: {} -status: - backup: {} - haproxy: {} - host: pxc-mysql-pxc - logcollector: {} - observedGeneration: 1 - pmm: {} - proxysql: {} - pxc: - image: '' - ready: 1 - size: 1 - status: paused - version: 8.0.21-12.1 - ready: 1 - size: 1 - state: paused diff --git a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/ready.yaml b/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/ready.yaml deleted file mode 100644 index bd7d82a..0000000 --- a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/ready.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: pxc.percona.com/v1 -kind: PerconaXtraDBCluster -metadata: - name: quickstart -spec: {} -status: - backup: {} - haproxy: {} - host: pxc-mysql-pxc - logcollector: {} - observedGeneration: 1 - pmm: {} - proxysql: {} - pxc: - image: '' - ready: 1 - size: 1 - status: ready - version: 8.0.21-12.1 - ready: 1 - size: 1 - state: ready diff --git a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/stopping.yaml b/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/stopping.yaml deleted file mode 100644 index f527445..0000000 --- a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/stopping.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: pxc.percona.com/v1 -kind: PerconaXtraDBCluster -metadata: - name: quickstart -spec: {} -status: - backup: {} - haproxy: {} - host: pxc-mysql-pxc - logcollector: {} - observedGeneration: 1 - pmm: {} - proxysql: {} - pxc: - image: '' - ready: 1 - size: 2 - status: stopping - version: 8.0.21-12.1 - ready: 1 - size: 2 - state: stopping diff --git a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/unknown.yaml b/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/unknown.yaml deleted file mode 100644 index c12b046..0000000 --- a/pkg/resource_customizations/pxc.percona.com/PerconaXtraDBCluster/testdata/unknown.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: pxc.percona.com/v1 -kind: PerconaXtraDBCluster -metadata: - name: quickstart -spec: {} -status: - backup: {} - haproxy: {} - host: pxc-mysql-pxc - logcollector: {} - observedGeneration: 1 - pmm: {} - proxysql: {} - pxc: - image: '' - ready: 1 - size: 1 - status: dontknow - version: 8.0.21-12.1 - ready: 1 - size: 1 - state: dontknow diff --git a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/health.lua b/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/health_test.yaml b/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/dependency_not_found.yaml b/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/dependency_not_found.yaml deleted file mode 100644 index df457a1..0000000 --- a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1 -kind: Project -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/dependency_not_ready.yaml deleted file mode 100644 index 5988921..0000000 --- a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1 -kind: Project -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/up_to_date.yaml b/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/up_to_date.yaml deleted file mode 100644 index 6f122aa..0000000 --- a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1 -kind: Project -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/update_failed.yaml b/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/update_failed.yaml deleted file mode 100644 index 6ea7bc8..0000000 --- a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1 -kind: Project -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/update_in_progress.yaml b/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/update_in_progress.yaml deleted file mode 100644 index 0a69398..0000000 --- a/pkg/resource_customizations/resourcemanager.cnrm.cloud.google.com/Project/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: resourcemanager.cnrm.cloud.google.com/v1beta1 -kind: Project -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/route.openshift.io/Route/health.lua b/pkg/resource_customizations/route.openshift.io/Route/health.lua deleted file mode 100644 index 9183d49..0000000 --- a/pkg/resource_customizations/route.openshift.io/Route/health.lua +++ /dev/null @@ -1,37 +0,0 @@ -health_status = {} -if obj.status ~= nil then - if obj.status.ingress ~= nil then - numIngressRules = 0 - numTrue = 0 - numFalse = 0 - for _, ingressRules in pairs(obj.status.ingress) do - numIngressRules = numIngressRules + 1 - if obj.status.ingress ~= nil then - for _, condition in pairs(ingressRules.conditions) do - if condition.type == "Admitted" and condition.status == "True" then - numTrue = numTrue + 1 - elseif condition.type == "Admitted" and condition.status == "False" then - numFalse = numFalse + 1 - end - end - end - health_status.status = 'Test' - end - if numTrue == numIngressRules then - health_status.status = "Healthy" - health_status.message = "Route is healthy" - return health_status - elseif numFalse > 0 then - health_status.status = "Degraded" - health_status.message = "Route is degraded" - return health_status - else - health_status.status = "Progressing" - health_status.message = "Route is still getting admitted" - return health_status - end - end -end -health_status.status = "Progressing" -health_status.message = "Route is still getting admitted" -return health_status \ No newline at end of file diff --git a/pkg/resource_customizations/route.openshift.io/Route/health_test.yaml b/pkg/resource_customizations/route.openshift.io/Route/health_test.yaml deleted file mode 100644 index 1293d7d..0000000 --- a/pkg/resource_customizations/route.openshift.io/Route/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: 'Route is still getting admitted' - inputPath: testdata/progressing.yaml -- healthStatus: - status: Degraded - message: 'Route is degraded' - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: 'Route is healthy' - inputPath: testdata/healthy.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/route.openshift.io/Route/testdata/degraded.yaml b/pkg/resource_customizations/route.openshift.io/Route/testdata/degraded.yaml deleted file mode 100644 index 9d6ec91..0000000 --- a/pkg/resource_customizations/route.openshift.io/Route/testdata/degraded.yaml +++ /dev/null @@ -1,43 +0,0 @@ -kind: Route -apiVersion: route.openshift.io/v1 -metadata: - annotations: - openshift.io/host.generated: 'true' - resourceVersion: '187177' - name: openshift-gitops-server - namespace: openshift-gitops - ownerReferences: - - apiVersion: argoproj.io/v1alpha1 - kind: ArgoCD - name: openshift-gitops - uid: 09443427-36c8-4680-9a4b-602ae8a45b89 - controller: true - blockOwnerDeletion: true - labels: - app.kubernetes.io/managed-by: openshift-gitops - app.kubernetes.io/name: openshift-gitops-server - app.kubernetes.io/part-of: argocd -spec: - host: >- - openshift-gitops-server-openshift-gitops.apps.dev-svc-4.8-083007.devcluster.openshift.com - to: - kind: Service - name: openshift-gitops-server - weight: 100 - port: - targetPort: https - tls: - termination: passthrough - insecureEdgeTerminationPolicy: Redirect - wildcardPolicy: None -status: - ingress: - - host: >- - openshift-gitops-server-openshift-gitops.apps.dev-svc-4.8-083007.devcluster.openshift.com - routerName: default - conditions: - - type: Admitted - status: 'False' - lastTransitionTime: '2021-08-30T12:13:34Z' - wildcardPolicy: None - routerCanonicalHostname: router-default.apps.dev-svc-4.8-083007.devcluster.openshift.com diff --git a/pkg/resource_customizations/route.openshift.io/Route/testdata/healthy.yaml b/pkg/resource_customizations/route.openshift.io/Route/testdata/healthy.yaml deleted file mode 100644 index a5eabfc..0000000 --- a/pkg/resource_customizations/route.openshift.io/Route/testdata/healthy.yaml +++ /dev/null @@ -1,43 +0,0 @@ -kind: Route -apiVersion: route.openshift.io/v1 -metadata: - annotations: - openshift.io/host.generated: 'true' - resourceVersion: '187177' - name: openshift-gitops-server - namespace: openshift-gitops - ownerReferences: - - apiVersion: argoproj.io/v1alpha1 - kind: ArgoCD - name: openshift-gitops - uid: 09443427-36c8-4680-9a4b-602ae8a45b89 - controller: true - blockOwnerDeletion: true - labels: - app.kubernetes.io/managed-by: openshift-gitops - app.kubernetes.io/name: openshift-gitops-server - app.kubernetes.io/part-of: argocd -spec: - host: >- - openshift-gitops-server-openshift-gitops.apps.dev-svc-4.8-083007.devcluster.openshift.com - to: - kind: Service - name: openshift-gitops-server - weight: 100 - port: - targetPort: https - tls: - termination: passthrough - insecureEdgeTerminationPolicy: Redirect - wildcardPolicy: None -status: - ingress: - - host: >- - openshift-gitops-server-openshift-gitops.apps.dev-svc-4.8-083007.devcluster.openshift.com - routerName: default - conditions: - - type: Admitted - status: 'True' - lastTransitionTime: '2021-08-30T12:13:34Z' - wildcardPolicy: None - routerCanonicalHostname: router-default.apps.dev-svc-4.8-083007.devcluster.openshift.com diff --git a/pkg/resource_customizations/route.openshift.io/Route/testdata/progressing.yaml b/pkg/resource_customizations/route.openshift.io/Route/testdata/progressing.yaml deleted file mode 100644 index c2d219b..0000000 --- a/pkg/resource_customizations/route.openshift.io/Route/testdata/progressing.yaml +++ /dev/null @@ -1,43 +0,0 @@ -kind: Route -apiVersion: route.openshift.io/v1 -metadata: - annotations: - openshift.io/host.generated: 'true' - resourceVersion: '187177' - name: openshift-gitops-server - namespace: openshift-gitops - ownerReferences: - - apiVersion: argoproj.io/v1alpha1 - kind: ArgoCD - name: openshift-gitops - uid: 09443427-36c8-4680-9a4b-602ae8a45b89 - controller: true - blockOwnerDeletion: true - labels: - app.kubernetes.io/managed-by: openshift-gitops - app.kubernetes.io/name: openshift-gitops-server - app.kubernetes.io/part-of: argocd -spec: - host: >- - openshift-gitops-server-openshift-gitops.apps.dev-svc-4.8-083007.devcluster.openshift.com - to: - kind: Service - name: openshift-gitops-server - weight: 100 - port: - targetPort: https - tls: - termination: passthrough - insecureEdgeTerminationPolicy: Redirect - wildcardPolicy: None -status: - ingress: - - host: >- - openshift-gitops-server-openshift-gitops.apps.dev-svc-4.8-083007.devcluster.openshift.com - routerName: default - conditions: - - type: Admitted - status: 'Unknown' - lastTransitionTime: '2021-08-30T12:13:34Z' - wildcardPolicy: None - routerCanonicalHostname: router-default.apps.dev-svc-4.8-083007.devcluster.openshift.com diff --git a/pkg/resource_customizations/serving.knative.dev/Service/health.lua b/pkg/resource_customizations/serving.knative.dev/Service/health.lua deleted file mode 100644 index 9867d8a..0000000 --- a/pkg/resource_customizations/serving.knative.dev/Service/health.lua +++ /dev/null @@ -1,40 +0,0 @@ -health_status = {} -health_status.status = "Progressing" -health_status.message = "Waiting for status update." -if obj.status ~= nil and obj.status.conditions ~= nil then - status_true = 0 - status_false = 0 - status_unknown = 0 - health_status.message = "" - for i, condition in pairs(obj.status.conditions) do - if condition.status == "True" and (condition.type == "ConfigurationsReady" or condition.type == "RoutesReady" or condition.type == "Ready") then - status_true = status_true + 1 - elseif condition.status == "False" or condition.status == "Unknown" then - msg = condition.type .. " is " .. condition.status - if condition.reason ~= nil and condition.reason ~= "" then - msg = msg .. ", since " .. condition.reason .. "." - end - if condition.message ~= nil and condition.message ~= "" then - msg = msg .. " " .. condition.message - end - health_status.message = health_status.message .. msg .. "\n" - if condition.status == "False" then - status_false = status_false + 1 - else - status_unknown = status_unknown + 1 - end - end - end - if status_true == 3 and status_false == 0 and status_unknown == 0 then - health_status.message = "Knative Service is healthy." - health_status.status = "Healthy" - return health_status - elseif status_false > 0 then - health_status.status = "Degraded" - return health_status - else - health_status.status = "Progressing" - return health_status - end -end -return health_status \ No newline at end of file diff --git a/pkg/resource_customizations/serving.knative.dev/Service/health_test.yaml b/pkg/resource_customizations/serving.knative.dev/Service/health_test.yaml deleted file mode 100644 index 88ddbf4..0000000 --- a/pkg/resource_customizations/serving.knative.dev/Service/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Ready is Unknown, since RolloutInProgress. A gradual rollout of the latest revision(s) is in progress.\nRoutesReady is Unknown, since RolloutInProgress. A gradual rollout of the latest revision(s) is in progress.\n" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Degraded - message: "ConfigurationsReady is False, since RevisionFailed. Revision \"helloworld-00002\" failed with message: Container failed with: container exited with no error.\nReady is False, since RevisionFailed. Revision \"helloworld-00002\" failed with message: Container failed with: container exited with no error.\n" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: Knative Service is healthy. - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/serving.knative.dev/Service/testdata/degraded.yaml b/pkg/resource_customizations/serving.knative.dev/Service/testdata/degraded.yaml deleted file mode 100644 index cc23d52..0000000 --- a/pkg/resource_customizations/serving.knative.dev/Service/testdata/degraded.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: serving.knative.dev/v1 -kind: Service -metadata: - name: helloworld - namespace: default -spec: {} -status: - conditions: - - lastTransitionTime: "2022-06-14T03:45:38Z" - message: 'Revision "helloworld-00002" failed with message: Container failed with: container exited with no error.' - reason: RevisionFailed - status: "False" - type: ConfigurationsReady - - lastTransitionTime: "2022-06-14T03:45:38Z" - message: 'Revision "helloworld-00002" failed with message: Container failed with: container exited with no error.' - reason: RevisionFailed - status: "False" - type: Ready - - lastTransitionTime: "2022-06-16T09:35:11Z" - status: "True" - type: RoutesReady diff --git a/pkg/resource_customizations/serving.knative.dev/Service/testdata/healthy.yaml b/pkg/resource_customizations/serving.knative.dev/Service/testdata/healthy.yaml deleted file mode 100644 index ced6960..0000000 --- a/pkg/resource_customizations/serving.knative.dev/Service/testdata/healthy.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: serving.knative.dev/v1 -kind: Service -metadata: - name: helloworld - namespace: default -spec: {} -status: - conditions: - - lastTransitionTime: "2022-06-20T03:52:41Z" - status: "True" - type: ConfigurationsReady - - lastTransitionTime: "2022-06-20T03:52:41Z" - status: "True" - type: Ready - - lastTransitionTime: "2022-06-20T03:52:41Z" - status: "True" - type: RoutesReady diff --git a/pkg/resource_customizations/serving.knative.dev/Service/testdata/progressing.yaml b/pkg/resource_customizations/serving.knative.dev/Service/testdata/progressing.yaml deleted file mode 100644 index f381e5f..0000000 --- a/pkg/resource_customizations/serving.knative.dev/Service/testdata/progressing.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: serving.knative.dev/v1 -kind: Service -metadata: - name: helloworld - namespace: default -spec: {} -status: - conditions: - - lastTransitionTime: "2022-06-20T04:14:22Z" - status: "True" - type: ConfigurationsReady - - lastTransitionTime: "2022-06-20T04:14:22Z" - message: A gradual rollout of the latest revision(s) is in progress. - reason: RolloutInProgress - status: Unknown - type: Ready - - lastTransitionTime: "2022-06-20T04:14:22Z" - message: A gradual rollout of the latest revision(s) is in progress. - reason: RolloutInProgress - status: Unknown - type: RoutesReady diff --git a/pkg/resource_customizations/serving.kserve.io/InferenceService/health.lua b/pkg/resource_customizations/serving.kserve.io/InferenceService/health.lua deleted file mode 100644 index e256bfc..0000000 --- a/pkg/resource_customizations/serving.kserve.io/InferenceService/health.lua +++ /dev/null @@ -1,40 +0,0 @@ -health_status = {} -health_status.status = "Progressing" -health_status.message = "Waiting for status update." -if obj.status ~= nil and obj.status.conditions ~= nil then - status_true = 0 - status_false = 0 - status_unknown = 0 - health_status.message = "" - for i, condition in pairs(obj.status.conditions) do - if condition.status == "True" and (condition.type == "IngressReady" or condition.type == "PredictorConfigurationReady" or condition.type == "PredictorReady" or condition.type == "PredictorRouteReady" or condition.type == "Ready") then - status_true = status_true + 1 - elseif condition.status == "False" or condition.status == "Unknown" then - msg = condition.type .. " is " .. condition.status - if condition.reason ~= nil and condition.reason ~= "" then - msg = msg .. ", since " .. condition.reason .. "." - end - if condition.message ~= nil and condition.message ~= "" then - msg = msg .. " " .. condition.message - end - health_status.message = health_status.message .. msg .. "\n" - if condition.status == "False" then - status_false = status_false + 1 - else - status_unknown = status_unknown + 1 - end - end - end - if status_true == 5 and status_false == 0 and status_unknown == 0 then - health_status.message = "Inference Service is healthy." - health_status.status = "Healthy" - return health_status - elseif status_false > 0 then - health_status.status = "Degraded" - return health_status - else - health_status.status = "Progressing" - return health_status - end -end -return health_status \ No newline at end of file diff --git a/pkg/resource_customizations/serving.kserve.io/InferenceService/health_test.yaml b/pkg/resource_customizations/serving.kserve.io/InferenceService/health_test.yaml deleted file mode 100644 index e8f32bd..0000000 --- a/pkg/resource_customizations/serving.kserve.io/InferenceService/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "PredictorConfigurationReady is Unknown\nPredictorReady is Unknown, since RevisionMissing. Configuration \"hello-world-predictor-default\" is waiting for a Revision to become ready.\nPredictorRouteReady is Unknown, since RevisionMissing. Configuration \"hello-world-predictor-default\" is waiting for a Revision to become ready.\nReady is Unknown, since RevisionMissing. Configuration \"hello-world-predictor-default\" is waiting for a Revision to become ready.\n" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Degraded - message: "IngressReady is False, since Predictor ingress not created.\nPredictorConfigurationReady is False, since RevisionFailed. Revision \"helloworld-00002\" failed with message: Container failed with: container exited with no error.\nPredictorReady is False, since RevisionFailed. Revision \"helloworld-00002\" failed with message: Container failed with: container exited with no error.\nReady is False, since Predictor ingress not created.\n" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: Inference Service is healthy. - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/serving.kserve.io/InferenceService/testdata/degraded.yaml b/pkg/resource_customizations/serving.kserve.io/InferenceService/testdata/degraded.yaml deleted file mode 100644 index 0cd3378..0000000 --- a/pkg/resource_customizations/serving.kserve.io/InferenceService/testdata/degraded.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: serving.kserve.io/v1beta1 -kind: InferenceService -metadata: - name: helloworld - namespace: default -spec: {} -status: - conditions: - - lastTransitionTime: "2022-06-14T03:45:38Z" - reason: Predictor ingress not created - status: "False" - type: IngressReady - - lastTransitionTime: "2022-06-14T03:45:38Z" - message: 'Revision "helloworld-00002" failed with message: Container failed with: container exited with no error.' - reason: RevisionFailed - status: "False" - type: PredictorConfigurationReady - - lastTransitionTime: "2022-06-14T03:45:38Z" - message: 'Revision "helloworld-00002" failed with message: Container failed with: container exited with no error.' - reason: RevisionFailed - status: "False" - type: PredictorReady - - lastTransitionTime: "2022-06-14T03:45:38Z" - severity: Info - status: "True" - type: PredictorRouteReady - - lastTransitionTime: "2022-06-14T03:45:38Z" - reason: Predictor ingress not created - status: "False" - type: Ready diff --git a/pkg/resource_customizations/serving.kserve.io/InferenceService/testdata/healthy.yaml b/pkg/resource_customizations/serving.kserve.io/InferenceService/testdata/healthy.yaml deleted file mode 100644 index 3c28c61..0000000 --- a/pkg/resource_customizations/serving.kserve.io/InferenceService/testdata/healthy.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: serving.kserve.io/v1beta1 -kind: InferenceService -metadata: - name: helloworld - namespace: default -spec: {} -status: - conditions: - - lastTransitionTime: "2023-06-20T22:44:51Z" - status: "True" - type: IngressReady - - lastTransitionTime: "2023-06-20T22:44:50Z" - severity: Info - status: "True" - type: PredictorConfigurationReady - - lastTransitionTime: "2023-06-20T22:44:51Z" - status: "True" - type: PredictorReady - - lastTransitionTime: "2023-06-20T22:44:51Z" - severity: Info - status: "True" - type: PredictorRouteReady - - lastTransitionTime: "2023-06-20T22:44:51Z" - status: "True" - type: Ready diff --git a/pkg/resource_customizations/serving.kserve.io/InferenceService/testdata/progressing.yaml b/pkg/resource_customizations/serving.kserve.io/InferenceService/testdata/progressing.yaml deleted file mode 100644 index fab0a57..0000000 --- a/pkg/resource_customizations/serving.kserve.io/InferenceService/testdata/progressing.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: serving.kserve.io/v1beta1 -kind: InferenceService -metadata: - name: helloworld - namespace: default -spec: {} -status: - conditions: - - lastTransitionTime: "2023-06-21T22:25:58Z" - severity: Info - status: Unknown - type: PredictorConfigurationReady - - lastTransitionTime: "2023-06-21T22:25:58Z" - message: 'Configuration "hello-world-predictor-default" is waiting for a Revision to become ready.' - reason: RevisionMissing - status: Unknown - type: PredictorReady - - lastTransitionTime: "2023-06-21T22:25:58Z" - message: 'Configuration "hello-world-predictor-default" is waiting for a Revision to become ready.' - reason: RevisionMissing - severity: Info - status: Unknown - type: PredictorRouteReady - - lastTransitionTime: "2023-06-21T22:25:58Z" - message: 'Configuration "hello-world-predictor-default" is waiting for a Revision to become ready.' - reason: RevisionMissing - status: Unknown - type: Ready diff --git a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/health.lua b/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/health.lua deleted file mode 100644 index aa10e76..0000000 --- a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/health.lua +++ /dev/null @@ -1,18 +0,0 @@ -hs = {} - -if obj.status ~= nil and obj.status.readyToUse then - hs.status = "Healthy" - hs.message = "Ready to use" - return hs -end - -if obj.status ~= nil and obj.status.error ~= nil then - hs.status = "Degraded" - hs.message = obj.status.error.message - return hs -end - -hs.status = "Progressing" -hs.message = "Waiting for status" - -return hs diff --git a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/health_test.yaml b/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/health_test.yaml deleted file mode 100644 index 7914d4a..0000000 --- a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/health_test.yaml +++ /dev/null @@ -1,14 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Waiting for status" - inputPath: testdata/initializing.yaml -- healthStatus: - status: Healthy - message: "Ready to use" - inputPath: testdata/good.yaml -- healthStatus: - status: Degraded - message: "VolumeSnapshotContent is dynamically provisioned while expecting a pre-provisioned one" - inputPath: testdata/bad.yaml - diff --git a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/testdata/bad.yaml b/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/testdata/bad.yaml deleted file mode 100644 index 2d7447f..0000000 --- a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/testdata/bad.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: snapshot.storage.k8s.io/v1 -kind: VolumeSnapshot -metadata: - name: data-04-06-2023 -spec: - source: - volumeSnapshotContentName: data-04-06-2023 -status: - error: - message: >- - VolumeSnapshotContent is dynamically provisioned while expecting a - pre-provisioned one - time: '2023-06-05T14:51:25Z' - readyToUse: false diff --git a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/testdata/good.yaml b/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/testdata/good.yaml deleted file mode 100644 index b8a82ef..0000000 --- a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/testdata/good.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: snapshot.storage.k8s.io/v1 -kind: VolumeSnapshot -metadata: - finalizers: - - snapshot.storage.kubernetes.io/volumesnapshot-as-source-protection - - snapshot.storage.kubernetes.io/volumesnapshot-bound-protection -status: - boundVolumeSnapshotContentName: snapcontent-7db10be0-424c-4ed2-9dfe-6c2120eae05b - creationTime: '2023-06-04T19:13:20Z' - readyToUse: true - restoreSize: 1Ti -spec: - source: - persistentVolumeClaimName: mask-data-process-trcxk-mysql-data - volumeSnapshotClassName: azure-tools diff --git a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/testdata/initializing.yaml b/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/testdata/initializing.yaml deleted file mode 100644 index 3df029d..0000000 --- a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshot/testdata/initializing.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: snapshot.storage.k8s.io/v1 -kind: VolumeSnapshot -metadata: - name: data-04-06-2023 -spec: - driver: disk.csi.azure.com -status: {} diff --git a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/health.lua b/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/health.lua deleted file mode 100644 index aa10e76..0000000 --- a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/health.lua +++ /dev/null @@ -1,18 +0,0 @@ -hs = {} - -if obj.status ~= nil and obj.status.readyToUse then - hs.status = "Healthy" - hs.message = "Ready to use" - return hs -end - -if obj.status ~= nil and obj.status.error ~= nil then - hs.status = "Degraded" - hs.message = obj.status.error.message - return hs -end - -hs.status = "Progressing" -hs.message = "Waiting for status" - -return hs diff --git a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/health_test.yaml b/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/health_test.yaml deleted file mode 100644 index 6cc455a..0000000 --- a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Waiting for status" - inputPath: testdata/initializing.yaml -- healthStatus: - status: Healthy - message: "Ready to use" - inputPath: testdata/good.yaml -- healthStatus: - status: Degraded - message: "Failed to check and update snapshot content" - inputPath: testdata/bad.yaml diff --git a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/testdata/bad.yaml b/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/testdata/bad.yaml deleted file mode 100644 index d8d3d3d..0000000 --- a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/testdata/bad.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: snapshot.storage.k8s.io/v1 -kind: VolumeSnapshotContent -metadata: - name: data-04-06-2023 -spec: - driver: disk.csi.azure.com -status: - error: - message: >- - Failed to check and update snapshot content - time: '2023-06-05T15:44:50Z' - readyToUse: false diff --git a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/testdata/good.yaml b/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/testdata/good.yaml deleted file mode 100644 index 56166be..0000000 --- a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/testdata/good.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: snapshot.storage.k8s.io/v1 -kind: VolumeSnapshotContent -metadata: - creationTimestamp: '2023-06-04T19:13:19Z' - finalizers: - - snapshot.storage.kubernetes.io/volumesnapshotcontent-bound-protection -status: - creationTime: 1685906000388294100 - readyToUse: true - restoreSize: 1099511627776 - snapshotHandle: >- - /subscriptions/XXXXXX -spec: - driver: disk.csi.azure.com - source: - volumeHandle: >- - /subscriptions/XXXXXX - volumeSnapshotClassName: azure-tools - volumeSnapshotRef: - apiVersion: snapshot.storage.k8s.io/v1 diff --git a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/testdata/initializing.yaml b/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/testdata/initializing.yaml deleted file mode 100644 index 8558cf3..0000000 --- a/pkg/resource_customizations/snapshot.storage.k8s.io/VolumeSnapshotContent/testdata/initializing.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: snapshot.storage.k8s.io/v1 -kind: VolumeSnapshotContent -metadata: - name: data-04-06-2023 -spec: - driver: disk.csi.azure.com -status: {} diff --git a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/health.lua b/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/health.lua deleted file mode 100644 index 5a50460..0000000 --- a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/health.lua +++ /dev/null @@ -1,133 +0,0 @@ -health_status = {} --- Can't use standard lib, math.huge equivalent -infinity = 2^1024-1 - -local function executor_range_api() - min_executor_instances = 0 - max_executor_instances = infinity - if obj.spec.dynamicAllocation.maxExecutors then - max_executor_instances = obj.spec.dynamicAllocation.maxExecutors - end - if obj.spec.dynamicAllocation.minExecutors then - min_executor_instances = obj.spec.dynamicAllocation.minExecutors - end - return min_executor_instances, max_executor_instances -end - -local function maybe_executor_range_spark_conf() - min_executor_instances = 0 - max_executor_instances = infinity - if obj.spec.sparkConf["spark.streaming.dynamicAllocation.enabled"] ~= nil and - obj.spec.sparkConf["spark.streaming.dynamicAllocation.enabled"] == "true" then - if(obj.spec.sparkConf["spark.streaming.dynamicAllocation.maxExecutors"] ~= nil) then - max_executor_instances = tonumber(obj.spec.sparkConf["spark.streaming.dynamicAllocation.maxExecutors"]) - end - if(obj.spec.sparkConf["spark.streaming.dynamicAllocation.minExecutors"] ~= nil) then - min_executor_instances = tonumber(obj.spec.sparkConf["spark.streaming.dynamicAllocation.minExecutors"]) - end - return min_executor_instances, max_executor_instances - elseif obj.spec.sparkConf["spark.dynamicAllocation.enabled"] ~= nil and - obj.spec.sparkConf["spark.dynamicAllocation.enabled"] == "true" then - if(obj.spec.sparkConf["spark.dynamicAllocation.maxExecutors"] ~= nil) then - max_executor_instances = tonumber(obj.spec.sparkConf["spark.dynamicAllocation.maxExecutors"]) - end - if(obj.spec.sparkConf["spark.dynamicAllocation.minExecutors"] ~= nil) then - min_executor_instances = tonumber(obj.spec.sparkConf["spark.dynamicAllocation.minExecutors"]) - end - return min_executor_instances, max_executor_instances - else - return nil - end -end - -local function maybe_executor_range() - if obj.spec["dynamicAllocation"] and obj.spec.dynamicAllocation.enabled then - return executor_range_api() - elseif obj.spec["sparkConf"] ~= nil then - return maybe_executor_range_spark_conf() - else - return nil - end -end - -if obj.status ~= nil then - if obj.status.applicationState.state ~= nil then - if obj.status.applicationState.state == "" then - health_status.status = "Progressing" - health_status.message = "SparkApplication was added, enqueuing it for submission" - return health_status - end - if obj.status.applicationState.state == "RUNNING" then - if obj.status.executorState ~= nil then - count=0 - executor_instances = obj.spec.executor.instances - for i, executorState in pairs(obj.status.executorState) do - if executorState == "RUNNING" then - count=count+1 - end - end - if executor_instances == count then - health_status.status = "Healthy" - health_status.message = "SparkApplication is Running" - return health_status - elseif maybe_executor_range() then - min_executor_instances, max_executor_instances = maybe_executor_range() - if count >= min_executor_instances and count <= max_executor_instances then - health_status.status = "Healthy" - health_status.message = "SparkApplication is Running" - return health_status - end - end - end - end - if obj.status.applicationState.state == "SUBMITTED" then - health_status.status = "Progressing" - health_status.message = "SparkApplication was submitted successfully" - return health_status - end - if obj.status.applicationState.state == "COMPLETED" then - health_status.status = "Healthy" - health_status.message = "SparkApplication was Completed" - return health_status - end - if obj.status.applicationState.state == "FAILED" then - health_status.status = "Degraded" - health_status.message = obj.status.applicationState.errorMessage - return health_status - end - if obj.status.applicationState.state == "SUBMISSION_FAILED" then - health_status.status = "Degraded" - health_status.message = obj.status.applicationState.errorMessage - return health_status - end - if obj.status.applicationState.state == "PENDING_RERUN" then - health_status.status = "Progressing" - health_status.message = "SparkApplication is Pending Rerun" - return health_status - end - if obj.status.applicationState.state == "INVALIDATING" then - health_status.status = "Missing" - health_status.message = "SparkApplication is in InvalidatingState" - return health_status - end - if obj.status.applicationState.state == "SUCCEEDING" then - health_status.status = "Progressing" - health_status.message = [[The driver pod has been completed successfully. The executor pods terminate and are cleaned up. - Under this circumstances, we assume the executor pod are completed.]] - return health_status - end - if obj.status.applicationState.state == "FAILING" then - health_status.status = "Degraded" - health_status.message = obj.status.applicationState.errorMessage - return health_status - end - if obj.status.applicationState.state == "UNKNOWN" then - health_status.status = "Progressing" - health_status.message = "SparkApplication is in UnknownState because either driver pod or one or all executor pods in unknown state " - return health_status - end - end -end -health_status.status = "Progressing" -health_status.message = "Waiting for Executor pods" -return health_status diff --git a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/health_test.yaml b/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/health_test.yaml deleted file mode 100644 index 582b446..0000000 --- a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/health_test.yaml +++ /dev/null @@ -1,25 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "SparkApplication is Pending Rerun" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Degraded - message: "Job Failed" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Healthy - message: "SparkApplication is Running" - inputPath: testdata/healthy.yaml -- healthStatus: - status: Healthy - message: "SparkApplication is Running" - inputPath: testdata/healthy_dynamic_alloc.yaml -- healthStatus: - status: Healthy - message: "SparkApplication is Running" - inputPath: testdata/healthy_dynamic_alloc_dstream.yaml -- healthStatus: - status: Healthy - message: "SparkApplication is Running" - inputPath: testdata/healthy_dynamic_alloc_operator_api.yaml diff --git a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/degraded.yaml b/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/degraded.yaml deleted file mode 100644 index 20e12a8..0000000 --- a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/degraded.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: sparkoperator.k8s.io/v1beta2 -kind: SparkApplication -metadata: - generation: 4 - labels: - argocd.argoproj.io/instance: spark-job - name: spark-job-app - namespace: spark-cluster - resourceVersion: "31812990" - uid: bfee52b0-74ca-4465-8005-f6643097ed64 -spec: - executor: - instances: 4 -status: - applicationState: - state: FAILED - errorMessage: Job Failed - driverInfo: - podName: spark-job-app-driver - webUIAddress: 172.20.207.161:4040 - webUIPort: 4040 - webUIServiceName: spark-job-app-ui-svc - executionAttempts: 13 - executorState: - spark-job-app-1591613851251-exec-1: FAILED - spark-job-app-1591613851251-exec-2: RUNNING - spark-job-app-1591613851251-exec-4: FAILED - spark-job-app-1591613851251-exec-5: RUNNING - lastSubmissionAttemptTime: "2020-06-08T10:57:32Z" - sparkApplicationId: spark-a5920b2a5aa04d22a737c60759b5bf82 - submissionAttempts: 1 - submissionID: 3e713ec8-9f6c-4e78-ac28-749797c846f0 - terminationTime: null \ No newline at end of file diff --git a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/healthy.yaml b/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/healthy.yaml deleted file mode 100644 index cd6e858..0000000 --- a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/healthy.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: sparkoperator.k8s.io/v1beta2 -kind: SparkApplication -metadata: - generation: 4 - labels: - argocd.argoproj.io/instance: spark-job - name: spark-job-app - namespace: spark-cluster - resourceVersion: "31812990" - uid: bfee52b0-74ca-4465-8005-f6643097ed64 -spec: - executor: - instances: 4 -status: - applicationState: - state: RUNNING - driverInfo: - podName: ingestion-datalake-news-app-driver - webUIAddress: 172.20.207.161:4040 - webUIPort: 4040 - webUIServiceName: ingestion-datalake-news-app-ui-svc - executionAttempts: 13 - executorState: - ingestion-datalake-news-app-1591613851251-exec-1: RUNNING - ingestion-datalake-news-app-1591613851251-exec-2: RUNNING - ingestion-datalake-news-app-1591613851251-exec-4: RUNNING - ingestion-datalake-news-app-1591613851251-exec-5: RUNNING - lastSubmissionAttemptTime: "2020-06-08T10:57:32Z" - sparkApplicationId: spark-a5920b2a5aa04d22a737c60759b5bf82 - submissionAttempts: 1 - submissionID: 3e713ec8-9f6c-4e78-ac28-749797c846f0 - terminationTime: null \ No newline at end of file diff --git a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/healthy_dynamic_alloc.yaml b/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/healthy_dynamic_alloc.yaml deleted file mode 100644 index 9ff52e7..0000000 --- a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/healthy_dynamic_alloc.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: sparkoperator.k8s.io/v1beta2 -kind: SparkApplication -metadata: - generation: 4 - labels: - argocd.argoproj.io/instance: spark-job - name: spark-job-app - namespace: spark-cluster - resourceVersion: "31812990" - uid: bfee52b0-74ca-4465-8005-f6643097ed64 -spec: - executor: - instances: 4 - sparkConf: - spark.dynamicAllocation.enabled: 'true' - spark.dynamicAllocation.maxExecutors: '10' - spark.dynamicAllocation.minExecutors: '2' -status: - applicationState: - state: RUNNING - driverInfo: - podName: ingestion-datalake-news-app-driver - webUIAddress: 172.20.207.161:4040 - webUIPort: 4040 - webUIServiceName: ingestion-datalake-news-app-ui-svc - executionAttempts: 13 - executorState: - ingestion-datalake-news-app-1591613851251-exec-1: RUNNING - ingestion-datalake-news-app-1591613851251-exec-2: RUNNING - ingestion-datalake-news-app-1591613851251-exec-4: RUNNING - ingestion-datalake-news-app-1591613851251-exec-5: RUNNING - ingestion-datalake-news-app-1591613851251-exec-6: RUNNING - lastSubmissionAttemptTime: "2020-06-08T10:57:32Z" - sparkApplicationId: spark-a5920b2a5aa04d22a737c60759b5bf82 - submissionAttempts: 1 - submissionID: 3e713ec8-9f6c-4e78-ac28-749797c846f0 - terminationTime: null diff --git a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/healthy_dynamic_alloc_dstream.yaml b/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/healthy_dynamic_alloc_dstream.yaml deleted file mode 100644 index ce24ff7..0000000 --- a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/healthy_dynamic_alloc_dstream.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: sparkoperator.k8s.io/v1beta2 -kind: SparkApplication -metadata: - generation: 4 - labels: - argocd.argoproj.io/instance: spark-job - name: spark-job-app - namespace: spark-cluster - resourceVersion: "31812990" - uid: bfee52b0-74ca-4465-8005-f6643097ed64 -spec: - executor: - instances: 4 - sparkConf: - spark.streaming.dynamicAllocation.enabled: 'true' - spark.streaming.dynamicAllocation.maxExecutors: '10' - spark.streaming.dynamicAllocation.minExecutors: '2' -status: - applicationState: - state: RUNNING - driverInfo: - podName: ingestion-datalake-news-app-driver - webUIAddress: 172.20.207.161:4040 - webUIPort: 4040 - webUIServiceName: ingestion-datalake-news-app-ui-svc - executionAttempts: 13 - executorState: - ingestion-datalake-news-app-1591613851251-exec-1: RUNNING - ingestion-datalake-news-app-1591613851251-exec-4: RUNNING - ingestion-datalake-news-app-1591613851251-exec-6: RUNNING - lastSubmissionAttemptTime: "2020-06-08T10:57:32Z" - sparkApplicationId: spark-a5920b2a5aa04d22a737c60759b5bf82 - submissionAttempts: 1 - submissionID: 3e713ec8-9f6c-4e78-ac28-749797c846f0 - terminationTime: null diff --git a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/healthy_dynamic_alloc_operator_api.yaml b/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/healthy_dynamic_alloc_operator_api.yaml deleted file mode 100644 index 538a279..0000000 --- a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/healthy_dynamic_alloc_operator_api.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: sparkoperator.k8s.io/v1beta2 -kind: SparkApplication -metadata: - generation: 4 - labels: - argocd.argoproj.io/instance: spark-job - name: spark-job-app - namespace: spark-cluster - resourceVersion: "31812990" - uid: bfee52b0-74ca-4465-8005-f6643097ed64 -spec: - executor: - instances: 4 - dynamicAllocation: - enabled: true - initialExecutors: 2 - minExecutors: 2 - maxExecutors: 10 -status: - applicationState: - state: RUNNING - driverInfo: - podName: ingestion-datalake-news-app-driver - webUIAddress: 172.20.207.161:4040 - webUIPort: 4040 - webUIServiceName: ingestion-datalake-news-app-ui-svc - executionAttempts: 13 - executorState: - ingestion-datalake-news-app-1591613851251-exec-1: RUNNING - ingestion-datalake-news-app-1591613851251-exec-2: RUNNING - ingestion-datalake-news-app-1591613851251-exec-4: RUNNING - ingestion-datalake-news-app-1591613851251-exec-5: RUNNING - ingestion-datalake-news-app-1591613851251-exec-6: RUNNING - lastSubmissionAttemptTime: "2020-06-08T10:57:32Z" - sparkApplicationId: spark-a5920b2a5aa04d22a737c60759b5bf82 - submissionAttempts: 1 - submissionID: 3e713ec8-9f6c-4e78-ac28-749797c846f0 - terminationTime: null diff --git a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/progressing.yaml b/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/progressing.yaml deleted file mode 100644 index 177fe68..0000000 --- a/pkg/resource_customizations/sparkoperator.k8s.io/SparkApplication/testdata/progressing.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: sparkoperator.k8s.io/v1beta2 -kind: SparkApplication -metadata: - generation: 4 - labels: - argocd.argoproj.io/instance: spark-job - name: spark-job-app - namespace: spark-cluster - resourceVersion: "31812990" - uid: bfee52b0-74ca-4465-8005-f6643097ed64 -spec: - executor: - instances: 4 -status: - applicationState: - state: PENDING_RERUN - driverInfo: - podName: ingestion-datalake-news-app-driver - webUIAddress: 172.20.207.161:4040 - webUIPort: 4040 - webUIServiceName: ingestion-datalake-news-app-ui-svc - executionAttempts: 13 - executorState: - ingestion-datalake-news-app-1591613851251-exec-1: PENDING_RERUN - ingestion-datalake-news-app-1591613851251-exec-2: RUNNING - ingestion-datalake-news-app-1591613851251-exec-4: PENDING_RERUN - ingestion-datalake-news-app-1591613851251-exec-5: RUNNING - lastSubmissionAttemptTime: "2020-06-08T10:57:32Z" - sparkApplicationId: spark-a5920b2a5aa04d22a737c60759b5bf82 - submissionAttempts: 1 - submissionID: 3e713ec8-9f6c-4e78-ac28-749797c846f0 - terminationTime: null \ No newline at end of file diff --git a/pkg/resource_customizations/spot.io/SpotDeployment/health.lua b/pkg/resource_customizations/spot.io/SpotDeployment/health.lua deleted file mode 100644 index 030e2c5..0000000 --- a/pkg/resource_customizations/spot.io/SpotDeployment/health.lua +++ /dev/null @@ -1,41 +0,0 @@ -hs = {} - -if obj.status == nil or obj.status.conditions == nil then - return hs -end - -for _, condition in ipairs(obj.status.conditions) do - if condition.type == "InvalidSpec" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Progressing" and condition.reason == "RolloutAborted" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Progressing" and condition.reason == "ProgressDeadlineExceeded" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - if condition.type == "Paused" and condition.status == "True" then - hs.status = "Suspended" - hs.message = "Rollout is paused" - return hs - end -end - -if obj.status.phase == "Progressing" then - hs.status = "Progressing" - hs.message = "Waiting for rollout to finish steps" - return hs -end - -hs.status = "Healthy" -hs.message = "" -return hs - - - diff --git a/pkg/resource_customizations/spot.io/SpotDeployment/health_test.yaml b/pkg/resource_customizations/spot.io/SpotDeployment/health_test.yaml deleted file mode 100644 index 9e81559..0000000 --- a/pkg/resource_customizations/spot.io/SpotDeployment/health_test.yaml +++ /dev/null @@ -1,12 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Rollout is aborted" - inputPath: testdata/degraded_spotdeployment.yaml -- healthStatus: - status: Healthy - inputPath: testdata/healthy_spotdeployment.yaml -- healthStatus: - status: Degraded - message: "The Rollout \"basic\" is invalid: spec.strategy.strategy: Required value: Rollout has missing field '.spec.strategy.canary or .spec.strategy.blueGreen'" - inputPath: testdata/invalid_spec_spotdeployment.yaml \ No newline at end of file diff --git a/pkg/resource_customizations/spot.io/SpotDeployment/testdata/degraded_spotdeployment.yaml b/pkg/resource_customizations/spot.io/SpotDeployment/testdata/degraded_spotdeployment.yaml deleted file mode 100644 index 9a79343..0000000 --- a/pkg/resource_customizations/spot.io/SpotDeployment/testdata/degraded_spotdeployment.yaml +++ /dev/null @@ -1,53 +0,0 @@ -apiVersion: spot.io/v1beta1 -kind: SpotDeployment -metadata: - name: canary-demo - namespace: default -spec: - replicas: 5 - revisionHistoryLimit: 3 - selector: - matchLabels: - app: canary-demo - template: - metadata: - creationTimestamp: null - labels: - app: canary-demo - spec: - containers: - - image: nginx:1.21 - imagePullPolicy: Always - name: canary-demo - ports: - - containerPort: 8080 - name: http - protocol: TCP - resources: - requests: - cpu: 5m - memory: 32Mi -status: - availableReplicas: 5 - conditions: - - lastTransitionTime: "2019-11-03T01:32:46Z" - lastUpdateTime: "2019-11-03T01:32:46Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - - lastTransitionTime: "2019-11-05T18:20:12Z" - lastUpdateTime: "2019-11-05T18:20:12Z" - message: Rollout is aborted - reason: RolloutAborted - status: "False" - type: Progressing - observedGeneration: 58b949649c - readyReplicas: 5 - replicas: 5 - selector: app=canary-demo - liveVersionDate: "2022-07-25T08:57:57.000Z" - liveVersionImages: - nginx: nginx:1.20 - phase: Degraded - revision: "52" \ No newline at end of file diff --git a/pkg/resource_customizations/spot.io/SpotDeployment/testdata/healthy_spotdeployment.yaml b/pkg/resource_customizations/spot.io/SpotDeployment/testdata/healthy_spotdeployment.yaml deleted file mode 100644 index 175b698..0000000 --- a/pkg/resource_customizations/spot.io/SpotDeployment/testdata/healthy_spotdeployment.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: spot.io/v1beta1 -kind: SpotDeployment -metadata: - clusterName: '' - creationTimestamp: '2019-05-01T21:55:30Z' - generation: 1 - labels: - app.kubernetes.io/instance: guestbook-canary - ksonnet.io/component: guestbook-ui - name: guestbook-canary - namespace: default - resourceVersion: '955764' - uid: d6105ccd-6c5b-11e9-b8d7-025000000001 -spec: - minReadySeconds: 10 - replicas: 5 - selector: - matchLabels: - app: guestbook-canary - template: - metadata: - creationTimestamp: null - labels: - app: guestbook-canary - spec: - containers: - - image: 'gcr.io/heptio-images/ks-guestbook-demo:0.1' - name: guestbook-canary - ports: - - containerPort: 80 - resources: {} -status: - conditions: - - lastTransitionTime: '2019-05-01T21:55:30Z' - lastUpdateTime: '2019-05-01T21:55:58Z' - message: ReplicaSet "guestbook-canary-84ccfddd66" has successfully progressed. - reason: NewReplicaSetAvailable - status: 'True' - type: Progressing - - lastTransitionTime: '2019-05-01T21:55:58Z' - lastUpdateTime: '2019-05-01T21:55:58Z' - message: Rollout has minimum availability - reason: AvailableReason - status: 'True' - type: Available - observedGeneration: c45557fd9 - readyReplicas: 5 - replicas: 5 - selector: app=guestbook-canary - liveVersionDate: "2022-07-14T07:56:27.000Z" - liveVersionImages: - rollouts-demo: gcr.io/heptio-images/ks-guestbook-demo:0.1 - phase: Healthy - revision: "9" \ No newline at end of file diff --git a/pkg/resource_customizations/spot.io/SpotDeployment/testdata/invalid_spec_spotdeployment.yaml b/pkg/resource_customizations/spot.io/SpotDeployment/testdata/invalid_spec_spotdeployment.yaml deleted file mode 100644 index f515c9e..0000000 --- a/pkg/resource_customizations/spot.io/SpotDeployment/testdata/invalid_spec_spotdeployment.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: spot.io/v1beta1 -kind: SpotDeployment -metadata: - creationTimestamp: "2020-11-13T00:22:49Z" - generation: 3 - name: basic - namespace: argocd-e2e - resourceVersion: "181746" - uid: 5b0926f3-30b7-4727-a76e-46c0d2617906 -spec: - replicas: 1 - selector: - matchLabels: - app: basic - template: - metadata: - creationTimestamp: null - labels: - app: basic - spec: - containers: - - image: nginx:1.19-alpine - name: basic - resources: - requests: - cpu: 1m - memory: 16Mi -status: - availableReplicas: 1 - conditions: - - lastTransitionTime: "2020-11-13T00:22:48Z" - lastUpdateTime: "2020-11-13T00:22:50Z" - message: ReplicaSet "basic-754cb84d5" has successfully progressed. - reason: NewReplicaSetAvailable - status: "True" - type: Progressing - - lastTransitionTime: "2020-11-13T00:22:50Z" - lastUpdateTime: "2020-11-13T00:22:50Z" - message: Rollout has minimum availability - reason: AvailableReason - status: "True" - type: Available - - lastTransitionTime: "2020-11-13T00:40:30Z" - lastUpdateTime: "2020-11-13T00:40:30Z" - message: 'The Rollout "basic" is invalid: spec.strategy.strategy: Required value: - Rollout has missing field ''.spec.strategy.canary or .spec.strategy.blueGreen''' - reason: InvalidSpec - status: "True" - type: InvalidSpec - observedGeneration: "3" - readyReplicas: 1 - replicas: 1 - selector: app=basic - phase: Degraded diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/health.lua b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/health_test.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/dependency_not_found.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/dependency_not_found.yaml deleted file mode 100644 index 473c408..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLDatabase -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/dependency_not_ready.yaml deleted file mode 100644 index 7b232b8..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLDatabase -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/up_to_date.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/up_to_date.yaml deleted file mode 100644 index 851787c..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLDatabase -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/update_failed.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/update_failed.yaml deleted file mode 100644 index 094adba..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLDatabase -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/update_in_progress.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/update_in_progress.yaml deleted file mode 100644 index aa9c1b8..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLDatabase/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLDatabase -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/health.lua b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/health_test.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/dependency_not_found.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/dependency_not_found.yaml deleted file mode 100644 index 7e5c48b..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLInstance -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/dependency_not_ready.yaml deleted file mode 100644 index c8d7cd7..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLInstance -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/up_to_date.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/up_to_date.yaml deleted file mode 100644 index 6e3f5dd..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLInstance -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/update_failed.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/update_failed.yaml deleted file mode 100644 index 58a1ab0..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLInstance -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/update_in_progress.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/update_in_progress.yaml deleted file mode 100644 index 501d5ee..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLInstance/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLInstance -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/health_test.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/dependency_not_found.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/dependency_not_found.yaml deleted file mode 100644 index eaceeca..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLUser -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/dependency_not_ready.yaml deleted file mode 100644 index 4eb6724..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLUser -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/up_to_date.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/up_to_date.yaml deleted file mode 100644 index 96bfc04..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLUser -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/update_failed.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/update_failed.yaml deleted file mode 100644 index b80f8c6..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLUser -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/update_in_progress.yaml b/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/update_in_progress.yaml deleted file mode 100644 index ffa6af0..0000000 --- a/pkg/resource_customizations/sql.cnrm.cloud.google.com/SQLUser/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: sql.cnrm.cloud.google.com/v1beta1 -kind: SQLUser -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready \ No newline at end of file diff --git a/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/health.lua b/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/health.lua deleted file mode 100644 index 9a213cd..0000000 --- a/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/health.lua +++ /dev/null @@ -1,20 +0,0 @@ -hs = { - status = "Progressing", - message = "Waiting for stack to be installed" -} -if obj.status ~= nil then - if obj.status.conditionedStatus ~= nil then - if obj.status.conditionedStatus.conditions ~= nil then - for i, condition in ipairs(obj.status.conditionedStatus.conditions) do - if condition.type == "Ready" then - hs.message = condition.reason - if condition.status == "True" then - hs.status = "Healthy" - return hs - end - end - end - end - end -end -return hs diff --git a/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/health_test.yaml b/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/health_test.yaml deleted file mode 100644 index c32bc8f..0000000 --- a/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: Waiting for stack to be installed - inputPath: testdata/wait_stack.yaml -- healthStatus: - status: Progressing - message: 'Resource is being created' - inputPath: testdata/being_created_stack.yaml -- healthStatus: - status: Healthy - message: 'Resource is available for use' - inputPath: testdata/installed_stack.yaml diff --git a/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/testdata/being_created_stack.yaml b/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/testdata/being_created_stack.yaml deleted file mode 100644 index 55ff238..0000000 --- a/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/testdata/being_created_stack.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: stacks.crossplane.io/v1alpha1 -kind: ClusterStackInstall -metadata: - creationTimestamp: "2020-05-13T09:35:26Z" - finalizers: - - finalizer.stackinstall.crossplane.io - generation: 1 - labels: - argocd.argoproj.io/instance: crossplane-cloudscale - name: stack-cloudscale - name: stack-cloudscale - namespace: syn-crossplane - resourceVersion: "20004" - selfLink: /apis/stacks.crossplane.io/v1alpha1/namespaces/syn-crossplane/clusterstackinstalls/stack-cloudscale - uid: cce4dfb5-185f-421d-be97-338408e0c712 -spec: - package: docker.io/vshn/stack-cloudscale:v0.0.2@sha256:8a9a94c3ef557da951d5c7f5bb0286a2f36c79f7ece499f61a8807383caed59b -status: - conditionedStatus: - conditions: - - lastTransitionTime: "2020-05-13T09:35:26Z" - reason: Resource is being created - status: "False" - type: Ready - - lastTransitionTime: "2020-05-13T09:35:26Z" - reason: Successfully reconciled resource - status: "True" - type: Synced - installJob: - apiVersion: batch/v1 - kind: Job - name: stack-cloudscale - namespace: syn-crossplane - uid: e9c2d5d5-41b1-4b11-8193-e5029c37cc52 diff --git a/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/testdata/installed_stack.yaml b/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/testdata/installed_stack.yaml deleted file mode 100644 index 86d9262..0000000 --- a/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/testdata/installed_stack.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: stacks.crossplane.io/v1alpha1 -kind: ClusterStackInstall -metadata: - creationTimestamp: "2020-05-13T09:35:26Z" - finalizers: - - finalizer.stackinstall.crossplane.io - generation: 1 - labels: - argocd.argoproj.io/instance: crossplane-cloudscale - name: stack-cloudscale - name: stack-cloudscale - namespace: syn-crossplane - resourceVersion: "20136" - selfLink: /apis/stacks.crossplane.io/v1alpha1/namespaces/syn-crossplane/clusterstackinstalls/stack-cloudscale - uid: cce4dfb5-185f-421d-be97-338408e0c712 -spec: - package: docker.io/vshn/stack-cloudscale:v0.0.2@sha256:8a9a94c3ef557da951d5c7f5bb0286a2f36c79f7ece499f61a8807383caed59b -status: - conditionedStatus: - conditions: - - lastTransitionTime: "2020-05-13T09:35:48Z" - reason: Resource is available for use - status: "True" - type: Ready - - lastTransitionTime: "2020-05-13T09:35:26Z" - reason: Successfully reconciled resource - status: "True" - type: Synced - installJob: - apiVersion: batch/v1 - kind: Job - name: stack-cloudscale - namespace: syn-crossplane - uid: e9c2d5d5-41b1-4b11-8193-e5029c37cc52 - stackRecord: - apiVersion: stacks.crossplane.io/v1alpha1 - kind: Stack - name: stack-cloudscale - namespace: syn-crossplane - uid: abccf273-2ec1-45a1-9738-af7b6aa39b76 diff --git a/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/testdata/wait_stack.yaml b/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/testdata/wait_stack.yaml deleted file mode 100644 index 5be2da7..0000000 --- a/pkg/resource_customizations/stacks.crossplane.io/ClusterStackInstall/testdata/wait_stack.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: stacks.crossplane.io/v1alpha1 -kind: ClusterStackInstall -metadata: - creationTimestamp: "2020-05-13T09:35:26Z" - finalizers: - - finalizer.stackinstall.crossplane.io - generation: 1 - labels: - argocd.argoproj.io/instance: crossplane-cloudscale - name: stack-cloudscale - name: stack-cloudscale - namespace: syn-crossplane - resourceVersion: "19999" - selfLink: /apis/stacks.crossplane.io/v1alpha1/namespaces/syn-crossplane/clusterstackinstalls/stack-cloudscale - uid: cce4dfb5-185f-421d-be97-338408e0c712 -spec: - package: docker.io/vshn/stack-cloudscale:v0.0.2@sha256:8a9a94c3ef557da951d5c7f5bb0286a2f36c79f7ece499f61a8807383caed59b diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/health.lua b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/health_test.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/dependency_not_found.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/dependency_not_found.yaml deleted file mode 100644 index a0e2c1f..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageBucket -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/dependency_not_ready.yaml deleted file mode 100644 index c478ae0..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageBucket -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/up_to_date.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/up_to_date.yaml deleted file mode 100644 index 514048e..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageBucket -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/update_failed.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/update_failed.yaml deleted file mode 100644 index 3662389..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageBucket -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/update_in_progress.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/update_in_progress.yaml deleted file mode 100644 index 58f68bb..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucket/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageBucket -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/health.lua b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/health_test.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/dependency_not_found.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/dependency_not_found.yaml deleted file mode 100644 index 52404ca..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageBucketAccessControl -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/dependency_not_ready.yaml deleted file mode 100644 index c094801..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageBucketAccessControl -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/up_to_date.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/up_to_date.yaml deleted file mode 100644 index b7f45aa..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageBucketAccessControl -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/update_failed.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/update_failed.yaml deleted file mode 100644 index 190b92c..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageBucketAccessControl -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/update_in_progress.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/update_in_progress.yaml deleted file mode 100644 index 36a7692..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageBucketAccessControl/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageBucketAccessControl -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/health.lua b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/health.lua deleted file mode 100644 index 63ce5d1..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/health.lua +++ /dev/null @@ -1,39 +0,0 @@ -hs = { - status = "Progressing", - message = "Update in progress" -} -if obj.status ~= nil then - if obj.status.conditions ~= nil then - for i, condition in ipairs(obj.status.conditions) do - - -- Up To Date - if condition.reason == "UpToDate" and condition.status == "True" then - hs.status = "Healthy" - hs.message = condition.message - return hs - end - - -- Update Failed - if condition.reason == "UpdateFailed" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Found - if condition.reason == "DependencyNotFound" then - hs.status = "Degraded" - hs.message = condition.message - return hs - end - - -- Dependency Not Ready - if condition.reason == "DependencyNotReady" then - hs.status = "Suspended" - hs.message = condition.message - return hs - end - end - end -end -return hs \ No newline at end of file diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/health_test.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/health_test.yaml deleted file mode 100644 index 8354cfb..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/health_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Dependency not found" - inputPath: testdata/dependency_not_found.yaml -- healthStatus: - status: Suspended - message: "Dependency not ready" - inputPath: testdata/dependency_not_ready.yaml -- healthStatus: - status: Healthy - message: "The resource is up to date" - inputPath: testdata/up_to_date.yaml -- healthStatus: - status: Degraded - message: "Update failed" - inputPath: testdata/update_failed.yaml -- healthStatus: - status: Progressing - message: "Update in progress" - inputPath: testdata/update_in_progress.yaml diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/dependency_not_found.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/dependency_not_found.yaml deleted file mode 100644 index 283d13d..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/dependency_not_found.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageDefaultObjectAccessControl -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not found - reason: DependencyNotFound - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/dependency_not_ready.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/dependency_not_ready.yaml deleted file mode 100644 index 224c2fc..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/dependency_not_ready.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageDefaultObjectAccessControl -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Dependency not ready - reason: DependencyNotReady - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/up_to_date.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/up_to_date.yaml deleted file mode 100644 index 1f1f998..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/up_to_date.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageDefaultObjectAccessControl -status: - conditions: - - lastTransitionTime: '2022-05-09T08:49:18Z' - message: The resource is up to date - reason: UpToDate - status: 'True' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/update_failed.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/update_failed.yaml deleted file mode 100644 index 493253f..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/update_failed.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageDefaultObjectAccessControl -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update failed - reason: UpdateFailed - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/update_in_progress.yaml b/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/update_in_progress.yaml deleted file mode 100644 index f001e9c..0000000 --- a/pkg/resource_customizations/storage.cnrm.cloud.google.com/StorageDefaultObjectAccessControl/testdata/update_in_progress.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: storage.cnrm.cloud.google.com/v1beta1 -kind: StorageDefaultObjectAccessControl -status: - conditions: - - lastTransitionTime: '2022-07-01T12:56:21Z' - message: Update in progress - reason: Updating - status: 'False' - type: Ready diff --git a/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/health.lua b/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/health.lua deleted file mode 100644 index 8f8b0ca..0000000 --- a/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/health.lua +++ /dev/null @@ -1,16 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.phase == "Bound" and obj.status.lastOperationStatus == "Success" then - hs.status = "Healthy" - hs.message = obj.status.message - return hs - end - if obj.status.lastOperationStatus == "Failed" then - hs.status = "Degraded" - hs.message = obj.status.message - return hs - end -end -hs.status = "Progressing" -hs.message = "Waiting for backend creation" -return hs diff --git a/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/health_test.yaml b/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/health_test.yaml deleted file mode 100644 index d7cbc7f..0000000 --- a/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Failed to create backend: backend tbc-ontap-nas already exists" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Progressing - message: "Waiting for backend creation" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Healthy - message: "Backend 'tbc-ontap-nas' created" - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/testdata/degraded.yaml b/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/testdata/degraded.yaml deleted file mode 100644 index cfc367d..0000000 --- a/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/testdata/degraded.yaml +++ /dev/null @@ -1,95 +0,0 @@ -apiVersion: trident.netapp.io/v1 -kind: TridentBackendConfig -metadata: - annotations: - creationTimestamp: '2021-06-24T11:36:17Z' - finalizers: - - trident.netapp.io - generation: 1 - labels: - app.kubernetes.io/instance: trident-config - managedFields: - - apiVersion: trident.netapp.io/v1 - fieldsType: FieldsV1 - fieldsV1: - 'f:metadata': - 'f:annotations': - .: {} - 'f:kubectl.kubernetes.io/last-applied-configuration': {} - 'f:labels': - .: {} - 'f:app.kubernetes.io/instance': {} - 'f:spec': - .: {} - 'f:backendName': {} - 'f:credentials': - .: {} - 'f:name': {} - 'f:dataLIF': {} - 'f:defaults': - .: {} - 'f:exportPolicy': {} - 'f:snapshotPolicy': {} - 'f:snapshotReserve': {} - 'f:spaceReserve': {} - 'f:deletionPolicy': {} - 'f:limitVolumeSize': {} - 'f:managementLIF': {} - 'f:nfsMountOptions': {} - 'f:storageDriverName': {} - 'f:storagePrefix': {} - 'f:svm': {} - 'f:version': {} - manager: argocd-application-controller - operation: Update - time: '2021-06-24T11:36:17Z' - - apiVersion: trident.netapp.io/v1 - fieldsType: FieldsV1 - fieldsV1: - 'f:metadata': - 'f:finalizers': - .: {} - 'v:"trident.netapp.io"': {} - 'f:status': - .: {} - 'f:backendInfo': - .: {} - 'f:backendName': {} - 'f:backendUUID': {} - 'f:deletionPolicy': {} - 'f:lastOperationStatus': {} - 'f:message': {} - 'f:phase': {} - manager: trident_orchestrator - operation: Update - time: '2021-06-24T11:36:17Z' - name: backend-tbc-ontap-nas - namespace: trident - resourceVersion: '3430134' - uid: a5714401-d4f4-480d-a317-d85c630afe55 -spec: - backendName: tbc-ontap-nas - credentials: - name: backend-ontap-nas-secret-smv10 - dataLIF: 1.1.1.1 - defaults: - exportPolicy: ep_000 - snapshotPolicy: default - snapshotReserve: '10' - spaceReserve: volume - deletionPolicy: retain - limitVolumeSize: 100Gi - managementLIF: 1.1.1.1 - nfsMountOptions: nfsvers=4 - storageDriverName: ontap-nas - storagePrefix: trident-play01 - svm: svm-play01 - version: 1 -status: - backendInfo: - backendName: '' - backendUUID: '' - deletionPolicy: retain - lastOperationStatus: Failed - message: 'Failed to create backend: backend tbc-ontap-nas already exists' - phase: '' diff --git a/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/testdata/healthy.yaml b/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/testdata/healthy.yaml deleted file mode 100644 index 2f45144..0000000 --- a/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/testdata/healthy.yaml +++ /dev/null @@ -1,94 +0,0 @@ -apiVersion: trident.netapp.io/v1 -kind: TridentBackendConfig -metadata: - creationTimestamp: '2021-06-24T11:30:12Z' - finalizers: - - trident.netapp.io - generation: 1 - labels: - app.kubernetes.io/instance: trident-config - managedFields: - - apiVersion: trident.netapp.io/v1 - fieldsType: FieldsV1 - fieldsV1: - 'f:metadata': - 'f:annotations': - .: {} - 'f:kubectl.kubernetes.io/last-applied-configuration': {} - 'f:labels': - .: {} - 'f:app.kubernetes.io/instance': {} - 'f:spec': - .: {} - 'f:backendName': {} - 'f:credentials': - .: {} - 'f:name': {} - 'f:dataLIF': {} - 'f:defaults': - .: {} - 'f:exportPolicy': {} - 'f:snapshotPolicy': {} - 'f:snapshotReserve': {} - 'f:spaceReserve': {} - 'f:deletionPolicy': {} - 'f:limitVolumeSize': {} - 'f:managementLIF': {} - 'f:nfsMountOptions': {} - 'f:storageDriverName': {} - 'f:storagePrefix': {} - 'f:svm': {} - 'f:version': {} - manager: argocd-application-controller - operation: Update - time: '2021-06-24T11:30:12Z' - - apiVersion: trident.netapp.io/v1 - fieldsType: FieldsV1 - fieldsV1: - 'f:metadata': - 'f:finalizers': - .: {} - 'v:"trident.netapp.io"': {} - 'f:status': - .: {} - 'f:backendInfo': - .: {} - 'f:backendName': {} - 'f:backendUUID': {} - 'f:deletionPolicy': {} - 'f:lastOperationStatus': {} - 'f:message': {} - 'f:phase': {} - manager: trident_orchestrator - operation: Update - time: '2021-06-24T11:30:12Z' - name: backend-tbc-ontap-nas - namespace: trident - resourceVersion: '3429076' - uid: 3de31983-aff9-4adb-a31c-1541d2cd86e6 -spec: - backendName: tbc-ontap-nas - credentials: - name: backend-ontap-nas-secret - dataLIF: 1.1.1.1 - defaults: - exportPolicy: ep_000 - snapshotPolicy: default - snapshotReserve: '10' - spaceReserve: volume - deletionPolicy: retain - limitVolumeSize: 100Gi - managementLIF: 1.1.1.1 - nfsMountOptions: nfsvers=4 - storageDriverName: ontap-nas - storagePrefix: trident-play01 - svm: svm-trident-play - version: 1 -status: - backendInfo: - backendName: tbc-ontap-nas - backendUUID: 00000000-0000-0000-0000-000000000000 - deletionPolicy: retain - lastOperationStatus: Success - message: Backend 'tbc-ontap-nas' created - phase: Bound diff --git a/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/testdata/progressing.yaml b/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/testdata/progressing.yaml deleted file mode 100644 index bd8c60b..0000000 --- a/pkg/resource_customizations/trident.netapp.io/TridentBackendConfig/testdata/progressing.yaml +++ /dev/null @@ -1,91 +0,0 @@ -apiVersion: trident.netapp.io/v1 -kind: TridentBackendConfig -metadata: - creationTimestamp: '2021-06-24T11:30:12Z' - finalizers: - - trident.netapp.io - generation: 1 - labels: - app.kubernetes.io/instance: trident-config - managedFields: - - apiVersion: trident.netapp.io/v1 - fieldsType: FieldsV1 - fieldsV1: - 'f:metadata': - 'f:annotations': - .: {} - 'f:kubectl.kubernetes.io/last-applied-configuration': {} - 'f:labels': - .: {} - 'f:app.kubernetes.io/instance': {} - 'f:spec': - .: {} - 'f:backendName': {} - 'f:credentials': - .: {} - 'f:name': {} - 'f:dataLIF': {} - 'f:defaults': - .: {} - 'f:exportPolicy': {} - 'f:snapshotPolicy': {} - 'f:snapshotReserve': {} - 'f:spaceReserve': {} - 'f:deletionPolicy': {} - 'f:limitVolumeSize': {} - 'f:managementLIF': {} - 'f:nfsMountOptions': {} - 'f:storageDriverName': {} - 'f:storagePrefix': {} - 'f:svm': {} - 'f:version': {} - manager: argocd-application-controller - operation: Update - time: '2021-06-24T11:30:12Z' - - apiVersion: trident.netapp.io/v1 - fieldsType: FieldsV1 - fieldsV1: - 'f:metadata': - 'f:finalizers': - .: {} - 'v:"trident.netapp.io"': {} - 'f:status': - .: {} - 'f:backendInfo': - .: {} - 'f:backendName': {} - 'f:backendUUID': {} - 'f:deletionPolicy': {} - 'f:lastOperationStatus': {} - 'f:message': {} - 'f:phase': {} - manager: trident_orchestrator - operation: Update - time: '2021-06-24T11:30:12Z' - name: backend-tbc-ontap-nas - namespace: trident - resourceVersion: '3429076' - uid: 3de31983-aff9-4adb-a31c-1541d2cd86e6 -spec: - backendName: tbc-ontap-nas - credentials: - name: backend-ontap-nas-secret - dataLIF: 1.1.1.1 - defaults: - exportPolicy: ep_000 - snapshotPolicy: default - snapshotReserve: '10' - spaceReserve: volume - deletionPolicy: retain - limitVolumeSize: 100Gi - managementLIF: 1.1.1.1 - nfsMountOptions: nfsvers=4 - storageDriverName: ontap-nas - storagePrefix: trident-play01 - svm: svm-trident-play - version: 1 -status: - deletionPolicy: retain - lastOperationStatus: Progressing - message: Creating 'tbc-ontap-nas' backend - phase: Bound diff --git a/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/health.lua b/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/health.lua deleted file mode 100644 index 4ceecef..0000000 --- a/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/health.lua +++ /dev/null @@ -1,16 +0,0 @@ -hs = {} -if obj.status ~= nil then - if obj.status.status == "Installed" then - hs.status = "Healthy" - hs.message = obj.status.message - return hs - end - if obj.status.status == "Failed" or obj.status.status == "Error" then - hs.status = "Degraded" - hs.message = obj.status.message - return hs - end -end -hs.status = "Progressing" -hs.message = "Waiting for trident installation" -return hs diff --git a/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/health_test.yaml b/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/health_test.yaml deleted file mode 100644 index 86ee88f..0000000 --- a/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/health_test.yaml +++ /dev/null @@ -1,13 +0,0 @@ -tests: -- healthStatus: - status: Degraded - message: "Trident is bound to another CR 'trident'" - inputPath: testdata/degraded.yaml -- healthStatus: - status: Progressing - message: "Waiting for trident installation" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Healthy - message: "Trident installed" - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/testdata/degraded.yaml b/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/testdata/degraded.yaml deleted file mode 100644 index deb2058..0000000 --- a/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/testdata/degraded.yaml +++ /dev/null @@ -1,91 +0,0 @@ -apiVersion: trident.netapp.io/v1 -kind: TridentOrchestrator -metadata: - creationTimestamp: '2021-06-24T11:27:54Z' - generation: 1 - labels: - app.kubernetes.io/instance: trident-operator - managedFields: - - apiVersion: trident.netapp.io/v1 - fieldsType: FieldsV1 - fieldsV1: - 'f:metadata': - 'f:annotations': - .: {} - 'f:kubectl.kubernetes.io/last-applied-configuration': {} - 'f:labels': - .: {} - 'f:app.kubernetes.io/instance': {} - 'f:spec': - .: {} - 'f:autosupportImage': {} - 'f:debug': {} - 'f:logFormat': {} - 'f:namespace': {} - 'f:tridentImage': {} - manager: argocd-application-controller - operation: Update - time: '2021-06-24T11:27:54Z' - - apiVersion: trident.netapp.io/v1 - fieldsType: FieldsV1 - fieldsV1: - 'f:status': - .: {} - 'f:currentInstallationParams': - .: {} - 'f:IPv6': {} - 'f:autosupportHostname': {} - 'f:autosupportImage': {} - 'f:autosupportProxy': {} - 'f:autosupportSerialNumber': {} - 'f:debug': {} - 'f:enableNodePrep': {} - 'f:imagePullSecrets': {} - 'f:imageRegistry': {} - 'f:k8sTimeout': {} - 'f:kubeletDir': {} - 'f:logFormat': {} - 'f:silenceAutosupport': {} - 'f:tridentImage': {} - 'f:message': {} - 'f:namespace': {} - 'f:status': {} - 'f:version': {} - manager: trident-operator - operation: Update - time: '2021-06-24T11:27:55Z' - name: trident - resourceVersion: '3428714' - uid: 4353204f-59f7-41be-a853-dcf114011222 -spec: - IPv6: false - autosupportImage: 'netapp/trident-autosupport:21.01' - autosupportProxy: null - debug: false - enableNodePrep: false - k8sTimeout: 0 - kubeletDir: null - logFormat: text - namespace: trident - silenceAutosupport: false - tridentImage: 'netapp/trident:21.04.0' -status: - currentInstallationParams: - IPv6: '' - autosupportHostname: '' - autosupportImage: '' - autosupportProxy: '' - autosupportSerialNumber: '' - debug: '' - enableNodePrep: '' - imagePullSecrets: null - imageRegistry: '' - k8sTimeout: '' - kubeletDir: '' - logFormat: '' - silenceAutosupport: '' - tridentImage: '' - message: "Trident is bound to another CR 'trident'" - namespace: trident - status: Error - version: '' diff --git a/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/testdata/healthy.yaml b/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/testdata/healthy.yaml deleted file mode 100644 index 211c7a2..0000000 --- a/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/testdata/healthy.yaml +++ /dev/null @@ -1,91 +0,0 @@ -apiVersion: trident.netapp.io/v1 -kind: TridentOrchestrator -metadata: - creationTimestamp: '2021-06-24T10:51:34Z' - generation: 1 - labels: - app.kubernetes.io/instance: trident-operator - managedFields: - - apiVersion: trident.netapp.io/v1 - fieldsType: FieldsV1 - fieldsV1: - 'f:metadata': - 'f:annotations': - .: {} - 'f:kubectl.kubernetes.io/last-applied-configuration': {} - 'f:labels': - .: {} - 'f:app.kubernetes.io/instance': {} - 'f:spec': - .: {} - 'f:autosupportImage': {} - 'f:debug': {} - 'f:logFormat': {} - 'f:namespace': {} - 'f:tridentImage': {} - manager: argocd-application-controller - operation: Update - time: '2021-06-24T10:51:34Z' - - apiVersion: trident.netapp.io/v1 - fieldsType: FieldsV1 - fieldsV1: - 'f:status': - .: {} - 'f:currentInstallationParams': - .: {} - 'f:IPv6': {} - 'f:autosupportHostname': {} - 'f:autosupportImage': {} - 'f:autosupportProxy': {} - 'f:autosupportSerialNumber': {} - 'f:debug': {} - 'f:enableNodePrep': {} - 'f:imagePullSecrets': {} - 'f:imageRegistry': {} - 'f:k8sTimeout': {} - 'f:kubeletDir': {} - 'f:logFormat': {} - 'f:silenceAutosupport': {} - 'f:tridentImage': {} - 'f:message': {} - 'f:namespace': {} - 'f:status': {} - 'f:version': {} - manager: trident-operator - operation: Update - time: '2021-06-24T10:51:35Z' - name: trident - resourceVersion: '3424514' - uid: eb768637-6b11-4e70-8646-43c2117bc202 -spec: - IPv6: false - autosupportImage: 'netapp/trident-autosupport:21.01' - autosupportProxy: null - debug: false - enableNodePrep: false - k8sTimeout: 0 - kubeletDir: null - logFormat: text - namespace: trident - silenceAutosupport: false - tridentImage: 'netapp/trident:21.04.0' -status: - currentInstallationParams: - IPv6: 'false' - autosupportHostname: '' - autosupportImage: 'netapp/trident-autosupport:21.01' - autosupportProxy: '' - autosupportSerialNumber: '' - debug: 'false' - enableNodePrep: 'false' - imagePullSecrets: [] - imageRegistry: '' - k8sTimeout: '30' - kubeletDir: /var/lib/kubelet - logFormat: text - silenceAutosupport: 'false' - tridentImage: 'netapp/trident:21.04.0' - message: Trident installed - namespace: trident - status: Installed - version: v21.04.0 diff --git a/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/testdata/progressing.yaml b/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/testdata/progressing.yaml deleted file mode 100644 index 6647b8d..0000000 --- a/pkg/resource_customizations/trident.netapp.io/TridentOrchestrator/testdata/progressing.yaml +++ /dev/null @@ -1,91 +0,0 @@ -apiVersion: trident.netapp.io/v1 -kind: TridentOrchestrator -metadata: - creationTimestamp: '2021-06-24T11:27:54Z' - generation: 1 - labels: - app.kubernetes.io/instance: trident-operator - managedFields: - - apiVersion: trident.netapp.io/v1 - fieldsType: FieldsV1 - fieldsV1: - 'f:metadata': - 'f:annotations': - .: {} - 'f:kubectl.kubernetes.io/last-applied-configuration': {} - 'f:labels': - .: {} - 'f:app.kubernetes.io/instance': {} - 'f:spec': - .: {} - 'f:autosupportImage': {} - 'f:debug': {} - 'f:logFormat': {} - 'f:namespace': {} - 'f:tridentImage': {} - manager: argocd-application-controller - operation: Update - time: '2021-06-24T11:27:54Z' - - apiVersion: trident.netapp.io/v1 - fieldsType: FieldsV1 - fieldsV1: - 'f:status': - .: {} - 'f:currentInstallationParams': - .: {} - 'f:IPv6': {} - 'f:autosupportHostname': {} - 'f:autosupportImage': {} - 'f:autosupportProxy': {} - 'f:autosupportSerialNumber': {} - 'f:debug': {} - 'f:enableNodePrep': {} - 'f:imagePullSecrets': {} - 'f:imageRegistry': {} - 'f:k8sTimeout': {} - 'f:kubeletDir': {} - 'f:logFormat': {} - 'f:silenceAutosupport': {} - 'f:tridentImage': {} - 'f:message': {} - 'f:namespace': {} - 'f:status': {} - 'f:version': {} - manager: trident-operator - operation: Update - time: '2021-06-24T11:27:55Z' - name: trident - resourceVersion: '3428714' - uid: 4353204f-59f7-41be-a853-dcf114011222 -spec: - IPv6: false - autosupportImage: 'netapp/trident-autosupport:21.01' - autosupportProxy: null - debug: false - enableNodePrep: false - k8sTimeout: 0 - kubeletDir: null - logFormat: text - namespace: trident - silenceAutosupport: false - tridentImage: 'netapp/trident:21.04.0' -status: - currentInstallationParams: - IPv6: '' - autosupportHostname: '' - autosupportImage: '' - autosupportProxy: '' - autosupportSerialNumber: '' - debug: '' - enableNodePrep: '' - imagePullSecrets: null - imageRegistry: '' - k8sTimeout: '' - kubeletDir: '' - logFormat: '' - silenceAutosupport: '' - tridentImage: '' - message: Installing Trident - namespace: trident - status: Installing - version: '' diff --git a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/health.lua b/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/health.lua deleted file mode 100644 index 5098ae9..0000000 --- a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/health.lua +++ /dev/null @@ -1,37 +0,0 @@ -health_status = {} -if obj.status == nil then - health_status.status = "Progressing" - health_status.message = "Current resource status is insufficient" - return health_status -end - -if obj.spec.clusters == nil or #obj.spec.clusters == 0 then - health_status.status = "Progressing" - health_status.message = "Current resource status is insufficient" - return health_status -end - -if obj.status.aggregatedStatus == nil or #obj.spec.clusters ~= #obj.status.aggregatedStatus then - health_status.status = "Progressing" - health_status.message = "Current resource status is insufficient" - return health_status -end - -for i, status in ipairs(obj.status.aggregatedStatus) do - if status.health == "Unhealthy" then - health_status.status = "Degraded" - health_status.message = "Current resource status is unhealthy" - return health_status - end - - if status.health == "Unknown" then - if status.applied ~= true then - health_status.status = "Degraded" - health_status.message = "Current resource status is unhealthy" - return health_status - end - end -end - -health_status.status = "Healthy" -return health_status diff --git a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/health_test.yaml b/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/health_test.yaml deleted file mode 100644 index 3ebee0e..0000000 --- a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/health_test.yaml +++ /dev/null @@ -1,31 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: "Current resource status is insufficient" - inputPath: testdata/progressing.yaml - - healthStatus: - status: Progressing - message: "Current resource status is insufficient" - inputPath: testdata/progressing_aggregatedStatus.yaml - - healthStatus: - status: Progressing - message: "Current resource status is insufficient" - inputPath: testdata/progressing_cluster.yaml - - healthStatus: - status: Degraded - message: "Current resource status is unhealthy" - inputPath: testdata/degraded_unapplied.yaml - - healthStatus: - status: Degraded - message: "Current resource status is unhealthy" - inputPath: testdata/degraded_unknown.yaml - - healthStatus: - status: Degraded - message: "Current resource status is unhealthy" - inputPath: testdata/degraded_unhealth.yaml - - healthStatus: - status: Healthy - inputPath: testdata/health.yaml - - healthStatus: - status: Healthy - inputPath: testdata/health_unknown.yaml diff --git a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/degraded_unapplied.yaml b/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/degraded_unapplied.yaml deleted file mode 100644 index 94d7370..0000000 --- a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/degraded_unapplied.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ClusterResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 5 - labels: - clusterpropagationpolicy.karmada.io/name: service-testk4j5t - name: test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: test - uid: 039b0d1a-05cb-40b4-b43a-438b0de386af - resourceVersion: "4106772" - uid: 3932ee50-4c2b-4e77-9bfb-45eeb4ec220f -spec: - clusters: - - name: member1 - resource: - apiVersion: v1 - kind: Service - name: service-test - namespace: default - resourceVersion: "3943220" - uid: 9c2b39b9-4607-4795-87db-1a54680939d0 -status: - aggregatedStatus: - - applied: false - clusterName: member1 - health: Unhealthy - conditions: - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: All works have been successfully applied - reason: FullyAppliedSuccess - status: "True" - type: FullyApplied - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: Binding has been scheduled - reason: BindingScheduled - status: "True" - type: Scheduled - schedulerObservedGeneration: 2 diff --git a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/degraded_unhealth.yaml b/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/degraded_unhealth.yaml deleted file mode 100644 index 6c39b88..0000000 --- a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/degraded_unhealth.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ClusterResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 5 - labels: - clusterpropagationpolicy.karmada.io/name: service-testk4j5t - name: test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: test - uid: 039b0d1a-05cb-40b4-b43a-438b0de386af - resourceVersion: "4106772" - uid: 3932ee50-4c2b-4e77-9bfb-45eeb4ec220f -spec: - clusters: - - name: member1 - resource: - apiVersion: v1 - kind: Service - name: service-test - namespace: default - resourceVersion: "3943220" - uid: 9c2b39b9-4607-4795-87db-1a54680939d0 -status: - aggregatedStatus: - - applied: true - clusterName: member1 - health: Unhealthy - conditions: - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: All works have been successfully applied - reason: FullyAppliedSuccess - status: "True" - type: FullyApplied - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: Binding has been scheduled - reason: BindingScheduled - status: "True" - type: Scheduled - schedulerObservedGeneration: 2 diff --git a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/degraded_unknown.yaml b/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/degraded_unknown.yaml deleted file mode 100644 index b87e39e..0000000 --- a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/degraded_unknown.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ClusterResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 5 - labels: - clusterpropagationpolicy.karmada.io/name: service-testk4j5t - name: test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: test - uid: 039b0d1a-05cb-40b4-b43a-438b0de386af - resourceVersion: "4106772" - uid: 3932ee50-4c2b-4e77-9bfb-45eeb4ec220f -spec: - clusters: - - name: member1 - resource: - apiVersion: v1 - kind: Service - name: service-test - namespace: default - resourceVersion: "3943220" - uid: 9c2b39b9-4607-4795-87db-1a54680939d0 -status: - aggregatedStatus: - - applied: false - clusterName: member1 - health: Unknown - conditions: - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: All works have been successfully applied - reason: FullyAppliedSuccess - status: "True" - type: FullyApplied - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: Binding has been scheduled - reason: BindingScheduled - status: "True" - type: Scheduled - schedulerObservedGeneration: 2 diff --git a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/health.yaml b/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/health.yaml deleted file mode 100644 index 9e8a87d..0000000 --- a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/health.yaml +++ /dev/null @@ -1,83 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ClusterResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 5 - labels: - clusterpropagationpolicy.karmada.io/name: service-testk4j5t - name: test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: test - uid: 039b0d1a-05cb-40b4-b43a-438b0de386af - resourceVersion: "4106772" - uid: 3932ee50-4c2b-4e77-9bfb-45eeb4ec220f -spec: - clusters: - - name: member1 - - name: member2 - - name: member3 - replicaRequirements: - nodeClaim: - tolerations: - - effect: NoExecute - key: node.kubernetes.io/not-ready - operator: Exists - tolerationSeconds: 300 - - effect: NoExecute - key: node.kubernetes.io/unreachable - operator: Exists - tolerationSeconds: 300 - resourceRequest: - cpu: 250m - memory: 512Mi - replicas: 1 - resource: - apiVersion: apps/v1 - kind: Deployment - name: test1 - namespace: default - resourceVersion: "3663243" - uid: 58ccb955-4da6-4167-9b65-dddadcef569e -status: - aggregatedStatus: - - applied: true - clusterName: member1 - health: Healthy - status: - availableReplicas: 1 - readyReplicas: 1 - replicas: 1 - updatedReplicas: 1 - - applied: true - clusterName: member2 - health: Healthy - status: - replicas: 1 - unavailableReplicas: 1 - updatedReplicas: 1 - - applied: true - clusterName: member3 - health: Healthy - status: - availableReplicas: 1 - readyReplicas: 1 - replicas: 1 - updatedReplicas: 1 - conditions: - - lastTransitionTime: "2022-11-02T02:49:06Z" - message: All works have been successfully applied - reason: FullyAppliedSuccess - status: "True" - type: FullyApplied - - lastTransitionTime: "2022-10-28T09:56:31Z" - message: Binding has been scheduled - reason: BindingScheduled - status: "True" - type: Scheduled - schedulerObservedGeneration: 7 diff --git a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/health_unknown.yaml b/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/health_unknown.yaml deleted file mode 100644 index 4a356a9..0000000 --- a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/health_unknown.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ClusterResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 5 - labels: - clusterpropagationpolicy.karmada.io/name: service-testk4j5t - name: test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: test - uid: 039b0d1a-05cb-40b4-b43a-438b0de386af - resourceVersion: "4106772" - uid: 3932ee50-4c2b-4e77-9bfb-45eeb4ec220f -spec: - clusters: - - name: member1 - resource: - apiVersion: v1 - kind: Service - name: service-test - namespace: default - resourceVersion: "3943220" - uid: 9c2b39b9-4607-4795-87db-1a54680939d0 -status: - aggregatedStatus: - - applied: true - clusterName: member1 - health: Unknown - conditions: - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: All works have been successfully applied - reason: FullyAppliedSuccess - status: "True" - type: FullyApplied - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: Binding has been scheduled - reason: BindingScheduled - status: "True" - type: Scheduled - schedulerObservedGeneration: 2 diff --git a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/progressing.yaml b/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/progressing.yaml deleted file mode 100644 index 8d4c5f2..0000000 --- a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/progressing.yaml +++ /dev/null @@ -1,41 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ClusterResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 5 - labels: - clusterpropagationpolicy.karmada.io/name: service-testk4j5t - name: test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: test - uid: 039b0d1a-05cb-40b4-b43a-438b0de386af - resourceVersion: "4106772" - uid: 3932ee50-4c2b-4e77-9bfb-45eeb4ec220f -spec: - resource: - apiVersion: v1 - kind: Service - name: test - namespace: default - resourceVersion: "2605059" - uid: 039b0d1a-05cb-40b4-b43a-438b0de386af -status: - conditions: - - lastTransitionTime: "2022-10-27T07:19:50Z" - message: '0/3 clusters are available: 3 cluster(s) didn''t match the placement - cluster affinity constraint.' - reason: BindingFailedScheduling - status: "False" - type: Scheduled - - lastTransitionTime: "2022-10-27T07:19:52Z" - message: Failed to apply all works, see status.aggregatedStatus for details - reason: FullyAppliedFailed - status: "False" - type: FullyApplied - schedulerObservedGeneration: 4 diff --git a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/progressing_aggregatedStatus.yaml b/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/progressing_aggregatedStatus.yaml deleted file mode 100644 index 5e7e851..0000000 --- a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/progressing_aggregatedStatus.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ClusterResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 5 - labels: - clusterpropagationpolicy.karmada.io/name: service-testk4j5t - name: test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: test - uid: 039b0d1a-05cb-40b4-b43a-438b0de386af - resourceVersion: "4106772" - uid: 3932ee50-4c2b-4e77-9bfb-45eeb4ec220f -spec: - clusters: - - name: member1 - - name: member2 - - name: member3 -status: - aggregatedStatus: - - applied: true - clusterName: member1 - health: Healthy - status: - availableReplicas: 1 - readyReplicas: 1 - replicas: 1 - updatedReplicas: 1 - conditions: - - ansibleResult: - changed: 1 - completion: 2020-06-08T13:41:20.133525 - failures: 0 - ok: 56 - skipped: 82 - lastTransitionTime: "2020-06-04T17:47:31Z" - message: Reconciling - reason: Running - status: "True" - type: Running diff --git a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/progressing_cluster.yaml b/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/progressing_cluster.yaml deleted file mode 100644 index 08d63e3..0000000 --- a/pkg/resource_customizations/work.karmada.io/ClusterResourceBinding/testdata/progressing_cluster.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ClusterResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 5 - labels: - clusterpropagationpolicy.karmada.io/name: service-testk4j5t - name: test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: test - uid: 039b0d1a-05cb-40b4-b43a-438b0de386af - resourceVersion: "4106772" - uid: 3932ee50-4c2b-4e77-9bfb-45eeb4ec220f -spec: - clusters: [] -status: - conditions: - - ansibleResult: - changed: 1 - completion: 2020-06-08T13:41:20.133525 - failures: 0 - ok: 56 - skipped: 82 - lastTransitionTime: "2020-06-04T17:47:31Z" - message: Reconciling - reason: Running - status: "True" - type: Running diff --git a/pkg/resource_customizations/work.karmada.io/ResourceBinding/health.lua b/pkg/resource_customizations/work.karmada.io/ResourceBinding/health.lua deleted file mode 100644 index 5098ae9..0000000 --- a/pkg/resource_customizations/work.karmada.io/ResourceBinding/health.lua +++ /dev/null @@ -1,37 +0,0 @@ -health_status = {} -if obj.status == nil then - health_status.status = "Progressing" - health_status.message = "Current resource status is insufficient" - return health_status -end - -if obj.spec.clusters == nil or #obj.spec.clusters == 0 then - health_status.status = "Progressing" - health_status.message = "Current resource status is insufficient" - return health_status -end - -if obj.status.aggregatedStatus == nil or #obj.spec.clusters ~= #obj.status.aggregatedStatus then - health_status.status = "Progressing" - health_status.message = "Current resource status is insufficient" - return health_status -end - -for i, status in ipairs(obj.status.aggregatedStatus) do - if status.health == "Unhealthy" then - health_status.status = "Degraded" - health_status.message = "Current resource status is unhealthy" - return health_status - end - - if status.health == "Unknown" then - if status.applied ~= true then - health_status.status = "Degraded" - health_status.message = "Current resource status is unhealthy" - return health_status - end - end -end - -health_status.status = "Healthy" -return health_status diff --git a/pkg/resource_customizations/work.karmada.io/ResourceBinding/health_test.yaml b/pkg/resource_customizations/work.karmada.io/ResourceBinding/health_test.yaml deleted file mode 100644 index 3ebee0e..0000000 --- a/pkg/resource_customizations/work.karmada.io/ResourceBinding/health_test.yaml +++ /dev/null @@ -1,31 +0,0 @@ -tests: - - healthStatus: - status: Progressing - message: "Current resource status is insufficient" - inputPath: testdata/progressing.yaml - - healthStatus: - status: Progressing - message: "Current resource status is insufficient" - inputPath: testdata/progressing_aggregatedStatus.yaml - - healthStatus: - status: Progressing - message: "Current resource status is insufficient" - inputPath: testdata/progressing_cluster.yaml - - healthStatus: - status: Degraded - message: "Current resource status is unhealthy" - inputPath: testdata/degraded_unapplied.yaml - - healthStatus: - status: Degraded - message: "Current resource status is unhealthy" - inputPath: testdata/degraded_unknown.yaml - - healthStatus: - status: Degraded - message: "Current resource status is unhealthy" - inputPath: testdata/degraded_unhealth.yaml - - healthStatus: - status: Healthy - inputPath: testdata/health.yaml - - healthStatus: - status: Healthy - inputPath: testdata/health_unknown.yaml diff --git a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/degraded_unapplied.yaml b/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/degraded_unapplied.yaml deleted file mode 100644 index f36b1d3..0000000 --- a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/degraded_unapplied.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 2 - labels: - propagationpolicy.karmada.io/name: service-service-testn7qfx - propagationpolicy.karmada.io/namespace: default - name: service-test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: service-test - uid: 9c2b39b9-4607-4795-87db-1a54680939d0 - resourceVersion: "3943290" - uid: 1459071b-e460-4038-8a5d-d2a4803ad6f1 -spec: - clusters: - - name: member1 - - name: member2 - resource: - apiVersion: v1 - kind: Service - name: service-test - namespace: default - resourceVersion: "3943220" - uid: 9c2b39b9-4607-4795-87db-1a54680939d0 -status: - aggregatedStatus: - - applied: false - clusterName: member1 - health: Unhealthy - - clusterName: member2 - health: Unhealthy - conditions: - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: All works have been successfully applied - reason: FullyAppliedSuccess - status: "True" - type: FullyApplied - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: Binding has been scheduled - reason: BindingScheduled - status: "True" - type: Scheduled - schedulerObservedGeneration: 2 diff --git a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/degraded_unhealth.yaml b/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/degraded_unhealth.yaml deleted file mode 100644 index c410059..0000000 --- a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/degraded_unhealth.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 2 - labels: - propagationpolicy.karmada.io/name: service-service-testn7qfx - propagationpolicy.karmada.io/namespace: default - name: service-test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: service-test - uid: 9c2b39b9-4607-4795-87db-1a54680939d0 - resourceVersion: "3943290" - uid: 1459071b-e460-4038-8a5d-d2a4803ad6f1 -spec: - clusters: - - name: member1 - resource: - apiVersion: v1 - kind: Service - name: service-test - namespace: default - resourceVersion: "3943220" - uid: 9c2b39b9-4607-4795-87db-1a54680939d0 -status: - aggregatedStatus: - - applied: true - clusterName: member1 - health: Unhealthy - conditions: - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: All works have been successfully applied - reason: FullyAppliedSuccess - status: "True" - type: FullyApplied - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: Binding has been scheduled - reason: BindingScheduled - status: "True" - type: Scheduled - schedulerObservedGeneration: 2 diff --git a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/degraded_unknown.yaml b/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/degraded_unknown.yaml deleted file mode 100644 index 6c447fd..0000000 --- a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/degraded_unknown.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 2 - labels: - propagationpolicy.karmada.io/name: service-service-testn7qfx - propagationpolicy.karmada.io/namespace: default - name: service-test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: service-test - uid: 9c2b39b9-4607-4795-87db-1a54680939d0 - resourceVersion: "3943290" - uid: 1459071b-e460-4038-8a5d-d2a4803ad6f1 -spec: - clusters: - - name: member1 - resource: - apiVersion: v1 - kind: Service - name: service-test - namespace: default - resourceVersion: "3943220" - uid: 9c2b39b9-4607-4795-87db-1a54680939d0 -status: - aggregatedStatus: - - applied: false - clusterName: member1 - health: Unknown - conditions: - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: All works have been successfully applied - reason: FullyAppliedSuccess - status: "True" - type: FullyApplied - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: Binding has been scheduled - reason: BindingScheduled - status: "True" - type: Scheduled - schedulerObservedGeneration: 2 diff --git a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/health.yaml b/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/health.yaml deleted file mode 100644 index 428cf4f..0000000 --- a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/health.yaml +++ /dev/null @@ -1,84 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 7 - labels: - propagationpolicy.karmada.io/name: test1-57dcd6489f - propagationpolicy.karmada.io/namespace: default - name: test1-deployment - namespace: default - ownerReferences: - - apiVersion: apps/v1 - blockOwnerDeletion: true - controller: true - kind: Deployment - name: test1 - uid: 58ccb955-4da6-4167-9b65-dddadcef569e - resourceVersion: "3903091" - uid: a46f5454-f8c5-4c9e-9119-3022aa5943b1 -spec: - clusters: - - name: member1 - - name: member2 - - name: member3 - replicaRequirements: - nodeClaim: - tolerations: - - effect: NoExecute - key: node.kubernetes.io/not-ready - operator: Exists - tolerationSeconds: 300 - - effect: NoExecute - key: node.kubernetes.io/unreachable - operator: Exists - tolerationSeconds: 300 - resourceRequest: - cpu: 250m - memory: 512Mi - replicas: 1 - resource: - apiVersion: apps/v1 - kind: Deployment - name: test1 - namespace: default - resourceVersion: "3663243" - uid: 58ccb955-4da6-4167-9b65-dddadcef569e -status: - aggregatedStatus: - - applied: true - clusterName: member1 - health: Healthy - status: - availableReplicas: 1 - readyReplicas: 1 - replicas: 1 - updatedReplicas: 1 - - applied: true - clusterName: member2 - health: Healthy - status: - replicas: 1 - unavailableReplicas: 1 - updatedReplicas: 1 - - applied: true - clusterName: member3 - health: Healthy - status: - availableReplicas: 1 - readyReplicas: 1 - replicas: 1 - updatedReplicas: 1 - conditions: - - lastTransitionTime: "2022-11-02T02:49:06Z" - message: All works have been successfully applied - reason: FullyAppliedSuccess - status: "True" - type: FullyApplied - - lastTransitionTime: "2022-10-28T09:56:31Z" - message: Binding has been scheduled - reason: BindingScheduled - status: "True" - type: Scheduled - schedulerObservedGeneration: 7 diff --git a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/health_unknown.yaml b/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/health_unknown.yaml deleted file mode 100644 index 47d1843..0000000 --- a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/health_unknown.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 2 - labels: - propagationpolicy.karmada.io/name: service-service-testn7qfx - propagationpolicy.karmada.io/namespace: default - name: service-test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: service-test - uid: 9c2b39b9-4607-4795-87db-1a54680939d0 - resourceVersion: "3943290" - uid: 1459071b-e460-4038-8a5d-d2a4803ad6f1 -spec: - clusters: - - name: member1 - resource: - apiVersion: v1 - kind: Service - name: service-test - namespace: default - resourceVersion: "3943220" - uid: 9c2b39b9-4607-4795-87db-1a54680939d0 -status: - aggregatedStatus: - - applied: true - clusterName: member1 - health: Unknown - conditions: - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: All works have been successfully applied - reason: FullyAppliedSuccess - status: "True" - type: FullyApplied - - lastTransitionTime: "2022-11-03T10:56:30Z" - message: Binding has been scheduled - reason: BindingScheduled - status: "True" - type: Scheduled - schedulerObservedGeneration: 2 diff --git a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/progressing.yaml b/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/progressing.yaml deleted file mode 100644 index 5c8d8a3..0000000 --- a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/progressing.yaml +++ /dev/null @@ -1,42 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 5 - labels: - propagationpolicy.karmada.io/name: service-testk4j5t - propagationpolicy.karmada.io/namespace: default - name: test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: test - uid: 039b0d1a-05cb-40b4-b43a-438b0de386af - resourceVersion: "4106772" - uid: 3932ee50-4c2b-4e77-9bfb-45eeb4ec220f -spec: - resource: - apiVersion: v1 - kind: Service - name: test - namespace: default - resourceVersion: "2605059" - uid: 039b0d1a-05cb-40b4-b43a-438b0de386af -status: - conditions: - - lastTransitionTime: "2022-10-27T07:19:50Z" - message: '0/3 clusters are available: 3 cluster(s) didn''t match the placement - cluster affinity constraint.' - reason: BindingFailedScheduling - status: "False" - type: Scheduled - - lastTransitionTime: "2022-10-27T07:19:52Z" - message: Failed to apply all works, see status.aggregatedStatus for details - reason: FullyAppliedFailed - status: "False" - type: FullyApplied - schedulerObservedGeneration: 4 diff --git a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/progressing_aggregatedStatus.yaml b/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/progressing_aggregatedStatus.yaml deleted file mode 100644 index d4ba59c..0000000 --- a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/progressing_aggregatedStatus.yaml +++ /dev/null @@ -1,47 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 5 - labels: - propagationpolicy.karmada.io/name: service-testk4j5t - propagationpolicy.karmada.io/namespace: default - name: test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: test - uid: 039b0d1a-05cb-40b4-b43a-438b0de386af - resourceVersion: "4106772" - uid: 3932ee50-4c2b-4e77-9bfb-45eeb4ec220f -spec: - clusters: - - name: member1 - - name: member2 - - name: member3 -status: - aggregatedStatus: - - applied: true - clusterName: member1 - health: Healthy - status: - availableReplicas: 1 - readyReplicas: 1 - replicas: 1 - updatedReplicas: 1 - conditions: - - ansibleResult: - changed: 1 - completion: 2020-06-08T13:41:20.133525 - failures: 0 - ok: 56 - skipped: 82 - lastTransitionTime: "2020-06-04T17:47:31Z" - message: Reconciling - reason: Running - status: "True" - type: Running diff --git a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/progressing_cluster.yaml b/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/progressing_cluster.yaml deleted file mode 100644 index 0463820..0000000 --- a/pkg/resource_customizations/work.karmada.io/ResourceBinding/testdata/progressing_cluster.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: work.karmada.io/v1alpha2 -kind: ResourceBinding -metadata: - finalizers: - - karmada.io/binding-controller - generation: 5 - labels: - propagationpolicy.karmada.io/name: service-testk4j5t - propagationpolicy.karmada.io/namespace: default - name: test-service - namespace: default - ownerReferences: - - apiVersion: v1 - blockOwnerDeletion: true - controller: true - kind: Service - name: test - uid: 039b0d1a-05cb-40b4-b43a-438b0de386af - resourceVersion: "4106772" - uid: 3932ee50-4c2b-4e77-9bfb-45eeb4ec220f -spec: - clusters: [] -status: - conditions: - - ansibleResult: - changed: 1 - completion: 2020-06-08T13:41:20.133525 - failures: 0 - ok: 56 - skipped: 82 - lastTransitionTime: "2020-06-04T17:47:31Z" - message: Reconciling - reason: Running - status: "True" - type: Running diff --git a/pkg/resource_customizations/zookeeper.pravega.io/ZookeeperCluster/health.lua b/pkg/resource_customizations/zookeeper.pravega.io/ZookeeperCluster/health.lua deleted file mode 100644 index 5228f53..0000000 --- a/pkg/resource_customizations/zookeeper.pravega.io/ZookeeperCluster/health.lua +++ /dev/null @@ -1,11 +0,0 @@ -health_status = {} -if obj.status ~= nil then - if obj.status.readyReplicas ~= 0 and obj.status.readyReplicas == obj.status.replicas then - health_status.status = "Healthy" - health_status.message = "All ZK Nodes have joined the ensemble" - return health_status - end -end -health_status.status = "Progressing" -health_status.message = "Waiting for ZK Nodes to join the ensemble" -return health_status \ No newline at end of file diff --git a/pkg/resource_customizations/zookeeper.pravega.io/ZookeeperCluster/health_test.yaml b/pkg/resource_customizations/zookeeper.pravega.io/ZookeeperCluster/health_test.yaml deleted file mode 100644 index 9ed9cfa..0000000 --- a/pkg/resource_customizations/zookeeper.pravega.io/ZookeeperCluster/health_test.yaml +++ /dev/null @@ -1,9 +0,0 @@ -tests: -- healthStatus: - status: Progressing - message: "Waiting for ZK Nodes to join the ensemble" - inputPath: testdata/progressing.yaml -- healthStatus: - status: Healthy - message: "All ZK Nodes have joined the ensemble" - inputPath: testdata/healthy.yaml diff --git a/pkg/resource_customizations/zookeeper.pravega.io/ZookeeperCluster/testdata/healthy.yaml b/pkg/resource_customizations/zookeeper.pravega.io/ZookeeperCluster/testdata/healthy.yaml deleted file mode 100644 index e771259..0000000 --- a/pkg/resource_customizations/zookeeper.pravega.io/ZookeeperCluster/testdata/healthy.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: zookeeper.pravega.io/v1beta1 -kind: ZookeeperCluster -metadata: - generation: 3 - labels: - argocd.argoproj.io/instance: test-cluster-zookeeper - name: test-cluster-zookeeper - namespace: zookeeper - resourceVersion: "265193" - selfLink: /apis/zookeeper.pravega.io/v1beta1/namespaces/zookeeper/zookeeperclusters/test-cluster-zookeeper - uid: eae42b94-b8ee-4fd7-9d92-30c9a30a4d5a -spec: {} -status: - externalClientEndpoint: N/A - internalClientEndpoint: 10.101.203.230:2181 - members: - ready: - - test-cluster-zookeeper-0 - unready: null - readyReplicas: 1 - replicas: 1 \ No newline at end of file diff --git a/pkg/resource_customizations/zookeeper.pravega.io/ZookeeperCluster/testdata/progressing.yaml b/pkg/resource_customizations/zookeeper.pravega.io/ZookeeperCluster/testdata/progressing.yaml deleted file mode 100644 index 6b734f2..0000000 --- a/pkg/resource_customizations/zookeeper.pravega.io/ZookeeperCluster/testdata/progressing.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: zookeeper.pravega.io/v1beta1 -kind: ZookeeperCluster -metadata: - generation: 3 - labels: - argocd.argoproj.io/instance: test-cluster-zookeeper - name: test-cluster-zookeeper - namespace: zookeeper - resourceVersion: "265193" - selfLink: /apis/zookeeper.pravega.io/v1beta1/namespaces/zookeeper/zookeeperclusters/test-cluster-zookeeper - uid: eae42b94-b8ee-4fd7-9d92-30c9a30a4d5a -spec: {} -status: - externalClientEndpoint: N/A - internalClientEndpoint: 10.101.203.230:2181 - members: - ready: - - test-cluster-zookeeper-0 - unready: null - readyReplicas: 0 - replicas: 1 \ No newline at end of file