Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: refactor run schema #52

Closed
AmitKumarDas opened this issue Apr 30, 2020 · 1 comment · Fixed by #53
Closed

chore: refactor run schema #52

AmitKumarDas opened this issue Apr 30, 2020 · 1 comment · Fixed by #53

Comments

@AmitKumarDas
Copy link

AmitKumarDas commented Apr 30, 2020

Following is the current schema:

// If defines the conditions required to verify the
// presence of, absence of, equals to & other checks
// against one or more resources observed in the cluster
type If struct {
	// OR-ing or AND-ing of conditions
	IfOperator IfOperator `json:"operator,omitempty"`

	// List of conditions that get executed as part of
	// if operation
	IfConditions []IfCondition `json:"conditions,omitempty"`
}

// IfCondition to match, filter, verify a kubernetes resource.
type IfCondition struct {
	// Selector to filter one or more resources that are expected
	// to be present in the cluster
	ResourceSelector metac.ResourceSelector `json:"resourceSelector,omitempty"`

	// ResourceOperator refers to the operation that gets executed to
	// the selected resources
	//
	// Defaults to 'Exists'
	ResourceOperator ResourceOperator `json:"operator,omitempty"`

	// Count comes into effect when operator is related to count
	// e.g. EqualsCount, GreaterThanEqualTo, LessThanEqualTo.
	Count *int `json:"count,omitempty"`
}

Following is the proposed schema

// ResourceCheck defines the conditions required to verify the
// presence of, absence of, equals to & other checks
// against one or more resources observed in the cluster
type ResourceCheck struct {
	// OR-ing or AND-ing of conditions
	SelectConditionOperator ResourceSelectConditionOperator `json:"selectConditionOperator,omitempty"`

	// List of conditions that get executed as part of
	// if operation
	SelectConditions []ResourceSelectCondition `json:"selectConditions,omitempty"`
}

// ResourceSelectCondition to match, filter, verify a kubernetes resource.
type ResourceSelectCondition struct {
	// Selector to filter one or more resources that are expected
	// to be present in the cluster
	Selector metac.ResourceSelector `json:"resourceSelector,omitempty"`

	// Operator refers to the operation that gets executed to
	// the selected resources
	//
	// Defaults to 'Exists'
	Operator ResourceSelectorOperator `json:"selectOperator,omitempty"`

	// Count comes into effect when operator is related to count
	// e.g. EqualsCount, GreaterThanEqualTo, LessThanEqualTo.
	Count *int `json:"count,omitempty"`
}
@AmitKumarDas
Copy link
Author

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant