Skip to content

Commit eac54d9

Browse files
committed
fix(api): remove unwanted ready field, use dep variable in readyExpr values
The `Ready` field is removed from the `DependencyReference` type. To perform an existence check on a dependency, `ReadyExpr` can be set to `"true"`, effectively disabling readiness checks. Tests now use the `dep` variable as expected by Applier controllers. Signed-off-by: Vincent Dely <vincent.dely@ik.me>
1 parent 8c3ac7a commit eac54d9

4 files changed

Lines changed: 55 additions & 223 deletions

File tree

apis/meta/dependencies.go

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package meta
1818

1919
import (
20-
"strconv"
2120
"strings"
2221
"unicode"
2322
)
@@ -33,18 +32,15 @@ type ObjectWithDependencies interface {
3332
// objects. Each dependency string can be in one of the following formats:
3433
// - "name" - a Flux Applier API (Kustomization or HelmRelease) dependency in the same namespace
3534
// - "namespace/name" - a Flux Applier API (Kustomization or HelmRelease) dependency in a specific namespace
36-
// - "name@readyExpr" - a Flux Applier API (Kustomization or HelmRelease) dependency with a CEL readiness expression (enabled)
37-
// - "namespace/name@readyExpr" - a Flux Applier API (Kustomization or HelmRelease) dependency in a specific namespace with a CEL expression (enabled)
35+
// - "name@readyExpr" - a Flux Applier API (Kustomization or HelmRelease) dependency with a CEL readiness expression
36+
// - "namespace/name@readyExpr" - a Flux Applier API (Kustomization or HelmRelease) dependency in a specific namespace with a CEL expression
3837
// - "apiVersion/Kind/name" - a Kubernetes resource dependency in the same namespace
39-
// - "apiVersion/Kind/name@readyExpr" - a Kubernetes resource dependency with a CEL readiness expression (disabled)
40-
// - "apiVersion/Kind/name:true@readyExpr" - a Kubernetes resource dependency with a CEL readiness expression (enabled)
38+
// - "apiVersion/Kind/name@readyExpr" - a Kubernetes resource dependency with a CEL readiness expression
4139
// - "apiVersion/Kind/namespace/name" - a Kubernetes resource dependency in a specific namespace
42-
// - "apiVersion/Kind/namespace/name@readyExpr" - a Kubernetes resource dependency in a specific namespace with a CEL readiness expression (disabled)
43-
// - "apiVersion/Kind/namespace/name:true@readyExpr" - a Kubernetes resource dependency in a specific namespace with a CEL readiness expression (enabled)
40+
// - "apiVersion/Kind/namespace/name@readyExpr" - a Kubernetes resource dependency in a specific namespace with a CEL readiness expression
4441
//
45-
// The : symbol is used to separate the resource reference from the readiness check enablement.
4642
// The @ symbol is used to separate the resource reference from the CEL expression.
47-
// Note that : and @ cannot be part of resource names or namespaces per Kubernetes naming conventions:
43+
// Note that @ cannot be part of resource names or namespaces per Kubernetes naming conventions:
4844
// https://kubernetes.io/docs/concepts/overview/working-with-objects/names/
4945
// For CEL expression syntax, see:
5046
// https://github.com/google/cel-spec/blob/master/doc/langdef.md
@@ -59,16 +55,6 @@ func MakeDependsOn(deps []string) []DependencyReference {
5955
dep = dep[:idx]
6056
}
6157

62-
// Split off the readiness check boolean value if present.
63-
if idx := strings.Index(dep, ":"); idx != -1 {
64-
ready, err := strconv.ParseBool(dep[idx+1:])
65-
if err != nil {
66-
ready = false
67-
}
68-
ref.Ready = new(ready)
69-
dep = dep[:idx]
70-
}
71-
7258
// Parse the apiVersion/Kind/namespace/name dependency string into DependencyReference objects.
7359
parts := strings.SplitN(dep, "/", 5)
7460
switch len(parts) {

0 commit comments

Comments
 (0)