Compare commits

..

502 Commits

Author SHA1 Message Date
Ayush Kumar
1396884a44 Feat: Implement array builder and enhance CUE generation for X-Definitions (#7039)
* feat: implement array builder and enhance CUE generation with conditional outputs

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>

* feat: enhance CUE generation for struct fields and add support for array element types

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>

* feat: refactor CUE generation logic for struct fields and streamline resource output handling

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

---------

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Amit Singh <singhamitch@outlook.com>
2026-02-12 14:27:56 +00:00
Anoop Gopalakrishnan
29a26d5650 Feat: Defkit implementation (#7037)
* Docs(KEP): Go SDK for X-Definition Authoring (defkit)

  Introduces KEP proposal for defkit, a Go SDK that enables platform
  engineers to author X-Definitions using native Go code instead of CUE.

  Key proposed features:
  - Fluent builder API for Component, Trait, Policy, and WorkflowStep definitions
  - Transparent Go-to-CUE compilation
  - IDE support with autocomplete and type checking
  - Schema-agnostic resource construction
  - Collection operations (map, filter, dedupe)
  - Composable health and status expressions
  - Addon integration with godef/ folder support
  - Module dependencies for definition sharing via go get

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(KEP): Examples and minor api changes given in the document

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(KEP): align defkit examples

- Fix golang version in CI
- Fix variable declaration in example for testing
- Add Is() comparison method to status check

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Docs(KEP): add security considerations section

- Add goal #7 for secure code execution model
- Add Security Considerations section covering:
  - Code execution model (compile-time only, not runtime)
  - Security benefits over CUE (static analysis, dependency scanning)
  - Threat model with mitigations

Addresses PR feedback about code execution safety.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Docs(KEP): add module versioning and definition placement sections

- Add Module Versioning section explaining git-based version derivation
- Add Definition Placement section covering:
  - Motivation for placement constraints in multi-cluster environments
  - Fluent API for placement (RunOn, NotRunOn, label conditions)
  - Logical combinators (And, Or, Not)
  - Module-level placement defaults
  - Placement evaluation logic
  - CLI experience for managing cluster labels
- Add Module Hooks section for lifecycle callbacks
- Minor fixes and clarifications throughout

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Docs(KEP): add module hooks and update addon integration sections

- Add Module Hooks section covering:
  - Use cases (CRD installation, setup scripts, post-install samples)
  - Hook configuration in module.yaml (pre-apply, post-apply)
  - Hook types (path for manifests, script for shell scripts)
  - waitFor field with condition names and CUE expressions
  - CLI usage (--skip-hooks, --dry-run)

- Update Addon Integration section with implementation details:
  - godef/ folder structure with module.yaml
  - CLI flags (--godef, --components, --traits, --policies, --workflowsteps)
  - Conflict detection and --override-definitions flag
  - Development workflow

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Docs(KEP): address PR review comments and clarify placement labels

- Fix misleading "Sandboxed Compilation" claim (cubic-ai feedback) -
  renamed to "Isolated Compilation" and clarified that security relies
  on trust model, not technical sandboxing
- Fix inconsistent apiVersion in module hooks example (defkit.oam.dev/v1
  → core.oam.dev/v1beta1)
- Clarify that placement uses vela-cluster-identity ConfigMap directly,
  not the vela cluster labels command (which is planned for future)
- Add --stats flag to apply-module CLI documentation

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Docs(KEP): fix API documentation

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): add core fluent API types for Go-based definitions

Introduce the defkit package providing a fluent Go API for defining
KubeVela X-Definitions (components, traits, policies, workflow steps).

Core types added:
- types.go: Value, Condition, Param interfaces
- base.go: Base definition types and interfaces
- param.go: Parameter builders (String, Int, Bool, Array, Map, Struct, Enum)
- expr.go: Expression builders for conditions and comparisons
- resource.go: Resource operations (Set, SetIf, Spread)
- context.go: KubeVela context references (appName, namespace, etc.)
- test_context.go: Test utilities for definition validation

This enables writing type-safe Go definitions that compile to CUE.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): add collection operations and helper builders

Add fluent API for array/collection transformations:
- CollectionOp with Filter, Map, Pick, Wrap, Dedupe operations
- From() and Each() entry points for collection pipelines
- FieldRef, FieldEquals, FieldMap for field-level operations
- MultiSource for complex multi-array comprehensions
- Add helper builders for template variables
- Add value transformation utilities

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): add CUE code generator

Implement CUEGenerator that transforms Go definitions into CUE code
Added helper methods and writers for conversion

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): add status and health policy builders

Add fluent builders for customStatus and healthPolicy CUE generation

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): add definition type builders

Add fluent builders for all four KubeVela X-Definition types:
- ComponentDefinition
- TraitDefinition
- PolicyDefinition
- WorkflowStepDefinition

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(goloader): add Go module loader for definitions

- Definition interface and registry for runtime discovery
- Discover and parse Go-based definition files
- Compile Go definitions to CUE at runtime
- Module environment for batch processing
- Parallel generation for better performance

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(cli): add vela def commands for Go-based definitions

- init-module: scaffold a new Go definition module
- apply-module: compile and apply definitions to cluster
- list-module: show definitions in a module
- validate-module: validate definitions without applying
- Also support the cue commands for xdefintions for go code

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): add testing utilities and matchers

- CUE comparison matchers for Ginkgo/Gomega tests
- Test helpers for definition validation

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): add patch container helpers for container mod operations

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(cli): update the go module to 1.23.8 for defkit init-module command

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Refactor: Add grouped help output for vela def command

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): add definition placement for cluster-aware deployments

Enable definitions to specify which clusters they should run on based on
cluster identity labels stored in a well-known ConfigMap.

Also derives module version from git tags and improves init-module to
create directories from --name flag.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): add RunOn/NotRunOn fluent API for placement constraints

Add placement methods to all definition builders allowing definitions
to specify cluster eligibility using the placement package's fluent API.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Docs(defkit): add commented placement example to module.yaml template

Show users the placement syntax in generated module.yaml without
setting actual values.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): add module-level placement support

Add placement constraints at the module level in module.yaml that
apply to all definitions unless overridden at definition level.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): add CLI placement enforcement in apply-module

Add placement constraint checking to `vela def apply-module` command.
Definitions are skipped if cluster labels don't match module placement.

- Add --ignore-placement flag to bypass placement checks
- Display placement status during apply with clear skip reasons
- Track placement-skipped count in summary output
Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(defkit): show all flags in subcommand help output

Fix custom help function to properly display flags for def subcommands
like init-module and apply-module instead of only showing parent flags.
Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(defkit): apply name prefix to definitions in apply-module

The --prefix flag was not being applied to definition names. The prefix
was set in module loader metadata but not used when creating Kubernetes
objects from parsed CUE.
Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore(defkit): align module command help with standard vela pattern

Remove argument placeholders from command Use field to align with
other vela commands (addon, cluster, workflow). Arguments are shown
in examples and individual --help output instead of the listing.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(goloader): use json.Unmarshal for go mod download output

The downloadGoModule function parses JSON output from 'go mod download -json'
but was incorrectly using yaml.Unmarshal with json struct tags. The yaml.v3
library ignores json tags, resulting in empty field values.

This would cause remote Go module loading (e.g., github.com/foo/bar@v1.0.0)
to fail with "go mod download did not return a directory" because result.Dir
would be empty.

Fix: Use json.Unmarshal instead since the data is JSON from the Go toolchain.
Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(goloader): use semver for MinVelaVersion comparison

String comparison of version numbers is incorrect for cases like
"v1.10.0" > "v1.9.0" which returns false due to lexicographic ordering.

Use the Masterminds/semver library (already a dependency) for proper
semantic version comparison in ValidateModule().

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(placement): validate operator in module placement conditions

Add validation to catch invalid placement operators at module load time
instead of silently failing at runtime evaluation.

- Add Operator.IsValid() method to check for valid operators
- Add ValidOperators() helper function
- Add validatePlacementConditions() in ValidateModule()
- Provides clear error message with valid operator list

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(cli): validate conflict strategy in apply-module

Invalid --conflict values like "invalid" were silently accepted and
would fall through the switch statement, behaving like "overwrite".

Add ConflictStrategy.IsValid() method and validation at flag parsing
to provide clear error message for invalid values.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(placement): support definition-level placement constraints

Previously only module-level placement was enforced. Now individual
definitions can specify their own placement constraints that override
module defaults.

Changes:
- Add Placement field to DefinitionInfo and DefinitionPlacement types
- Add GetPlacement/HasPlacement to Definition interface
- Update registry ToJSON to include placement in output
- Update goloader to capture definition placement from registry
- Update CLI apply-module to use GetEffectivePlacement() for combining
  module-level and definition-level placement
- Add comprehensive tests for definition placement

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore(defkit): remove dead PatchTemplate code

PatchTemplate, PatchOp, SetPatchOp, and SetIfPatchOp were defined but
never used anywhere in the codebase. The PatchResource type already
provides the same functionality and is the one actually being used
through Template.Patch().

Removed:
- PatchTemplate struct and its methods (ToCue, SetIf, Set)
- PatchOp interface
- SetPatchOp struct and its ToCue method
- SetIfPatchOp struct and its ToCue method
- NewPatchTemplate constructor

This cleanup reduces maintenance burden without affecting any
functionality.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(cli): pass actual VelaVersion to validate-module command

The help text for `vela def validate-module` promised to check
minVelaVersion requirements but ValidateModule() was called with
an empty string, causing the check to be silently skipped.

Now passes velaversion.VelaVersion so modules specifying a minimum
KubeVela version will be properly validated against the current CLI
version.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): implement WithDetails() and FromTyped() APIs

WithDetails():
- Adds WithDetails(message, details...) method to StatusBuilder
- Allows adding structured key-value details alongside status messages
- Uses existing StatusDetail and statusWithDetailsExpr infrastructure
- Example: s.WithDetails(s.Format("Ready: %v", ...), s.Detail("endpoint", ...))

FromTyped():
- Converts typed Kubernetes objects (runtime.Object) to Resource
- Provides compile-time type safety for building resources
- Requires TypeMeta to be set on the object
- Includes MustFromTyped() variant that panics on error
- Example: defkit.FromTyped(&appsv1.Deployment{...})

Both APIs were documented in the KEP but not implemented.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Style(defkit): apply gofmt formatting

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(defkit): fix remote module download with @latest version

When downloading a Go module without an explicit version, always append
@latest to ensure go mod download fetches from the remote repository
instead of skipping the download.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(defkit): support running def commands from any directory

Previously, module commands like `vela def list-module` only worked
when run from within the kubevela repository. Now they work from any
directory by honoring replace directives in the source module's go.mod.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): generate doc.go files in init-module

Create doc.go files with package documentation in each definition
directory (components, traits, policies, workflowsteps). This ensures
go mod tidy works correctly by making each directory a valid Go package,
and provides helpful examples for users creating new definitions.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(defkit): deduplicate definitions from overlapping directory scans

The module loader scans both conventional directories (components/,
traits/, etc.) and the root directory. Since DiscoverDefinitions uses
recursive filepath.Walk, files in subdirectories were found twice.
Added file tracking to skip already-processed files.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(defkit): validate placement constraints and fix GOWORK interference

Add validation for conflicting placement constraints at registration time.
Definitions with logically impossible placement (e.g., same condition in
both RunOn and NotRunOn) now fail fast with a clear error message.

Also fix placement loading when parent directories contain go.work files
by setting GOWORK=off when running the registry generator.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): add parameter schema constraints and runtime condition methods

Extend the parameter fluent API with comprehensive validation and
conditional logic support:

- Schema constraints for input validation (Min/Max, Pattern, MinLen/MaxLen, MinItems/MaxItems)
- Runtime conditions for template logic (In, Contains, Matches, StartsWith/EndsWith, Len*, IsEmpty/IsNotEmpty, HasKey, IsFalse)

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(defkit): add waitFor support with CUE expressions for module hooks

Add the ability to specify custom readiness conditions for module hooks
using the new `waitFor` field. This allows users to define precise
conditions for when resources should be considered ready.

The waitFor field supports two formats:
- Simple condition name (e.g., "Ready", "Established") - checks
  status.conditions for the named condition with status "True"
- CUE expression (e.g., "status.replicas == status.readyReplicas") -
  evaluated against the full resource for flexible readiness checks

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Feat(addon): add godef support for Go-based definitions in addons

Add support for a godef/ folder in addons that allows writing definitions
in Go instead of CUE. When an addon is enabled, Go definitions are
automatically compiled to CUE and deployed alongside traditional CUE
definitions.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: lint issues and make reviewable

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: lint and build failure

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: lint and ci errors

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: golangci-lint errors for defkit package

- Use standard library errors (errors.Is/As) instead of pkg/errors
- Fix ineffassign issues by scoping variables correctly
- Add nolint comments for intentional nilerr, makezero patterns
- Combine chained appends in addon init.go
- Add gosec nolint for CLI file operations and permissions
- Increase gocyclo threshold to 35, nolint complex CLI commands

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: kubectl installation with retry and fallback version in github actions

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(ci): hardcode kubectl version to avoid flaky CDN endpoint

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore: improve test coverage for codecov

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore: add more tests for codecov and CI to pass

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: ci failure on style

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: OperatorNotEquals to fail closed with empty values

Change NotEquals operator to return false when Values slice is empty,
matching the fail-closed behavior of Equals operator. This prevents
silent widening of placement eligibility when a malformed constraint
is created.

Following Kubernetes label selector semantics where In/NotIn operators
require non-empty values, we apply a fail-closed approach for safety
in placement decisions.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: OpenArrayParam field shadowing and remove redundant GetName()

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: path traversal vulnerability in Go definition scaffolding

 Validate Go definition names before using them in file paths to prevent
 creation of files outside the addon directory. Unsanitized names could
 contain path traversal segments (e.g., "../../../etc/passwd") allowing
 arbitrary file writes.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: unescaped string interpolation in health_expr CUE generation

  Use %q format verb in formatValue() to properly escape quotes and
  special characters when generating CUE strings. Update fieldContainsExpr
  to use formatValue() instead of raw string interpolation.

  This prevents invalid CUE when substring values contain quotes or
  backslashes.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: Guard against typed nil in Gomega matchers to prevent panic

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: Guard against malformed bracket path in parseBracketAccess

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: incomplete AppRevision test to actually verify resolution

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix: apply fail-closed behavior to NotIn with empty values

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Doc: Added note about RawCUE and some alignment style

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

---------

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
2026-02-10 15:00:44 +00:00
Vishal Kumar
ff5f3a8fbb Feat: eager status for post dispatch (#7030)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 2m56s
* Fix: 7032 Adds component type to structured log output (#7033)

Signed-off-by: Brian Kane <briankane1@gmail.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat: add pending status for traits during post dispatch processing

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat: enhance health status evaluation for workloads and traits

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat: update application health status evaluation and add workload health indicator

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat: remove required healthy field from application revisions and applications, update status structure

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Fix: Support multiple traits of same type and improve PostDispatch handling

                                                                                               * fix: support multiple traits of the same type and improve PostDispatch handling

                                                                                               - Refactored trait status tracking in  to use a composite key (Type + Index), enabling support for multiple traits of the same type on a single component.
                                                                                               - Updated health evaluation logic in  and  to ignore traits marked as  when determining overall health.
                                                                                               - Enhanced  to refresh component status after dispatching traits, ensuring the application status reflects the latest state.
                                                                                               - Adjusted logic to correctly mark PostDispatch traits as  when the workload is not yet healthy.

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Fix: Support multiple traits of same type and improve PostDispatch handling

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* refactor: minor reviewable changes

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* test: verifying kubebbuilder annotation

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat: optimize trait status handling by removing unnecessary order tracking

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat: remove unnecessary trait dispatch stage checks to streamline status processing

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* refactor: removes redundant changes

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat: ensure health status is collected for PostDispatch traits during workflow execution

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat: ensure health status is collected for PostDispatch traits during workflow execution

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

# Conflicts:
#	pkg/controller/core.oam.dev/v1beta1/application/apply.go
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat: add health status checks for PostDispatch traits in application tests

Co-authored-by: vaibhav0096 <vaibhav.agrawal0096@gmail.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat: make workloadHealthy field optional in application revisions and applications

Signed-off-by: vishal210893 <vishal210893@gmail.com>

---------

Signed-off-by: Brian Kane <briankane1@gmail.com>
Signed-off-by: vaagrawal_gwre <vaagrawal@Guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Brian Kane <briankane1@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
2026-02-04 09:41:38 +00:00
Brian Kane
995a09d3c7 Fix: 7032 Adds component type to structured log output (#7033)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 11m56s
Signed-off-by: Brian Kane <briankane1@gmail.com>
2026-01-27 09:30:58 +00:00
Brian Kane
7c06ee2060 Fix: Prevent app validation errors when traits are used alongside workflow data passing (#7031)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 51m50s
Signed-off-by: Brian Kane <briankane1@gmail.com>
2026-01-23 18:03:09 +00:00
Brian Kane
37fb2a6f49 Feat: 7024 Enable custom errors in components similar to traits (#7028)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 12m42s
Signed-off-by: Brian Kane <briankane1@gmail.com>
2026-01-21 10:37:07 +00:00
Brian Kane
555e4416f4 Fix: 7018 Ensure Component removals are correctly persisted and reflected in status (#7027)
Signed-off-by: Brian Kane <briankane1@gmail.com>
2026-01-21 09:26:17 +00:00
Amit Singh
5ead6db8d7 Chore: bumps up pkg and workflow dependency versions (#7026)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 1m29s
* chore: bumps up workflow and pkg versions and updates import statements

Signed-off-by: Amit Singh <singhamitch@outlook.com>

* chore: minor linter fixes

Signed-off-by: Amit Singh <singhamitch@outlook.com>

---------

Signed-off-by: Amit Singh <singhamitch@outlook.com>
2026-01-20 15:32:03 +00:00
Brian Kane
2a75dbdc35 Add a minimal, interface based provider registry to break complex import cycle (#7021)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 1m45s
Signed-off-by: Brian Kane <briankane1@gmail.com>
2026-01-19 11:22:28 +00:00
Brian Kane
568b1c578b Feat: 7019 Support re-running workflows and ensure passed data is updated during dispatch (#7025)
Signed-off-by: Brian Kane <briankane1@gmail.com>
2026-01-19 11:18:10 +00:00
GoGstickGo
8c85dcdbbc Fix: Support cuex package imports in vela show/def show commands (#7017)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 2m0s
- Added GetCUExParameterValue()
 function that uses cuex.DefaultCompiler instead
    of standard CUE compiler

 - Added GetParametersWithCuex() function with cuex support
- Updated GetBaseResourceKinds() to use cuex compiler
- Updated all callers to use cuex-aware functions

 Fixes #7012

Signed-off-by: GoGstickGo <janilution@gmail.com>
2026-01-16 09:56:10 +00:00
Amit Singh
0b85d55e68 Feat: post dispatch output context (#7008)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 1m46s
* exploring context data passing

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* adds output status fetch logic

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* fix: standardize  import in dispatcher.

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* feat: Allow  traits to access workload output status in CUE context

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* feat: Implement PostDispatch traits that apply after component health is confirmed.

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* feat: Refactor  trait handling and status propagation in application dispatch.

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* fix: run make reviewable

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* feat: Implement and document PostDispatch traits, applying them after component health is confirmed and guarded by a feature flag, along with new example applications.

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* feat: Add comments

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Fix: Restore the status field in ctx.

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Fix: Error for evaluating the status of the trait

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* refactor: removes minor unnecessary changes

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* refactor: minor linter changes

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* test: Add comprehensive tests for PostDispatch traits and their status handling

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Fix: Increase multi-cluster test time

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Chore: Add focus and print the application status

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Chore: print deployment status in the multicluster test

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Chore: add labels for the deployment

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* debugging test failure

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* debugging test failure by updating multi cluster ctx

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* undoes multi cluster ctx change

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Feat: enable MultiStageComponentApply feature by default

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Feat: implement post-dispatch traits application in workflow states

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Chore: remove unnecessary blank lines in application_controller.go

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Feat: enhance output readiness handling in health checks

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Feat: add logic to determine need for post-dispatch outputs in workload processing

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Feat: enhance output extraction and dependency checking for post-dispatch traits

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* fix code to exclude validation of post dispatch trait in webhook

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* fix code to exclude validation of post dispatch trait in webhook

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* commit for running the test again

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* commit for running the test again

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* commit for running the test again

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* triggering checks

Signed-off-by: Amit Singh <singhamitch@outlook.com>

* chore: adds explanation comments

Signed-off-by: Amit Singh <singhamitch@outlook.com>

* chore: adds errors to context

Signed-off-by: Amit Singh <singhamitch@outlook.com>

* chore: minor improvements

Signed-off-by: Amit Singh <singhamitch@outlook.com>

* fix: update output handling for pending PostDispatch traits

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* fix: improve output handling for PostDispatch traits in deploy process

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* fix: streamline output handling in PostDispatch process

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* chore: commit to re run the pipeline

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* chore: commit to re run the pipeline

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* chore: commit to re run the pipeline

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* fix: enhance output status handling in PostDispatch context for multi-stage support

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* chore: commit to re run the pipeline

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* fix: increase timeout for PostDispatch trait verification in tests

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* fix: enhance output status handling in PostDispatch context for multi-stage support

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* chore: commit to re run the pipeline

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

---------

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: Chitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: Vishal Kumar <vishal210893@gmail.com>
2026-01-14 10:28:13 +00:00
Brian Kane
432ffd3ddd Feat: Improve Cue Error Reporting (#6984)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 11m49s
Signed-off-by: Brian Kane <briankane1@gmail.com>
2026-01-07 14:37:06 +00:00
Ricardo Noriega
3cc668289e Fix typos in documentation (#7015)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 2m58s
Signed-off-by: Ricardo Noriega De Soto <rnoriega@redhat.com>
2026-01-06 11:29:14 +00:00
Anoop Gopalakrishnan
e2935da549 Docs(KEP): Go SDK for X-Definition Authoring (defkit) (#7009)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 16m11s
* Docs(KEP): Go SDK for X-Definition Authoring (defkit)

  Introduces KEP proposal for defkit, a Go SDK that enables platform
  engineers to author X-Definitions using native Go code instead of CUE.

  Key proposed features:
  - Fluent builder API for Component, Trait, Policy, and WorkflowStep definitions
  - Transparent Go-to-CUE compilation
  - IDE support with autocomplete and type checking
  - Schema-agnostic resource construction
  - Collection operations (map, filter, dedupe)
  - Composable health and status expressions
  - Addon integration with godef/ folder support
  - Module dependencies for definition sharing via go get

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(KEP): Examples and minor api changes given in the document

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(KEP): align defkit examples

- Fix golang version in CI
- Fix variable declaration in example for testing
- Add Is() comparison method to status check

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Docs(KEP): add security considerations section

- Add goal #7 for secure code execution model
- Add Security Considerations section covering:
  - Code execution model (compile-time only, not runtime)
  - Security benefits over CUE (static analysis, dependency scanning)
  - Threat model with mitigations

Addresses PR feedback about code execution safety.

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Docs(KEP): add module versioning and definition placement sections

- Add Module Versioning section explaining git-based version derivation
- Add Definition Placement section covering:
  - Motivation for placement constraints in multi-cluster environments
  - Fluent API for placement (RunOn, NotRunOn, label conditions)
  - Logical combinators (And, Or, Not)
  - Module-level placement defaults
  - Placement evaluation logic
  - CLI experience for managing cluster labels
- Add Module Hooks section for lifecycle callbacks
- Minor fixes and clarifications throughout

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Docs(KEP): add module hooks and update addon integration sections

- Add Module Hooks section covering:
  - Use cases (CRD installation, setup scripts, post-install samples)
  - Hook configuration in module.yaml (pre-apply, post-apply)
  - Hook types (path for manifests, script for shell scripts)
  - waitFor field with condition names and CUE expressions
  - CLI usage (--skip-hooks, --dry-run)

- Update Addon Integration section with implementation details:
  - godef/ folder structure with module.yaml
  - CLI flags (--godef, --components, --traits, --policies, --workflowsteps)
  - Conflict detection and --override-definitions flag
  - Development workflow

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Docs(KEP): address PR review comments and clarify placement labels

- Fix misleading "Sandboxed Compilation" claim (cubic-ai feedback) -
  renamed to "Isolated Compilation" and clarified that security relies
  on trust model, not technical sandboxing
- Fix inconsistent apiVersion in module hooks example (defkit.oam.dev/v1
  → core.oam.dev/v1beta1)
- Clarify that placement uses vela-cluster-identity ConfigMap directly,
  not the vela cluster labels command (which is planned for future)
- Add --stats flag to apply-module CLI documentation

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Docs(KEP): fix API documentation

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Docs(KEP): add forward-reference for RawCUE() escape hatch

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

---------

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
2025-12-30 16:11:46 -08:00
Bryan Leong
358e46e628 Style: clean up dry-run (#7007)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 13m45s
- Remove trailing whitespace on dryrun outputs
- Fixed the relevant plugin-test outputs
- Refactor to avoid partial lines that codecov flags out

Signed-off-by: Bryan Leong <leong.bryan@gmail.com>
2025-12-16 11:18:14 +00:00
Brian Kane
bf2340bb35 Feat(KEP): Declarative Addon Support (#6996)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 17m36s
Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-11-28 16:43:06 +00:00
rahulkhinchi-wq
a459bba20e fix: dangerous-exec-command-87 (#6999)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 17m1s
Co-authored-by: root <root@ai-guardian-remediation-54f45fdc58-g5zpm>
2025-11-26 06:52:34 -08:00
Ayush Kumar
552764d48f Fix: Enhance shared resource handling to avoid last-applied-configuration pollution (#6998)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 19m3s
Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-11-26 11:08:22 +00:00
Brian Kane
9b558e38cd Feat(KEP): #6973 - Native Helm Rendering (#6974)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 16m47s
* KEP #6973 - Native Helm Rendering

Signed-off-by: Brian Kane <briankane1@gmail.com>

* KEP: #6973 - Native Helm Rendering - Minor format and spelling corrections

Signed-off-by: Brian Kane <briankane1@gmail.com>

---------

Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-11-25 11:36:27 +00:00
Brian Kane
9889a0cb31 Feat(KEP): Nested Definition Rendering (Compositions) (#6993)
* Feat(KEP): Nested Definition Rendering (Compositions)

Signed-off-by: Brian Kane <briankane1@gmail.com>

* Feat(KEP) #6990 - Nested Definition Rendering (Compositions) - Minor Updates

Signed-off-by: Brian Kane <briankane1@gmail.com>

---------

Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-11-25 11:35:08 +00:00
Chaitanyareddy0702
90ed704cff Refactor: update workflow-related types to use v1alpha1 API (#6975)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 17m1s
* refactor: update workflow-related types to use v1alpha1 API

- Changed the workflow mode in ApplicationBuilder from v1beta1 to v1alpha1.
- Updated WorkflowStep and WorkflowSubStep constructors to use the new v1alpha1 types.
- Modified the TypedApplication interface to reflect the new workflow mode.
- Adjusted WorkflowStepBase and WorkflowSubStepBase to utilize v1alpha1 inputs and outputs.
- Commented out unused WorkflowSubStep registration for future consideration.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* fix: update Inputs and Outputs types to use v1alpha1 API in GoDefModifier

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* fix: remove commented-out code for AddInput and AddOutput in genBaseSetterFunc

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* fix: update ApplicationBuilder to use apis package for components, steps, and policies

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* fix: remove unused WorkflowSubStep related code and update WorkflowStep reference to use v1alpha1 API

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* feat: add support for WorkflowSubStep registration and handling in GoDefModifier

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* fix: update import path for WorkflowStepBase in GoDefModifier

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* fix: update import path for WorkflowStep in DefinitionKindToStatement

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* fix: update WorkflowSubStep references to use WorkflowStepBase from v1alpha1 API

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* fix: simplify subSteps generation in GoDefModifier by directly appending WorkflowStepBase

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* fix: nest properties under WorkflowStepBase in GoDefModifier for WorkflowStep definitions

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* fix: remove toolchain version from go.mod

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Run: make reviewable

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* fix: enhance application auto-update test to wait for application revisions

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

---------

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
2025-11-18 08:47:44 +00:00
Ayush Kumar
0a599ad177 Refactor: Pre-Validation Hooks to be More Extensible and Testable (#6978)
* refactor: pre-start hook implementation

- Introduced a new `hook.go` file defining the `PreStartHook` interface for pre-start validation hooks.
- Removed the old `pre_start_hook.go` file which contained the `SystemCRDValidationHook` implementation.
- Updated the server initialization code to use the new hook structure, specifically integrating the `crdvalidation` package for pre-start validation.
- Enhanced logging for pre-start hook execution to improve clarity on hook names and execution results.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: move color writer implementation to logging package and update usage in server setup

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: rename Hook to CRDValidation for clarity and consistency

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: reorder import statements for consistency

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: replace hardcoded namespace with variable in cleanup function

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: rename CRDValidation type to Hook for consistency

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: enhance CRD validation hook with custom client support and improved error handling

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: extend timeout for CRD validation hook and improve error handling for slow API servers

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: remove redundant comments from PreStartHook definition

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

---------

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
2025-11-17 18:14:40 -08:00
Chaitanyareddy0702
d064d3dbd2 Feat: Add configurable timeout for admission webhooks (#6977)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 23s
* Feat: Add configurable timeout for admission webhooks

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat: Update admission webhook timeout configuration to use admissionWebhookTimeout variable

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat: Add admission webhook timeout parameter to README

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* removed period in readme to run pipelines

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

---------

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
2025-11-13 11:43:35 +08:00
Ayush Kumar
89ff116f8e Fix: E2E Application Test (live-diff application version) (#6976)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 27s
* refactor: Simplify application auto-update test by removing unnecessary reconciliation waits

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* feat: Add e2e application tests with k3d and webhook validation

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* fix: Remove unnecessary blank line in application auto-update test

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* feat: Add k3d cleanup step after running application tests

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

---------

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
2025-11-11 14:24:30 +00:00
Ayush Kumar
0485704cd7 Fix: Prevent namespace admins from accessing vela-system definitions without explicit permissions (#6972)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 34s
* fix: add admission rules for applications and improve permission checks

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* test: enhance application auto-update tests with reconciliation checks

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* fix: enhance application auto-update test to verify application revision creation

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

---------

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
2025-11-10 08:14:41 +00:00
Amit Singh
2a31930c4b Chore: imports workflow crd from pkg repo (#6954)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 38s
* chore: adds logic to pull workflow crd from pkg repo

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* feat: introduce GetIteratorLabel utility function and refactor label retrieval in CUE processing

Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>
Co-authored-by: Vishal Kumar <vishal210893@gmail.com>

* feat: refactor FromCUE method to use GetIteratorLabel utility for improved label retrieval

Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* feat: remove unused imports and optimize list concatenation in template files

Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>
Co-authored-by: Vishal Kumar <vishal210893@gmail.com>

* refactor: standardize import formatting across multiple YAML and Go files

Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>
Co-authored-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>

* refactor: import statements in multiple YAML templates for consistency

- Removed unnecessary parentheses around import statements in various CUE templates.
- Ensured a consistent import style across all templates in the vela-core chart.

Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>

* feat: add disk space cleanup steps before and after cross-build in Go workflow

Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>

* refactor: update check-diff target to depend on build for improved consistency

Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>

* refactor: update reviewable target to include build for improved consistency in check-diff

Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>

---------

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Vishal Kumar <vishal210893@gmail.com>
2025-11-06 18:56:04 -08:00
Brian Kane
8e3749f970 Fix: Fix issue with imports/packages in status validations (#6963)
Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-11-06 15:23:08 -08:00
Anirudh Edpuganti
089f657b0c fix: update YAML import path to use go.yaml.in/yaml/v3 and adjust dependencies in go.mod and go.sum (#6944)
Signed-off-by: ANIRUDH-333 <aniedpuganti@gmail.com>
2025-11-06 10:37:19 +00:00
Ayush Kumar
ea409c7437 Refactor: controller setup and improve server tests (#6958)
* Feat: Add integration test setup and cleanup scripts, enhance server testing capabilities

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Refactor: Rename variables for clarity and consistency in core command handling

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: Remove redundant server test targets and enhance logging in core command execution

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Refactor server tests and enhance E2E testing setup

- Updated server_test.go to improve test organization and clarity, including the addition of BeforeSuite and AfterSuite for environment setup and teardown.
- Enhanced the waitWebhookSecretVolume tests to cover various scenarios including empty directories and files.
- Added new tests for syncConfigurations and logging setup functions to ensure proper configuration handling.
- Introduced a new E2E test for the main function in main_e2e_test.go to validate the core functionality of the application.
- Improved the e2e.mk file to set up a k3d cluster for running main_e2e_test with embedded test binaries and added cleanup steps.
- Removed the setup-integration-tests.sh script as its functionality is now integrated into the Makefile.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Refactor:  improve multicluster test timeouts

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

---------

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
2025-11-05 10:23:24 +00:00
Vishal Kumar
5b24e8b410 Chore: Graceful skip and robust processing for missing definition directories in install script (#6964)
* Feat(script): Update installation definition script for improved error handling and namespace management

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>

* added line to rerun the github action

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* minor change to rerun the github action

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Fix(script): Enhance installation script to restore original files on failure

Signed-off-by: vishal210893 <vishal210893@gmail.com>

---------

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: vishal210893 <vishal210893@gmail.com>
2025-11-05 09:12:56 +00:00
AshvinBambhaniya2003
305a90f428 Feat(addon): Store addon registry tokens in Secrets (#6935)
* feat(addon): Store addon registry tokens in Secrets

Previously, addon registry tokens were stored in plaintext within the 'vela-addon-registry' ConfigMap. This is not a secure practice for sensitive data.

This commit refactors the addon registry functionality to store tokens in Kubernetes Secrets. The ConfigMap now only contains a reference to the secret name, while the token itself is stored securely.

This change includes:
- Creating/updating secrets when a registry is added/updated.
- Loading tokens from secrets when a registry is listed/retrieved.
- Deleting secrets when a registry is deleted.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* test(addon): Add tests for registry token secret storage

This commit introduces a comprehensive test suite for the addon registry feature.

It includes:
- Isolated unit tests for each CRUD operation (Add, Update, List, Get, Delete) to ensure each function works correctly in isolation.
- A stateful integration test to validate the complete lifecycle of an addon registry from creation to deletion.

The tests verify that tokens are handled correctly via Kubernetes Secrets, confirming the implementation of the secure token storage feature.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(addon): improve addon registry robustness and fix bugs

This commit introduces several improvements to the addon registry to make it more robust and fixes several bugs.

- When updating a secret, the existing secret is now fetched and updated to avoid potential conflicts.
- Deleting a non-existent registry now returns no error, making the operation idempotent.
- Getting a non-existent registry now returns a structured not-found error.
- Loading a token from a non-existent secret is now handled gracefully.
- When setting a token directly on a git-based addon source, the token secret reference is now cleared.
- The token secret reference is now correctly copied in `SafeCopy`.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* Refactor(addon): Fix secret deletion and improve registry logic

This commit refactors the addon registry data store to fix a critical bug where deleting an addon registry would not delete its associated token secret.

The root cause was that the `GetRegistry` function, which was used by `DeleteRegistry`, would load the token from the secret and then clear the `TokenSecretRef` field on the in-memory object. This meant that when `DeleteRegistry` tried to find the secret to delete, the reference was already gone.

This has been fixed by:
1. Introducing a central `getRegistries` helper function to read the raw registry data from the ConfigMap.
2. Refactoring all data store methods (`List`, `Get`, `Add`, `Update`, `Delete`) to use this central helper, removing duplicate code.
3. Ensuring `DeleteRegistry` uses the raw, unmodified registry data so that the `TokenSecretRef` is always available for deletion.

Additionally, comprehensive unit tests for the new helper functions (`getRegistries`, `loadTokenFromSecret`, `createOrUpdateTokenSecret`) have been added to verify the fix and improve overall code quality and stability.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(addon): improve addon registry token security and logging

This commit enhances the security and observability of addon registry token handling.

- Adds a warning message to users when an insecure inline token is detected in an addon registry configuration, prompting them to migrate to a more secure secret-based storage.
- Implements info-level logging to create an audit trail for token migrations, providing administrators with visibility into security-related events.
- Refactors the token migration logic into a new `migrateInlineTokenToSecret` function, improving code clarity and maintainability.
- Introduces unit tests for the `TokenSource` interface methods and the `GetTokenSource` function to ensure correctness and prevent regressions.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* Chore: remove comments to triger ci

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-10-31 13:52:30 +00:00
AshvinBambhaniya2003
d1f077ee0d Fix(addon): show correct owner in definition conflict error (#6903)
* fix(addon): show correct owner in definition conflict error

When enabling an addon, if a definition conflicted with one from another existing addon, the error message would misleadingly cite the addon being installed as the owner, rather than the actual owner of the definition. This made it difficult for users to diagnose the conflict.

This commit corrects the error message generation in `checkConflictDefs` to use the name of the actual owner application. A comprehensive unit test for this function has also been added to verify the corrected behavior and prevent regressions.

Fixes #6898

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* fix(addon): show correct owner name in conflict message

When a definition conflict occurs, the error message attempts to show the addon that owns the existing definition.

However, if the owner is not a KubeVela addon application (i.e., its name doesn't have the 'addon-' prefix), the `AppName2Addon` function returns an empty string. This resulted in a confusing conflict message with a blank owner name, like "already exist in  \n".

This patch fixes the issue by checking if the result of `AppName2Addon` is empty. If it is, it falls back to using the full application name of the owner,
ensuring the conflict message is always clear and actionable.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* chore(addon): update comment for addon name

- Add this comment to trigger ci

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* fix(addon): improve conflict message for addon definitions

adjust comment placement and logic to ensure correct addon name display in conflict messages

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-10-31 13:52:00 +00:00
AshvinBambhaniya2003
260fc1a294 Feat: Enhance unit test coverage for references/appfile package (#6913)
* feat(appfile): Enhance unit test coverage and migrate to standard Go testing

This commit significantly enhances the unit test coverage for the `references/appfile` package by introducing a comprehensive suite of new test cases and migrating existing tests to the standard Go `testing` framework with `testify/assert`.

Key additions and improvements include:
- **New Test Cases for `references/appfile/api/appfile.go`**: Added tests for `NewAppFile`, `JSONToYaml`, and `LoadFromBytes` to ensure correct application file initialization, parsing, and loading.
- **New Test Cases for `references/appfile/api/service.go`**: Introduced tests for `GetUserConfigName`, `GetApplicationConfig`, and `ToStringSlice` to validate service configuration extraction and type conversions.
- **Expanded Test Coverage for `references/appfile/app.go`**: Added new tests for `NewApplication`, `Validate`, `GetComponents`, `GetServiceConfig`, `GetApplicationSettings`, `GetWorkload`, and `GetTraits`, ensuring the robustness of application-level operations.
- **Dedicated Test Files for `modify.go` and `run.go`**: Created `modify_test.go` and `run_test.go` to provide specific unit tests for `SetWorkload`, `CreateOrUpdateApplication`, `CreateOrUpdateObjects`, and `Run` functions.
- **Test Framework Migration**: Refactored `addon_suit_test.go` to `main_test.go` and `addon_test.go` to use standard Go `testing` and `testify/assert`, improving consistency and maintainability.

These changes collectively improve the robustness, reliability, and maintainability of the `appfile` package by providing a more comprehensive and standardized testing approach.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* chore(references/appfile): improve test suite robustness and style

This commit introduces two improvements to the test suite in the `references/appfile` package.

First, the `TestMain` function in `main_test.go` is refactored to ensure the `envtest` control-plane is always stopped, even if test setup fails. This is achieved by creating a single exit path that handles cleanup, preventing resource leaks.

Second, a minor linting issue (S1005) in `modify_test.go` is fixed by removing an unnecessary assignment to the blank identifier.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* Chore: remove comment to trigger ci

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-10-31 13:51:09 +00:00
AshvinBambhaniya2003
24f6718619 Feat(testing): Enhance Unit Test Coverage for Core Utility Packages (#6929)
* test(cli): enhance unit test coverage for theme and color config

This commit introduces a comprehensive suite of unit tests for the theme and color configuration functions in `references/cli/top/config`.

Key changes include:
- Refactored existing tests in `color_test.go` to use table-driven sub-tests for improved clarity and maintainability.
- Added new test functions to validate color parsing, hex color detection, and default theme creation.
- Implemented tests for theme file lifecycle management, including creation and loading logic.

These additions significantly increase the test coverage and ensure the robustness and correctness of the CLI's theme and color functionality.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* test(cli): refactor and enhance tests for top view models and utils

This commit improves the unit test suite for the CLI's top view functionality by refactoring existing tests and adding new ones to increase coverage.

Key changes include:
- In `application_test.go`, `TestApplicationList_ToTableBody` is refactored to be a table-driven test, and new tests are added for `serviceNum`, `workflowMode`, and `workflowStepNum` helpers.
- In `time_test.go`, `TestTimeFormat` is refactored into a table-driven test for better structure and readability.

These changes align the tests with best practices and improve the overall robustness of the CLI top view's data presentation logic.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* test(cuegen): enhance unit test coverage for CUE generation packages

This commit introduces a comprehensive suite of unit tests and refactors existing tests for the CUE generation packages located in `references/cuegen`.

Key changes include:
- Refactored existing tests in `generator_test.go` and `provider_test.go` to use table-driven sub-tests, improving clarity, maintainability, and coverage of error conditions.
- Added new test functions to `convert_test.go` to validate helper functions for comment generation, type support, and enum field handling.
- Added new tests in `provider_test.go` to cover provider extraction, declaration modification, and panic recovery logic.

These changes significantly increase the test coverage for the `cuegen` libraries, ensuring the correctness and robustness of the CUE code generation functionality.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* test(docgen): add comprehensive unit tests for doc generation

This commit introduces a comprehensive suite of unit tests for the documentation generation package located in `references/docgen`.

Key changes include:
- Added new test files (`console_test.go`, `convert_test.go`, `openapi_test.go`) to cover the core functions for parsing and generating documentation for CUE, Terraform, and OpenAPI schemas.
- Refactored and enhanced `i18n_test.go` to use sub-tests, resolve race conditions, and improve coverage for fallback logic and error handling.
- Ensured all new and existing tests follow best practices, using table-driven tests for clarity and maintainability.

This effort significantly increases the test coverage for the `docgen` package, improving the reliability and robustness of the documentation generation features.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* test: improve test reliability and conventions

This commit introduces several improvements to the test suite to enhance reliability and adhere to best practices.

- **Fix flaky test in `docgen/openapi_test.go`**:
  The test for `GenerateConsoleDocument` was flaky because it performed an exact string match on table output generated from a map. Since map iteration order is not guaranteed, this could cause spurious failures. The test is now order-insensitive, comparing sorted sets of lines instead.

- **Improve assertions in `docgen/console_test.go`**:
  - Removes an unnecessary `test.EquateErrors()` option, which is not needed for simple string comparisons.
  - Corrects the `cmp.Diff` argument order to the standard `(want, got)` convention for clearer failure messages.
  - Fixes a typo in an error message.

- **Standardize assertions in `cli/top/config/color_test.go`**:
  Swaps `assert.Equal` arguments to the standard `(expected, actual)` convention.

- **Clean up `cuegen/generators/provider/provider_test.go`**:
  Removes a redundant error check.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-10-31 13:50:30 +00:00
AshvinBambhaniya2003
44ac92d1ba Feat(test): Enhance unit test coverage for webhook, workflow, VELAQL, and monitor packages (#6895)
* feat(monitor): Add unit tests for application metrics watcher

This commit introduces a new test file with comprehensive unit tests for the application metrics watcher functionality in pkg/monitor/watcher.

Key additions include:
  - Test cases for the application metrics watcher's inc() method covering add, delete, and update operations
  - Test cases for report() method that verifies dirty flags are cleared
  - Test cases for helper functions getPhase() and getApp()

These additions improve the overall test coverage and ensure the correctness of the application metrics monitoring functionality.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(velaql): Add comprehensive unit tests for ParseVelaQLFromPath

This commit introduces new unit tests for the ParseVelaQLFromPath function in pkg/velaql, along with test data files to improve test coverage and ensure correctness.

Key additions include:
  - `pkg/velaql/parse_test.go`: Adds TestParseVelaQLFromPath function with comprehensive test cases covering:
    * Valid CUE files with and without export fields
    * Nonexistent and empty file paths
    * Invalid CUE content
    * Files with invalid export types
  - Test data files in pkg/velaql/testdata/:
    * simple-valid.cue: Valid CUE file with export field
    * simple-no-export.cue: Valid CUE file without export field
    * empty.cue: Empty CUE file
    * invalid-cue-content.cue: CUE file with invalid syntax
    * invalid-export.cue: CUE file with invalid export type

These additions improve the overall test coverage and ensure the robustness of the VELAQL parsing functionality.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(webhook): Add unit tests for ValidateDefinitionRevision function

This commit introduces new unit tests for the ValidateDefinitionRevision function in pkg/webhook/utils to improve test coverage and ensure correctness of definition revision validation.

Key additions include:
  - `pkg/webhook/utils/utils_test.go`: Adds TestValidateDefinitionRevision function with comprehensive test cases covering:
    * Success scenarios with matching definition revisions
    * Success scenarios when definition revision does not exist
    * Failure scenarios with revision hash mismatches
    * Failure scenarios with spec mismatches
    * Failure scenarios with invalid definition revision names

These additions improve the overall test coverage and ensure the robustness of the webhook utility functions for validating definition revisions.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(workflow): Add unit tests for OAM apply and query utilities

This commit introduces new unit tests for workflow provider functions in pkg/workflow/providers to improve test coverage and ensure correctness.

Key additions include:
  - `pkg/workflow/providers/oam/apply_test.go`: Adds TestRenderComponent function with comprehensive test cases for component rendering
  - `pkg/workflow/providers/query/utils_test.go`: Adds:
    * TestBuildResourceArray function with comprehensive test cases covering simple, nested, and complex resource tree scenarios
    * TestBuildResourceItem function with test cases for resources with and without annotations

These additions improve the overall test coverage and ensure the robustness of the workflow provider functions for OAM applications.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* fix(velaql): Improve error handling in ParseVelaQLFromPath test

This commit addresses an issue in the TestParseVelaQLFromPath function where file read errors were being silently ignored. The changes include:

- Removing the unused expectedView field from test cases
- Replacing conditional error checking with require.NoError to ensure file read operations are properly validated
- Ensuring that test failures are properly reported when file reading fails

This fix improves the reliability of the test suite by making sure that any file I/O errors are properly caught and reported rather than silently ignored.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat: Apply cross-cutting test improvements

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat: Enhance test coverage with file-specific suggestions

This commit applies file-specific suggestions to enhance the test suite's
coverage and robustness.

Key changes include:

- **`pkg/monitor/watcher/application_test.go`**:
  - Added a test case for a multi-step workflow with mixed phases to
    validate `stepPhaseCounter` aggregation.
  - Added a test for idempotence by calling `inc` twice.
  - Added test cases for an empty workflow and an unknown application phase.
  - Strengthened the `report` test to assert that counters are not cleared.

- **`pkg/velaql/parse_test.go`**:
  - Added a test case for `ParseVelaQLFromPath` to handle files with
    leading/trailing whitespace.
  - Added a test case to ensure consistent error messages for relative paths.

- **`pkg/webhook/utils/utils_test.go`**:
  - Added a test case to `TestValidateCueTemplate` for a malformed CUE
    template.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-10-31 13:49:15 +00:00
Chaitanyareddy0702
d627ecea2a Chore: Upgrade cuelang version to v0.14.1 (#6877)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 24s
* chore: updates culenag version and syntax across all files

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* debuggin: reverts tf provider changes

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Refactor: Simplify provider configuration by removing 'providerBasic' and directly defining access keys and region for providers

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Refactor: Consolidate provider configuration by introducing 'providerBasic' for access keys and region

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* chore: reorganize import statements in deepcopy files for consistency

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* chore: reorder import statements for consistency across deepcopy files

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Refactor: Safely handle pattern parameter selectors to avoid panics in GetParameters and getStatusMap

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* chore: add comment to clarify test context in definition_revision_test.go

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* chore: remove redundant comment from test context initialization in definition_revision_test.go

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Refactor: Introduce GetSelectorLabel function to safely extract labels from CUE selectors

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* chore: add newline at end of file in utils.go

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* chore: increase timeout for multi-cluster e2e

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

---------

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
2025-10-23 10:56:37 +01:00
Ayush Kumar
d8a17740dc Refactor: controller flags registration and cobra options (#6949)
* feat: Introduce comprehensive configuration management for KubeVela

- Added multiple configuration files under `cmd/core/app/config` to encapsulate various aspects of KubeVela's functionality, including:
  - Feature gates
  - Logging (KLog)
  - Kubernetes API client settings
  - Multi-cluster management
  - OAM-specific configurations
  - Observability settings (metrics and logging)
  - Performance optimizations
  - Profiling settings
  - Reconciliation settings
  - Resource management
  - Server-level configurations
  - Sharding configurations
  - Webhook settings
  - Workflow engine configurations

- Refactored `CoreOptions` to utilize the new configuration modules, ensuring a clean delegation pattern for flag registration.
- Updated tests to validate the new configuration structure and ensure backward compatibility with legacy fields.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* feat: Sync config module values to legacy fields and add debug logging for webhook configuration

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* chore: Remove debug logging for webhook configuration in server command

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* chore: Add missing newlines at the end of multiple configuration files

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: Clean up legacy field synchronization and improve configuration handling in CoreOptions

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* feat: Introduce ControllerConfig for improved controller configuration management

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* feat: Implement sync methods for configuration values across various modules

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: Update ControllerConfig to embed Args struct and simplify flag registration

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: Remove ConfigureKLog method and apply klog settings directly in server run function

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: Remove unnecessary line in ControllerConfig and update test assertions for CUE options

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* feat: Enhance CUE configuration flags with detailed descriptions and add comprehensive tests for core options

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* feat: Add backward compatibility notes to sync methods and enhance CLI override tests for configuration values

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* refactor: Standardize flag formatting in TestCoreOptions_AllConfigModulesHaveFlags

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

---------

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
2025-10-23 10:54:45 +01:00
jguionnet
05b0ec89a5 Refactor: Update documentation generation to retain .md extensions and fixed Components header (#6957)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 25s
- Modified the documentation generation logic to keep .md file extensions, enhancing IDE support and compatibility with Docusaurus.
- Updated various documentation headers to include the correct .md references in auto-generated messages, ensuring consistency across multiple components (component, policy, trait, workflow).

Signed-off-by: jguionnet jguionnet@guidewire.com

Signed-off-by: jguionnet jguionnet@guidewire.com
Signed-off-by: Jerome Guionnet <jguionnet@guidewire.com>
2025-10-22 18:17:46 -07:00
Ayush Kumar
f196d66b5e Fix: Prevent index out-of-bounds in definitions (#6948)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 24s
* Fix: Update ingress messages to handle host retrieval more robustly across multiple templates

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Fix: Enhance output handling in k8s-objects template to check for empty objects

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Fix: Ensure policy selection from envBindingPolicies only occurs if the list is not empty

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

---------

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
2025-10-17 14:34:43 +01:00
AshvinBambhaniya2003
21d9d24b07 Feat(addon): Enhance unit test coverage for pkg/addon (#6901)
* feat(addon): add comprehensive unit tests for addon readers

This commit enhances the test coverage and code quality for the addon reader implementations in the pkg/addon package.

- Refactors all existing addon reader tests (gitee, github, gitlab, local) to use consistent, modern testing patterns like sub-tests.
- Replaces the old memory_reader_test.go with a completely refactored implementation.
- Adds new unit tests for previously untested functions, including various getters, client constructors, and RelativePath helpers.
- Improves http-based tests (gitlab, github, gitee) to use robust mock handlers that correctly simulate API behavior, including pagination and error states.

These changes improve the overall quality and reliability of the addon system and uncovered two minor bugs during the process.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(addon): add more unit tests for addon helpers

This commit continues to improve the test coverage for the pkg/addon package by adding unit tests for several helper and factory functions.

- Adds a test for WrapErrRateLimit to ensure GitHub API rate limit errors are handled correctly.
- Adds a test for ClassifyItemByPattern to verify addon file classification logic.
- Adds a test for the NewAsyncReader factory function to ensure correct reader instantiation.
- Adds tests for various utility functions in utils.go, including IsRegistryFuncs, InstallOptions, ProduceDefConflictError, and GenerateChartMetadata.

These tests increase the reliability of the addon installation and handling logic.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(addon): add unit tests for versioned addon registry

This commit improves test coverage for the versioned addon registry logic in the pkg/addon package.

- Adds a unit test for resolveAddonListFromIndex to verify the logic for parsing Helm index files.
- Introduces a new table-driven test for the internal loadAddon function, covering success and multiple failure scenarios (e.g., version not found, download failure, corrupt data).
- Adds a new test helper, setupAddonTestServer, to create isolated mock HTTP servers for testing addon loading, improving test reliability and clarity.

These tests ensure the core logic for discovering and fetching versioned addons is robust and functions as expected.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* chore(addon): remove unused gitlab testdata path constant

- remove unused gitlab testdata path constant name `gitlabTestdataPath`

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* refactor(addon): improve unit tests based on review feedback

This commit addresses several code review comments to improve the quality, correctness, and robustness of the unit tests in the pkg/addon package.
- Refactors map key assertions in the memory reader test to use the correct "comma ok" idiom instead of assert.NotNil.
- Updates the GitHub reader test to use a compliant addon mock that includes the required template.cue file.
- Modifies the chart metadata test in utils_test.go to use t.TempDir() for better test isolation and automatic cleanup.
- Switches from assert.NotNil to require.NotNil in the versioned registry test to prevent panics on nil pointers.
These changes make the test suite more robust, reliable, and easier to maintain.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-10-17 10:47:43 +01:00
AshvinBambhaniya2003
3f5b698dac Feat(appfile): Add comprehensive unit tests for appfile and component package (#6908)
* feat(appfile): Add comprehensive unit tests for appfile package

This commit significantly enhances the test coverage for the `pkg/appfile` package by adding a comprehensive suite of new unit tests. These tests improve the reliability of core application parsing, generation, and validation logic.

Key additions include:
- **Parsing:** New tests for policy parsing, legacy application revision handling, and dynamic component loading.
- **Manifest Generation:** Added coverage for `GenerateComponentManifests` and `GeneratePolicyManifests` to ensure correctness of generated resources.
- **OAM Contracts:** New tests for `SetOAMContract` and `setWorkloadRefToTrait` to verify OAM label and reference injection.
- **Template & Context:** Added tests for loading templates from revisions (`LoadTemplateFromRevision`) and preparing the process context (`PrepareProcessContext`).
- **Validation:** Enhanced validation tests for component parameters and uniqueness of output names.

As part of this effort, the existing tests were also migrated from Ginkgo to the standard `testing` package with `testify/assert` to maintain consistency across the codebase.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* refactor(pkg/component): Migrate ref-objects tests to standard Go testing and add new test cases

This commit refactors the unit tests for `pkg/component/ref-objects` from a Ginkgo-based suite to the standard Go `testing` package. Additionally, new unit test cases have been added to further enhance test coverage and ensure the robustness of the `ref-objects` functionality.

Key changes include:
- Deletion of `pkg/component/ref_objects_suite_test.go`.
- Introduction of `pkg/component/main_test.go` to manage test environment setup and teardown using `TestMain`.
- Creation of `pkg/component/ref_objects_test.go` containing all the ref-objects related unit tests, now using standard Go testing functions, along with newly added test cases for improved coverage.

This migration improves consistency with other unit tests in the codebase and leverages the native Go testing framework.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* chore(pkg/component): Reorder imports in ref_objects_test.go

This commit reorders the import statements in `pkg/component/ref_objects_test.go` to adhere to standard Go formatting and import grouping conventions. This change improves code readability and consistency.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-10-17 10:45:45 +01:00
AshvinBambhaniya2003
4b1d1601c8 fix(addon): correct path calculation in gitlab reader (#6902)
The GetPath method for GitLabItem produced an incorrect path when an addon's base path in the repository was empty. This was caused by an off-by-one error in the string slicing logic that always assumed a base path separator existed, incorrectly truncating the first character of the file path.

This commit corrects the logic by adding a check for an empty base path, ensuring the full path is returned in that case.

Fixes #6899

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-10-17 10:43:08 +01:00
Brian Kane
ebf73d03c2 Chore: Add codeowners (#6946)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 20s
Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-10-16 08:33:49 -07:00
AshvinBambhaniya2003
1d7b186664 Feat: Enhance unit test coverage for references/common package (#6918)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 26s
* feat(common): Enhance unit test coverage for common utilities

This commit significantly enhances the unit test coverage for the `references/common` package, covering a wide range of utilities related to application management, metrics, registry operations, traits, and workloads. Existing tests have also been refactored to improve readability and maintainability.

Key additions and improvements include:
- **Application Utilities**: New tests for `ExportFromAppFile`, `ApplyApp`, `IsAppfile`, `Info`, `SonLeafResource`, `LoadAppFile`, and `ApplyApplication` in `application_test.go`.
- **Metrics Utilities**: Expanded tests for `ToPercentage`, `GetPodStorage`, and `GetPodOfManagedResource` in `metrics_test.go`, with existing tests refactored to use `testify/assert` and table-driven formats.
- **Registry Operations**: New tests for `InstallComponentDefinition` and `InstallTraitDefinition` in `registry_test.go`.
- **Trait Definitions**: New `trait_test.go` file with tests for `ListRawWorkloadDefinitions`.
- **Workload Initialization**: New `workload_test.go` file with tests for `InitApplication` and `BaseComplete`.

These changes collectively improve the robustness, reliability, and maintainability of the `references/common` package by providing a more comprehensive and standardized testing approach.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* test(common): Improve test assertions and error handling

This commit improves the quality and reliability of unit tests in the `references/common` package by addressing several inconsistencies and potential issues.

Key changes include:

- Asserts the error returned by `v1beta1.AddToScheme` across multiple test files (`application_test.go`, `registry_test.go`, `workload_test.go`) to prevent masking scheme registration failures.
- Replaces `strings.Contains` with the more idiomatic `assert.Contains` in `application_test.go`.
- Adds an assertion to check the error returned by `tmpFile.Close()` in `application_test.go`.
- Uses `assert.EqualError` instead of `assert.Equal` for comparing error messages in `registry_test.go` for more precise error checking.
- Removes an unused `strings` import from `application_test.go`.

These changes lead to more robust, readable, and consistent tests.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* fix(common): Fix flaky test in TestExportFromAppFile

The `TestExportFromAppFile` test was passing locally but failing in CI with a "no matches for kind" error.

This was caused by passing an uninitialized `common.Args` object to the `ExportFromAppFile` function. The function was using the client from this object, which was not the correctly configured fake client.

This commit fixes the issue by explicitly setting the fake client on the `common.Args` object before it is used, making the test hermetic and reliable.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-10-14 11:33:21 -07:00
James Dobson
d46ad7e06e Chore: Remove unused parameter 'addonName' from 'vela-cli' workflow step. (#6930)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 20s
Signed-off-by: James Dobson <jdobson@guidewire.com>
2025-10-09 13:34:26 -07:00
Ayush Kumar
743fcc6efc Chore: update homebrew bump action (#6939)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 23s
* Fix: update Homebrew formula action to latest version

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* Fix: update Homebrew formula action reference to correct version

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* fix: remove redundant Homebrew bump action

- Fixes: https://github.com/kubevela/kubevela/actions/runs/18149681613/job/51659048948
- The kubevela formula in homebrew/core is already configured for automatic updates via BrewTestBot.
- BrewTestBot runs every ~3 hours after a new release to automatically open version bump PRs.
- The manual bump step (dawidd6/action-homebrew-bump-formula) was redundant and caused workflow failures:
  'Error: Whoops, the kubevela formula has its version update pull requests automatically opened by BrewTestBot every ~3 hours!'
- Removed the manual bump action to prevent conflicts and rely solely on BrewTestBot for formula updates https://github.com/Homebrew/homebrew-core/blob/master/Formula/k/kubevela.rb.

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

---------

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
2025-10-06 11:59:00 -07:00
AshvinBambhaniya2003
10b45d3a8f Fix(references/appfile): Fix namespace check and Terraform output parsing (#6915)
* fix(references/appfile): correct namespace existence check in addon

The `generateSecretFromTerraformOutput` function was using an incorrect logic to check for namespace existence. It was trying to create the namespace and if it succeeded, it would return an error.

This commit corrects the logic to use `k8sClient.Get` and checks for a `NotFound` error to accurately determine if the namespace exists.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* fix(references/appfile): make terraform output parsing robust

The previous implementation for parsing `terraform output` was fragile and could lead to data corruption or errors. It would incorrectly remove all spaces from values and would fail to parse values that contained an equals sign.

This commit refactors the parsing logic to be more robust:
- It no longer removes spaces from output values, preserving them correctly.
- It correctly parses `key=value` pairs by splitting only on the first equals sign in a line.
- It properly handles quoted string values from Terraform.

The corresponding tests in `addon_test.go` have been updated to align with the refactored function signature and verify the new, robust behavior.

Fixes #6916

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-10-06 11:57:37 -07:00
Vishal Kumar
7f81d6f2d6 Feat: add KinD setup step to sync-sdk workflow (#6937)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 34s
Signed-off-by: vishal210893 <vishal210893@gmail.com>
2025-10-02 15:01:20 -07:00
Anoop Gopalakrishnan
17b7edca9e Fix: goreleaser flag for release
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 25s
Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
2025-09-30 19:41:27 -07:00
Anoop Gopalakrishnan
773149aa53 Fix: clean up runner for disk space during release (#6936)
Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
2025-09-30 18:24:08 -07:00
Vishal Kumar
a8b652e59d Feat(logging): Add colorized logging support for local development with dev-logs option to enable during development (#6931)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 49s
* Feat(logging): Add colorized logging support with DevLogs option

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Fix: return error on directory walk failure in lookupFilesInRoot

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Feat(logging): Add logger setup for local development with DevLogs option

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Feat(logging): Enable/Disable DevLogs option in kubevela-controller configuration

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Feat(logging): Make DevLogs configurable in kubevela-controller and values.yaml

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Feat(logging): Add devLogs option for formatted logging support in README and values.yaml

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Feat(logging): Update logger setup for DevLogs and handle errors in file lookup

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Feat(logging): Enhance caching by capturing Go cache directories for improved build performance

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Feat(logging): Enhance caching by capturing Go cache directories for improved build performance

Signed-off-by: vishal210893 <vishal210893@gmail.com>

---------

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
2025-09-30 09:32:16 -07:00
Ayush Kumar
36f217e258 Feat: webhook reject unknown cr outputs (#6932)
* feat: implement output resource existence validation in component, trait, and policy definitions

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: add validation tests for ComponentDefinition and TraitDefinition outputs

- Implement tests for ComponentDefinition with non-existent CRDs in outputs, ensuring they are rejected.
- Add tests for valid outputs in ComponentDefinition, confirming acceptance.
- Include tests for mixed valid and non-K8s outputs in ComponentDefinition, verifying they pass validation.
- Test handling of empty outputs in ComponentDefinition, ensuring they are accepted.
- Introduce tests for invalid apiVersion formats in ComponentDefinition, confirming rejection.
- Add tests for TraitDefinition with mixed valid and invalid outputs, ensuring proper rejection.
- Create YAML manifests for valid and invalid ComponentDefinitions and TraitDefinitions to support e2e tests.
- Ensure comprehensive coverage of edge cases in output validation logic.

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

fix: handle errors in resource validation for component, trait, and policy definitions

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

fix: improve error handling in Go module tidy and resource validation

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: add webhook debugging setup and validation tests for ComponentDefinition and TraitDefinition

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: add VS Code launch configuration for debugging webhook validation

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

refactor: streamline error handling in Go module tidy and remove obsolete test manifests

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: add mock context support for CUE template compilation

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: enhance validation for WorkflowStepDefinition resources and improve output resource checks

Signed-off-by: viskumar <viskumar@guidewire.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: implement resource validation for CUE templates and add unit tests

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: enhance logging and validation for component, policy, and trait definitions

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: improve error handling and logging in validation handlers for component, policy, trait, and workflow step definitions

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

Remove testUnknownResource folder from repository

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: implement structured logging for validation handlers and remove deprecated request_logger

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: enhance structured logging and error handling in admission validation handlers

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: improve logging messages in validating handlers for better clarity

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: refactor logging field definitions for consistency and improve error handling in resource validation

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

chore: add license header to invalid_resource_check.go and invalid_resource_check_test.go

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: enhance validation tests for WorkflowStepDefinition and improve error messages

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: add e2e-test-local target for k3d cluster setup and webhook validation

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: add webhook configuration for workflow step definitions with validation rules

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: update e2e-test-local configuration and improve Ingress API version compatibility

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: add installation of FluxCD CRDs in pre-hook to prevent webhook validation errors

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: add ValidateResourcesExist feature gate and enhance resource validation in webhook handlers

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: enhance resource validation in e2e tests and improve addon definition checks

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: enhance addon definition detection by using owner references for validation

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: add ValidateResourcesExist feature gate and implement webhook validation for resource existence

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: update Ingress API version to v1 and adjust service references in tests

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

chore: remove webhook test commands and related YAML files from makefiles and tests

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

chore: remove architecture section from webhook debugging guide

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

feat: update webhook setup script with k3d host gateway IP note and improve cluster creation logic

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Fix: Correct path in Ingress resource definition in template tests

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Chore: add empty line to re-trigger failing workflow

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Chore: remove space to re-trigger workflow

Signed-off-by: Chaitanya Reddy Onteddu <co@guidewire.com>

---------

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Chaitanya Reddy Onteddu <co@guidewire.com>
Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: Amit Singh <amisingh@guidewire.com>
2025-09-30 09:30:53 -07:00
Vishal Kumar
c298c0eb06 Fix: webhook TLS caBundle breakage during failed Helm upgrades (#6919)
Some checks failed
Webhook Upgrade Validation / webhook-upgrade-check (push) Failing after 33s
* Fix: Add post-rollback hook to admission-related resources for better upgrade handling

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Fix: Add webhook upgrade validation workflow for handling failed Helm upgrades

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Fix: Update webhook upgrade validation template for improved resource handling

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Fix: Refactor webhook upgrade validation script for improved readability and resource handling

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* webhook-upgrade-validation.yml

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Fix: Update KubeVela CLI installation method in webhook upgrade validation workflow

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Fix: Update KubeVela CLI installation method in webhook upgrade validation workflow

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Fix: Add verification step for active webhook validation in upgrade workflow

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Fix: Update test command in webhook upgrade validation workflow to use Ginkgo

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Fix: Update cluster deletion command in webhook upgrade validation workflow

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Fix: Refactor environment setup in webhook upgrade validation workflow

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Fix: Update KinD setup in webhook upgrade validation workflow

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

---------

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
2025-09-29 08:08:07 -07:00
Chaitanyareddy0702
8aabc9f789 Fix: Enhance workflow context generation (#6925)
* Feat: Enhance workflow context generation to include application labels and annotations

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Fix: Add application labels and annotations to workflow context generation

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Fix: add comments

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

---------

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
2025-09-29 08:06:51 -07:00
Chaitanyareddy0702
af1ce628d1 Chore: Add workflow addon testing (#6911)
* Chore: Add workflow addon testing

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat(tests): Update addon tests to use correct command and deployment name

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>

* Feat(tests): Enhance addon tests with debugging information for deployment not found

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>

* Feat(tests): Add debugging output for listing WorkflowRuns in addon tests

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>

* Feat(tests): Improve debugging output for WorkflowRuns in addon tests

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>

* Feat(tests): Update addon test command path for enabling Workflow

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>

* Refactor: Clean up unused imports and commented-out code in addon tests

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat(tests): Add debugging steps for addon registry in e2e tests

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Feat: Update vela-workflow version to v0.6.2 in mock server and tests

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Refactor: Remove debug commands from e2e tests and clean up addon test assertions

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Fix: run make reviewable

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* Fix: Update assertions in addon tests to check for successful WorkflowRun phase

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

---------

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Co-authored-by: Vishal Kumar <vishal210893@gmail.com>
2025-09-24 09:25:38 -07:00
Ayush Kumar
707ae396ce Chore: refactors workflows to use re-usable actions and adds upgrade test (#6878)
* Feat(utils): Enhance unit test coverage and quality for pkg/utils (#6884)

* feat(env): Add comprehensive unit tests for environment management

This commit introduces a comprehensive suite of unit tests for the environment management functions in `pkg/utils/env`.

Key changes include:
- Refactoring the test setup to use `TestMain` for better test environment control.
- Adding new test cases for `CreateEnv`, `GetEnvByName`, `ListEnvs`, `SetCurrentEnv`, `SetEnvLabels`, and `DeleteEnv`.

These tests improve the overall test coverage and ensure the correctness and reliability of environment-related operations.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(errors): Add unit tests for error handling utilities

This commit introduces new unit tests for the error handling utilities located in `pkg/utils/errors/`.

Specifically, new test files have been added for:
- `crd_test.go`: Tests for CRD-related error checks.
- `list_test.go`: Tests for error list aggregation.
- `reason_test.go`: Tests for specific error reasons like label conflicts and CUE path not found.
- `resourcetracker_test.go`: Tests for resource tracker errors.

These additions improve the test coverage and ensure the robustness of KubeVela's error handling mechanisms.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* refactor(schema): Refactor ui_schema_test.go to use testify/assert and add new test cases

This commit refactors `pkg/utils/schema/ui_schema_test.go` to improve its readability and maintainability.

Key changes include:
- Migrating from Ginkgo/Gomega to testify/assert for assertions.
- Restructuring `TestGetDefaultUIType` into a table-driven test.
- Adding new comprehensive test cases for `Condition_Validate` function.

These changes enhance the test suite for UI schema utilities, making it more robust and easier to extend.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* refactor(system): Refactor system_test.go and add comprehensive unit tests

This commit refactors `pkg/utils/system/system_test.go` to improve its structure, readability, and test coverage.

Key changes include:
- Converting existing tests to a table-driven format using `testify/assert`.
- Adding new comprehensive test cases for:
    - `CreateIfNotExist`
    - `GetVelaHomeDir`
    - `GetDirectoryFunctions` (e.g., `GetCapCenterDir`, `GetCapabilityDir`)
    - `InitFunctions` (e.g., `InitCapabilityDir`, `InitCapCenterDir`, `InitDirs`)
    - `BindEnvironmentVariables`

These changes enhance the test suite for system utilities, ensuring their correctness and robustness.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(types): Add unit tests for QL types

This commit introduces new unit tests for the types defined in `pkg/utils/types`, specifically focusing on types related to KubeVela Query Language (QL).

New test cases cover:
- `ServiceEndpoint.String()`: Verifies the string representation of service endpoints, including various protocols, ports, and paths.
- `AppliedResource.GroupVersionKind()`: Ensures correct extraction of GroupVersionKind from applied resources.
- `ResourceTreeNode.GroupVersionKind()`: Verifies correct extraction of GroupVersionKind from resource tree nodes.

These tests improve the coverage and reliability of core data structures used in KubeVela.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(util): Add and refactor unit tests for utility functions

This commit introduces new unit tests and refactors existing ones within the `pkg/utils/util` package.

Key changes include:
- **`pkg/utils/util/cmd_test.go`**: Adds comprehensive tests for `IOStreams` and its print functions, as well as `NewDefaultIOStreams` and `NewTestIOStreams`.
- **`pkg/utils/util/factory_test.go`**: Refactors the `GenerateLeaderElectionID` test to a table-driven format and adds new tests for `computeDiscoverCacheDir` and `RestConfigGetter` methods, ensuring the correctness of Kubernetes client configuration and discovery.

These additions and refactorings enhance the test coverage and reliability of core utility functions.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(utils): Add and refactor unit tests for json, jwt, parse, and strings utilities

This commit introduces new unit tests and refactors existing ones across several utility packages within `pkg/utils/`.

Key changes include:
- **`pkg/utils/json`**: Adds tests for `StrictUnmarshal` to ensure proper JSON unmarshaling.
- **`pkg/utils/jwt`**: Adds tests for JWT token subject extraction and certificate subject retrieval.
- **`pkg/utils/parse`**: Expands test coverage for URL parsing functions (`Parse`, `ParseGitlab`).
- **`pkg/utils/strings`**: Refactors existing tests to a table-driven format and adds tests for box drawing string generation.

These additions and refactorings significantly improve the test coverage and reliability of KubeVela's utility functions.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* fix(tests): Address test and error handling issues

This commit addresses several issues identified in unit tests and error handling utilities, improving test reliability and code safety.

Key fixes and improvements include:
- **`pkg/utils/errors`**:
    - Added nil check to `IsCuePathNotFound` to prevent panics.
    - Corrected `fmt.Errorf` usage to `errors.New` in `reason_test.go` (SA1006 fix).
    - Used `assert.EqualError` for clearer error message comparisons in `resourcetracker_test.go`.
- **`pkg/utils/jwt_test.go`**: Marked `generateTestCert` as a test helper using `t.Helper()` for better error reporting.
- **`pkg/utils/system_test.go`**:
    - Removed unused `verifyCleanup` field.
    - Modified `TestGetVelaHomeDir` to use a temporary home directory, preventing destructive operations on the user's system.
- **`pkg/utils/util/cmd_test.go`**: Swapped `assert.Equal` arguments to follow `expected, actual` convention.

These changes enhance the robustness and correctness of the test suite and related utility functions.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* chore(tests): Apply gofmt and import ordering to test files

This commit applies standard Go formatting (`gofmt`) and corrects import ordering in several test files.

Affected files:
- `pkg/utils/schema/ui_schema_test.go`: Added missing newline at EOF.
- `pkg/utils/system/system_test.go`: Corrected import ordering.
- `pkg/utils/util/factory_test.go`: Corrected import ordering.

These changes ensure consistency with project coding standards.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: upgrades ga versions

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

# Conflicts:
#	.github/workflows/unit-test.yml
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: upgrades ga versions in go workflow

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* test: updates fluxcd negative test case criteria

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: update action versions in workflow files

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* test: add upgrade e2e and unit test workflows for KubeVela

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* Chore: simplify upgrade test workflows by removing redundant steps and enhancing installation process

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* Feat: automate KubeVela installation by fetching the latest release version

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: remove fix/upgrade-test branch from workflow triggers

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: add new actions for system info and unit testing diagnostics

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: implement Kubevela K8s upgrade e2e and unit test actions with diagnostics

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: create Kubevela test environment setup action with system dependencies and Ginkgo framework

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: implement Kubevela K8s upgrade multicluster e2e test action with coverage reporting and diagnostics

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: update workflow triggers to include and exclude fix/upgrade-test branch

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* Feat: Support Native Cue in HealthPolicy and CustomStatus (#6859)

* Feat: Support Native Cue in HealthPolicy and CustomStatus

Signed-off-by: Brian Kane <briankane1@gmail.com>

* Feat: Support Native Cue in HealthPolicy and CustomStatus - Fix PR Comments & Bugs

Signed-off-by: Brian Kane <briankane1@gmail.com>

---------

Signed-off-by: Brian Kane <briankane1@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* Feat: Consolidate Health & Status and Pass Status Context Data (#6860)

Signed-off-by: Brian Kane <briankane1@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* <type>: <description> <jira number>

[optional body]

[optional footer]

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: remove author information from Kubevela test environment setup action

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: add fix/upgrade-test branch to workflow triggers and streamline unit test steps

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: add KinD setup step for unit tests and remove fix/upgrade-test branch from e2e triggers

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: add GitHub actions for deploying current branch and installing latest KubeVela release

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: rename test YAML files for consistency

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: update GitHub actions to use specific checkout version and streamline deployment steps

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: enhance GitHub actions for Kubevela tests with Codecov integration and cleanup

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: improve e2e profile cleanup logic in test workflows

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: add GitHub Action for setting up Kind cluster for E2E testing

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* Chore: Optimised Github workflow

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: update action.yaml to enhance KinD cluster setup with configurable version and optional naming

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* Chore: Add sudo command

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* Chore: Revert check windows

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* Chore: Add sudo to action

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* Chore:  Change branch trigger filters

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* Chore: Revert changes from rebase

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* refactor: optimizes github actions

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: update action.yaml to install kubectl and helm using direct downloads

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: update Kubernetes version in e2e multicluster test workflow

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: updates upgrade test triggers

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: updates upgrade test triggers

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* feat: enhance action.yaml to support architecture detection and improve Helm installation

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Brian Kane <briankane1@gmail.com>
Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: AshvinBambhaniya2003 <156189340+AshvinBambhaniya2003@users.noreply.github.com>
Co-authored-by: Vishal Kumar <vishal210893@gmail.com>
Co-authored-by: Brian Kane <briankane1@gmail.com>
Co-authored-by: Reetika Malhotra <rmalhotra@guidewire.com>
Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Chaitanyareddy0702 <78363486+Chaitanyareddy0702@users.noreply.github.com>
2025-09-23 10:06:41 -07:00
Brian Kane
c0e906629e Fix: Unbundle the X-Definition Validation from Authentication Features (#6904)
Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-09-17 04:33:20 +08:00
Vaibhav Agrawal
90e601a51e Fix: inconsistent dry-run behavior with non-existent namespaces in CLI vs app.yaml (#6896) 2025-09-17 03:10:10 +08:00
AshvinBambhaniya2003
2139c813ad Feat(multicluster): Enhance Unit Test Coverage for Multicluster Packages (#6892)
* feat(multicluster): Enhance unit test coverage for multicluster utilities

This commit introduces a comprehensive suite of unit tests for the multicluster management functions in pkg/multicluster.

Key changes include:
  - `cluster_management_test.go`: Improves the structure of TestDetachCluster and TestRenameCluster by organizing test cases into a collection, which enhances clarity and
    simplifies adding new scenarios.
  - `utils_test.go` and `virtual_cluster_test.go`: Adds new test cases to validate additional utility and virtual cluster helper functions, increasing overall test
    coverage.

These additions improve the overall test coverage and ensure the correctness and reliability of multicluster operations.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(multicluster): Add unit tests for multicluster workflow provider

This commit introduces new unit tests for the multicluster workflow provider located in pkg/workflow/providers/multicluster.

Key additions include:
  - Comprehensive tests for the Deploy workflow step, covering parameter validation, error handling, and successful deployment scenarios.
  - New tests for GetPlacementsFromTopologyPolicies to ensure correct placement resolution from topology policies, including error cases and default behaviors.

These additions improve the test coverage and ensure the robustness of the multicluster workflow provider.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* fix(multicluster): Correct duplicate import in utils_test.go

This commit resolves a linting error (ST1019) in pkg/multicluster/utils_test.go caused by the k8s.io/api/core/v1 package being imported twice with different aliases (v1
and corev1).

The redundant import alias v1 has been removed, and the corresponding type reference for []v1.Secret has been updated to []corev1.Secret to maintain consistency.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* test(multicluster): fix cross-test side effects

The TestListExistingClusterSecrets function mutates the global
variable ClusterGatewaySecretNamespace without restoring its original
value. This can lead to unpredictable behavior in other tests that
rely on this variable.

This commit fixes the issue by saving the value of
ClusterGatewaySecretNamespace before the test runs and restoring it
afterward using a defer statement.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* test(multicluster): remove redundant test case in TestContext

The `TestContextWithClusterName` sub-test in `TestContext` is redundant, as its functionality is already covered by the more comprehensive `TestClusterNameInContext` sub-test.

This commit removes the unnecessary test to improve the clarity and maintainability of the test suite without sacrificing coverage.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-09-15 08:37:55 -07:00
AshvinBambhaniya2003
d6ad578070 Feat(tests): Add unit test coverage for core packages (#6889)
* test(resourcekeeper): add unit tests for resource management

This commit introduces new unit tests to improve the test coverage of the `resourcekeeper` package.

- A new test file `containsresources_test.go` is added, which includes a comprehensive table-driven test for the `ContainsResources` function.
- A new table-driven test, `TestUpdateSharedManagedResourceOwner`, is added to `gc_test.go` to verify the logic for updating ownership of shared resources.

These tests follow Go best practices and enhance the robustness of the resourcekeeper functionality.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(resourcetracker): add unit tests for tree display logic

This commit enhances the test coverage for the resource tree display logic in the `pkg/resourcetracker` package.

- Refactors `TestResourceTreePrintOption_getWidthForDetails` to cover more cases and improve test clarity.
- Adds a comprehensive test for `TestPrintResourceTree` to verify the output of the resource tree printing.
- Introduces a new test for the `tableRoundTripper` to ensure the HTTP `Accept` header is correctly mutated.
- Adds tests for helper functions like `TestLoadResourceRows`, `TestSortRows`, and `TestFillResourceRows` to ensure each part of the tree building logic is working as expected.
These changes improve the overall quality and reliability of the resource tracker's tree view functionality.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(envbinding): add unit tests for placement logic

This commit enhances the test coverage for the `envbinding` policy package.

- Adds a new test for `WritePlacementDecisions` to verify the logic of writing placement decisions to the application status. This includes scenarios for adding new policies, updating existing ones, and handling malformed data.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(schema): add unit tests for schema parsing and conversion

This commit enhances the test coverage for the `pkg/schema` package by adding unit tests for CUE parsing and OpenAPI schema conversion.

- Adds a new test for `ParsePropertiesToSchema` to verify that CUE parameter definitions are correctly parsed into OpenAPI schemas.
- Introduces a new test for `ConvertOpenAPISchema2SwaggerObject` to ensure the conversion from a raw OpenAPI v3 schema to a Swagger object is handled correctly, including error cases.
These tests improve the reliability of the schema generation and conversion logic, which is critical for capability definitions.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-09-11 07:29:07 +08:00
AshvinBambhaniya2003
2758afb1b2 Feat(utils): Enhance unit test coverage and quality for pkg/utils (#6884)
* feat(env): Add comprehensive unit tests for environment management

This commit introduces a comprehensive suite of unit tests for the environment management functions in `pkg/utils/env`.

Key changes include:
- Refactoring the test setup to use `TestMain` for better test environment control.
- Adding new test cases for `CreateEnv`, `GetEnvByName`, `ListEnvs`, `SetCurrentEnv`, `SetEnvLabels`, and `DeleteEnv`.

These tests improve the overall test coverage and ensure the correctness and reliability of environment-related operations.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(errors): Add unit tests for error handling utilities

This commit introduces new unit tests for the error handling utilities located in `pkg/utils/errors/`.

Specifically, new test files have been added for:
- `crd_test.go`: Tests for CRD-related error checks.
- `list_test.go`: Tests for error list aggregation.
- `reason_test.go`: Tests for specific error reasons like label conflicts and CUE path not found.
- `resourcetracker_test.go`: Tests for resource tracker errors.

These additions improve the test coverage and ensure the robustness of KubeVela's error handling mechanisms.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* refactor(schema): Refactor ui_schema_test.go to use testify/assert and add new test cases

This commit refactors `pkg/utils/schema/ui_schema_test.go` to improve its readability and maintainability.

Key changes include:
- Migrating from Ginkgo/Gomega to testify/assert for assertions.
- Restructuring `TestGetDefaultUIType` into a table-driven test.
- Adding new comprehensive test cases for `Condition_Validate` function.

These changes enhance the test suite for UI schema utilities, making it more robust and easier to extend.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* refactor(system): Refactor system_test.go and add comprehensive unit tests

This commit refactors `pkg/utils/system/system_test.go` to improve its structure, readability, and test coverage.

Key changes include:
- Converting existing tests to a table-driven format using `testify/assert`.
- Adding new comprehensive test cases for:
    - `CreateIfNotExist`
    - `GetVelaHomeDir`
    - `GetDirectoryFunctions` (e.g., `GetCapCenterDir`, `GetCapabilityDir`)
    - `InitFunctions` (e.g., `InitCapabilityDir`, `InitCapCenterDir`, `InitDirs`)
    - `BindEnvironmentVariables`

These changes enhance the test suite for system utilities, ensuring their correctness and robustness.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(types): Add unit tests for QL types

This commit introduces new unit tests for the types defined in `pkg/utils/types`, specifically focusing on types related to KubeVela Query Language (QL).

New test cases cover:
- `ServiceEndpoint.String()`: Verifies the string representation of service endpoints, including various protocols, ports, and paths.
- `AppliedResource.GroupVersionKind()`: Ensures correct extraction of GroupVersionKind from applied resources.
- `ResourceTreeNode.GroupVersionKind()`: Verifies correct extraction of GroupVersionKind from resource tree nodes.

These tests improve the coverage and reliability of core data structures used in KubeVela.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(util): Add and refactor unit tests for utility functions

This commit introduces new unit tests and refactors existing ones within the `pkg/utils/util` package.

Key changes include:
- **`pkg/utils/util/cmd_test.go`**: Adds comprehensive tests for `IOStreams` and its print functions, as well as `NewDefaultIOStreams` and `NewTestIOStreams`.
- **`pkg/utils/util/factory_test.go`**: Refactors the `GenerateLeaderElectionID` test to a table-driven format and adds new tests for `computeDiscoverCacheDir` and `RestConfigGetter` methods, ensuring the correctness of Kubernetes client configuration and discovery.

These additions and refactorings enhance the test coverage and reliability of core utility functions.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(utils): Add and refactor unit tests for json, jwt, parse, and strings utilities

This commit introduces new unit tests and refactors existing ones across several utility packages within `pkg/utils/`.

Key changes include:
- **`pkg/utils/json`**: Adds tests for `StrictUnmarshal` to ensure proper JSON unmarshaling.
- **`pkg/utils/jwt`**: Adds tests for JWT token subject extraction and certificate subject retrieval.
- **`pkg/utils/parse`**: Expands test coverage for URL parsing functions (`Parse`, `ParseGitlab`).
- **`pkg/utils/strings`**: Refactors existing tests to a table-driven format and adds tests for box drawing string generation.

These additions and refactorings significantly improve the test coverage and reliability of KubeVela's utility functions.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* fix(tests): Address test and error handling issues

This commit addresses several issues identified in unit tests and error handling utilities, improving test reliability and code safety.

Key fixes and improvements include:
- **`pkg/utils/errors`**:
    - Added nil check to `IsCuePathNotFound` to prevent panics.
    - Corrected `fmt.Errorf` usage to `errors.New` in `reason_test.go` (SA1006 fix).
    - Used `assert.EqualError` for clearer error message comparisons in `resourcetracker_test.go`.
- **`pkg/utils/jwt_test.go`**: Marked `generateTestCert` as a test helper using `t.Helper()` for better error reporting.
- **`pkg/utils/system_test.go`**:
    - Removed unused `verifyCleanup` field.
    - Modified `TestGetVelaHomeDir` to use a temporary home directory, preventing destructive operations on the user's system.
- **`pkg/utils/util/cmd_test.go`**: Swapped `assert.Equal` arguments to follow `expected, actual` convention.

These changes enhance the robustness and correctness of the test suite and related utility functions.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* chore(tests): Apply gofmt and import ordering to test files

This commit applies standard Go formatting (`gofmt`) and corrects import ordering in several test files.

Affected files:
- `pkg/utils/schema/ui_schema_test.go`: Added missing newline at EOF.
- `pkg/utils/system/system_test.go`: Corrected import ordering.
- `pkg/utils/util/factory_test.go`: Corrected import ordering.

These changes ensure consistency with project coding standards.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-09-09 05:35:59 +08:00
Brian Kane
70e6c9a49f fix: apply status results to correct component (#6886)
Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-09-08 01:49:48 -07:00
Amit Singh
2d46bb300f Chore: removes references to kubevelafix (#6882)
* chore: removes references to kubevelafix

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: upgrades oamdev/stern reference

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: upgrades oamdev/tf-config-inspect reference

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

---------

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Co-authored-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
2025-09-04 06:27:00 +08:00
Rashid Alam
6fbeb6887f Fix(cli): return non-zero exit code on vela def render error (#6818)
* fix  exit code on render error

Signed-off-by: 7h3-3mp7y-m4n <emailtorash@gmail.com>

* minor changes

Signed-off-by: 7h3-3mp7y-m4n <emailtorash@gmail.com>

* fix error catch logic

Signed-off-by: 7h3-3mp7y-m4n <emailtorash@gmail.com>

---------

Signed-off-by: 7h3-3mp7y-m4n <emailtorash@gmail.com>
2025-09-03 06:00:58 +08:00
S Code Man
e533898192 Fix: Address Wrong Storage trait for hostPath volumes #6811 (#6812)
* fix: Address Wrong `Storage` trait for hostPath volumes #6811

Signed-off-by: S Code Man <30977678+scodeman@users.noreply.github.com>

* fix: use tab instead of space

Signed-off-by: S Code Man <30977678+scodeman@users.noreply.github.com>

* chore: run make reviewable

Signed-off-by: S Code Man <30977678+scodeman@users.noreply.github.com>

---------

Signed-off-by: S Code Man <30977678+scodeman@users.noreply.github.com>
2025-09-03 05:59:44 +08:00
AshvinBambhaniya2003
72d5c2f0a5 Feat(tests): Add unit test coverage for core packages (#6880)
* feat(config): add unit test for config pkg

- add unit test cases for writer.go file
- add unit test cases for factory.go file

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(auth): add unit tests for auth package

This commit introduces a comprehensive suite of unit tests for the `pkg/auth` package, significantly improving test coverage and ensuring the correctness of the authentication and authorization logic.

The following key areas are now covered:
- **Identity:** Tests for identity creation, validation, matching, and subject generation.
- **Kubeconfig:** Tests for kubeconfig generation options, certificate creation, and identity reading from kubeconfig.
- **Privileges:** Tests for privilege description implementations, listing privileges, and pretty-printing.

By adding these tests, we increase the robustness of the auth package and make future refactoring safer.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(oam): add unit tests for auxiliary functions

This commit adds comprehensive unit tests for the auxiliary functions in the pkg/oam package. The new tests cover the following functions:

- GetPublishVersion / SetPublishVersion
- GetDeployVersion
- GetLastAppliedTime
- GetControllerRequirement / SetControllerRequirement
- GetCluster / SetCluster / SetClusterIfEmpty

These tests address the lack of coverage for these functions and ensure their behavior is correct, including edge cases like handling missing annotations or removing annotations when set to an empty string.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* feat(cue): add unit tests for cue packages

This commit enhances the test coverage of the `pkg/cue` directory by adding unit tests for the `definition`, `script`, and `task` packages.

The new tests cover the following areas:
- `pkg/cue/definition`:
  - `TestWorkloadGetTemplateContext`: Verifies the template context retrieval for workloads.
  - `TestTraitGetTemplateContext`: Ensures correct template context retrieval for traits.
  - `TestGetCommonLabels`: Checks the conversion of context labels to OAM labels.
  - `TestGetBaseContextLabels`: Validates the creation of base context labels.
- `pkg/cue/script`:
  - Adds tests for `ParseToValue`, `ParseToValueWithCueX`, `ParseToTemplateValue`, and `ParseToTemplateValueWithCueX` to ensure CUE scripts are parsed correctly.
- `pkg/cue/task`:
  - Refactors the existing test for `Process` to use a table-driven approach, improving readability and covering more cases.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

* fix(tests): address PR comments and improve test reliability

This commit addresses several comments from a pull request review, improving the reliability and correctness of tests in various packages.

The following changes are included:

- **`pkg/config/writer`**:
  - Renamed `writter_test.go` to `writer_test.go` to fix a typo.

- **`pkg/cue/task`**:
  - Replaced the use of an external invalid URL with a local unreachable endpoint (`http://127.0.0.1:3000`) in `process_test.go` to prevent network flakiness.
  - Switched to using `assert.ErrorContains` for safer error message assertions, avoiding potential panics.
  - Corrected an assertion to compare a byte slice with a string by converting the byte slice to a string first.

- **`pkg/oam`**:
  - Updated `auxliary_test.go` to use `time.Time.Equal` for time comparisons, making the test robust against timezone differences.

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>

---------

Signed-off-by: Ashvin Bambhaniya <ashvin.bambhaniya@improwised.com>
2025-09-03 05:58:58 +08:00
Brian Kane
e8428e704c Feature: Validate Definition Permissions on App Creation (#6876)
Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-09-03 05:53:56 +08:00
Brian Kane
56bc3b02e9 Feat: Consolidate Health & Status and Pass Status Context Data (#6860)
Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-08-24 02:30:06 +08:00
Chaitanyareddy0702
af1fb9a0fd Feat: Allow gating with components dependsOn field (#6854)
* Fix: Add workflow dynamically when user doesn't define workflow steps but adds dependsOn in the component

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Reetika Malhotra <rmalhotra@guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* fix: modify ApplyComponentWorkflowStepGenerator Generate function

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Reetika Malhotra <rmalhotra@guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Feat: Add test cases for the component level dependsOn feature

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Reetika Malhotra <rmalhotra@guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* <type>: <description> <jira number>

[optional body]

[optional footer]

Signed-off-by: Reetika Malhotra <rmalhotra@guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Fix: Refactor component dependency tests and improve failure handling

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Fix: Update environment context handling in application tests and adjust repository name check in setup script

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Chore: Remove .sh file

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Fix: Update component dependency test cases and adjust timeout for application status check

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Fix: Clean up environment setup in component dependency tests

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Fix: Update component dependency images to use latest version and adjust test cases

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Fix: uncomment tests

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Fix: update failing database image to empty string to simulate pull failure

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

---------

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Reetika Malhotra <rmalhotra@guidewire.com>
Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Co-authored-by: Reetika Malhotra <rmalhotra@guidewire.com>
Co-authored-by: Vishal Kumar <vishal210893@gmail.com>
2025-08-22 09:00:21 -07:00
Amit Singh
8b7950cf61 Chore: upgrades kind version (#6853)
* chore: upgrades ga versions

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* chore: upgrades ga versions in definition lint

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* chore: upgrades ga versions in go workflow

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* chore: upgrades ga versions in sdk test workflow

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* chore: upgrades ga versions in e2e test workflow

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* test: updates fluxcd negative test case criteria

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* test: debugging e2e test failures

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* chore: update action versions in workflow files

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* Fix: Use hash instead of version in github actions

Signed-off-by: Chaitanya Reddy Onteddu <co@guidewire.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

* chore: fix newline at end of file in README.md

Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>

* test: increase timeout for application update checks in multicluster standalone tests

Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>

---------

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Chaitanya Reddy Onteddu <co@guidewire.com>
Signed-off-by: Ayush <ayushshyamkumar888@gmail.com>
Co-authored-by: Vishal Kumar <vishal210893@gmail.com>
Co-authored-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>
Co-authored-by: Ayush <ayushshyamkumar888@gmail.com>
2025-08-22 08:55:37 -07:00
Brian Kane
a5de74ec1e Feat: Support Native Cue in HealthPolicy and CustomStatus (#6859)
* Feat: Support Native Cue in HealthPolicy and CustomStatus

Signed-off-by: Brian Kane <briankane1@gmail.com>

* Feat: Support Native Cue in HealthPolicy and CustomStatus - Fix PR Comments & Bugs

Signed-off-by: Brian Kane <briankane1@gmail.com>

---------

Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-08-22 12:24:21 +08:00
Brian Kane
3aa94842fb Fix: prevent make reviewable typecheck noise via wrapper (#6858)
Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-08-21 06:08:12 +08:00
Brian Kane
1a934e1618 Feat: Application Status Metrics & Structured Logs (#6857)
Feat: Application Status Metrics & Structured Logs

Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-08-21 06:07:13 +08:00
Brian Kane
721c75e44a Fix: Fixes the request workflowstep (#6804)
* Fix: Fixes the request workflowstep

Signed-off-by: Brian Kane <briankane1@gmail.com>

* Fix: Fixes the request workflowstep

Signed-off-by: Brian Kane <briankane1@gmail.com>

---------

Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-08-13 15:21:50 -07:00
Vishal Kumar
d598d0a6fd Chore: (deps): Update github.com/docker/docker from v25.0.6 to v28.3.… (#6849)
* Chore: (deps): Update github.com/docker/docker from v25.0.6 to v28.3.2 (CVE-2024-41110)

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Chore: (deps): Update github.com/docker/docker from v25.0.6 to v28.3.3 (CVE-2024-41110)

Signed-off-by: vishal210893 <vishal210893@gmail.com>

---------

Signed-off-by: vishal210893 <vishal210893@gmail.com>
2025-08-13 06:05:38 +08:00
dependabot[bot]
4a9ecd9ce7 Chore: (deps): Bump github/codeql-action from 3.28.16 to 3.29.5 (#6846)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.16 to 3.29.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](28deaeda66...51f77329af)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-06 11:51:42 -07:00
Brian Kane
a27261bd14 Feature: Enhanced Status Reporting (#6828)
Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-08-06 09:55:30 -07:00
Aberham Oscar
0b6092cf2b Fix: omit component revision in additionalLabel to add to k8s object when component revision is not set and DisableAllComponentRevision setted true #6643 (#6647)
* Fix: omit component revision in additionalLabel to add to k8s object when component revision is not set and DisableAllComponentRevision setted true

Signed-off-by: 那金洋(29362878) <najinyang001@ke.com>

* Fix: omit component revision in additionalLabel to add to k8s object when component revision is not set and DisableAllComponentRevision setted true test cases

Signed-off-by: 那金洋(29362878) <najinyang001@ke.com>

---------

Signed-off-by: 那金洋(29362878) <najinyang001@ke.com>
2025-08-05 10:13:02 -07:00
dependabot[bot]
aebccf90d0 Chore: (deps): Bump zeebe-io/backport-action from 2.1.1 to 3.2.1 (#6820)
Bumps [zeebe-io/backport-action](https://github.com/zeebe-io/backport-action) from 2.1.1 to 3.2.1.
- [Release notes](https://github.com/zeebe-io/backport-action/releases)
- [Commits](08bafb375e...0193454f0c)

---
updated-dependencies:
- dependency-name: zeebe-io/backport-action
  dependency-version: 3.2.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 15:48:44 -07:00
dependabot[bot]
3f5b5e6593 Chore: (deps): Bump sigstore/cosign-installer from 3.5.0 to 3.9.2 (#6834)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.5.0 to 3.9.2.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](59acb6260d...d58896d6a1)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-version: 3.9.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 07:48:24 -07:00
Vishal Kumar
b5a9925042 Chore: upgrade Kubernetes dependencies to v0.31.10 & enhance CLI, workflows, tests, and documentation (#6837)
* Create testwr

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Update testwr

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Update testwr

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Update testwr

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Update testwr

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Update testwr

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Update testwr

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Update testwr

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Delete testwr

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Chore: (deps): Bump goreleaser/goreleaser-action from 5.0.0 to 6.3.0 (#6775)

Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 5.0.0 to 6.3.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](7ec5c2b0c6...9c156ee8a1)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Chore: Replace the openssf badge with UI link (#6783)

[optional body]

[optional footer]

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* chore: moves dockerhub user name to secret section in the reusable workflow (#6778)

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush <ayushshyam.official.888@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Chore: update helm repo path in tests (#6797)

* chore: fixes the breaking tests with older helm chart address

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* tests: update the registery url

Signed-off-by: semmet95 <singhamitch@outlook.com>

* updates the default url

Signed-off-by: semmet95 <singhamitch@outlook.com>

* test: reverts the changes

Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: sets github repo directory as the default definition registry

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: reverts the default definition registry url

Signed-off-by: Amit Singh <singhamitch@outlook.com>

* test: overwrites custom definition registry url

Signed-off-by: Amit Singh <singhamitch@outlook.com>

* debugging test failure

Signed-off-by: Amit Singh <singhamitch@outlook.com>

---------

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Fix: moves resource modification inside patch block (#6791)

* fix: moves resource modification inside patch block

Signed-off-by: Ayush Shyam Kumar <ayushshyam.official.888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: adds changes from make-reviewable

Signed-off-by: Ayush Shyam Kumar <ayushshyam.official.888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* debugging error

Signed-off-by: Ayush Shyam Kumar <ayushshyam.official.888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* test: updates the helm outdated path to new one

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* tests: fixes the failing helm test case

Signed-off-by: semmet95 <singhamitch@outlook.com>

* removes debugging printing statements

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

---------

Signed-off-by: Ayush Shyam Kumar <ayushshyam.official.888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Ayush <ayushshyam.official.888@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Chore: switches to new oapi type field type (#6794)

* chore: switches to new oapi type field type

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: updates gen_sdk to use the new schema type

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: updates gen_sdk_test to use the new schema type

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: updates schema to use the new schema type

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: updates chart urls

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: changes from make reviewable

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: fixes linting errors

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* debugging test failure

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: fixes schema type nil check

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: replaces literals with constants

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* debugging test failure

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* test: switches to the new addon registry url

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: extra line removal

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: replaces deprecated urls

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: removes extra quotes form marshaljson

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: updates chart url in mock resource

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

---------

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Co-authored-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Fix: vela cli namespace behaviour (#6805)

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Fix: vela up command to behave similarly with kubectl (#6809)

* Fix: vela up command to behave similarly with kubectl

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* Chore: Update the unit test cases and add a new test cases

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

---------

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: Chaitanya Reddy Onteddu <co@guidewire.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Fix: check component status after initial deployment (#6824)

* fix: check component status after initial deployment

Signed-off-by: Brian Kane <briankane1@gmail.com>

* Fix: applications should correctly reflect component health throughout the apps lifecycle

Signed-off-by: Brian Kane <briankane1@gmail.com>

* Fix: check component status after initial deployment

Signed-off-by: Brian Kane <briankane1@gmail.com>

---------

Signed-off-by: Brian Kane <briankane1@gmail.com>
Co-authored-by: Mikhail Elenskii <elenskii-mikhail@outlook.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* chore: upgrade k8s version to v0.31.10 and corresponding fixes

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* fix: remove defer from feature gate testing in multiple test files

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* fix: remove defer from feature gate testing in multiple test files

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* fix: use RunPortForwardContext for improved context handling in port forwarding

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Chore: Fix check-diff

Signed-off-by: Chaitanya Reddy Onteddu <co@guidewire.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* Chore: Update ENVTEST_K8S_VERSION variable

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* fix: update feature gate testing to use GinkgoT for improved context handling

Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Fix: update Kubernetes version in e2e tests to v1.31

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Fix: increase timeout for application revision retrieval in multicluster tests

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>

* chore: update kubevela workflow to master

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Fix: increase timeout in multicluster tests

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* fix: upgrade dependencies and improve context handling in port forwarding

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* chore: remove space to trigger pipeline

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* chore: add space to trigger pipeline

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* chore: updated go sum

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* chore: updated go.mod for running github action

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* chore: updated go.mod for running github action

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* Fix: increase timeout and enhanced multicluster tests

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* adding a comment to re run the pipeline

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* Adding back decription removed during check-diff

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* ran make reviewable

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* replaced generate-groups.sh with kube_codegen.sh

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* API Call changes for kube_codegen

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* fixed incorrect Api package path format and output dir handling

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* resolved incompatible dependencies issue

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

* chore: update clientgen.sh to use kubevela clientgen_work_temp

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>

* chore: update clientgen.sh to use kubevela clientgen_work_temp

Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>

* test: increase timeout for application deployment and rollback verification

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>

---------

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush <ayushshyam.official.888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Ayush Shyam Kumar <ayushshyam.official.888@gmail.com>
Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: Brian Kane <briankane1@gmail.com>
Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: Chaitanya Reddy Onteddu <co@guidewire.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Signed-off-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
Co-authored-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Anoop Gopalakrishnan <2038273+anoop2811@users.noreply.github.com>
Co-authored-by: Ayush Kumar <65535504+roguepikachu@users.noreply.github.com>
Co-authored-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Ayush <ayushshyam.official.888@gmail.com>
Co-authored-by: Chaitanyareddy0702 <78363486+Chaitanyareddy0702@users.noreply.github.com>
Co-authored-by: Chaitanya Reddy Onteddu <co@guidewire.com>
Co-authored-by: Brian Kane <briankane1@gmail.com>
Co-authored-by: Mikhail Elenskii <elenskii-mikhail@outlook.com>
Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: Reetika Malhotra <malhotra.reetika25@gmail.com>
2025-07-31 07:46:56 -07:00
Brian Kane
c79f03fe92 Fix: corrects validating webhook behaviour with cuex compilers (#6799)
Signed-off-by: Brian Kane <briankane1@gmail.com>
2025-07-17 15:18:36 -07:00
Brian Kane
fedcca1c7b Fix: check component status after initial deployment (#6824)
* fix: check component status after initial deployment

Signed-off-by: Brian Kane <briankane1@gmail.com>

* Fix: applications should correctly reflect component health throughout the apps lifecycle

Signed-off-by: Brian Kane <briankane1@gmail.com>

* Fix: check component status after initial deployment

Signed-off-by: Brian Kane <briankane1@gmail.com>

---------

Signed-off-by: Brian Kane <briankane1@gmail.com>
Co-authored-by: Mikhail Elenskii <elenskii-mikhail@outlook.com>
2025-07-04 23:01:44 +05:30
Chaitanyareddy0702
b601d28afd Fix: vela up command to behave similarly with kubectl (#6809)
* Fix: vela up command to behave similarly with kubectl

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* Chore: Update the unit test cases and add a new test cases

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

---------

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: Chaitanya Reddy Onteddu <co@guidewire.com>
2025-06-23 21:25:45 -07:00
Chaitanyareddy0702
7d72fa904c Fix: vela cli namespace behaviour (#6805) 2025-06-17 10:25:59 +08:00
Amit Singh
4d6fa58c0f Chore: switches to new oapi type field type (#6794)
* chore: switches to new oapi type field type

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: updates gen_sdk to use the new schema type

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: updates gen_sdk_test to use the new schema type

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: updates schema to use the new schema type

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: updates chart urls

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: changes from make reviewable

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: fixes linting errors

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* debugging test failure

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: fixes schema type nil check

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: replaces literals with constants

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* debugging test failure

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* test: switches to the new addon registry url

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: extra line removal

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: replaces deprecated urls

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: removes extra quotes form marshaljson

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: updates chart url in mock resource

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

---------

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Co-authored-by: Vishal Kumar <vishal210893@gmail.com>
2025-06-15 20:44:58 -07:00
Amit Singh
26123cf671 Fix: moves resource modification inside patch block (#6791)
* fix: moves resource modification inside patch block

Signed-off-by: Ayush Shyam Kumar <ayushshyam.official.888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: adds changes from make-reviewable

Signed-off-by: Ayush Shyam Kumar <ayushshyam.official.888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* debugging error

Signed-off-by: Ayush Shyam Kumar <ayushshyam.official.888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* test: updates the helm outdated path to new one

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* tests: fixes the failing helm test case

Signed-off-by: semmet95 <singhamitch@outlook.com>

* removes debugging printing statements

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

---------

Signed-off-by: Ayush Shyam Kumar <ayushshyam.official.888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Ayush <ayushshyam.official.888@gmail.com>
2025-06-15 09:40:35 -07:00
Ayush Kumar
ad9cda63c9 Chore: update helm repo path in tests (#6797)
* chore: fixes the breaking tests with older helm chart address

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Co-authored-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* tests: update the registery url

Signed-off-by: semmet95 <singhamitch@outlook.com>

* updates the default url

Signed-off-by: semmet95 <singhamitch@outlook.com>

* test: reverts the changes

Signed-off-by: semmet95 <singhamitch@outlook.com>

* fix: sets github repo directory as the default definition registry

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>

* chore: reverts the default definition registry url

Signed-off-by: Amit Singh <singhamitch@outlook.com>

* test: overwrites custom definition registry url

Signed-off-by: Amit Singh <singhamitch@outlook.com>

* debugging test failure

Signed-off-by: Amit Singh <singhamitch@outlook.com>

---------

Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: semmet95 <singhamitch@outlook.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
2025-06-13 07:13:25 -07:00
Ayush Kumar
011e1f1445 chore: moves dockerhub user name to secret section in the reusable workflow (#6778)
Signed-off-by: Ayush Kumar <ayushshyamkumar888@gmail.com>
Signed-off-by: Ayush <ayushshyam.official.888@gmail.com>
2025-05-28 09:18:53 +05:30
Anoop Gopalakrishnan
974d3e88bf Chore: Replace the openssf badge with UI link (#6783)
[optional body]

[optional footer]

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
2025-05-22 06:45:37 +08:00
dependabot[bot]
ef9b6f3cc1 Chore: (deps): Bump goreleaser/goreleaser-action from 5.0.0 to 6.3.0 (#6775)
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 5.0.0 to 6.3.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](7ec5c2b0c6...9c156ee8a1)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-06 10:24:31 +05:30
dependabot[bot]
144e96df31 Chore: (deps): Bump github.com/go-git/go-git/v5 from 5.13.1 to 5.16.0 (#6764)
Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.13.1 to 5.16.0.
- [Release notes](https://github.com/go-git/go-git/releases)
- [Commits](https://github.com/go-git/go-git/compare/v5.13.1...v5.16.0)

---
updated-dependencies:
- dependency-name: github.com/go-git/go-git/v5
  dependency-version: 5.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-03 12:55:40 +05:30
dependabot[bot]
5ee9c8b38c Chore: (deps): Bump github/codeql-action from 2.1.37 to 3.28.16 (#6770)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.1.37 to 3.28.16.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2.1.37...28deaeda66b76a05916b6923827895f2b14ab387)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.16
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-03 12:55:00 +05:30
Vishal Kumar
d3ce7ad118 Feat(validation): fail-fast CUE validation for required parameters (incl. dynamic sources) (#6774)
* Chore: Added fail fast validation logic of component having multiple steps including workflow, component etc.

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* testing updated param filter logic

Signed-off-by: Amit Singh <singhamitch@outlook.com>

* Added validation logic for struct type parameter

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* fixed code when struct type parameter is provided in component

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* refactor: minor code improvements

Signed-off-by: Amit Singh <singhamitch@outlook.com>

* fixed go lint issue

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* Chore: Add test cases for fail fast logic

Signed-off-by: Vishal Kumar <vishal210893@gmail.com>

* updated expect logic

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* Added e2e test cases for required param validation

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* Added feature gate in e2e test cases for required param validation

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* Added feature gate make e2e_test file and removed for ginkgo test file

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* Fixed code to quoted string

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* Added logic and test case for policy type override

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

* Added license header

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

---------

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Vishal Kumar <vishal210893@gmail.com>
Co-authored-by: Amit Singh <singhamitch@outlook.com>
Co-authored-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
2025-05-03 12:54:05 +05:30
shivin
a1145f21fe Fix: update apps with topology policy during cluster join (#6768)
* functionality to get all application with a topology in cluster

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: Shivin Gopalani <sgopalani@guidewire.com>

* refactor code and unit tests

Signed-off-by: Shivin Gopalani <sgopalani@guidewire.com>

* refactor code and unit tests

Signed-off-by: Shivin Gopalani <sgopalani@guidewire.com>

* rearrange imports

Signed-off-by: Shivin Gopalani <sgopalani@guidewire.com>

* remove calling of goroutine

Signed-off-by: Shivin Gopalani <sgopalani@guidewire.com>

* update logic to set publich version annotation

Signed-off-by: Shivin Gopalani <sgopalani@guidewire.com>

* removed unused constants

Signed-off-by: Shivin Gopalani <sgopalani@guidewire.com>

* make reviewable

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* add license info for cluster_test.go

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* ignore errors in updateAppsWithTopologyPolicy

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* modify error message

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* gofmt

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* add retry logic to handle conflict errors

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* using cmd to print and add log for retried applications

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* using context as first argument

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* log namespace in error

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* optimize retry logic

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* add pagination for listing applications

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

---------

Signed-off-by: vishal210893 <vishal210893@gmail.com>
Signed-off-by: Shivin Gopalani <sgopalani@guidewire.com>
Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>
Co-authored-by: vishal210893 <vishal210893@gmail.com>
2025-05-01 14:31:11 +05:30
glaxman
edf3be272e fix(traitdefinition): podsecuritycontext - Make localhostProfile optional for other types and provide it only for Localhost. Fixes #6772 (#6773)
Signed-off-by: glaxman <508625+glaxman@users.noreply.github.com>
2025-05-01 09:29:03 +05:30
Oleg Tsymbal
b4f9db4af8 Fix(Helm): make tolerations, nodeSelector, affinity more generic (#6771)
* Fix(Helm): make tolerations, nodeSelector, affinity more generic

Signed-off-by: Oleg Tsymbal <dzirg44@gmail.com>

* Fix(Helm): make conditionals if and with consistent

Signed-off-by: Oleg Tsymbal <dzirg44@gmail.com>

* Fix(Helm): trigger the build to see if it is a problem with timeout

Signed-off-by: Oleg Tsymbal <dzirg44@gmail.com>

---------

Signed-off-by: Oleg Tsymbal <dzirg44@gmail.com>
2025-04-30 14:13:25 +05:30
PushparajShetty
78c0b2c04e Chore: update go and golangci version (#6767)
* update go and golangci version

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* update golangci version

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* update staticcheck version

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* update staticcheck version

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* update staticcheck version

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* update golangci_lint version

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* update golangci_lint version

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* updated .golangci.yaml

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* updated .golangci.yaml

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* updated .golangci.yaml

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* updated .golangci.yaml

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* updated .golangci.yaml

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* updated .golangci.yaml

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* updated .golangci.yaml

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* updated .golangci.yaml

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* updated .golangci.yaml

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* updated .golangci.yaml

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* updated .golangci.yaml and formating in go files

Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* updated .golangci.yaml and formating in go files

Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* updated makefile step

Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* fix formatting issue

Signed-off-by: Gowtham S <gowthams316@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* update ginkgo tests

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* updated ginkgo tests

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* upgraded go/x/crypto to v0.37.0

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* go/kin-openapi version to v0.118.0 and go/x/net version upgraded to v0.39.0

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* upgrades go/x/oauth2 version to v0.29.0

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* update ginkgo test

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* upgrades alpine image version to 3.21

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* updates ginkgo tests

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

---------

Signed-off-by: Vaibhav Agrawal <vaibhav.agrawal0096@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>
Signed-off-by: Gowtham S <gowthams316@gmail.com>
Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>
2025-04-29 03:46:08 +08:00
Anoop Gopalakrishnan
5d42a3b507 Fix: Failing issue-commands workflow (#6766)
Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
2025-04-25 06:16:59 +08:00
alingse
1588736b4e Fix: call errors.Wrap with a nil value error err (#6739)
Signed-off-by: alingse <alingse@foxmail.com>
2025-04-22 03:56:57 +05:30
Amit Singh
27965fb8aa Chore: updates vuln dependencies versions (#6757)
* chore: updates vuln dependencies versions

Signed-off-by: Amit Singh <singhamitch@outlook.com>

* fix check-diff tests

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

* updated import for deprecated package

Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>

---------

Signed-off-by: Amit Singh <singhamitch@outlook.com>
Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>
Co-authored-by: Gowtham <gowthams316@gmail.com>
Co-authored-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>
Co-authored-by: PushparajShetty <116911361+PushparajShetty@users.noreply.github.com>
2025-04-18 10:22:27 +05:30
PushparajShetty
262daacb63 fix the initilization for trait in output section (#6762)
Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>
2025-04-18 10:21:54 +05:30
PushparajShetty
fb17af5e75 update workflow package to fix output compatibility (#6761)
Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>
2025-04-17 03:14:49 -07:00
jguionnet
5122eb575b Update score card action version (#6759)
Signed-off-by: jguionnet <jguionnet@guidewire.com>
2025-04-15 23:25:36 +05:30
Ayush Kumar
d93e292142 feat: add signed releases, SBOMs, and SLSA provenance (#6749)
- Add SPDX SBOMs for Vela Core and CLI images
- Sign and attest images to GHCR and DockerHub
- Generate and attest SLSA provenance
- Include SBOMs for binaries via GoReleaser
- Sign artifact checksums for integrity

Signed-off-by: Ayush <ayushshyam.official.888@gmail.com>
2025-04-15 11:22:37 +08:00
shivin
f9e15c55ad upgrade vulnerable packages (#6755)
Signed-off-by: Gowtham S <gowthams316@gmail.com>
2025-04-14 22:37:52 +05:30
jguionnet
af7f623cba Feat: added support for stateful set (#6638)
* StatefulSet Draft

Signed-off-by: jguionnet <jguionnet@guidewire.com>

* First running version

Signed-off-by: jguionnet <jguionnet@guidewire.com>

* Add generated component definition

Signed-off-by: jguionnet <jguionnet@guidewire.com>

* Adding an statefulset example inline with the component doc

Signed-off-by: jguionnet <jguionnet@guidewire.com>

* Adjustment to an example defining a simplistic statefulset and trait

Signed-off-by: jguionnet <jguionnet@guidewire.com>

* Fix PR Review comments

Signed-off-by: jguionnet <jguionnet@guidewire.com>

* After running make reviewable and more ...

Signed-off-by: jguionnet <jguionnet@guidewire.com>

---------

Signed-off-by: jguionnet <jguionnet@guidewire.com>
2025-04-12 07:17:21 +08:00
Ayush Shyam Kumar
d487012468 adds slsa generator to the workflow (#6747)
Signed-off-by: Shivin Gopalani <gopalanishivin@gmail.com>
Signed-off-by: Ayush <ayushshyam.official.888@gmail.com>
Co-authored-by: Ayush Kumar <aykumar@guidewire.com>
2025-04-09 14:17:56 -07:00
ClarenceLiu
fc8888cb4d Fix(CUE): remove duplicate tcpSocket in startup-probe (#6528)
Signed-off-by: ComingCL <1328004790@qq.com>
2025-04-03 21:34:15 +05:30
dependabot[bot]
9558cb8491 Chore: (deps): Bump docker/build-push-action from 6.3.0 to 6.15.0 (#6740)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.3.0 to 6.15.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](1a162644f9...471d1dc4e0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-31 22:32:21 +05:30
Chaitanyareddy0702
bde50df3e5 Fix: Vela not deleting the definition revisions after cleaning up the definitions (#6738)
Signed-off-by: svc-gh-gokarna_gwre <svc-gh-gokarna@guidewire.com>
Co-authored-by: svc-gh-gokarna_gwre <svc-gh-gokarna@guidewire.com>
2025-03-29 06:16:03 +08:00
Vishal Kumar
dba2676cd9 Fix: modified webservice componenet definition to define resource req and … (#6714)
* modified webservice componenet definition to define resource req and limit

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* maintained backward compatibility and introduce new parameter limit for resource limit

Signed-off-by: vishal210893 <vishal210893@gmail.com>

* updated definition in cue file and run make reviewable command to generate component definition

Signed-off-by: vishal210893 <vishal210893@gmail.com>

---------

Signed-off-by: vishal210893 <vishal210893@gmail.com>
2025-03-27 05:50:27 +08:00
Brian Kane
8ee02c6506 Feat: Enable CueX compiler in component & trait templating (#6720)
* Feat: Enable CueX compiler in component & trait templating

* Feat: Enable CueX compiler in component & trait templating

Signed-off-by: Brian Kane <briankane1@gmail.com>

---------

Signed-off-by: Brian Kane <briankane1@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-25 07:52:51 +08:00
shivin
0751c15ee5 Fix: support task component to be one-time run to completion (#6733)
* added metadata.name for Job to be combination of app name and component name

Signed-off-by: Shivin Gopalani <sgopalani@guidewire.com>

* make reviewable

Signed-off-by: Shivin Gopalani <sgopalani@guidewire.com>

---------

Signed-off-by: Shivin Gopalani <sgopalani@guidewire.com>
Co-authored-by: Shivin Gopalani <sgopalani@guidewire.com>
2025-03-25 04:56:51 +05:30
dependabot[bot]
1a16e52e36 Chore: (deps): Bump docker/setup-qemu-action from 3.0.0 to 3.6.0 (#6735)
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 3.0.0 to 3.6.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](68827325e0...29109295f8)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-25 02:36:44 +05:30
Jonatas Teixeira
853a077107 Fix(parser) - The app.Spec.Policies[idx].Name must be a valid string (#6723)
* Fix(parser) - Valid value must be an empty string or consist of alphanumeric characters, '-', '' or '.', and must start and end with an alphanumeric character

Signed-off-by: Jonatas Teixeira <jonatas.teixeira@hellofresh.com>

* Fix(e2e) - Increase waiting to prevent test start before port-forwared be finished

Signed-off-by: Jonatas Teixeira <jonatas.teixeira@hellofresh.com>

* Fix(e2e) - Adjust the time

Signed-off-by: Jonatas Teixeira <jonatas.teixeira@hellofresh.com>

* Fix(e2e) - Increase waiting to prevent test start before port-forwared be finished - By using gomega

Signed-off-by: Jonatas Teixeira <jonatas.teixeira@hellofresh.com>

* Fix(e2e) - Change vela command to get app status

Signed-off-by: Jonatas Teixeira <jonatas.teixeira@hellofresh.com>

---------

Signed-off-by: Jonatas Teixeira <jonatas.teixeira@hellofresh.com>
2025-03-25 02:28:45 +05:30
shivin
c5d9f69c9c Fix: removing detached clusters from resource trackers (#6728)
* removing detached clusters from resource trackers

Signed-off-by: Pushparaj Shetty KS <kspushparajshetty@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* resolve merge conflicts

Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* resolved code conflicts

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>

* update TestGetAddonStatus test case

Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>

---------

Signed-off-by: Pushparaj Shetty KS <kspushparajshetty@gmail.com>
Signed-off-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>
Signed-off-by: Chaitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
Co-authored-by: Shivin Gopalani <sgopalani@guidewire.com>
Co-authored-by: Pushparaj Shetty K S <kspushparajshetty@gmail.com>
2025-03-19 07:35:06 +08:00
dependabot[bot]
e0f162e47d Chore: (deps): Bump docker/login-action from 3.0.0 to 3.4.0 (#6726)
Bumps [docker/login-action](https://github.com/docker/login-action) from 3.0.0 to 3.4.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](343f7c4344...74a5d14239)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-17 22:57:49 +05:30
Chaitanyareddy0702
d9fcebb9e8 Feat: support token retrieval via AuthInfo.Exec command (#6721)
Signed-off-by: co_gwre <co@guidewire.com>
Co-authored-by: co_gwre <co@guidewire.com>
2025-03-13 07:44:18 +05:30
Anoop Gopalakrishnan
c48ded1994 Fix: build failure due to deprecated actions/cache (#6711)
Some checks failed
CodeQL / Analyze (go) (push) Failing after 35s
E2E MultiCluster Test / detect-noop (push) Successful in 2s
E2E Test / detect-noop (push) Successful in 3s
Go / detect-noop (push) Successful in 2s
license / Check for unapproved licenses (push) Failing after 8s
Registry / publish-core-images (push) Failing after 14s
Scorecards supply-chain security / Scorecards analysis (push) Failing after 27s
Unit-Test / detect-noop (push) Successful in 2s
Definition-Lint / definition-doc (push) Failing after 7m7s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 1m51s
E2E Test / e2e-tests (v1.29) (push) Failing after 1m36s
Go / staticcheck (push) Successful in 2m16s
Go / check-diff (push) Successful in 18m47s
Go / lint (push) Failing after 20m12s
Go / check-cli-image-build (push) Failing after 4m29s
Go / check-core-image-build (push) Successful in 6m31s
Unit-Test / unit-tests (push) Failing after 13m24s
Go / check-windows (push) Has been cancelled
* Fix(build): Upgrade actions/cache version

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Fix(build): Update actions/cache

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

---------

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
2025-03-05 12:03:01 +08:00
yyzxw
424e433963 Feat: add controller metrics (#6650)
Some checks failed
Definition-Lint / definition-doc (push) Failing after 4m24s
E2E MultiCluster Test / detect-noop (push) Successful in 24s
E2E Test / detect-noop (push) Successful in 20s
Go / detect-noop (push) Successful in 23s
license / Check for unapproved licenses (push) Failing after 2m40s
Registry / publish-core-images (push) Failing after 53s
Scorecards supply-chain security / Scorecards analysis (push) Failing after 41s
Unit-Test / detect-noop (push) Successful in 16s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 1m25s
E2E Test / e2e-tests (v1.29) (push) Failing after 1m12s
CodeQL / Analyze (go) (push) Failing after 16m11s
Go / staticcheck (push) Successful in 18m56s
Go / lint (push) Successful in 20m1s
Go / check-diff (push) Failing after 15m2s
Go / check-cli-image-build (push) Failing after 2m41s
Go / check-core-image-build (push) Successful in 18m10s
Unit-Test / unit-tests (push) Failing after 13m17s
Go / check-windows (push) Has been cancelled
* feat: add controller metrics

Signed-off-by: yyzxw <1020938856@qq.com>

* Fix: README changes after make reviewable

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

---------

Signed-off-by: yyzxw <1020938856@qq.com>
Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
Co-authored-by: Anoop Gopalakrishnan <2038273+anoop2811@users.noreply.github.com>
Co-authored-by: Anoop Gopalakrishnan <anoop2811@aol.in>
2025-03-02 17:02:58 -08:00
dependabot[bot]
b51957ef9f Chore: (deps): Bump golangci/golangci-lint-action from 6.1.1 to 6.5.0 (#6690)
Some checks failed
Definition-Lint / definition-doc (push) Failing after 6m35s
E2E MultiCluster Test / detect-noop (push) Successful in 19s
E2E Test / detect-noop (push) Successful in 16s
Go / detect-noop (push) Successful in 16s
license / Check for unapproved licenses (push) Failing after 2m38s
Registry / publish-core-images (push) Failing after 46s
CodeQL / Analyze (go) (push) Failing after 11m34s
Unit-Test / detect-noop (push) Successful in 2s
Scorecards supply-chain security / Scorecards analysis (push) Failing after 48s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 13s
Go / staticcheck (push) Successful in 2m7s
E2E Test / e2e-tests (v1.29) (push) Failing after 2m23s
Go / lint (push) Successful in 12m8s
Go / check-diff (push) Failing after 15m33s
Go / check-core-image-build (push) Successful in 4m53s
Go / check-cli-image-build (push) Failing after 3m17s
Unit-Test / unit-tests (push) Failing after 5m4s
Go / check-windows (push) Has been cancelled
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.1.1 to 6.5.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](971e284b60...2226d7cb06)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-02 09:25:57 -08:00
huochexizhan
cd0b0988f9 fix: fix incorrect nil return value (#6705)
Signed-off-by: huochexizhan <huochexizhan@outlook.com>
2025-03-02 09:23:56 -08:00
Taosh
ead624e553 chore: quick deploy button for kubevela (#6692)
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m48s
E2E MultiCluster Test / detect-noop (push) Successful in 9s
E2E Test / detect-noop (push) Successful in 8s
Go / detect-noop (push) Successful in 8s
license / Check for unapproved licenses (push) Failing after 22s
Registry / publish-core-images (push) Failing after 22s
Scorecards supply-chain security / Scorecards analysis (push) Failing after 35s
Unit-Test / detect-noop (push) Successful in 9s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 27s
E2E Test / e2e-tests (v1.29) (push) Failing after 24s
Definition-Lint / definition-doc (push) Failing after 6m49s
Go / staticcheck (push) Successful in 2m59s
Go / lint (push) Failing after 19m45s
Go / check-diff (push) Failing after 21m3s
Go / check-core-image-build (push) Failing after 5m16s
Go / check-cli-image-build (push) Failing after 3m11s
Unit-Test / unit-tests (push) Failing after 13m17s
Go / check-windows (push) Has been cancelled
Signed-off-by: 青炽 <hanyuntao.hyt@alibaba-inc.com>
Co-authored-by: 青炽 <hanyuntao.hyt@alibaba-inc.com>
2025-02-28 19:07:41 -08:00
Daniel Higuero
f5aed7aefd Update CODEOWNERS (#6695)
Remove dhiguero from codeowners
2025-02-28 19:02:20 -08:00
shivin
30249d5297 Fix: fix for skipping deletion of orphan resources (#6700)
* fix for skipping deletion of orphan resources

Signed-off-by: Pushparaj Shetty KS <kspushparajshetty@gmail.com>

* gofmt fix

Signed-off-by: Pushparaj Shetty KS <kspushparajshetty@gmail.com>

---------

Signed-off-by: Pushparaj Shetty KS <kspushparajshetty@gmail.com>
2025-02-28 19:00:31 -08:00
Anoop Gopalakrishnan
472e1f1e59 Fix: upddate deprecated action versions (#6702)
Some checks failed
Definition-Lint / definition-doc (push) Failing after 33s
E2E MultiCluster Test / detect-noop (push) Successful in 9s
E2E Test / detect-noop (push) Successful in 9s
Go / detect-noop (push) Successful in 9s
license / Check for unapproved licenses (push) Failing after 15s
CodeQL / Analyze (go) (push) Failing after 1m55s
Registry / publish-core-images (push) Failing after 24s
Unit-Test / detect-noop (push) Successful in 9s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 36s
E2E Test / e2e-tests (v1.29) (push) Failing after 29s
Go / staticcheck (push) Successful in 20m2s
Go / lint (push) Failing after 22m11s
Go / check-core-image-build (push) Successful in 8m59s
Go / check-cli-image-build (push) Successful in 2m41s
Go / check-diff (push) Failing after 15m22s
Unit-Test / unit-tests (push) Failing after 5m29s
Scorecards supply-chain security / Scorecards analysis (push) Failing after 35s
Go / check-windows (push) Has been cancelled
2025-02-28 11:08:05 +08:00
Tianxin Dong
33cd16d425 chore: update workflow to fix the compatibility for outputs (#6701)
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m38s
E2E MultiCluster Test / detect-noop (push) Successful in 27s
E2E Test / detect-noop (push) Successful in 21s
Go / detect-noop (push) Successful in 26s
Definition-Lint / definition-doc (push) Successful in 3m19s
Registry / publish-core-images (push) Failing after 38s
Scorecards supply-chain security / Scorecards analysis (push) Failing after 28s
Unit-Test / detect-noop (push) Successful in 2s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 19s
E2E Test / e2e-tests (v1.29) (push) Failing after 18s
license / Check for unapproved licenses (push) Failing after 3m3s
Go / staticcheck (push) Successful in 3m8s
Go / lint (push) Failing after 19m52s
Go / check-core-image-build (push) Failing after 4m24s
Go / check-cli-image-build (push) Failing after 3m5s
Go / check-diff (push) Successful in 25m18s
Unit-Test / unit-tests (push) Failing after 12m41s
Go / check-windows (push) Has been cancelled
Signed-off-by: FogDong <fog@bentoml.com>
2025-02-27 00:16:28 +05:30
Amit Singh
793ba55455 fix: switches to new helm repo url (#6694)
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m2s
Definition-Lint / definition-doc (push) Failing after 7m6s
E2E MultiCluster Test / detect-noop (push) Successful in 25s
E2E Test / detect-noop (push) Successful in 35s
Go / detect-noop (push) Successful in 17s
license / Check for unapproved licenses (push) Failing after 2m49s
Registry / publish-core-images (push) Failing after 55s
Unit-Test / detect-noop (push) Successful in 23s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 2m27s
E2E Test / e2e-tests (v1.29) (push) Failing after 1m37s
Go / staticcheck (push) Successful in 19m8s
Go / lint (push) Failing after 19m44s
Go / check-diff (push) Failing after 15m16s
Go / check-core-image-build (push) Failing after 4m5s
Go / check-cli-image-build (push) Failing after 3m1s
Unit-Test / unit-tests (push) Failing after 13m10s
Go / check-windows (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Failing after 51s
Signed-off-by: Chitanya Reddy Onteddu <chaitanyareddy0702@gmail.com>
2025-02-20 20:41:12 +05:30
Tianxin Dong
711c9f0053 fix: fix addon check (#6687)
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m21s
Definition-Lint / definition-doc (push) Failing after 7m18s
E2E MultiCluster Test / detect-noop (push) Successful in 26s
E2E Test / detect-noop (push) Successful in 19s
Go / detect-noop (push) Successful in 19s
license / Check for unapproved licenses (push) Failing after 2m57s
Registry / publish-core-images (push) Failing after 45s
Unit-Test / detect-noop (push) Successful in 21s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 1m39s
E2E Test / e2e-tests (v1.29) (push) Failing after 1m21s
Go / staticcheck (push) Successful in 17m18s
Go / lint (push) Failing after 19m39s
Go / check-diff (push) Failing after 14m58s
Go / check-core-image-build (push) Failing after 3m51s
Go / check-cli-image-build (push) Failing after 3m4s
Unit-Test / unit-tests (push) Failing after 12m46s
Go / check-windows (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Failing after 56s
Signed-off-by: FogDong <fog@bentoml.com>
2025-02-12 13:18:39 +08:00
Kanchan Dhamane
bc15e5b359 Feat: Semantic versioning support for Definitions (#6648)
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m43s
Definition-Lint / definition-doc (push) Failing after 6m13s
E2E MultiCluster Test / detect-noop (push) Successful in 24s
E2E Test / detect-noop (push) Successful in 17s
Go / detect-noop (push) Successful in 21s
license / Check for unapproved licenses (push) Failing after 2m38s
Registry / publish-core-images (push) Failing after 40s
Unit-Test / detect-noop (push) Successful in 20s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 1m55s
E2E Test / e2e-tests (v1.29) (push) Failing after 1m18s
Go / staticcheck (push) Successful in 18m35s
Go / lint (push) Failing after 19m38s
Go / check-diff (push) Failing after 15m7s
Go / check-core-image-build (push) Failing after 3m45s
Go / check-cli-image-build (push) Failing after 2m23s
Unit-Test / unit-tests (push) Failing after 12m43s
Go / check-windows (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Failing after 48s
* feature: Add Semantic versioning to KubeVela Definitions

Fixes https://github.com/kubevela/kubevela/issues/6435
Fixes https://github.com/kubevela/kubevela/issues/6534

Changes:
- Adds an optional "Version" field for all Definition Specs.
- Adds the following new validations to Webhooks for Definitions:
	- Validate the "Version" field follows Semantic versioning.
	- Dis-allow conflicting versioning fields ( Name annotation, Spec.Version)
- Adds the following new validations to Webhooks for Application:
	- Dis-allow the use of both the "publishVersion" & "autoUpdate" annotations.
- Enahnce "multiStageComponentApply" feature to support auto updates.

Boy Scout Changes:
- Fixes Plugin e2e tests broken by the fix for 6534.
- Fixes the dryRun and livediff commands to respect the "-n" namespace flag.
- Fixes the Application ValidationWebhook to respect the "-n" namespace flag.

Co-authored-by: Rahul Kumar <35751394+bugbounce@users.noreply.github.com>
Co-authored-by: Chaitanya Reddy <chaitanyareddy0702@gmail.com>
Co-authored-by: Vibhor Chinda <vibhorchinda@gmail.com>
Co-authored-by: Shivin Gopalani <gopalanishivin@gmail.com>

Signed-off-by: kanchan-dhamane <74534570+kanchan-dhamane@users.noreply.github.com>

* feature: Add KEP to define the proposal

Signed-off-by: kanchan-dhamane <74534570+kanchan-dhamane@users.noreply.github.com>

* fix: Rebase and fix merge conflicts

Signed-off-by: kanchan-dhamane <74534570+kanchan-dhamane@users.noreply.github.com>

* Fix: Adds unit test cases

Signed-off-by: kanchan-dhamane <74534570+kanchan-dhamane@users.noreply.github.com>

---------

Signed-off-by: kanchan-dhamane <74534570+kanchan-dhamane@users.noreply.github.com>
Co-authored-by: bugbounce <35751394+bugbounce@users.noreply.github.com>
2025-02-03 11:09:28 +08:00
Eko Simanjuntak
d0d7beb700 fix: return error before accesing mapping resource (#6660)
Some checks failed
CodeQL / Analyze (go) (push) Failing after 2m18s
Definition-Lint / definition-doc (push) Failing after 6m5s
E2E MultiCluster Test / detect-noop (push) Successful in 18s
E2E Test / detect-noop (push) Successful in 21s
Go / detect-noop (push) Successful in 19s
license / Check for unapproved licenses (push) Failing after 2m30s
Registry / publish-core-images (push) Failing after 49s
Unit-Test / detect-noop (push) Successful in 18s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 1m28s
E2E Test / e2e-tests (v1.29) (push) Failing after 1m17s
Go / staticcheck (push) Successful in 18m20s
Go / lint (push) Failing after 19m38s
Go / check-diff (push) Failing after 15m6s
Go / check-core-image-build (push) Failing after 4m1s
Go / check-cli-image-build (push) Failing after 3m2s
Unit-Test / unit-tests (push) Failing after 13m29s
Go / check-windows (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Failing after 41s
Signed-off-by: Eko Simanjuntak <ecojuntak@gmail.com>
2025-01-25 00:36:13 +05:30
dependabot[bot]
e63d8c33ec Chore: (deps): Bump github.com/go-git/go-git/v5 from 5.8.1 to 5.13.1 (#6668)
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m30s
Definition-Lint / definition-doc (push) Failing after 6m23s
E2E MultiCluster Test / detect-noop (push) Successful in 22s
E2E Test / detect-noop (push) Successful in 24s
Go / detect-noop (push) Successful in 27s
license / Check for unapproved licenses (push) Failing after 2m46s
Registry / publish-core-images (push) Failing after 1m5s
Scorecards supply-chain security / Scorecards analysis (push) Failing after 46s
Unit-Test / detect-noop (push) Successful in 26s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 3m12s
E2E Test / e2e-tests (v1.29) (push) Failing after 1m13s
Go / staticcheck (push) Successful in 19m3s
Go / lint (push) Failing after 19m42s
Go / check-diff (push) Failing after 11m44s
Go / check-core-image-build (push) Failing after 3m8s
Go / check-cli-image-build (push) Failing after 2m32s
Unit-Test / unit-tests (push) Failing after 12m55s
Go / check-windows (push) Has been cancelled
Bumps [github.com/go-git/go-git/v5](https://github.com/go-git/go-git) from 5.8.1 to 5.13.1.
- [Release notes](https://github.com/go-git/go-git/releases)
- [Commits](https://github.com/go-git/go-git/compare/v5.8.1...v5.13.1)

---
updated-dependencies:
- dependency-name: github.com/go-git/go-git/v5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-22 01:56:32 +05:30
dependabot[bot]
3779f828ae Chore: (deps): Bump docker/setup-buildx-action from 3.0.0 to 3.8.0 (#6678)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.0.0 to 3.8.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](f95db51fdd...6524bf65af)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-22 01:54:37 +05:30
dependabot[bot]
4d744a35d4 Chore: (deps): Bump golang.org/x/crypto from 0.25.0 to 0.32.0 (#6672)
Some checks failed
CodeQL / Analyze (go) (push) Failing after 1m54s
Definition-Lint / definition-doc (push) Failing after 7m11s
E2E MultiCluster Test / detect-noop (push) Successful in 25s
E2E Test / detect-noop (push) Successful in 25s
Go / detect-noop (push) Successful in 21s
license / Check for unapproved licenses (push) Failing after 2m40s
Registry / publish-core-images (push) Failing after 38s
Unit-Test / detect-noop (push) Successful in 30s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 3m26s
E2E Test / e2e-tests (v1.29) (push) Failing after 1m13s
Go / staticcheck (push) Successful in 20m3s
Go / lint (push) Failing after 19m36s
Go / check-diff (push) Failing after 15m14s
Go / check-core-image-build (push) Failing after 3m22s
Go / check-cli-image-build (push) Failing after 2m16s
Unit-Test / unit-tests (push) Failing after 12m30s
Go / check-windows (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Failing after 53s
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.25.0 to 0.32.0.
- [Commits](https://github.com/golang/crypto/compare/v0.25.0...v0.32.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-14 03:09:33 +08:00
Thomas Schuetz
9f09436359 Feat: add securityContext and podSecurityContext traits (#6666)
Some checks failed
Definition-Lint / definition-doc (push) Failing after 1m45s
CodeQL / Analyze (go) (push) Failing after 1m49s
E2E MultiCluster Test / detect-noop (push) Successful in 18s
E2E Test / detect-noop (push) Successful in 26s
Go / detect-noop (push) Successful in 21s
Registry / publish-core-images (push) Failing after 1m24s
license / Check for unapproved licenses (push) Failing after 2m53s
Unit-Test / detect-noop (push) Successful in 26s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Failing after 1m56s
E2E Test / e2e-tests (v1.29) (push) Failing after 1m24s
Sync SDK / sync_sdk (push) Failing after 23m1s
Go / staticcheck (push) Successful in 19m14s
Go / check-diff (push) Failing after 15m19s
Go / check-core-image-build (push) Failing after 4m25s
Go / lint (push) Failing after 21m4s
Go / check-cli-image-build (push) Failing after 3m26s
Unit-Test / unit-tests (push) Failing after 8m53s
Scorecards supply-chain security / Scorecards analysis (push) Failing after 20s
Go / check-windows (push) Has been cancelled
* feat: add securityContext and podSecurityContext traits

Signed-off-by: Thomas Schuetz <thomas.schuetz@t-sc.eu>
Signed-off-by: Thomas Schütz <thomas.schuetz@karriere.at>

* Fix: broken runner config for workglow (#6669)

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
Signed-off-by: Thomas Schütz <thomas.schuetz@karriere.at>

* fix: fix spaces at for statements

Signed-off-by: Thomas Schütz <thomas.schuetz@karriere.at>

---------

Signed-off-by: Thomas Schuetz <thomas.schuetz@t-sc.eu>
Signed-off-by: Thomas Schütz <thomas.schuetz@karriere.at>
Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
Co-authored-by: Anoop Gopalakrishnan <2038273+anoop2811@users.noreply.github.com>
2025-01-10 22:24:22 +05:30
Anoop Gopalakrishnan
c6765c6ff0 Fix: broken runner config for workglow (#6669)
Some checks failed
CodeQL / Analyze (go) (push) Failing after 8m37s
Definition-Lint / definition-doc (push) Failing after 6m9s
E2E Test / detect-noop (push) Successful in 20s
Go / detect-noop (push) Successful in 25s
license / Check for unapproved licenses (push) Failing after 3m7s
E2E MultiCluster Test / detect-noop (push) Failing after 10m51s
Registry / publish-core-images (push) Failing after 1m5s
Scorecards supply-chain security / Scorecards analysis (push) Failing after 4m5s
Unit-Test / detect-noop (push) Successful in 20s
E2E Test / e2e-tests (v1.29) (push) Failing after 12m25s
Go / staticcheck (push) Successful in 18m25s
Go / lint (push) Failing after 20m3s
Go / check-core-image-build (push) Failing after 4m15s
Go / check-cli-image-build (push) Failing after 3m8s
Go / check-diff (push) Failing after 17m20s
Unit-Test / unit-tests (push) Failing after 13m22s
Go / check-windows (push) Has been cancelled
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Has been cancelled
Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
2025-01-06 13:37:59 +08:00
Ai Ranthem
a5606b7808 Chore: (deps): Update k8s to 1.29 (#6654)
Some checks failed
CodeQL / Analyze (go) (push) Failing after 6m23s
Definition-Lint / definition-doc (push) Failing after 3m8s
E2E MultiCluster Test / detect-noop (push) Successful in 6s
E2E Test / detect-noop (push) Successful in 3s
Go / detect-noop (push) Successful in 2s
license / Check for unapproved licenses (push) Failing after 18s
Registry / publish-core-images (push) Failing after 1m4s
Unit-Test / detect-noop (push) Successful in 20s
Sync SDK / sync_sdk (push) Failing after 3m9s
Go / staticcheck (push) Successful in 6m17s
Go / check-diff (push) Failing after 19m4s
Go / check-core-image-build (push) Failing after 5m44s
Go / check-cli-image-build (push) Failing after 3m31s
Unit-Test / unit-tests (push) Failing after 13m54s
Go / lint (push) Failing after 1h53m27s
Scorecards supply-chain security / Scorecards analysis (push) Failing after 1m27s
E2E MultiCluster Test / e2e-multi-cluster-tests (v1.29) (push) Has been cancelled
E2E Test / e2e-tests (v1.29) (push) Has been cancelled
Go / check-windows (push) Has been cancelled
* chore: update k8s to 1.29

Signed-off-by: phantomnat <w.nattadej@gmail.com>

* fix: unit test

Signed-off-by: phantomnat <w.nattadej@gmail.com>

* fix: lint

Signed-off-by: phantomnat <w.nattadej@gmail.com>

* fix: lint

Signed-off-by: phantomnat <w.nattadej@gmail.com>

* fix: e2e

Signed-off-by: phantomnat <w.nattadej@gmail.com>

* fix: lint and e2e test

Signed-off-by: phantomnat <w.nattadej@gmail.com>

* test(e2e): increase timeout

Signed-off-by: phantomnat <w.nattadej@gmail.com>

* fix e2e and scripts

Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>

* make reviewable

Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>

* rollback a unnecessary ut change

Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>

* update go.mod to import merged workflow

Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>

---------

Signed-off-by: phantomnat <w.nattadej@gmail.com>
Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
Co-authored-by: phantomnat <w.nattadej@gmail.com>
2025-01-03 07:54:42 +08:00
dependabot[bot]
a6bd2d5fc3 Chore: (deps): Bump golangci/golangci-lint-action from 3.7.0 to 6.1.1 (#6634)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.7.0 to 6.1.1.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](3a91952989...971e284b60)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-10 03:30:43 +05:30
Jonatas Teixeira
f7b1eee7f3 fix: include the build labels and annotaiton metadata (#6655)
Signed-off-by: Jonatas Teixeira <jonatas.teixeira@hellofresh.com>
2024-12-09 13:15:34 +08:00
HongKuang
903f3dfe44 chore: fix function name in comment (#6499)
Signed-off-by: hongkuang <liurenhong@outlook.com>
2024-12-03 14:50:37 +08:00
Tianxin Dong
0f780dec75 Feat: add new providers and fix definitions (#6599)
* feat: add new providers and fix definitions

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix definitions and tests

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix lint and helm

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix definitions

Signed-off-by: FogDong <fog@bentoml.com>

* fix: add multicluster

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix e2e

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix dynamic client for cli

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix api gen

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix lint

Signed-off-by: FogDong <fog@bentoml.com>

---------

Signed-off-by: FogDong <fog@bentoml.com>
2024-10-01 12:29:44 +05:30
YoungLH
b1d62aa6ca Fix: Correct spelling of "application" in deletion message (#6626) (#6628)
Previously, the deletion message for applications contained a typo where "application" was misspelled as "appplication". This commit corrects the spelling to "application" in the message:

- Before: "Start deleting appplication %s/%s\n"
- After: "Start deleting application %s/%s\n"

This change improves the clarity of the output message when deleting applications.

Signed-off-by: YoungLH <974840768@qq.com>
2024-09-27 14:10:17 +08:00
Chaitanyareddy0702
613174384a Feat(#6505): Add support for Cue Required field feature (#6622)
* Fix: e2e-tests and unit-tests

- Remove gomega from workflow e2e-test step
- Change the app phase to WorkFlowFailed when there is an error in workflow
- Change the app10.yaml file

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

Author: VibhorChinda <vibhorchinda@gmail.com>

* Feat: Add strict cue required field parameter validation

Signed-off-by: Chaitanya Reddy Onteddu <co@guidewire.com>

---------

Signed-off-by: Chaitanya Reddy Onteddu <co@guidewire.com>
Co-authored-by: VibhorChinda <vibhorchinda@gmail.com>
2024-09-20 20:28:44 +05:30
Tianxin Dong
3f87c6f2e7 fix: fix github action token (#6608)
Signed-off-by: FogDong <fog@bentoml.com>
2024-08-27 16:52:14 +08:00
Harshita Sao
9370981639 fix: fixed the pinned dependencies issue (#6602)
Signed-off-by: harshitasao <harshitasao@gmail.com>
2024-08-18 22:36:07 +08:00
Tianxin Dong
0f978aed40 chore: use official workflow version (#6588)
Signed-off-by: FogDong <fog@bentoml.com>
2024-07-29 14:08:56 +08:00
Tianxin Dong
4f8bf44684 Refactor: use cuex engine (#6575)
* refactor: use cuex engine

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix lint

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix unit test

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix static check and sdk tests

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix testdata

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix velaql unit test

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix docgen parser

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix cuegen

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix velaql

Signed-off-by: FogDong <fog@bentoml.com>

* fix: delete useless print

Signed-off-by: FogDong <fog@bentoml.com>

* fix: set client for ql

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix mt tests

Signed-off-by: FogDong <fog@bentoml.com>

* fix: set kubeclient in generator

Signed-off-by: FogDong <fog@bentoml.com>

* fix: use pass kube client

Signed-off-by: FogDong <fog@bentoml.com>

* fix: simplify ql

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix lint

Signed-off-by: FogDong <fog@bentoml.com>

* fix: add wf debug back

Signed-off-by: FogDong <fog@bentoml.com>

* fix: add loader

Signed-off-by: FogDong <fog@bentoml.com>

---------

Signed-off-by: FogDong <fog@bentoml.com>
2024-07-27 17:44:20 +08:00
dependabot[bot]
a565b48ae6 Chore: (deps): Bump actions/setup-node from 4.0.0 to 4.0.3 (#6582)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.0 to 4.0.3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](8f152de45c...1e60f620b9)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-15 20:11:42 +05:30
dependabot[bot]
9993fba94d Chore: (deps): Bump actions/github-script from 6.4.1 to 7.0.1 (#6407)
Bumps [actions/github-script](https://github.com/actions/github-script) from 6.4.1 to 7.0.1.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](d7906e4ad0...60a0d83039)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-15 20:09:05 +05:30
shreyas pandya
e3f0a6006d Fix(docs): documentation where schematic for component definition refers to kube (#6579)
* cue structure implemented

Signed-off-by: Kartikay <kartikay_2101ce32@iitp.ac.in>

* indent fix

Signed-off-by: Kartikay <kartikay_2101ce32@iitp.ac.in>

* Fix(docs): correct example by changing schematic from kube to cue

- fixes #6436

Signed-off-by: Shreyas <pandyashreyas1@gmail.com>

---------

Signed-off-by: Kartikay <kartikay_2101ce32@iitp.ac.in>
Signed-off-by: Shreyas <pandyashreyas1@gmail.com>
Co-authored-by: Kartikay <kartikay_2101ce32@iitp.ac.in>
2024-07-15 14:27:44 +05:30
dependabot[bot]
4aeeaa7294 Chore: (deps): Bump docker/build-push-action from 5.0.0 to 6.3.0 (#6571)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5.0.0 to 6.3.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](0565240e2d...1a162644f9)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-12 22:21:59 +08:00
Kanchan Dhamane
5dbbbce4ea chore: updates the make fmt command (#6577)
Signed-off-by: kanchan-dhamane <74534570+kanchan-dhamane@users.noreply.github.com>
2024-07-12 22:19:12 +08:00
Yuping Fan
a0ae9c68ee Fix(CUE): fix namespaces field missing in the required at affinity trait (#6567)
Signed-off-by: Yuping Fan <coderfyp@gmail.com>
Co-authored-by: Yuping Fan <coderfyp@gmail.com>
2024-07-10 11:08:43 +08:00
dependabot[bot]
eba6a7001b Chore: (deps): Bump golang.org/x/crypto from 0.23.0 to 0.25.0 (#6569)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.23.0 to 0.25.0.
- [Commits](https://github.com/golang/crypto/compare/v0.23.0...v0.25.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 11:07:49 +08:00
Vibhor Chinda
79bf139958 Cleaned/Deleted the worklows after every test case (#6565)
Signed-off-by: vchinda <vchinda@guidewire.com>
Co-authored-by: vchinda <vchinda@guidewire.com>
2024-07-03 16:12:53 +08:00
Tianxin Dong
82dad1ebbb Chore: update go version to 1.22 (#6560)
* chore: update go version to 1.22

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix lint

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix unit test

Signed-off-by: FogDong <fog@bentoml.com>

* fix: update static check tool

Signed-off-by: FogDong <fog@bentoml.com>

* fix: add debug

Signed-off-by: FogDong <fog@bentoml.com>

* fix: use ghcr to fix dockerhub rate limit

Signed-off-by: FogDong <fog@bentoml.com>

* fix: use ghcr for addons

Signed-off-by: FogDong <fog@bentoml.com>

* fix: add more timeout for e2e multicluster test

Signed-off-by: FogDong <fog@bentoml.com>

* fix: use ghcr

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix e2e addon image

Signed-off-by: FogDong <fog@bentoml.com>

* fix: test addon terraform version

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix admission image

Signed-off-by: FogDong <fog@bentoml.com>

* fix: fix terraform version

Signed-off-by: FogDong <fog@bentoml.com>

---------

Signed-off-by: FogDong <fog@bentoml.com>
2024-07-03 16:10:56 +08:00
Anoop Gopalakrishnan
c085d83aa8 Chore: Add Fog, Anoop and Daniel as codeowners (#6564)
* Chore: Add Anoop and Daniel as codeowners

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore: Add Fog as a codeowner

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

* Chore: Removed @zzxwill due to non existent error

- Codeowners file was saying the the user handle did not have access to
  the repo

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>

---------

Signed-off-by: Anoop Gopalakrishnan <anoop2811@aol.in>
2024-07-03 16:10:34 +08:00
Chaitanyareddy0702
52873eb7da Fix: e2e-tests and unit-tests (#6562)
- Remove gomega from workflow e2e-test step
- Change the app phase to WorkFlowFailed when there is an error in workflow
- Change the app10.yaml file

Signed-off-by: Chaitanyareddy0702 <chaitanyareddy0702@gmail.com>

Author: VibhorChinda <vibhorchinda@gmail.com>
2024-07-02 16:42:55 +08:00
yukunjie
d5709623ae Fix(CUE): fix volumns variable err bug in vela-cli (#6537)
Signed-off-by: yukunjie <yukunjie007@163.com>
Co-authored-by: yukunjie <yukunjie007@163.com>
2024-06-17 16:17:34 +08:00
Tianxin Dong
de4f89e914 fix: disable auto maxprocs logging (#6530)
Signed-off-by: FogDong <fog@bentoml.com>
2024-06-07 16:12:41 +08:00
dependabot[bot]
fdcdf659d8 Chore: (deps): Bump golang.org/x/crypto from 0.21.0 to 0.23.0 (#6518)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.21.0 to 0.23.0.
- [Commits](https://github.com/golang/crypto/compare/v0.21.0...v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 13:24:21 +08:00
dependabot[bot]
856718ef8e Chore: (deps): Bump golang.org/x/net from 0.21.0 to 0.23.0 (#6506)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.21.0 to 0.23.0.
- [Commits](https://github.com/golang/net/compare/v0.21.0...v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 11:43:28 +08:00
dependabot[bot]
dbd230e7ff Chore: (deps): Bump github.com/cloudflare/circl from 1.3.3 to 1.3.7 (#6439)
Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.3.3 to 1.3.7.
- [Release notes](https://github.com/cloudflare/circl/releases)
- [Commits](https://github.com/cloudflare/circl/compare/v1.3.3...v1.3.7)

---
updated-dependencies:
- dependency-name: github.com/cloudflare/circl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 11:40:25 +08:00
Tianxin Dong
8917780555 fix: bump pkg version to fix the client bug (#6507)
Signed-off-by: FogDong <fog@bentoml.com>
2024-04-22 15:31:51 +08:00
曾子恒
f46bfcf131 Fix(CUE): fix variable error bug in startup-probe (#6472)
The original variable is "grtcpSocketpc", but this variable does not
exist in the file. According to the context, it should be "tcpSocket".
In addition, its type needs to be int to work properly.

Signed-off-by: zengziheng <zengziheng@datacloak.com>
Co-authored-by: zengziheng <zengziheng@datacloak.com>
2024-04-07 10:38:33 +08:00
yyzxw
5bdd0db6e7 Chore: update chart readme (#6494)
Signed-off-by: yyzxw <1020938856@qq.com>
Co-authored-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
2024-04-01 16:06:20 +08:00
yyzxw
838ff055b8 chore: ci yaml err (#6492)
Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
Co-authored-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
2024-04-01 10:28:12 +08:00
Awadabang
24756fc507 fix: comma ok (#6457)
Signed-off-by: Awadabang <sheunggz@gmail.com>
Co-authored-by: Awadabang <sheunggz@gmail.com>
2024-03-15 22:50:47 +08:00
dependabot[bot]
81b54781a2 Chore: (deps): Bump google.golang.org/protobuf from 1.31.0 to 1.33.0 (#6479)
Bumps google.golang.org/protobuf from 1.31.0 to 1.33.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 22:49:56 +08:00
dependabot[bot]
d27cc318f2 Chore: (deps): Bump golang.org/x/crypto from 0.18.0 to 0.21.0 (#6474)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.18.0 to 0.21.0.
- [Commits](https://github.com/golang/crypto/compare/v0.18.0...v0.21.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 22:48:51 +08:00
Paul Sweeney
4e16b047f9 Fix: allow different service and container port (#6477)
Signed-off-by: kolossi <github@kolossi.co.uk>
Co-authored-by: kolossi <kolossi@github.com>
2024-03-15 22:46:22 +08:00
msun1996
c512bbe93a Fix: zstd encoder concurrency number in k8s container, upgrade kubevela/pkg version to 1.9.0 (#6462) (#6476)
Signed-off-by: hanzhaoyang <hanzhaoyang@jd.com>
Co-authored-by: hanzhaoyang <hanzhaoyang@jd.com>
2024-03-15 22:44:55 +08:00
Daniel Higuero
1a001e5b29 Address GolangCI lint 1.55 errors (#6453)
Signed-off-by: Daniel Higuero <daniel@napptive.com>
2024-02-07 17:27:32 +08:00
Paul Sweeney
42d75e09e5 Fix: add cronjob support for annotations, resources, and volumeMounts (#6422)
* Fix: add cronjob support for annotations, resources, and volumeMounts

Signed-off-by: kolossi <github@kolossi.co.uk>

* Fix: cronjob support change if shortcuts to chained ifs

Signed-off-by: kolossi <github@kolossi.co.uk>

* Fix: cronjob support change if shortcuts to chained ifs

Signed-off-by: kolossi <github@kolossi.co.uk>

---------

Signed-off-by: kolossi <github@kolossi.co.uk>
Co-authored-by: kolossi <kolossi@github.com>
2024-01-22 13:11:52 +08:00
Eray
5101401837 Fix: hpa build-in trait corresponding to cpu parameters when try to use memory (#6434)
Signed-off-by: Eray Arslan <relfishere@gmail.com>
2024-01-22 13:10:26 +08:00
dependabot[bot]
b9bfc4ac75 Chore: (deps): Bump golang.org/x/crypto from 0.14.0 to 0.18.0 (#6442)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.18.0.
- [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.18.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-22 13:09:42 +08:00
Tyler Gillson
86dc53afab Fix: load local ComponentDefinitions recursively (#6414)
* fix: load local componentdefinitions recursively

Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>

* test: add dry-run offline def dir test

Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>

* test: fix unit tests

Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>

---------

Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
2024-01-04 08:47:59 -08:00
Tyler Gillson
62efa9c787 fix: prevent kube client lookup in GetFakeClient (#6428)
Signed-off-by: Tyler Gillson <tyler.gillson@gmail.com>
2023-12-26 20:44:03 +08:00
dependabot[bot]
0c449d52b1 Chore: (deps): Bump actions/setup-go from 4.1.0 to 5.0.0 (#6426)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.1.0 to 5.0.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](93397bea11...0c52d547c9)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-26 20:41:14 +08:00
dependabot[bot]
7a69a3b52b Chore: (deps): Bump fkirc/skip-duplicate-actions from 5.3.0 to 5.3.1 (#6380)
Bumps [fkirc/skip-duplicate-actions](https://github.com/fkirc/skip-duplicate-actions) from 5.3.0 to 5.3.1.
- [Release notes](https://github.com/fkirc/skip-duplicate-actions/releases)
- [Commits](12aca0a884...f75f66ce18)

---
updated-dependencies:
- dependency-name: fkirc/skip-duplicate-actions
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 11:03:58 +08:00
dependabot[bot]
7973864c22 Chore: (deps): Bump thehanimo/pr-title-checker from 1.4.0 to 1.4.1 (#6375)
Bumps [thehanimo/pr-title-checker](https://github.com/thehanimo/pr-title-checker) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/thehanimo/pr-title-checker/releases)
- [Commits](https://github.com/thehanimo/pr-title-checker/compare/v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: thehanimo/pr-title-checker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-25 11:00:45 +08:00
Daniel Higuero
f88b167b04 Fix: helm template adding namespace (#6423)
* fix: helm template adding namespace

Signed-off-by: Daniel Higuero <daniel@napptive.com>

* revert commented makefile

Signed-off-by: Daniel Higuero <daniel@napptive.com>

---------

Signed-off-by: Daniel Higuero <daniel@napptive.com>
2023-12-25 10:57:39 +08:00
caiqi1111
8b8c00fbba Fix: update build.mk (#6374)
Signed-off-by: caiqi <caiqi_yewu@cmss.chinamobile.com>
2023-12-05 13:13:07 +08:00
Ryan
5f04812d06 Feat: add annotations and labels to gateway.cue (#6397)
* add annotations and labels to gateway.cue and update gateway.yaml by "make reviewable"

Signed-off-by: YanRyan <527421522@qq.com>

* Update vela-templates/definitions/internal/trait/gateway.cue

Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>

* Update vela-templates/definitions/internal/trait/gateway.cue

Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>

* Update vela-templates/definitions/internal/trait/gateway.cue

Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>

* accept FogDong suggestions, use make reviewablew to update gateway.yaml

Signed-off-by: YanRyan <527421522@qq.com>

* Update vela-templates/definitions/internal/trait/gateway.cue

Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com> (+2 squashed commits)
Squashed commits:
[2ad1ed5e3] Update vela-templates/definitions/internal/trait/gateway.cue

Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>
[a644195ae] Update vela-templates/definitions/internal/trait/gateway.cue

Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>

---------

Signed-off-by: YanRyan <527421522@qq.com>
Co-authored-by: Tianxin Dong <wuwuglu19@gmail.com>
2023-11-20 14:33:29 +08:00
dependabot[bot]
9c037c8233 Chore: (deps): Bump zeebe-io/backport-action from 1.4.0 to 2.1.1 (#6399)
Bumps [zeebe-io/backport-action](https://github.com/zeebe-io/backport-action) from 1.4.0 to 2.1.1.
- [Release notes](https://github.com/zeebe-io/backport-action/releases)
- [Commits](bd68141f07...08bafb375e)

---
updated-dependencies:
- dependency-name: zeebe-io/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-14 22:09:43 +08:00
dependabot[bot]
dc14baf1d8 Chore: (deps): Bump github.com/onsi/ginkgo/v2 from 2.11.0 to 2.13.1 (#6400)
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.11.0 to 2.13.1.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.11.0...v2.13.1)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-14 22:09:04 +08:00
dependabot[bot]
003f329b31 Chore: (deps): Bump actions/setup-node from 3.8.1 to 4.0.0 (#6385)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.8.1 to 4.0.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](5e21ff4d9b...8f152de45c)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 15:09:05 +08:00
dependabot[bot]
b036624efc Chore: (deps): Bump ossf/scorecard-action from 2.2.0 to 2.3.1 (#6386)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.2.0 to 2.3.1.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](08b4669551...0864cf1902)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-02 17:28:04 +08:00
qiaozp
73c9c75c6f Chore: bump terraform-controller to v0.8.0 (#6363)
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-10-01 12:01:07 +08:00
dependabot[bot]
cdcda5c9f9 Chore: (deps): Bump github.com/go-resty/resty/v2 from 2.7.0 to 2.8.0 (#6357)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-30 22:57:44 -05:00
dependabot[bot]
5861988909 Chore: (deps): Bump actions/checkout from 4.0.0 to 4.1.0 (#6360)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](3df4ab11eb...8ade135a41)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-27 08:19:22 +08:00
Mcduller
d3581b9189 Fix: fix the vela show error when format the output markdown (#6356)
Signed-off-by: Mcduller <1596582524@qq.com>
2023-09-25 14:34:37 +08:00
caiqi1111
30fb7a56a0 Fix: validate cue template in webhook handler and add policyvaladatin… (#6355) 2023-09-22 08:42:12 -05:00
caiqi1111
786e0f7755 Fix: update traitdefinitions apiVersions in validatingWebhookConfigur… (#6352)
Signed-off-by: caiqi <caiqi_yewu@cmss.chinamobile.com>
2023-09-21 11:44:28 +08:00
dependabot[bot]
544cc4afb6 Chore: (deps): Bump docker/setup-buildx-action from 2.10.0 to 3.0.0 (#6351)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.10.0 to 3.0.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](885d1462b8...f95db51fdd)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-20 10:53:54 +08:00
Anoop Gopalakrishnan
a07acc02c9 Feat: Add command to list all workflows in vela-cli (#6326)
- fixes #6326

Signed-off-by: Muralicharan Gurumoorthy <muralicharan.gurumoorthy@gmail.com>
Co-authored-by: Muralicharan Gurumoorthy <muralicharan.gurumoorthy@gmail.com>
2023-09-20 10:19:08 +08:00
dependabot[bot]
26faaaf4f9 Chore: (deps): Bump golang.org/x/oauth2 from 0.11.0 to 0.12.0 (#6346)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.11.0 to 0.12.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-19 18:11:24 +08:00
dependabot[bot]
ac9aa16579 Chore: (deps): Bump docker/login-action from 2.2.0 to 3.0.0 (#6349)
Bumps [docker/login-action](https://github.com/docker/login-action) from 2.2.0 to 3.0.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](465a07811f...343f7c4344)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-19 16:52:37 +08:00
dependabot[bot]
a8cc84587c Chore: (deps): Bump goreleaser/goreleaser-action from 4.6.0 to 5.0.0 (#6348)
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4.6.0 to 5.0.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](5fdedb94ab...7ec5c2b0c6)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-19 16:52:16 +08:00
dependabot[bot]
263081a105 Chore: (deps): Bump docker/setup-qemu-action from 2.2.0 to 3.0.0 (#6350)
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2.2.0 to 3.0.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](2b82ce82d5...68827325e0)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-19 16:50:12 +08:00
dependabot[bot]
308819db33 Chore: (deps): Bump github.com/hashicorp/hcl/v2 from 2.17.0 to 2.18.0 (#6344)
Bumps [github.com/hashicorp/hcl/v2](https://github.com/hashicorp/hcl) from 2.17.0 to 2.18.0.
- [Release notes](https://github.com/hashicorp/hcl/releases)
- [Changelog](https://github.com/hashicorp/hcl/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/hcl/compare/v2.17.0...v2.18.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/hcl/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-19 15:25:36 +08:00
dependabot[bot]
0defc5d312 Chore: (deps): Bump golang.org/x/crypto from 0.12.0 to 0.13.0 (#6347)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.12.0 to 0.13.0.
- [Commits](https://github.com/golang/crypto/compare/v0.12.0...v0.13.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-19 15:25:18 +08:00
qiaozp
c8d53c103c Fix: unit test for http pkg (#6354)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-09-19 15:24:45 +08:00
dependabot[bot]
3655a90dfe Chore: (deps): Bump docker/build-push-action from 4.1.1 to 5.0.0 (#6340) 2023-09-13 03:43:45 +00:00
dependabot[bot]
e94426963d Chore: (deps): Bump actions/upload-artifact from 3.1.2 to 3.1.3 (#6337)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](0b7f8abb15...a8a3f3ad30)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 10:15:53 +08:00
yyzxw
5d8543fd8b Fix: gateway triat miss port name (#6329)
Signed-off-by: yyzxw <1020938856@qq.com>
2023-09-13 10:03:37 +08:00
dependabot[bot]
48d1ba0538 Chore: (deps): Bump github.com/xanzy/go-gitlab from 0.90.0 to 0.91.1 (#6323)
Bumps [github.com/xanzy/go-gitlab](https://github.com/xanzy/go-gitlab) from 0.90.0 to 0.91.1.
- [Changelog](https://github.com/xanzy/go-gitlab/blob/master/releases_test.go)
- [Commits](https://github.com/xanzy/go-gitlab/compare/v0.90.0...v0.91.1)

---
updated-dependencies:
- dependency-name: github.com/xanzy/go-gitlab
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 10:03:20 +08:00
dependabot[bot]
eb1bb69a3e Chore: (deps): Bump github.com/cyphar/filepath-securejoin from 0.2.3 to 0.2.4 (#6330)
Bumps [github.com/cyphar/filepath-securejoin](https://github.com/cyphar/filepath-securejoin) from 0.2.3 to 0.2.4.
- [Release notes](https://github.com/cyphar/filepath-securejoin/releases)
- [Commits](https://github.com/cyphar/filepath-securejoin/compare/v0.2.3...v0.2.4)

---
updated-dependencies:
- dependency-name: github.com/cyphar/filepath-securejoin
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 10:02:46 +08:00
dependabot[bot]
a39a8356bd Chore: (deps): Bump actions/checkout from 3.6.0 to 4.0.0 (#6338)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.6.0 to 4.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](f43a0e5ff2...3df4ab11eb)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 10:00:47 +08:00
dependabot[bot]
e3dc76d0cd Chore: (deps): Bump goreleaser/goreleaser-action from 4.4.0 to 4.6.0 (#6336)
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4.4.0 to 4.6.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](3fa32b8bb5...5fdedb94ab)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 09:59:16 +08:00
dependabot[bot]
5be6f38e54 Chore: (deps): Bump actions/cache from 3.3.1 to 3.3.2 (#6334)
Bumps [actions/cache](https://github.com/actions/cache) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](88522ab9f3...704facf57e)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 09:58:44 +08:00
dependabot[bot]
6961587c7f Chore: (deps): Bump golang.org/x/text from 0.12.0 to 0.13.0 (#6322)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.12.0 to 0.13.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.12.0...v0.13.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-07 11:39:42 +08:00
qiaozp
6cbc12f9bb Fix: addon dependency package retrieving is not compatible to v-prefixed version (#6316) 2023-09-02 21:00:41 +08:00
dependabot[bot]
08548968f0 Chore: (deps): Bump github.com/onsi/gomega from 1.27.8 to 1.27.10 (#6307)
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.8 to 1.27.10.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.27.8...v1.27.10)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-31 16:04:50 +08:00
JohnJan
d787e95a08 Feat: apply-component supports namespace (#6248) 2023-08-31 14:08:48 +08:00
dependabot[bot]
c4f9c8f63f Chore: (deps): Bump gomodules.xyz/jsonpatch/v2 from 2.3.0 to 2.4.0 (#6308)
Bumps [gomodules.xyz/jsonpatch/v2](https://github.com/gomodules/jsonpatch) from 2.3.0 to 2.4.0.
- [Release notes](https://github.com/gomodules/jsonpatch/releases)
- [Changelog](https://github.com/gomodules/jsonpatch/blob/release-2.0/CHANGELOG.md)
- [Commits](https://github.com/gomodules/jsonpatch/compare/v2.3.0...v2.4.0)

---
updated-dependencies:
- dependency-name: gomodules.xyz/jsonpatch/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-28 21:57:35 +08:00
dependabot[bot]
6ee7eb345b Chore: (deps): Bump docker/setup-buildx-action from 2.9.1 to 2.10.0 (#6310)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.9.1 to 2.10.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](4c0219f9ac...885d1462b8)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-28 21:57:12 +08:00
dependabot[bot]
b5d42d3d4e Chore: (deps): Bump github.com/containerd/containerd from 1.7.3 to 1.7.5 (#6306)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.7.3 to 1.7.5.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.3...v1.7.5)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-28 21:56:37 +08:00
dependabot[bot]
662597bbca Chore: (deps): Bump golang.org/x/oauth2 from 0.10.0 to 0.11.0 (#6309)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.10.0 to 0.11.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-28 21:56:11 +08:00
dependabot[bot]
9459aae74f Chore: (deps): Bump actions/checkout from 3.5.3 to 3.6.0 (#6311)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 3.6.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](c85c95e3d7...f43a0e5ff2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-28 21:55:23 +08:00
qiaozp
94cbcad471 Chore: tidy appHandler (#6300) 2023-08-28 11:01:33 +08:00
Mcduller
68a2223353 Fix: fix the error when create the same secret twice (#6290)
Signed-off-by: Mcduller <1596582524@qq.com>
2023-08-28 00:11:58 +08:00
yyzxw
15c0b1e218 Feat: enable unknown flags (#6303)
Signed-off-by: yyzxw <1020938856@qq.com>
2023-08-27 17:20:25 +08:00
意琦行
faf5502fae fix: hide msg when no cluster uninstall (#6294) 2023-08-25 12:27:40 +08:00
suwliang3
bdf9bf16b8 feature: identity addon from helm chart structure (#6288)
Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>
2023-08-24 10:29:19 +08:00
JohnJan
6afe75efa6 Fix: container-ports trait reserve port name (#6274) 2023-08-23 15:09:56 +08:00
suwliang3
88a85eacb6 feature: add an annotation for the addon (#6256)
Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>
2023-08-22 17:30:12 +08:00
Pranav
c315e81757 Fix: Print command output using stdout channel #6268 (#6273)
Co-authored-by: Priyanaka Kotturi
2023-08-22 09:55:20 +08:00
dependabot[bot]
5b6b66a5cc Chore: (deps): Bump zeebe-io/backport-action from 1.3.1 to 1.4.0 (#6278)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-21 23:45:10 +08:00
dependabot[bot]
103bd9b42e Chore: (deps): Bump golang.org/x/tools from 0.11.0 to 0.12.0 (#6283)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-21 23:43:56 +08:00
yyzxw
b494185481 chore: add lint fix (#6275)
Signed-off-by: yyzxw <1020938856@qq.com>
2023-08-21 18:02:13 +08:00
dependabot[bot]
9d479b7f7c Chore: (deps): Bump github.com/oam-dev/terraform-controller (#6284)
Bumps [github.com/oam-dev/terraform-controller](https://github.com/oam-dev/terraform-controller) from 0.7.11 to 0.7.12.
- [Release notes](https://github.com/oam-dev/terraform-controller/releases)
- [Commits](https://github.com/oam-dev/terraform-controller/compare/v0.7.11...v0.7.12)

---
updated-dependencies:
- dependency-name: github.com/oam-dev/terraform-controller
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-21 18:00:39 +08:00
dependabot[bot]
629592c7e7 Chore: (deps): Bump github.com/xanzy/go-gitlab from 0.86.0 to 0.90.0 (#6282)
Bumps [github.com/xanzy/go-gitlab](https://github.com/xanzy/go-gitlab) from 0.86.0 to 0.90.0.
- [Changelog](https://github.com/xanzy/go-gitlab/blob/master/releases_test.go)
- [Commits](https://github.com/xanzy/go-gitlab/compare/v0.86.0...v0.90.0)

---
updated-dependencies:
- dependency-name: github.com/xanzy/go-gitlab
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-21 17:59:50 +08:00
dependabot[bot]
b06dec994a Chore: (deps): Bump github.com/containerd/containerd from 1.7.2 to 1.7.3 (#6281)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.2...v1.7.3)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-21 17:59:16 +08:00
dependabot[bot]
4218faac4b Chore: (deps): Bump golang.org/x/term from 0.10.0 to 0.11.0 (#6280)
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.10.0 to 0.11.0.
- [Commits](https://github.com/golang/term/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-21 17:57:34 +08:00
dependabot[bot]
555e94a10c Chore: (deps): Bump golangci/golangci-lint-action from 3.6.0 to 3.7.0 (#6279)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](639cd343e1...3a91952989)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-21 17:54:46 +08:00
dependabot[bot]
5349f1663f Chore: (deps): Bump actions/setup-node from 3.7.0 to 3.8.1 (#6277)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.7.0 to 3.8.1.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](e33196f742...5e21ff4d9b)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-21 17:54:08 +08:00
dependabot[bot]
4778aacaaf Chore: (deps): Bump docker/setup-buildx-action from 2.9.0 to 2.9.1 (#6215)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.9.0 to 2.9.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](2a1a44ac4a...4c0219f9ac)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-16 16:42:11 +08:00
dependabot[bot]
dab2059bf8 Chore: (deps): Bump actions/setup-go from 4.0.1 to 4.1.0 (#6266)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.0.1 to 4.1.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](fac708d667...93397bea11)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-16 16:41:46 +08:00
dependabot[bot]
9c57c09878 Chore: (deps): Bump goreleaser/goreleaser-action from 4.3.0 to 4.4.0 (#6267)
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4.3.0 to 4.4.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](336e29918d...3fa32b8bb5)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-15 11:52:59 +08:00
dependabot[bot]
cc1ac251ce Chore: (deps): Bump github.com/google/go-containerregistry (#6264)
Bumps [github.com/google/go-containerregistry](https://github.com/google/go-containerregistry) from 0.15.2 to 0.16.1.
- [Release notes](https://github.com/google/go-containerregistry/releases)
- [Changelog](https://github.com/google/go-containerregistry/blob/main/.goreleaser.yml)
- [Commits](https://github.com/google/go-containerregistry/compare/v0.15.2...v0.16.1)

---
updated-dependencies:
- dependency-name: github.com/google/go-containerregistry
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-15 11:52:24 +08:00
dependabot[bot]
18fb098fce Chore: (deps): Bump golang.org/x/text from 0.11.0 to 0.12.0 (#6262)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.11.0 to 0.12.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-15 11:51:51 +08:00
qiaozp
5a5721048c Refactor: organize appHandler, remove unused flags (#6254) 2023-08-11 12:50:22 +08:00
qiaozp
bab5bb2caf Refactor: capabilities and workload in appfile parsing (#6250) 2023-08-10 14:41:20 +08:00
dependabot[bot]
cce1859294 Chore: (deps): Bump github.com/go-git/go-git/v5 from 5.7.0 to 5.8.1 (#6239)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-08 17:11:03 +08:00
Daniel Higuero
72bb0798ef Fix: test timeout due to hardcoded goproxy (#6246)
Co-authored-by: JohnJan <wuzhongjian_yewu@cmss.chinamobile.com>
2023-08-08 09:43:41 +08:00
qiaozp
29aa2b9644 Fix: issue bot permission (#6245) 2023-08-07 17:10:50 +08:00
qiaozp
307d1db36d Chore: revert "Feat: apply-component supports namespace" (#6247) 2023-08-07 15:44:20 +08:00
qiaozp
00ae0c9494 Feat: support offline dryrun with deploy step (#6234) 2023-07-26 18:09:01 +08:00
JohnJan
f0357fdc8f Feat: apply-component supports namespace (#6228)
* Feat: apply-component supports namespace

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Feat: apply-component supports namespace

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

---------

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2023-07-25 10:31:18 +08:00
dependabot[bot]
ef8b0ac00f Chore: (deps): Bump github.com/mattn/go-runewidth from 0.0.14 to 0.0.15 (#6229)
Bumps [github.com/mattn/go-runewidth](https://github.com/mattn/go-runewidth) from 0.0.14 to 0.0.15.
- [Commits](https://github.com/mattn/go-runewidth/compare/v0.0.14...v0.0.15)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-runewidth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-24 17:23:38 +08:00
suwliang3
aaaf2bddac bug: The log printing error for the addon module (#6207)
Signed-off-by: suwanliang <suwanliang@cmss.chinamobile.com>
Co-authored-by: suwanliang <suwanliang@cmss.chinamobile.com>
2023-07-24 17:22:53 +08:00
dependabot[bot]
eeb6f08edf Chore: (deps): Bump golang.org/x/tools from 0.10.0 to 0.11.0 (#6217)
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.10.0 to 0.11.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-24 13:37:50 +08:00
JohnJan
b9f1cc97a9 Feat: add container-ports trait for hostPort and hostIP (#6187)
* Feat: add container-ports trait for hostPort and hostIP

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Feat: add container-ports trait for hostPort and hostIP

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Feat: add container-ports trait for hostPort and hostIP

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Feat: add container-ports trait for hostPort and hostIP

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Feat: add container-ports trait for hostPort and hostIP

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

---------

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2023-07-11 18:44:05 +08:00
Jianbo Sun
2117554d53 Fix: add deploy as built-in step to avoid parse in offline mode (#6201) 2023-07-11 17:23:32 +08:00
dependabot[bot]
9edd6ebc30 Chore: (deps): Bump golang.org/x/oauth2 from 0.9.0 to 0.10.0 (#6195)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.9.0 to 0.10.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 09:51:26 +08:00
dependabot[bot]
ccdfc409a8 Chore: (deps): Bump golang.org/x/term from 0.9.0 to 0.10.0 (#6197)
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.9.0 to 0.10.0.
- [Commits](https://github.com/golang/term/compare/v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 22:43:09 +08:00
dependabot[bot]
449b3e0b49 Chore: (deps): Bump RyanSiu1995/kubebuilder-action (#6192)
Bumps [RyanSiu1995/kubebuilder-action](https://github.com/ryansiu1995/kubebuilder-action) from ed0e300b13152c2c2bfb104475665c7bf609332f to 7170cb0476187070ae04cbb6cee305e809de2693.
- [Release notes](https://github.com/ryansiu1995/kubebuilder-action/releases)
- [Commits](ed0e300b13...7170cb0476)

---
updated-dependencies:
- dependency-name: RyanSiu1995/kubebuilder-action
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 22:42:39 +08:00
dependabot[bot]
8be1fb29b4 Chore: (deps): Bump github.com/prometheus/client_golang (#6198)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.1 to 1.16.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.15.1...v1.16.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 19:33:45 +08:00
dependabot[bot]
b42e6cf1e6 Chore: (deps): Bump golang.org/x/text from 0.10.0 to 0.11.0 (#6196)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.10.0 to 0.11.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 19:32:43 +08:00
dependabot[bot]
096afa227b Chore: (deps): Bump docker/setup-buildx-action from 2.8.0 to 2.9.0 (#6193)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.8.0 to 2.9.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](16c0bc4a6e...2a1a44ac4a)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 19:32:16 +08:00
dependabot[bot]
57b74c3687 Chore: (deps): Bump actions/setup-node from 3.6.0 to 3.7.0 (#6194)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](64ed1c7eab...e33196f742)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 19:24:58 +08:00
dependabot[bot]
9203bbcdb8 Chore: (deps): Bump github.com/kubevela/workflow (#6177)
Bumps [github.com/kubevela/workflow](https://github.com/kubevela/workflow) from 0.5.1-0.20230412142834-be9e5a10baf0 to 0.6.0.
- [Release notes](https://github.com/kubevela/workflow/releases)
- [Commits](https://github.com/kubevela/workflow/commits/v0.6.0)

---
updated-dependencies:
- dependency-name: github.com/kubevela/workflow
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-06 16:48:47 +08:00
JohnJan
f3e920ab60 Refactor: parse workloads (#6185)
Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2023-07-05 09:49:34 +08:00
Tanjim Hossain
6893a2b776 fix arm64 build, rm --platform flags in Dockerfile (#6170)
explicitly specify alpine version



explicitly specify alpine version

Signed-off-by: Audacious Tux <tangimhossain1@gmail.com>
2023-07-04 15:39:58 +08:00
Jianbo Sun
4637e3a918 Revert: "Feat: support applicator applying resources and update status (#6030)" (#6182) 2023-07-04 14:06:28 +08:00
dependabot[bot]
118f022cf5 Chore: (deps): Bump github.com/xanzy/go-gitlab from 0.85.0 to 0.86.0 (#6180)
Bumps [github.com/xanzy/go-gitlab](https://github.com/xanzy/go-gitlab) from 0.85.0 to 0.86.0.
- [Changelog](https://github.com/xanzy/go-gitlab/blob/master/releases_test.go)
- [Commits](https://github.com/xanzy/go-gitlab/compare/v0.85.0...v0.86.0)

---
updated-dependencies:
- dependency-name: github.com/xanzy/go-gitlab
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-04 12:17:36 +08:00
qiaozp
dabaf03e73 Chore: swtich between old and new registry in vela install (#6173)
* Chore: swtich between old and new registry in vela install

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* add comments

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* minor fix

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

---------

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-07-04 12:15:30 +08:00
iyear
64e4ab813d Fix: top command abnormal render (#6174)
* Fix: top command abnormal render

Signed-off-by: iyear <ljyngup@gmail.com>

* Fix: imports

Signed-off-by: iyear <ljyngup@gmail.com>

* Fix: gomod

Signed-off-by: iyear <ljyngup@gmail.com>

---------

Signed-off-by: iyear <ljyngup@gmail.com>
2023-07-04 12:09:02 +08:00
dependabot[bot]
2808de4733 Chore: (deps): Bump docker/setup-buildx-action from 2.7.0 to 2.8.0 (#6175)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](ecf95283f0...16c0bc4a6e)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-03 23:31:05 +08:00
dependabot[bot]
8059c30f57 Chore: (deps): Bump sigs.k8s.io/gateway-api from 0.7.0 to 0.7.1 (#6179)
Bumps [sigs.k8s.io/gateway-api](https://github.com/kubernetes-sigs/gateway-api) from 0.7.0 to 0.7.1.
- [Release notes](https://github.com/kubernetes-sigs/gateway-api/releases)
- [Changelog](https://github.com/kubernetes-sigs/gateway-api/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kubernetes-sigs/gateway-api/compare/v0.7.0...v0.7.1)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/gateway-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-03 23:30:56 +08:00
Somefive
48cf6fb10e Fix: vela install chart switch place (#6153)
* Fix: vela install chart switch place

Signed-off-by: Somefive <Somefive@foxmail.com>

* Fix: test case replace url

Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>

---------

Signed-off-by: Somefive <Somefive@foxmail.com>
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
Co-authored-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2023-06-29 17:48:12 +08:00
StevenLeiZhang
90246065d9 Fix: vela dry-run can not render Applicaiton, if x-definition(Compnent/Trait) is not installed to vela-system namespace (#6135)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2023-06-27 23:08:23 +08:00
dependabot[bot]
6e1cb04cd4 Chore: (deps): Bump golang.org/x/oauth2 from 0.8.0 to 0.9.0 (#6155)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.8.0 to 0.9.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-27 19:07:38 +08:00
dependabot[bot]
b8259c9979 Chore: (deps): Bump github.com/onsi/ginkgo/v2 from 2.10.0 to 2.11.0 (#6159)
Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.10.0 to 2.11.0.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v2.10.0...v2.11.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-27 19:07:16 +08:00
dependabot[bot]
110d475ae0 Chore: (deps): Bump github.com/go-git/go-git/v5 from 5.6.1 to 5.7.0 (#6156)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-27 10:23:55 +08:00
dependabot[bot]
141f7dcdeb Chore: (deps): Bump github.com/oam-dev/terraform-controller from 0.7.10 to 0.7.11 (#6157)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-27 10:23:22 +08:00
dependabot[bot]
1baa125cc1 Chore: (deps): Bump ossf/scorecard-action from 2.1.3 to 2.2.0 (#6160)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-27 10:21:43 +08:00
dependabot[bot]
7d3854d86a Chore: (deps): Bump sigs.k8s.io/kind from 0.18.0 to 0.20.0 (#6158)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-27 10:14:01 +08:00
Somefive
6e9063d40c Fix: ci definition lint wrong config (#6148)
Signed-off-by: Somefive <Somefive@foxmail.com>
2023-06-21 13:48:53 +08:00
Somefive
c4f14ad261 Fix: remove forbid redirect for http get (#6147) 2023-06-21 13:46:44 +08:00
Somefive
257695f073 Fix: addon registry use kubevela.github.io and support redirect (#6133) 2023-06-20 16:30:27 +08:00
dependabot[bot]
162a8f346a Chore: (deps): Bump docker/setup-buildx-action from 2.6.0 to 2.7.0 (#6143)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.6.0 to 2.7.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](6a58db7e0d...ecf95283f0)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 23:19:04 +08:00
dependabot[bot]
9b6019f93d Chore: (deps): Bump golangci/golangci-lint-action from 3.5.0 to 3.6.0 (#6141)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](5f1fec7010...639cd343e1)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 18:08:22 +08:00
dependabot[bot]
d283c2fbeb Chore: (deps): Bump goreleaser/goreleaser-action from 4.2.0 to 4.3.0 (#6145)
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](f82d6c1c34...336e29918d)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 17:57:04 +08:00
dependabot[bot]
10e458c06d Chore: (deps): Bump golang.org/x/tools from 0.9.3 to 0.10.0 (#6136)
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.9.3 to 0.10.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.9.3...v0.10.0)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 17:56:40 +08:00
dependabot[bot]
2ca31b41a0 Chore: (deps): Bump github.com/prometheus/client_model (#6139)
Bumps [github.com/prometheus/client_model](https://github.com/prometheus/client_model) from 0.3.0 to 0.4.0.
- [Release notes](https://github.com/prometheus/client_model/releases)
- [Commits](https://github.com/prometheus/client_model/compare/v0.3.0...v0.4.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_model
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 17:56:04 +08:00
dependabot[bot]
c43368457f Chore: (deps): Bump github.com/containerd/containerd from 1.7.1 to 1.7.2 (#6140)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.7.1 to 1.7.2.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.1...v1.7.2)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 17:54:38 +08:00
dependabot[bot]
69dd0d0b20 Chore: (deps): Bump docker/build-push-action from 4.1.0 to 4.1.1 (#6142)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](44ea916f6c...2eb1c1961a)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 17:52:04 +08:00
dependabot[bot]
7af4bd5a49 Chore: (deps): Bump zeebe-io/backport-action from 1.3.0 to 1.3.1 (#6144)
Bumps [zeebe-io/backport-action](https://github.com/zeebe-io/backport-action) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/zeebe-io/backport-action/releases)
- [Commits](b9f8a0a03e...bf5fdd624b)

---
updated-dependencies:
- dependency-name: zeebe-io/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-19 17:51:35 +08:00
StevenLeiZhang
28004bc26f Fix: vela top crash, when view Application topology (#6127)
Signed-off-by: StevenLeiZhang <zhangleiic@163.com>
2023-06-18 10:20:46 +08:00
Somefive
da3618ad27 Chore: remove useless envbinding env (#6122)
* Chore: remove useless envbinding env

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* fix go proxy

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-06-15 14:50:20 +08:00
zhaohuiweixiao
189555ba16 Refactor: addon dependency installation logic (#6045)
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
2023-06-15 11:20:50 +08:00
zhaohuiweixiao
49327b8910 Fix: addon args is not changed when reinstall it without args (#6065)
* Fix: addon args is not changed when reinstall it without args

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

* Fix: addon args review modify

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

---------

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
2023-06-14 16:59:35 +08:00
Somefive
a513029ec8 Fix: vela addon registry add allow redirect (#6120)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-06-14 14:22:12 +08:00
dependabot[bot]
b05ea09d5a Chore: (deps): Bump github.com/getkin/kin-openapi from 0.94.0 to 0.118.0 (#6106)
Bumps [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) from 0.94.0 to 0.118.0.
- [Release notes](https://github.com/getkin/kin-openapi/releases)
- [Commits](https://github.com/getkin/kin-openapi/compare/v0.94.0...v0.118.0)



---
updated-dependencies:
- dependency-name: github.com/getkin/kin-openapi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-13 12:00:31 +08:00
zhaohuiweixiao
ff52cf58ba Fix: can not get the APISchema when registry is not version registry (#6066)
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
2023-06-13 10:36:03 +08:00
zhaohuiweixiao
95fa62164a Fix: addon status list addon info error when there are mulitiple registries (#6073)
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
2023-06-13 10:34:52 +08:00
dependabot[bot]
b576bee882 Chore: (deps): Bump github.com/onsi/gomega from 1.27.7 to 1.27.8 (#6105)
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.7 to 1.27.8.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.27.7...v1.27.8)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 20:52:36 +08:00
dependabot[bot]
9599e67275 Chore: (deps): Bump github.com/hashicorp/hcl/v2 from 2.16.2 to 2.17.0 (#6107)
Bumps [github.com/hashicorp/hcl/v2](https://github.com/hashicorp/hcl) from 2.16.2 to 2.17.0.
- [Release notes](https://github.com/hashicorp/hcl/releases)
- [Changelog](https://github.com/hashicorp/hcl/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/hcl/compare/v2.16.2...v2.17.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/hcl/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 20:52:18 +08:00
dependabot[bot]
8626a4d988 Chore: (deps): Bump docker/setup-qemu-action from 2.1.0 to 2.2.0 (#6108)
Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/docker/setup-qemu-action/releases)
- [Commits](e81a89b173...2b82ce82d5)

---
updated-dependencies:
- dependency-name: docker/setup-qemu-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 20:51:42 +08:00
dependabot[bot]
ef2df1231c Chore: (deps): Bump docker/build-push-action from 4.0.0 to 4.1.0 (#6109)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](3b5e8027fc...44ea916f6c)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 20:51:30 +08:00
dependabot[bot]
8a794a08cd Chore: (deps): Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 (#6104)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.3 to 1.8.4.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.3...v1.8.4)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 18:55:33 +08:00
dependabot[bot]
36efea15a3 Chore: (deps): Bump docker/login-action from 2.1.0 to 2.2.0 (#6110)
Bumps [docker/login-action](https://github.com/docker/login-action) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](f4ef78c080...465a07811f)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 18:53:21 +08:00
dependabot[bot]
799dfbe781 Chore: (deps): Bump actions/checkout from 3.5.2 to 3.5.3 (#6112)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8e5e7e5ab8...c85c95e3d7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 18:53:00 +08:00
dependabot[bot]
06cacb80a0 Chore: (deps): Bump docker/setup-buildx-action from 2.4.1 to 2.6.0 (#6111)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.4.1 to 2.6.0.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](f03ac48505...6a58db7e0d)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 17:37:09 +08:00
dependabot[bot]
652368fdb3 Chore: (deps): Bump github.com/xanzy/go-gitlab from 0.83.0 to 0.85.0 (#6103)
Bumps [github.com/xanzy/go-gitlab](https://github.com/xanzy/go-gitlab) from 0.83.0 to 0.85.0.
- [Changelog](https://github.com/xanzy/go-gitlab/blob/master/releases_test.go)
- [Commits](https://github.com/xanzy/go-gitlab/compare/v0.83.0...v0.85.0)

---
updated-dependencies:
- dependency-name: github.com/xanzy/go-gitlab
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-12 17:35:42 +08:00
Somefive
f1bae16723 Chore: remove schematic kube and helm (#6099)
* Chore: remove unused code

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: remove schematic Kube & Helm

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-06-12 10:41:02 +08:00
suwliang3
c0cbe24dc4 Feat: optimize "application-resource-tree-view" (#6096)
* feature: Optimize "application-resource-tree-view"

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>

* fix: go fmt

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>

* fix: modif staticcheck

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>

---------

Signed-off-by: suwanliang_yewu <suwanliang_yewu@cmss.chinamobile.com>
2023-06-09 09:44:36 +08:00
Somefive
c255d21ad6 Chore: remove unnecessary go mod (#6093)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-06-08 15:32:57 +08:00
merusso
be3b990df0 Feat(#5861): Support addon dependencies version ranges (#6002)
* Feat(#5861): Support addon dependencies version ranges

This change enables addon maintainers to define version ranges for
dependencies in an addon's metadata.yaml file.

This behavior is similar to the version range allowed in the `system`
section of the metadata file. The version range expression for
`dependencies` follows the same format as for `system`.

Example:

```yaml
dependencies:
  - name: addon1
    version: ">= 2.3.3, < 3.0.0"
  - name: addon2
    version: ">= 0.1.0, < 1.0.0"
```

When installing an addon, the behavior varies depending on whether the
dependency is already installed.

If a dependency is already installed, the installed version will be
validated against the version range, and installation will fail with an
error if there's a mismatch.
If a dependency is not installed, the version range will be used to
select the addon version to be installed. If no addon version matching
the range exists, the installation will fail with an error.

Fixes #5861

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix(lint): remove unused ctx parameter

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix(lint): Add comment for IsLocalRegistry

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix(lint): unexport AddonInfoMap

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix(lint): unexport addonInfo

Signed-off-by: Michael Russo <merusso@gmail.com>

* chore: replace map[string]addonInfo with addonInfoMap for consistency

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix: add short circuit when dependency version is not specified

Signed-off-by: Michael Russo <merusso@gmail.com>

* feat: Add test for multiple validation errors

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix: Run go mod tidy

Signed-off-by: Michael Russo <merusso@gmail.com>

* feat: add tests for ToVersionedRegistry

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix: simplify listInstalledAddons loop

Signed-off-by: Michael Russo <merusso@gmail.com>

* feat: listAvailableAddons returns addons from multiple sources

Changes:
* implement ListAddonInfo in Registry
* add interface to aid testing of listAvailableAddons
* add tests for listAvailableAddons

Signed-off-by: Michael Russo <merusso@gmail.com>

* refactor: simplify validateAddonDependencies

move logic from validateAddonDependencies to
calculateDependencyVersionToInstall.

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix(lint): Implicit memory aliasing in for loop.

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix(lint): non-wrapping format verb for fmt.Errorf

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix(lint): indent-error-flow: (revive)

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix(lint): unexported-return

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix(lint): exported type comment format (revive)

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix(lint): refactor AddonInfo to ItemInfo, avoid "stutter" (revive)

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix(lint): add comment to exported method Registry.ListAddonInfo

Signed-off-by: Michael Russo <merusso@gmail.com>

* fix(lint): fix stutter, rename AddonInfoLister to ItemInfoLister

Signed-off-by: Michael Russo <merusso@gmail.com>

* chore: Add suite tests for Registry.ListAddonInfo()

Signed-off-by: Michael Russo <merusso@gmail.com>

* Test: add test cases for addon.sortVersionsDescending

Signed-off-by: Michael Russo <merusso@gmail.com>

---------

Signed-off-by: Michael Russo <merusso@gmail.com>
2023-06-07 11:44:54 +08:00
Yang Gang
30bc8c95f7 Chore: Cache the DiscoveryClient for cli command. (#6091)
Signed-off-by: yanggang <gang.yang@daocloud.io>
2023-06-07 09:58:46 +08:00
dependabot[bot]
cacbad3bb5 Chore: (deps): Bump github.com/google/go-containerregistry (#6081)
Bumps [github.com/google/go-containerregistry](https://github.com/google/go-containerregistry) from 0.15.1 to 0.15.2.
- [Release notes](https://github.com/google/go-containerregistry/releases)
- [Changelog](https://github.com/google/go-containerregistry/blob/main/.goreleaser.yml)
- [Commits](https://github.com/google/go-containerregistry/compare/v0.15.1...v0.15.2)

---
updated-dependencies:
- dependency-name: github.com/google/go-containerregistry
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-06 10:13:25 +08:00
Yang Gang
114cf4005e Chore: Fix duplicate logs and parameter wrong hints. (#6086)
Signed-off-by: yanggang <gang.yang@daocloud.io>
2023-06-06 09:52:09 +08:00
dependabot[bot]
f28c050530 Chore: (deps): Bump golangci/golangci-lint-action from 3.4.0 to 3.5.0 (#6077)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](08e2f20817...5f1fec7010)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-06 09:50:24 +08:00
dependabot[bot]
25e4d6278e Chore: (deps): Bump zeebe-io/backport-action from 1.2.0 to 1.3.0 (#6078)
Bumps [zeebe-io/backport-action](https://github.com/zeebe-io/backport-action) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/zeebe-io/backport-action/releases)
- [Commits](a759fd2d7d...b9f8a0a03e)

---
updated-dependencies:
- dependency-name: zeebe-io/backport-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-06 09:50:08 +08:00
dependabot[bot]
5bbae04963 Chore: (deps): Bump github.com/sirupsen/logrus from 1.9.2 to 1.9.3 (#6084)
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.2 to 1.9.3.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.9.2...v1.9.3)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-06 09:49:54 +08:00
dependabot[bot]
85213e656d Chore: (deps): Bump thehanimo/pr-title-checker from 1.3.7 to 1.4.0 (#6079)
Bumps [thehanimo/pr-title-checker](https://github.com/thehanimo/pr-title-checker) from 1.3.7 to 1.4.0.
- [Release notes](https://github.com/thehanimo/pr-title-checker/releases)
- [Commits](https://github.com/thehanimo/pr-title-checker/compare/v1.3.7...v1.4.0)

---
updated-dependencies:
- dependency-name: thehanimo/pr-title-checker
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-05 17:48:02 +08:00
dependabot[bot]
c07033092e Chore: (deps): Bump github.com/cloudtty/cloudtty from 0.5.2 to 0.5.3 (#6083)
Bumps [github.com/cloudtty/cloudtty](https://github.com/cloudtty/cloudtty) from 0.5.2 to 0.5.3.
- [Release notes](https://github.com/cloudtty/cloudtty/releases)
- [Commits](https://github.com/cloudtty/cloudtty/compare/v0.5.2...v0.5.3)

---
updated-dependencies:
- dependency-name: github.com/cloudtty/cloudtty
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-05 17:47:41 +08:00
Somefive
8e6bed2340 Fix: application gc not blocked by apprev gc (#6074)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-06-05 11:04:23 +08:00
Somefive
f15eba2c5f Chore: remove legacy rollout and scope (#6068)
* Chore: remove legacy rollout & scope

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* remove outdated params

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* fix

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-06-05 10:57:38 +08:00
qiaozp
057e640ce2 Chore: remove migrated swagger json (#6075)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-06-05 10:08:42 +08:00
Susheel Pal
715ec0cbe2 Fix: typo (#6069)
Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2023-06-05 09:35:28 +08:00
Somefive
7a8264ddf3 Fix: issue command permission error (#6071) 2023-06-03 08:53:41 +08:00
Somefive
eb4b1a8161 Fix: vela def vet can be used without Kubernetes (#6063) 2023-06-01 14:15:45 +08:00
Somefive
1a6dafafde Feat: support custom cascading gc policy (#6059) 2023-06-01 10:12:10 +08:00
Paul Sweeney
e215b18a3e Feat: Fix ingress service name for multiple gateway traits (#6067)
Signed-off-by: Paul Sweeney <psweeney@travelrepublic.co.uk>
2023-06-01 09:48:29 +08:00
Somefive
dd899c2b39 Chore: remove outdated apis(v1alppha2 ApplicationConfiguration Component, and HealthScope, Rollout) (#6041)
* remove outdated api

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* fix rt test: no component rt

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* recover context.revision to component hash

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-06-01 09:32:49 +08:00
yyzxw
d6788f12dd feature: parallel init cluster info (#6060)
Signed-off-by: yyzxw <1020938856@qq.com>
2023-05-31 19:31:08 +08:00
qiaozp
c039328682 Fix: component-pod-view not showing podIP, hostIP, nodeName (#6058)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-05-31 14:36:46 +08:00
Somefive
af7922d87c Chore: remove oss upload in CI (#6051) 2023-05-31 14:14:05 +08:00
Somefive
04cd510ddc Chore: use package function to replace parallel function (#6052) 2023-05-31 14:01:30 +08:00
yyzxw
1c0f2c4c7d feature: expose probe params in helm chart (#6044)
Signed-off-by: yyzxw <1020938856@qq.com>
2023-05-31 09:46:22 +08:00
Somefive
ff881f930c Fix: ignore kind not match err for vela def (#6053)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-30 17:03:41 +08:00
Somefive
057441bc76 Chore: set CLI verbose output to be hidden by default (#6016)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-30 14:53:41 +08:00
dependabot[bot]
d3b1006935 Chore: (deps): Bump github.com/onsi/gomega from 1.27.6 to 1.27.7 (#6048)
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.6 to 1.27.7.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.27.6...v1.27.7)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 10:57:30 +08:00
dependabot[bot]
8818f5485b Chore: (deps): Bump github.com/imdario/mergo from 0.3.15 to 0.3.16 (#6046)
Bumps [github.com/imdario/mergo](https://github.com/imdario/mergo) from 0.3.15 to 0.3.16.
- [Release notes](https://github.com/imdario/mergo/releases)
- [Commits](https://github.com/imdario/mergo/compare/v0.3.15...v0.3.16)

---
updated-dependencies:
- dependency-name: github.com/imdario/mergo
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 09:52:51 +08:00
dependabot[bot]
159bb73b8f Chore: (deps): Bump gomodules.xyz/jsonpatch/v2 from 2.2.0 to 2.3.0 (#6050)
Bumps [gomodules.xyz/jsonpatch/v2](https://github.com/gomodules/jsonpatch) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/gomodules/jsonpatch/releases)
- [Changelog](https://github.com/gomodules/jsonpatch/blob/release-2.0/CHANGELOG.md)
- [Commits](https://github.com/gomodules/jsonpatch/compare/v2.2.0...v2.3.0)

---
updated-dependencies:
- dependency-name: gomodules.xyz/jsonpatch/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-29 21:25:28 +08:00
Somefive
268400e163 Feat: support applicator applying resources and update status (#6030)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-29 17:57:34 +08:00
dependabot[bot]
a1f57e4a90 Chore: (deps): Bump github.com/openkruise/rollouts (#6047)
Bumps [github.com/openkruise/rollouts](https://github.com/openkruise/rollouts) from 0.1.1-0.20220622054609-149e5a48da5e to 0.3.0.
- [Release notes](https://github.com/openkruise/rollouts/releases)
- [Changelog](https://github.com/openkruise/rollouts/blob/master/CHANGELOG.md)
- [Commits](https://github.com/openkruise/rollouts/commits/v0.3.0)



---
updated-dependencies:
- dependency-name: github.com/openkruise/rollouts
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-29 17:53:17 +08:00
dependabot[bot]
9d214c49f2 Chore: (deps): Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 (#6049)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.2 to 1.8.3.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.2...v1.8.3)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-29 17:52:35 +08:00
yyzxw
99ad780261 chore: add controller ut (#6043)
Signed-off-by: yyzxw <1020938856@qq.com>
2023-05-29 11:55:06 +08:00
Ahmed Qashlan
a849435db2 Feat(velaql): read max depth for query iterator from env. (#6039)
* Feat(velaql): read max depth for query iterator from env

Signed-off-by: Ahmed Qashlan <ahmedelqashlan@gmail.com>

* Feat(velaql): read max depth for query iterator from env.

Ref #6014

Signed-off-by: Ahmed Qashlan <ahmedelqashlan@gmail.com>

---------

Signed-off-by: Ahmed Qashlan <ahmedelqashlan@gmail.com>
2023-05-29 10:49:46 +08:00
Somefive
5ccec581e6 Chore: remove acr in ci (#6040)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-26 15:41:19 +08:00
Somefive
2298dd73dc Feat: revert ci to kind (#6035)
* Feat: revert ci to kind

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* feat: use internal runner

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* fix test bug

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-25 17:49:44 +08:00
Somefive
ef4bb07fb3 Chore: remove dm (#6036)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-25 13:54:35 +08:00
Somefive
4d81ba8909 Feat: support force resource location with dispatch (#6033)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-25 10:18:50 +08:00
Somefive
0df7803022 Feat: add validation for invalid definition attribute (#6029)
* Feat: add validation for invalid definition attribute

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* fix flaky test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-24 16:40:42 +08:00
Somefive
e109d4e525 Chore: upgrade kubebuilder installation in unit-test ci (#6018)
* Chore: upgrade kubebuilder installation in unit-test ci

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* upgrade ingress in kuebuilder test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-23 14:46:22 +08:00
Somefive
868cd32012 Chore: auto prune ci network after test (#6028)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-23 14:45:55 +08:00
dependabot[bot]
9246929a1f Chore: (deps): Bump sigs.k8s.io/gateway-api from 0.6.2 to 0.7.0 (#6020)
* Chore: (deps): Bump sigs.k8s.io/gateway-api from 0.6.2 to 0.7.0

Bumps [sigs.k8s.io/gateway-api](https://github.com/kubernetes-sigs/gateway-api) from 0.6.2 to 0.7.0.
- [Release notes](https://github.com/kubernetes-sigs/gateway-api/releases)
- [Changelog](https://github.com/kubernetes-sigs/gateway-api/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kubernetes-sigs/gateway-api/compare/v0.6.2...v0.7.0)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/gateway-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Chore: upgrade CRD yaml

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2023-05-23 14:43:41 +08:00
dependabot[bot]
f080f80779 Chore: (deps): Bump github.com/nacos-group/nacos-sdk-go/v2 (#6019)
Bumps [github.com/nacos-group/nacos-sdk-go/v2](https://github.com/nacos-group/nacos-sdk-go) from 2.1.0 to 2.2.2.
- [Release notes](https://github.com/nacos-group/nacos-sdk-go/releases)
- [Commits](https://github.com/nacos-group/nacos-sdk-go/compare/v2.1.0...v2.2.2)



---
updated-dependencies:
- dependency-name: github.com/nacos-group/nacos-sdk-go/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 11:13:09 +08:00
dependabot[bot]
7b132d62b5 Chore: (deps): Bump golang.org/x/crypto from 0.6.0 to 0.9.0 (#6021)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.6.0 to 0.9.0.
- [Commits](https://github.com/golang/crypto/compare/v0.6.0...v0.9.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 11:10:49 +08:00
Somefive
c66a63909e Feat: support remote cluster client to allow user use CRD resource in managed cluster without installing CRD to hub cluster (#6008)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-23 10:15:20 +08:00
dependabot[bot]
2c341db8c0 Chore: (deps): Bump github.com/sirupsen/logrus from 1.9.0 to 1.9.2 (#6022)
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.0 to 1.9.2.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.9.0...v1.9.2)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:41:19 +08:00
dependabot[bot]
da662a2f93 Chore: (deps): Bump actions/setup-go from 4.0.0 to 4.0.1 (#6023)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](4d34df0c23...fac708d667)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:41:05 +08:00
dependabot[bot]
af606be896 Chore: (deps): Bump codecov/codecov-action from 3.1.3 to 3.1.4 (#6024)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](894ff025c7...eaaf4bedf3)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:40:51 +08:00
yyzxw
3cb0f7b330 refactor: parse trait & scope (#6017)
Signed-off-by: yyzxw <1020938856@qq.com>
2023-05-22 19:21:01 +08:00
dependabot[bot]
338703baf5 Chore: (deps): Bump github.com/containerd/containerd from 1.7.0 to 1.7.1 (#6025)
Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-22 19:09:27 +08:00
caiqi1111
3a933780de Fix: add cluster information for vela adopt help (#6015)
Signed-off-by: caiqi <caiqi_yewu@cmss.chinamobile.com>
2023-05-22 16:32:33 +08:00
yyzxw
dc52498b1d refactor: enhanced code readability (#6012)
Signed-off-by: yyzxw <1020938856@qq.com>
2023-05-21 15:19:06 +08:00
Somefive
aa36edbc3a Fix: ci tool version (#6011) 2023-05-19 15:56:44 +08:00
iyear
ff79438c8f Feat: add gen-cue to Makefile (#6009)
Signed-off-by: iyear <ljyngup@gmail.com>
2023-05-19 14:44:10 +08:00
yyzxw
933d85c735 chore: add flags test (#6007)
Signed-off-by: yyzxw <1020938856@qq.com>
Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
Co-authored-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
2023-05-18 17:48:05 +08:00
Somefive
1b9bdffd06 fix multicluster adopt (#5988)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-18 10:44:25 +08:00
iyear
f3f2af81b4 Refactor: transparent and extensible cuegen decl (#6006)
Signed-off-by: iyear <ljyngup@gmail.com>
2023-05-18 10:00:49 +08:00
Somefive
c4bd532523 Fix: ci docker install (#6005)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-17 19:59:59 +08:00
Dhanu Saputra
208a4aed2d Feat: application_controller should be responsible for deleting application revision (#5739)
* [Feature] application_controller should be responsible for deleting application revision

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* test

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* delete-app-revision: fix reviews, add tests

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* delete-app-revision: rebase master

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* delete-app-revision: make func private

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* delete-app-revision clean

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* delete-app-revision: fix staticcheck

Signed-off-by: dhanu <andreasdhanu@gmail.com>

* delete-app-revision: fix review

Signed-off-by: dhanu <andreasdhanu@gmail.com>

---------

Signed-off-by: dhanu <andreasdhanu@gmail.com>
2023-05-17 17:41:01 +08:00
Somefive
530d7c5bd6 Feat: support resource update policy (#6003) 2023-05-17 16:11:06 +08:00
zhaohuiweixiao
eaa7f5821e Fix: list addon commond displays only the first 20 entries when addon registry is gitlab type (#5999)
* Fix: list addon commond displays only the first 20 entries when addon registry is gitlab type

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

* Fix: add tips for registry addon command

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

* Fix: modify the addon registry command tip

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

---------

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
2023-05-17 15:32:14 +08:00
Somefive
34d6898fac Fix: cleanup ci for minimal chart (#6004) 2023-05-17 09:47:42 +08:00
Somefive
da8588c887 Feat: support customizing application revision limit number in policy (#5995)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-16 16:12:37 +08:00
yyzxw
1af82cd282 cleanup: remove unused code and fix typo (#5986)
Signed-off-by: yyzxw <1020938856@qq.com>
Signed-off-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
Co-authored-by: xiaowu.zhu <xiaowu.zhu@daocloud.io>
2023-05-16 12:37:00 +08:00
Somefive
e0d106024b Feat: remove vela install version requirement upper bound (#5996)
* Feat: relax vela install requirement upper bound

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: typo

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-16 11:57:40 +08:00
Dani
fb539048fb CUE line spaces and typo (#5997)
Signed-off-by: André Gomes <andre3000pt@gmail.com>
2023-05-16 10:50:31 +08:00
dependabot[bot]
454887e450 Chore: (deps): Bump golang.org/x/sync from 0.1.0 to 0.2.0 (#5993)
Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.1.0 to 0.2.0.
- [Commits](https://github.com/golang/sync/compare/v0.1.0...v0.2.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-15 18:51:03 +08:00
dependabot[bot]
e500c7992e Chore: (deps): Bump github.com/google/go-containerregistry (#5991)
Bumps [github.com/google/go-containerregistry](https://github.com/google/go-containerregistry) from 0.14.0 to 0.15.1.
- [Release notes](https://github.com/google/go-containerregistry/releases)
- [Changelog](https://github.com/google/go-containerregistry/blob/main/.goreleaser.yml)
- [Commits](https://github.com/google/go-containerregistry/compare/v0.14.0...v0.15.1)

---
updated-dependencies:
- dependency-name: github.com/google/go-containerregistry
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-15 17:42:17 +08:00
dependabot[bot]
f66bd51391 Chore: (deps): Bump github.com/alibabacloud-go/cs-20151215/v3 (#5990)
Bumps [github.com/alibabacloud-go/cs-20151215/v3](https://github.com/alibabacloud-go/cs-20151215) from 3.0.32 to 3.0.35.
- [Release notes](https://github.com/alibabacloud-go/cs-20151215/releases)
- [Changelog](https://github.com/alibabacloud-go/cs-20151215/blob/master/ChangeLog.txt)
- [Commits](https://github.com/alibabacloud-go/cs-20151215/compare/v3.0.32...v3.0.35)

---
updated-dependencies:
- dependency-name: github.com/alibabacloud-go/cs-20151215/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-15 17:35:32 +08:00
dependabot[bot]
31a0158d90 Chore: (deps): Bump golang.org/x/oauth2 from 0.7.0 to 0.8.0 (#5992)
Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.7.0 to 0.8.0.
- [Commits](https://github.com/golang/oauth2/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-15 17:35:13 +08:00
Dani
7b119e687d Chore: CUE code quality changes (#5987)
* Update topologyspreadconstraints.cue

Update cue comment standard in one file

Signed-off-by: André Gomes <andre3000pt@gmail.com>

* Update expose.cue

Corrected cue format

Signed-off-by: André Gomes <andre3000pt@gmail.com>

* make reviewable ran

Signed-off-by: André Gomes <andre3000pt@gmail.com>

* Update apply-terraform-config.cue

usae -> usage

Signed-off-by: André Gomes <andre3000pt@gmail.com>

* make reviewable ran again

Signed-off-by: André Gomes <andre3000pt@gmail.com>

---------

Signed-off-by: André Gomes <andre3000pt@gmail.com>
2023-05-15 17:18:21 +08:00
Somefive
d59b116d06 Feat: upgrade ginkgo to v2 (#5940)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-15 16:07:51 +08:00
Somefive
643429d474 Chore: update dependabot settings (#5984)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-05-15 09:51:33 +08:00
yyzxw
f6a9d6675d test: add ut (#5985)
Signed-off-by: yyzxw <1020938856@qq.com>
2023-05-15 09:50:50 +08:00
Siege Lion
d19bb89ce7 Fix: fix the typo error in vela top (#5982) 2023-05-12 22:41:41 +08:00
dependabot[bot]
c56820a164 Chore: (deps): Bump github.com/rogpeppe/go-internal from 1.9.0 to 1.10.0 (#5963)
Bumps [github.com/rogpeppe/go-internal](https://github.com/rogpeppe/go-internal) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/rogpeppe/go-internal/releases)
- [Commits](https://github.com/rogpeppe/go-internal/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/rogpeppe/go-internal
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-12 14:25:15 +08:00
iyear
e5b9dca03c Feat: support def gen-doc command (#5975)
* Feat: support def gen-doc command

Signed-off-by: iyear <ljyngup@gmail.com>

* Fix: ci error

Signed-off-by: iyear <ljyngup@gmail.com>

* Fix: typo

Signed-off-by: iyear <ljyngup@gmail.com>

---------

Signed-off-by: iyear <ljyngup@gmail.com>
2023-05-12 14:24:49 +08:00
dependabot[bot]
c8f2c744f8 Chore: (deps): Bump github.com/docker/distribution from 2.8.1+incompatible to 2.8.2+incompatible (#5980)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-12 13:54:31 +08:00
dependabot[bot]
8a71a96bb4 Chore: (deps): Bump github.com/openkruise/kruise-api from 1.3.0 to 1.4.0 (#5964)
Bumps [github.com/openkruise/kruise-api](https://github.com/openkruise/kruise-api) from 1.3.0 to 1.4.0.
- [Commits](https://github.com/openkruise/kruise-api/compare/v1.3.0...v1.4.0)

---
updated-dependencies:
- dependency-name: github.com/openkruise/kruise-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-12 13:46:50 +08:00
dependabot[bot]
4ff33308d2 Chore: (deps): Bump github.com/cloudflare/circl from 1.1.0 to 1.3.3 (#5979)
Bumps [github.com/cloudflare/circl](https://github.com/cloudflare/circl) from 1.1.0 to 1.3.3.
- [Release notes](https://github.com/cloudflare/circl/releases)
- [Commits](https://github.com/cloudflare/circl/compare/v1.1.0...v1.3.3)

---
updated-dependencies:
- dependency-name: github.com/cloudflare/circl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-12 13:37:40 +08:00
Paul Sweeney
4a1ed788a0 Fix: Restore service creation for gateway trait (#5978) 2023-05-12 13:32:33 +08:00
dependabot[bot]
761c308e6f Chore: (deps): Bump github.com/onsi/ginkgo/v2 from 2.9.2 to 2.9.4 (#5960) 2023-05-10 06:47:56 +00:00
iyear
01e4dcb667 Feat: only print to stdout (#5958) 2023-05-10 14:17:16 +08:00
Paul Sweeney
6ca20121e2 Feat: Add support for multiple gateway traits (#5860)
Co-authored-by: paul <paul@kolossi.co.uk>
2023-05-10 11:21:39 +08:00
iyear
af0556a52b Feat: provider doc generator (#5968)
Signed-off-by: iyear <ljyngup@gmail.com>
2023-05-10 10:25:35 +08:00
Xinwei Xiong
68743841cd Chore: Give the help information of Makefile to make it more clear (#5638)
* chore(Makefile): Give the help information of Makefile to make it more readable

Signed-off-by: Xinwei Xiong <3293172751nss@gmail.com>

fix: Fixed some spelling mistakes

Signed-off-by: Xinwei Xiong <3293172751nss@gmail.com>

fix: part of the makefile shows a problem

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>

* fix: makefile targer image-cleanup

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>

---------

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
2023-05-09 18:55:25 +08:00
dependabot[bot]
72560661cc Chore: (deps): Bump golang.org/x/oauth2 from 0.6.0 to 0.7.0 (#5961) 2023-05-08 09:43:18 +00:00
suwliang3
c06c5dd9fd Fix: The addon page displays the deleted addon (#5924)
Co-authored-by: qiaozp <47812250+chivalryq@users.noreply.github.com>
2023-05-08 14:10:12 +08:00
dependabot[bot]
df3a9901e9 Chore: (deps): Bump github.com/spf13/cobra from 1.6.1 to 1.7.0 (#5945) 2023-05-08 02:32:45 +00:00
dependabot[bot]
932b48dc89 Chore: (deps): Bump golang.org/x/term from 0.6.0 to 0.7.0 (#5941)
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/golang/term/releases)
- [Commits](https://github.com/golang/term/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-06 21:04:17 +08:00
dependabot[bot]
b54a153b25 Chore: (deps): Bump github.com/cloudtty/cloudtty from 0.2.0 to 0.5.2 (#5942)
Bumps [github.com/cloudtty/cloudtty](https://github.com/cloudtty/cloudtty) from 0.2.0 to 0.5.2.
- [Release notes](https://github.com/cloudtty/cloudtty/releases)
- [Commits](https://github.com/cloudtty/cloudtty/compare/v0.2.0...v0.5.2)

---
updated-dependencies:
- dependency-name: github.com/cloudtty/cloudtty
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-06 21:04:01 +08:00
dependabot[bot]
944d782d17 Chore: (deps): Bump github.com/fluxcd/helm-controller/api (#5953)
Bumps [github.com/fluxcd/helm-controller/api](https://github.com/fluxcd/helm-controller) from 0.32.1 to 0.32.2.
- [Release notes](https://github.com/fluxcd/helm-controller/releases)
- [Changelog](https://github.com/fluxcd/helm-controller/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fluxcd/helm-controller/compare/v0.32.1...v0.32.2)

---
updated-dependencies:
- dependency-name: github.com/fluxcd/helm-controller/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-06 21:03:38 +08:00
dependabot[bot]
9ffec640f4 Chore: (deps): Bump github.com/prometheus/client_golang (#5954)
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.14.0 to 1.15.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.14.0...v1.15.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-06 21:03:26 +08:00
zhaohuiweixiao
91e31c1673 Fix: restrict the rules that automatically add topology strategy to addons to be valid only for the yaml type (#5957)
Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
2023-05-06 21:47:19 +12:00
iyear
e675cdafc4 Feat: add vela def gen-cue command (#5956)
* Feat: add vela def gen-cue command

Signed-off-by: iyear <ljyngup@gmail.com>

* Fix: golangci-lint G304 error

Signed-off-by: iyear <ljyngup@gmail.com>

* Chore: remove useless stat

Signed-off-by: iyear <ljyngup@gmail.com>

* Chore: remove useless log

Signed-off-by: iyear <ljyngup@gmail.com>

* Chore: type alias

Signed-off-by: iyear <ljyngup@gmail.com>

---------

Signed-off-by: iyear <ljyngup@gmail.com>
2023-05-05 20:26:13 +09:00
Somefive
e828d3c8cf Feat: allow empty policy name (#5917) 2023-05-04 16:48:43 +08:00
Somefive
0921f43262 Chore: update dependabot settings (#5946) 2023-05-04 16:39:50 +08:00
qiaozp
5cb942c444 Fix: trait not added in Go SDK (#5950)
Signed-off-by: qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-05-04 10:20:52 +08:00
dependabot[bot]
258a1abcdd Chore: (deps): Bump github.com/briandowns/spinner from 1.11.1 to 1.23.0 (#5824) 2023-04-28 09:25:14 +00:00
Somefive
5c8a44a066 Chore: upgrade moby dependency to fix security issue (#5937)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-28 16:16:53 +08:00
Somefive
be85b1d579 add retest for pr (#5936)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-28 15:47:26 +08:00
dependabot[bot]
392d2382de Chore: (deps): Bump github.com/google/go-containerregistry (#5927)
Bumps [github.com/google/go-containerregistry](https://github.com/google/go-containerregistry) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/google/go-containerregistry/releases)
- [Changelog](https://github.com/google/go-containerregistry/blob/main/.goreleaser.yml)
- [Commits](https://github.com/google/go-containerregistry/compare/v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: github.com/google/go-containerregistry
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-28 15:16:47 +08:00
dependabot[bot]
bf03d9a016 Chore: (deps): Bump github.com/go-logr/logr from 1.2.3 to 1.2.4 (#5929)
Bumps [github.com/go-logr/logr](https://github.com/go-logr/logr) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/go-logr/logr/releases)
- [Changelog](https://github.com/go-logr/logr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/go-logr/logr/compare/v1.2.3...v1.2.4)

---
updated-dependencies:
- dependency-name: github.com/go-logr/logr
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-28 15:15:15 +08:00
dependabot[bot]
b3a6b778e7 Chore: (deps): Bump github.com/form3tech-oss/jwt-go (#5930)
Bumps [github.com/form3tech-oss/jwt-go](https://github.com/form3tech-oss/jwt-go) from 3.2.3+incompatible to 3.2.5+incompatible.
- [Release notes](https://github.com/form3tech-oss/jwt-go/releases)
- [Changelog](https://github.com/form3tech-oss/jwt-go/blob/master/VERSION_HISTORY.md)
- [Commits](https://github.com/form3tech-oss/jwt-go/compare/v3.2.3...v3.2.5)

---
updated-dependencies:
- dependency-name: github.com/form3tech-oss/jwt-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-28 15:14:49 +08:00
zhaohuiweixiao
98deab08f5 Fix: install dependency is invalid for runtime addon when it's cluster arg is nil (#5865)
* Fix: install dependency is invalid for runtime addon when it's clusters arg is nil

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

* Fix: add unit test for getDependencyArgs and checkDependencyNeedInstall

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

* Fix: Simplified the checkDependencyNeedInstall func logic

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

* Fix: add comments for checkDependencyNeedInstall

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

---------

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
2023-04-28 10:16:33 +08:00
Somefive
d6541d0c4f Chore: add e2e ci env bootstrap & remove multlcluster legacy rollout ci (#5926)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-27 13:55:19 +08:00
Somefive
fb79ee433c Chore: refactor vela cli entrance (#5909)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-27 10:02:47 +08:00
Somefive
9def4087df Fix: multicluster disable installation (#5922)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-26 13:58:47 +08:00
Somefive
b9fa400cd0 Chore: update code owners (#5923)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-26 11:31:34 +08:00
dependabot[bot]
479221f49f Chore: (deps): Bump sigs.k8s.io/gateway-api from 0.4.3 to 0.6.2 (#5829)
* Chore: (deps): Bump sigs.k8s.io/gateway-api from 0.4.3 to 0.6.2

Bumps [sigs.k8s.io/gateway-api](https://github.com/kubernetes-sigs/gateway-api) from 0.4.3 to 0.6.2.
- [Release notes](https://github.com/kubernetes-sigs/gateway-api/releases)
- [Changelog](https://github.com/kubernetes-sigs/gateway-api/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kubernetes-sigs/gateway-api/compare/v0.4.3...v0.6.2)

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---
updated-dependencies:
- dependency-name: sigs.k8s.io/gateway-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix gateway related api

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Somefive <yd219913@alibaba-inc.com>
2023-04-26 10:48:17 +08:00
dependabot[bot]
5df0aa055c Chore: (deps): Bump github.com/imdario/mergo from 0.3.13 to 0.3.15 (#5919)
Bumps [github.com/imdario/mergo](https://github.com/imdario/mergo) from 0.3.13 to 0.3.15.
- [Release notes](https://github.com/imdario/mergo/releases)
- [Commits](https://github.com/imdario/mergo/compare/v0.3.13...v0.3.15)

---
updated-dependencies:
- dependency-name: github.com/imdario/mergo
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-25 21:22:57 +08:00
dependabot[bot]
babf84f75b Chore: (deps): Bump sigs.k8s.io/kind from 0.17.0 to 0.18.0 (#5920)
Bumps [sigs.k8s.io/kind](https://github.com/kubernetes-sigs/kind) from 0.17.0 to 0.18.0.
- [Release notes](https://github.com/kubernetes-sigs/kind/releases)
- [Commits](https://github.com/kubernetes-sigs/kind/compare/v0.17.0...v0.18.0)

---
updated-dependencies:
- dependency-name: sigs.k8s.io/kind
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-25 21:22:35 +08:00
iyear
5b8c38ad3e Feat: initial provider generator (#5839)
* Feat: initial provider generator

Signed-off-by: iyear <ljyngup@gmail.com>

* Fix: distinguish any and ellipsis type

Signed-off-by: iyear <ljyngup@gmail.com>

---------

Signed-off-by: iyear <ljyngup@gmail.com>
2023-04-25 10:30:23 +08:00
dependabot[bot]
434cd4c2d0 Chore: (deps): Bump github.com/onsi/gomega from 1.27.5 to 1.27.6 (#5912) 2023-04-24 10:48:14 +00:00
dependabot[bot]
e7d57e96e8 Chore: (deps): Bump codecov/codecov-action from 3.1.2 to 3.1.3 (#5910)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](40a12dcee2...894ff025c7)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-24 17:37:20 +08:00
Somefive
bfb673e0c9 Feat: support multi policies (#5811)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-24 17:02:32 +08:00
Somefive
1c04656834 Fix: upgrade cluster register to support join ocm cluster with k8s 1.24+ (#5907)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-24 16:47:36 +08:00
dependabot[bot]
6ddb2ec53b Chore: (deps): Bump github.com/containerd/containerd from 1.6.18 to 1.7.0 (#5892) 2023-04-24 07:06:26 +00:00
caiqi1111
b4e499ba37 Fix: support get helm chart values from which index.yaml urls is not … (#5786)
* Fix: support get helm chart values from which index.yaml urls is not completed

Signed-off-by: caiqi <caiqi_yewu@cmss.chinamobile.com>

* Fix: support get helm chart values from which index.yaml urls is not completed

Signed-off-by: caiqi <caiqi_yewu@cmss.chinamobile.com>

* Fix: support get helm chart values from which index.yaml urls is uncomplted

Signed-off-by: caiqi <caiqi_yewu@cmss.chinamobile.com>

* Fix: support get helm chart values from which index.yaml urls is uncompleted

Signed-off-by: caiqi <caiqi_yewu@cmss.chinamobile.com>

---------

Signed-off-by: caiqi <caiqi_yewu@cmss.chinamobile.com>
2023-04-24 10:30:30 +08:00
Somefive
0174e9aa1f Fix: multi cluster inline policy load extra definitions (#5901)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-24 10:19:25 +08:00
Somefive
f328308d8e Feat: remove unused crd in chart (#5899)
* Feat: remove unused crd in chart

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* fix test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-24 09:57:30 +08:00
JohnJan
efb2f1b083 Fix: parse template disable resolve provider functions (#5905)
Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2023-04-24 09:57:16 +08:00
Somefive
1aaab58f15 Feat: upgrade deps (#5900)
* Chore: cherry-pick #5821 #5822

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: upgrade cluster gateway

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: fix config test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-23 17:50:37 +08:00
Somefive
3de9e391ee Feat: vela cuex eval (#5562)
* Feat: vela cuex render

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* feat: CLI command `vela cuex eval <file>`

Signed-off-by: Zhenghao Lou <rhzx3519@gmail.com>

* responsive writer

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
Signed-off-by: Zhenghao Lou <rhzx3519@gmail.com>
Co-authored-by: Zhenghao Lou <rhzx3519@gmail.com>
2023-04-23 10:21:11 +08:00
dependabot[bot]
956eb31f29 Chore: (deps): Bump golang.org/x/text from 0.8.0 to 0.9.0 (#5897)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-21 22:46:16 +08:00
dependabot[bot]
681144319b Chore: (deps): Bump github.com/fatih/color from 1.13.0 to 1.15.0 (#5898)
Bumps [github.com/fatih/color](https://github.com/fatih/color) from 1.13.0 to 1.15.0.
- [Release notes](https://github.com/fatih/color/releases)
- [Commits](https://github.com/fatih/color/compare/v1.13.0...v1.15.0)

---
updated-dependencies:
- dependency-name: github.com/fatih/color
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-21 22:43:29 +08:00
iyear
9042ed078b Fix: make any as top value in cue (#5893)
* Fix: make any as top value in cue

Signed-off-by: iyear <ljyngup@gmail.com>

* Feat: support different cue special type in type option

Signed-off-by: iyear <ljyngup@gmail.com>

* Fix: unit test type option

Signed-off-by: iyear <ljyngup@gmail.com>

---------

Signed-off-by: iyear <ljyngup@gmail.com>
2023-04-21 16:45:34 +08:00
Somefive
dab1618eef Feat: refactor vela help (#5895)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-21 14:19:36 +08:00
JohnJan
5549619ef9 Feat: support validate properties with CueX (#5894)
Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2023-04-21 10:05:40 +08:00
dependabot[bot]
a427c1e4c2 Chore: (deps): Bump github.com/oam-dev/cluster-gateway (#5891)
Bumps [github.com/oam-dev/cluster-gateway](https://github.com/oam-dev/cluster-gateway) from 1.9.0-alpha.1.0.20230412030221-d9666385607f to 1.9.0-alpha.2.
- [Release notes](https://github.com/oam-dev/cluster-gateway/releases)
- [Commits](https://github.com/oam-dev/cluster-gateway/commits/v1.9.0-alpha.2)

---
updated-dependencies:
- dependency-name: github.com/oam-dev/cluster-gateway
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-20 17:57:11 +08:00
Somefive
106b7b3670 Feat: support mark stage in gc when workflow failed (#5882)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-20 14:05:45 +08:00
dependabot[bot]
351cb83f15 Chore: (deps): Bump github.com/xanzy/go-gitlab from 0.80.0 to 0.83.0 (#5884)
Bumps [github.com/xanzy/go-gitlab](https://github.com/xanzy/go-gitlab) from 0.80.0 to 0.83.0.
- [Release notes](https://github.com/xanzy/go-gitlab/releases)
- [Changelog](https://github.com/xanzy/go-gitlab/blob/master/releases_test.go)
- [Commits](https://github.com/xanzy/go-gitlab/compare/v0.80.0...v0.83.0)

---
updated-dependencies:
- dependency-name: github.com/xanzy/go-gitlab
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-19 17:45:46 +08:00
JohnJan
3d9b1b68af Feat: support parse template depends on CueX (#5848)
* Feat: support parse template depends on CueX

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Feat: support parse template depends on CueX

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

---------

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2023-04-19 17:40:56 +08:00
Somefive
feb819920e Feat: support connecting cluster via proxy url (#5875)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-19 11:12:02 +08:00
Somefive
859702900f Fix: upgrade dependencies (#5827)
* Fix: upgrade base

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* upgrade gateway api

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Chore: (deps): Bump codecov/codecov-action from 3.1.1 to 3.1.2

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](d9f34f8cd5...40a12dcee2)

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix: revert gateway api

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: add docker hub login for e2e

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-19 09:39:33 +08:00
Somefive
d1a37eb2d0 Test: pend multicluster rollout test (#5873)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-18 19:03:13 +08:00
Tianxin Dong
657fcc6c64 Fix: fix terminate suspending steps (#5872)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-04-18 16:57:30 +08:00
Tianxin Dong
0e77b2bcc3 Chore: update cue to v0.5.0 (#5869)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-04-18 16:14:45 +08:00
dependabot[bot]
95cc5f1c26 Chore: (deps): Bump actions/checkout from 3.4.0 to 3.5.2 (#5866)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.4.0 to 3.5.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](24cb908017...8e5e7e5ab8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-18 15:33:21 +08:00
Somefive
61dd692819 Chore: refactor e2e test (#5871)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-18 14:39:09 +08:00
dependabot[bot]
13eb7876f3 Chore: (deps): Bump github.com/dave/jennifer from 1.6.0 to 1.6.1 (#5847)
Bumps [github.com/dave/jennifer](https://github.com/dave/jennifer) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/dave/jennifer/releases)
- [Commits](https://github.com/dave/jennifer/compare/v1.6.0...v1.6.1)

---
updated-dependencies:
- dependency-name: github.com/dave/jennifer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-17 16:32:55 +08:00
wyike
2821682c60 fix bug if addon parameter is Empty (#5856)
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2023-04-14 17:45:09 +08:00
Jianbo Sun
863da991bc Feat: add new fields for addon metadata (#5845)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2023-04-14 17:16:38 +08:00
Basuotian
7b2e294a88 fix typo of clean-jobs example doc (#5855)
Signed-off-by: Basuotian <basuoluomiu@gmail.com>
2023-04-14 11:32:28 +08:00
Jianbo Sun
08a773341d Fix: refine the erorr output format (#5843)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2023-04-13 15:59:34 +08:00
Tianxin Dong
fea7ae5935 Fix: fix the operate order in suspend & resume (#5841)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-04-13 11:29:22 +08:00
dependabot[bot]
4a08caf81e Chore: (deps): Bump k8s.io/klog/v2 from 2.90.0 to 2.90.1 (#5830)
Bumps [k8s.io/klog/v2](https://github.com/kubernetes/klog) from 2.90.0 to 2.90.1.
- [Release notes](https://github.com/kubernetes/klog/releases)
- [Changelog](https://github.com/kubernetes/klog/blob/main/RELEASE.md)
- [Commits](https://github.com/kubernetes/klog/compare/v2.90.0...v2.90.1)

---
updated-dependencies:
- dependency-name: k8s.io/klog/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-13 10:58:37 +08:00
Somefive
792f33d471 Feat: migrate prism cluster (#5836)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-12 20:25:24 +08:00
JohnJan
c007ad8df0 Feat: support config validation depends on CueX (#5796)
* Feat: support config validation depends on CueX

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Feat: support config validation depends on CueX

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Feat: support config validation depends on CueX

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

* Feat: support config validation depends on CueX

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>

---------

Signed-off-by: wuzhongjian <wuzhongjian_yewu@cmss.chinamobile.com>
2023-04-12 13:58:12 +08:00
Tianxin Dong
05ac3eaeb7 Fix: fix multi clusters bottom in vela adopt (#5834)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-04-12 11:52:03 +08:00
Jianbo Sun
39e33c1260 Chore: update pr template and test github copilot (#5833)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2023-04-12 10:50:51 +08:00
iyear
167720f2e5 Chore: expose functions and refactor conversion style (#5828)
Signed-off-by: iyear <ljyngup@gmail.com>
2023-04-11 22:50:01 +08:00
iyear
6397f973d2 Chore: add special field name test case (#5826)
Signed-off-by: iyear <ljyngup@gmail.com>
2023-04-11 13:04:45 +08:00
dependabot[bot]
abb2732ce5 Chore: (deps): Bump github.com/chartmuseum/helm-push (#5724)
Bumps [github.com/chartmuseum/helm-push](https://github.com/chartmuseum/helm-push) from 0.10.2 to 0.10.3.
- [Release notes](https://github.com/chartmuseum/helm-push/releases)
- [Changelog](https://github.com/chartmuseum/helm-push/blob/main/.goreleaser.yml)
- [Commits](https://github.com/chartmuseum/helm-push/compare/v0.10.2...v0.10.3)

---
updated-dependencies:
- dependency-name: github.com/chartmuseum/helm-push
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-11 10:11:41 +08:00
dependabot[bot]
ab156efbb5 Chore: (deps): Bump github.com/fluxcd/helm-controller/api (#5798)
Bumps [github.com/fluxcd/helm-controller/api](https://github.com/fluxcd/helm-controller) from 0.21.0 to 0.32.1.
- [Release notes](https://github.com/fluxcd/helm-controller/releases)
- [Changelog](https://github.com/fluxcd/helm-controller/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fluxcd/helm-controller/compare/v0.21.0...v0.32.1)

---
updated-dependencies:
- dependency-name: github.com/fluxcd/helm-controller/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-11 10:08:21 +08:00
Somefive
bfa5f4c641 Feat: upgrade pkg & workflow (#5819)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-11 09:59:58 +08:00
Somefive
57dd6d105f Chore: update codeowners (#5818)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-10 13:59:32 +08:00
Somefive
d8af202242 Feat: upgrade k8s.io to 0.26 (#5758)
* Feat: upgrade k8s.io to 0.26

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Feat: replace temp replace

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-10 11:19:05 +08:00
qiaozp
5ef0798d89 Chore: bump testing to Kubernetes v1.26 (#5816)
* Chore: bump testing to Kubernetes v1.25

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix condition in e2e test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Bump e2e-multicluster-test to v1.25

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Bump e2e-rollout-test and rebase

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Fix: EndpointSlice v1beta1 is depracated

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix vela ql test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* remove comment

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* Bump all e2e test environment to v1.26

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

---------

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-04-07 17:28:51 +08:00
zhaohuiweixiao
76dc154e92 Refactor: the addon dependency installation logic is accurate to the cluster (#5206)
* Refactor: the addon dependency installation logic is accurate to the cluster

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

* Fix: optimize the code based on the review

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

* Feat: add unit test for func checkDependencyNeedInstall

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>

---------

Signed-off-by: zhaohuihui <zhaohuihui_yewu@cmss.chinamobile.com>
2023-04-07 17:15:44 +08:00
Mcduller
eba40ab20d Feat: support vela def vet the input "dir" and many cue files (#5806)
* Feat: support vela def vet the input "dir" and many cue files

Signed-off-by: Mcduller <1596582524@qq.com>

* Feat: support vela def vet the input "dir" and many cue files

Signed-off-by: Mcduller <1596582524@qq.com>

---------

Signed-off-by: Mcduller <1596582524@qq.com>
2023-04-07 14:12:37 +08:00
朱晓兵
3ae9381d6c Feat: compatible with k8s last-applied-configuration while perfer app.oam.dev/last-applied-configuration in annotations (#5804)
* Fix: when taking over an existing resource for the first time, use kubectl last apply anno

Signed-off-by: zxbyoyoyo <596908030@qq.com>

* Fix: '-' || 'skip' return nil

Signed-off-by: zxbyoyoyo <596908030@qq.com>

* Fix: check-diff

Signed-off-by: zxbyoyoyo <596908030@qq.com>

---------

Signed-off-by: zxbyoyoyo <596908030@qq.com>
2023-04-07 11:05:42 +08:00
Tianxin Dong
c128c71e29 Fix: use step id to filter the log data and fix the regex (#5809)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-04-07 10:39:23 +08:00
iyear
2bd593855b Fix: can't reuse modified ref options (#5795)
Signed-off-by: iyear <ljyngup@gmail.com>
2023-04-06 20:02:49 +08:00
Tianxin Dong
3c2d47be6e Fix: fix step id to name in workflow logs (#5805)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-04-06 14:56:22 +08:00
qiaozp
c24cbdc6f9 Feat: compatibility on componentDefinition spec.workload.definition field (#5800)
* Feat: compatibility on componentDefinition spec.workload.definition field

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* rollback

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* remove hack fallback

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

---------

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-04-06 11:48:26 +08:00
dependabot[bot]
0a368ec856 Chore: (deps): Bump ossf/scorecard-action from 2.1.2 to 2.1.3 (#5790) 2023-04-06 03:05:09 +00:00
Tianxin Dong
7ea237d580 Feat: add mode in steps for step group (#5799) 2023-04-06 10:52:48 +08:00
iyear
06eb414f1e Feat: add type filter option (#5789)
Signed-off-by: iyear <ljyngup@gmail.com>
2023-04-04 09:56:54 +08:00
wyike
52b1f20e5f Fix: filter rollout created by rolling-release in vela workflow resume (#5783)
* filter rollout created by rolling-release

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix golint

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* use annotation instead trait type

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* use annotations instead of triat type

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* lint go import

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

---------

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2023-04-03 15:28:46 +08:00
Somefive
d8f92e0b44 Feat: vela cluster join support overwrite (#5784)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-04-03 10:12:44 +08:00
zhaohuiweixiao
1a04121894 Feat: list addon with specify registry (#5780) 2023-03-31 17:47:41 +08:00
Jianbo Sun
6e4460e3fb Feat: expose trait with new ports (#5781)
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
2023-03-31 15:56:18 +08:00
Zhenghao Lou
784106cdf3 Fix: component name generated by vela adopt is not in lowecase (#5775)
CUE: fix the adopt-templates/default.cue

closes #5771

Signed-off-by: Zhenghao Lou <rhzx3519@gmail.com>
2023-03-30 13:58:32 +08:00
wyike
bb34012c3a Feat: add check prometheus metrics workflowStepDefinition (#5768)
* add metrics

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

add check metrics

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* add check-metrics definition example

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

rename example

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* small fix

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix lint

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* add default metrics

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

---------

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
2023-03-30 11:11:25 +08:00
iyear
d5ecb7b870 Refactor: split Generate function (#5763)
Signed-off-by: iyear <ljyngup@gmail.com>
2023-03-29 17:56:41 +08:00
Tianxin Dong
d4576db82d Chore: stable the version of workflow to 0.5.0 for 1.8 release (#5759)
Signed-off-by: FogDong <dongtianxin.tx@alibaba-inc.com>
2023-03-29 11:49:01 +08:00
Somefive
542b32bcf4 Chore: fix definition parse logic and allow if/for comprehension & use op.#Suspend for deploy (#5743)
* Chore: fix definition parse logic and allow if/for comprehension & use op.#Suspend for deploy

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: flaky mc test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: flaky mc test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-03-28 15:35:15 +08:00
howieyuen
8619f1c413 Fix: vela top cannot switch the theme (#5745)
Signed-off-by: howieyuen <howieyuen@outlook.com>
2023-03-28 13:50:00 +08:00
dependabot[bot]
d06d3bee79 Chore: (deps): Bump rajatjindal/krew-release-bot from 0.0.43 to 0.0.46 (#5747)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-28 09:30:57 +08:00
qiaozp
2e109dd77b Fix: gateway message is wrong (#5748)
Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-03-27 22:25:09 +08:00
Basuotian
1afdb09964 vela adopt support multi-cluster adoption (#5635)
Signed-off-by: Basuotian <basuoluomiu@gmail.com>
2023-03-27 15:28:44 +08:00
Somefive
b71efddfc8 Feat: fix flacky test (#5741)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-03-27 13:52:48 +08:00
Somefive
9dc0db4cfc Feat: add qps for load test client (#5733)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-03-24 18:04:18 +08:00
iyear
de790e6fae Feat: support nullable option (#5736)
Signed-off-by: iyear <ljyngup@gmail.com>
2023-03-24 16:24:05 +08:00
Somefive
e70d2a1021 Feat: enhance vela adopt and refactor (#5728)
* Feat: enhance vela adopt and refactor

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

* Fix: flaky mc test

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-03-24 16:23:01 +08:00
Somefive
5790e57423 Feat: remove comp name dup check (#5727) 2023-03-24 15:21:58 +08:00
Somefive
4aa14fc337 Feat: support pause reconcile (#5732)
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
2023-03-24 13:19:44 +08:00
iyear
d694dff4de Refactor: option pattern (#5720)
* Refactor: option pattern

Signed-off-by: iyear <ljyngup@gmail.com>

* Fix: nil check and add tests

Signed-off-by: iyear <ljyngup@gmail.com>

---------

Signed-off-by: iyear <ljyngup@gmail.com>
2023-03-24 12:06:34 +08:00
qiaozp
6b4da4fa45 Feat: add sub-module to Golang SDK (#5655)
* wait to deal with go.mod

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* seperate def and module modifier

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix module import

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* refine code

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* remove the pointer reference in loop

generalize the language-specific argument parsing

amend tests

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* remove focused test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* fix test

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

* update command usage

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>

---------

Signed-off-by: Qiaozp <qiaozhongpei.qzp@alibaba-inc.com>
2023-03-24 11:28:56 +08:00
S Code Man
fe279cf20d Fix: fix vela-minimal helm chart unrecognised options (#5721)
* fix(vela-minimal): fix unrecognised options

Signed-off-by: florent.madiot.e <florent.madiot.e@thalesdigital.io>

* Fix(vela-minimal): make reviewable

Signed-off-by: florent.madiot.e <florent.madiot.e@thalesdigital.io>

---------

Signed-off-by: florent.madiot.e <florent.madiot.e@thalesdigital.io>
2023-03-24 11:28:35 +08:00
1486 changed files with 139821 additions and 139347 deletions

34
.github/CODEOWNERS vendored
View File

@@ -1,39 +1,35 @@
# This file is a github code protect rule follow the codeowners https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners#example-of-a-codeowners-file
* @barnettZQG @wonderflow @leejanee @Somefive @jefree-cat @FogDong
design/ @barnettZQG @leejanee @wonderflow @Somefive @jefree-cat @FogDong
* @barnettZQG @wonderflow @leejanee @Somefive @jefree-cat @FogDong @wangyikewxgm @chivalryq @anoop2811 @briankane @jguionnet
design/ @barnettZQG @leejanee @wonderflow @Somefive @jefree-cat @FogDong @anoop2811 @briankane @jguionnet
# Owner of Core Controllers
pkg/controller/core.oam.dev @Somefive @FogDong @barnettZQG @wonderflow
pkg/controller/core.oam.dev @Somefive @FogDong @barnettZQG @wonderflow @wangyikewxgm @chivalryq @anoop2811 @briankane @jguionnet
# Owner of Standard Controllers
pkg/controller/standard.oam.dev @wangyikewxgm @barnettZQG @wonderflow
pkg/controller/standard.oam.dev @wangyikewxgm @barnettZQG @wonderflow @Somefive @anoop2811 @FogDong @briankane @jguionnet
# Owner of CUE
pkg/cue @leejanee @FogDong @Somefive
pkg/stdlib @leejanee @FogDong @Somefive
pkg/cue @leejanee @FogDong @Somefive @anoop2811 @briankane @jguionnet
pkg/stdlib @leejanee @FogDong @Somefive @anoop2811 @briankane @jguionnet
# Owner of Workflow
pkg/workflow @leejanee @FogDong @Somefive
# Owner of rollout
pkg/controller/common/rollout/ @wangyikewxgm @wonderflow
runtime/rollout @wangyikewxgm @wonderflow
pkg/workflow @leejanee @FogDong @Somefive @wangyikewxgm @chivalryq @anoop2811 @briankane @jguionnet
# Owner of vela templates
vela-templates/ @Somefive @barnettZQG @wonderflow @FogDong
vela-templates/ @Somefive @barnettZQG @wonderflow @FogDong @wangyikewxgm @chivalryq @anoop2811 @briankane @jguionnet
# Owner of vela CLI
references/cli/ @Somefive @zzxwill @StevenLeiZhang @charlie0129 @chivalryq
references/cli/ @Somefive @StevenLeiZhang @charlie0129 @wangyikewxgm @chivalryq @anoop2811 @FogDong @briankane @jguionnet
# Owner of vela addon framework
pkg/addon/ @wangyikewxgm @wonderflow @charlie0129
pkg/addon/ @wangyikewxgm @wonderflow @charlie0129 @anoop2811 @FogDong @briankane @jguionnet
# Owner of resource keeper and tracker
pkg/resourcekeeper @Somefive @FogDong
pkg/resourcetracker @Somefive @FogDong
pkg/resourcekeeper @Somefive @FogDong @chivalryq @anoop2811 @briankane @jguionnet
pkg/resourcetracker @Somefive @FogDong @chivalryq @anoop2811 @briankane @jguionnet
.github/ @chivalryq @wonderflow
makefiles @chivalryq @wonderflow
go.* @chivalryq @wonderflow
.github/ @chivalryq @wonderflow @Somefive @FogDong @wangyikewxgm @anoop2811 @briankane @jguionnet
makefiles @chivalryq @wonderflow @Somefive @FogDong @wangyikewxgm @anoop2811 @briankane @jguionnet
go.* @chivalryq @wonderflow @Somefive @FogDong @wangyikewxgm @anoop2811 @briankane @jguionnet

View File

@@ -1,6 +1,8 @@
### Description of your changes
copilot:all
<!--
Briefly describe what this pull request does. We love pull requests that resolve an open KubeVela issue. If yours does, you

View File

@@ -0,0 +1,35 @@
# Deploy Current Branch Action
This GitHub composite action builds a Docker image from the current branch commit and deploys it to a KubeVela cluster for development testing.
## What it does
- Generates a unique image tag from the latest commit hash
- Builds and loads the Docker image into a KinD cluster
- Applies KubeVela CRDs for upgrade safety
- Upgrades the KubeVela Helm release to use the local development image
- Verifies deployment status and the running image version
## Usage
```yaml
- name: Deploy Current Branch
uses: ./path/to/this/action
```
## Requirements
- Docker, Helm, kubectl, and KinD must be available in your runner environment
- Kubernetes cluster access
- `charts/vela-core/crds` directory with CRDs
- Valid Helm chart at `charts/vela-core`
## Steps performed
1. **Generate commit hash for image tag**
2. **Build & load Docker image into KinD**
3. **Pre-apply chart CRDs**
4. **Upgrade KubeVela using local image**
5. **Verify deployment and image version**
---

View File

@@ -0,0 +1,89 @@
name: 'Deploy Current Branch'
description: 'Builds Docker image from current branch commit and deploys it to KubeVela cluster for development testing'
runs:
using: "composite"
steps:
# ========================================================================
# Git Commit Hash Generation
# Generate unique image tag from current branch's latest commit
# ========================================================================
- name: Get commit hash
id: commit_hash
shell: bash
run: |
COMMIT_HASH="git-$(git rev-parse --short HEAD)"
echo "Using commit hash: $COMMIT_HASH"
echo "COMMIT_HASH=$COMMIT_HASH" >> $GITHUB_ENV
# ========================================================================
# Docker Image Build and Cluster Loading
# Build development image from current code and load into KinD cluster
# ========================================================================
- name: Build and load Docker image
shell: bash
run: |
echo "Building development image: vela-core-test:${{ env.COMMIT_HASH }}"
mkdir -p $HOME/tmp/
docker build --no-cache \
-t vela-core-test:${{ env.COMMIT_HASH }} \
-f Dockerfile .
echo "Loading image into KinD cluster..."
TMPDIR=$HOME/tmp/ kind load docker-image vela-core-test:${{ env.COMMIT_HASH }}
# ========================================================================
# Custom Resource Definitions Application
# Pre-apply CRDs to ensure upgrade compatibility and prevent conflicts
# ========================================================================
- name: Pre-apply CRDs from target chart (upgrade-safe)
shell: bash
run: |
CRD_DIR="charts/vela-core/crds"
echo "Applying CRDs idempotently..."
kubectl apply -f "${CRD_DIR}"
# ========================================================================
# KubeVela Helm Chart Upgrade
# Upgrade existing installation to use locally built development image
# ========================================================================
- name: Upgrade KubeVela to development image
shell: bash
run: |
echo "Upgrading KubeVela to development version..."
helm upgrade kubevela ./charts/vela-core \
--namespace vela-system \
--set image.repository=vela-core-test \
--set image.tag=${{ env.COMMIT_HASH }} \
--set image.pullPolicy=IfNotPresent \
--timeout 5m \
--wait \
--debug
# ========================================================================
# Deployment Status Verification
# Verify successful upgrade and confirm correct image deployment
# ========================================================================
- name: Verify deployment status
shell: bash
run: |
echo "=== DEPLOYMENT VERIFICATION ==="
echo "Verifying upgrade to local development image..."
echo "--- Pod Status ---"
kubectl get pods -n vela-system
echo "--- Deployment Rollout ---"
kubectl rollout status deployment/kubevela-vela-core \
-n vela-system \
--timeout=300s
echo "--- Deployed Image Version ---"
kubectl get deployment kubevela-vela-core \
-n vela-system \
-o yaml | grep "image:" | head -1
echo "Deployment verification completed successfully!"

View File

@@ -0,0 +1,32 @@
# Install Latest KubeVela Release Action
This GitHub composite action installs the latest stable KubeVela release from the official Helm repository and verifies its deployment status.
## What it does
- Discovers the latest stable KubeVela release tag from GitHub
- Adds and updates the official KubeVela Helm chart repository
- Installs KubeVela into the `vela-system` namespace (using Helm)
- Verifies pod status and deployment rollout for successful installation
## Usage
```yaml
- name: Install Latest KubeVela Release
uses: ./path/to/this/action
```
## Requirements
- Helm, kubectl, jq, and curl must be available in your runner environment
- Kubernetes cluster access
## Steps performed
1. **Release Tag Discovery:** Fetches latest stable tag (without `v` prefix)
2. **Helm Repo Setup:** Adds/updates KubeVela Helm chart repo
3. **Install KubeVela:** Installs latest release in the `vela-system` namespace
4. **Status Verification:** Checks pod status and rollout for readiness
---

View File

@@ -0,0 +1,68 @@
name: 'Install Latest KubeVela Release'
description: 'Installs the latest stable KubeVela release from official Helm repository with status verification'
runs:
using: "composite"
steps:
# ========================================================================
# Latest Release Tag Discovery
# Fetch current stable release version from GitHub API
# ========================================================================
- name: Get latest KubeVela release tag (no v prefix)
id: get_latest_tag
shell: bash
run: |
TAG=$(curl -s https://api.github.com/repos/kubevela/kubevela/releases/latest | \
jq -r ".tag_name" | \
awk '{sub(/^v/, ""); print}')
echo "LATEST_TAG=$TAG" >> $GITHUB_ENV
echo "Discovered latest release: $TAG"
# ========================================================================
# Helm Repository Configuration
# Add and update official KubeVela chart repository
# ========================================================================
- name: Add KubeVela Helm repo
shell: bash
run: |
echo "Adding KubeVela Helm repository..."
helm repo add kubevela https://kubevela.github.io/charts
helm repo update
echo "Helm repository configuration completed"
# ========================================================================
# KubeVela Stable Release Installation
# Deploy latest stable version to vela-system namespace
# ========================================================================
- name: Install KubeVela ${{ env.LATEST_TAG }}
shell: bash
run: |
echo "Installing KubeVela version: ${{ env.LATEST_TAG }}"
helm install \
--create-namespace \
-n vela-system \
kubevela kubevela/vela-core \
--version ${{ env.LATEST_TAG }} \
--timeout 10m \
--wait
echo "KubeVela installation completed"
# ========================================================================
# Installation Status Verification
# Verify successful deployment and readiness of KubeVela components
# ========================================================================
- name: Post-install status
shell: bash
run: |
echo "=== INSTALLATION VERIFICATION ==="
echo "Verifying KubeVela deployment status..."
echo "--- Pod Status ---"
kubectl get pods -n vela-system
echo "--- Deployment Rollout ---"
kubectl rollout status deployment/kubevela-vela-core \
-n vela-system \
--timeout=300s
echo "KubeVela installation verification completed successfully!"

51
.github/actions/e2e-test/README.md vendored Normal file
View File

@@ -0,0 +1,51 @@
# Kubevela K8s Upgrade E2E Test Action
A comprehensive GitHub composite action for running KubeVela Kubernetes upgrade end-to-end (E2E) tests with complete environment setup, multiple test suites, and failure diagnostics.
> **Note**: This action requires the `GO_VERSION` environment variable to be set in your workflow.
## Quick Start
### Basic Usage
```yaml
name: E2E Tests
on: [push, pull_request]
jobs:
e2e-tests:
runs-on: ubuntu-latest
env:
GO_VERSION: '1.23.8'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run KubeVela E2E Tests
uses: ./.github/actions/upgrade-e2e-test
```
## Test Flow Diagram
```
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Environment │ │ E2E Environment │ │ Test Execution │
│ Setup │───▶│ Preparation │───▶│ (3 Suites) │
│ │ │ │ │ │
│ • Install tools │ │ • Cleanup │ │ • API tests │
│ • Setup Go │ │ • Core setup │ │ • Addon tests │
│ • Dependencies │ │ • Helm tests │ │ • General tests │
│ • Build project │ │ │ │ │
└─────────────────┘ └──────────────────┘ └─────────────────┘
┌─────────────────┐
│ Diagnostics │
│ (On Failure) │
│ │
│ • Cluster logs │
│ • System events │
│ • Test artifacts│
└─────────────────┘
```

100
.github/actions/e2e-test/action.yaml vendored Normal file
View File

@@ -0,0 +1,100 @@
name: 'Kubevela K8s Upgrade e2e Test'
description: 'Runs Kubevela K8s upgrade e2e tests, uploads coverage, and collects diagnostics on failure.'
inputs:
codecov-token:
description: 'Codecov token for uploading coverage reports'
required: false
default: ''
codecov-enable:
description: 'Enable codecov coverage upload'
required: false
default: 'false'
runs:
using: "composite"
steps:
# ========================================================================
# Environment Setup
# ========================================================================
- name: Configure environment setup
uses: ./.github/actions/env-setup
with:
install-ginkgo: 'true'
install-setup-envtest: 'false'
install-kustomize: 'false'
- name: Build project
shell: bash
run: make
# ========================================================================
# E2E Test Environment Preparation
# ========================================================================
- name: Prepare e2e environment
shell: bash
run: |
echo "Preparing e2e test environment..."
make e2e-cleanup
make e2e-setup-core
echo "Running Helm tests..."
helm test -n vela-system kubevela --timeout 5m
# ========================================================================
# E2E Test Execution
# ========================================================================
- name: Run API e2e tests
shell: bash
run: |
echo "Running API e2e tests..."
make e2e-api-test
- name: Run addon e2e tests
shell: bash
run: |
echo "Running addon e2e tests..."
make e2e-addon-test
- name: Run general e2e tests
shell: bash
run: |
echo "Running general e2e tests..."
make e2e-test
- name: Upload coverage report
if: ${{ inputs.codecov-enable == 'true' }}
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24
with:
token: ${{ inputs.codecov-token }}
files: ./coverage.txt
flags: core-unittests
name: codecov-umbrella
fail_ci_if_error: false
# ========================================================================
# Failure Diagnostics
# ========================================================================
- name: Collect failure diagnostics
if: failure()
shell: bash
run: |
echo "=== FAILURE DIAGNOSTICS ==="
echo "Collecting diagnostic information for debugging..."
echo "--- Cluster Status ---"
kubectl get nodes -o wide || true
kubectl get pods -A || true
echo "--- KubeVela System Logs ---"
kubectl logs -n vela-system -l app.kubernetes.io/name=vela-core --tail=100 || true
echo "--- Recent Events ---"
kubectl get events -A --sort-by='.lastTimestamp' --field-selector type!=Normal || true
echo "--- Helm Release Status ---"
helm list -A || true
helm status kubevela -n vela-system || true
echo "--- Test Artifacts ---"
find . -name "*.log" -type f -exec echo "=== {} ===" \; -exec cat {} \; || true

67
.github/actions/env-setup/README.md vendored Normal file
View File

@@ -0,0 +1,67 @@
# Kubevela Test Environment Setup Action
A GitHub Actions composite action that sets up a complete testing environment for Kubevela projects with Go, Kubernetes tools, and the Ginkgo testing framework.
## Features
- 🛠️ **System Dependencies**: Installs essential build tools (make, gcc, jq, curl, etc.)
- ☸️ **Kubernetes Tools**: Sets up kubectl and Helm for cluster operations
- 🐹 **Go Environment**: Configurable Go version with module caching
- 📦 **Dependency Management**: Downloads and verifies Go module dependencies
- 🧪 **Testing Framework**: Installs Ginkgo v2 for BDD-style testing
## Usage
```yaml
- name: Setup Kubevela Test Environment
uses: ./path/to/this/action
with:
go-version: '1.23.8' # Optional: Go version (default: 1.23.8)
```
### Example Workflow
```yaml
name: Kubevela Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Test Environment
uses: ./path/to/this/action
with:
go-version: '1.21'
- name: Run Tests
run: |
ginkgo -r ./tests/e2e/
```
## Inputs
| Input | Description | Required | Default | Usage |
|-------|-------------|----------|---------|-------|
| `go-version` | Go version to install and use | No | `1.23.8` | Specify Go version for your project |
## What This Action Installs
### System Tools
- **make**: Build automation tool
- **gcc**: GNU Compiler Collection
- **jq**: JSON processor for shell scripts
- **ca-certificates**: SSL/TLS certificates
- **curl**: HTTP client for downloads
- **gnupg**: GNU Privacy Guard for security
### Kubernetes Ecosystem
- **kubectl**: Kubernetes command-line tool (latest stable)
- **helm**: Kubernetes package manager (latest stable)
### Go Development
- **Go Runtime**: Specified version with module caching enabled
- **Go Modules**: Downloaded and verified dependencies
- **Ginkgo v2.14.0**: BDD testing framework for Go

120
.github/actions/env-setup/action.yaml vendored Normal file
View File

@@ -0,0 +1,120 @@
name: 'Kubevela Test Environment Setup'
description: 'Sets up complete testing environment for Kubevela with Go, Kubernetes tools, and testing frameworks.'
inputs:
go-version:
description: 'Go version to use for testing'
required: false
default: '1.23.8'
install-ginkgo:
description: 'Install Ginkgo testing framework'
required: false
default: 'true'
install-setup-envtest:
description: 'Install setup-envtest for integration testing'
required: false
default: 'false'
install-kustomize:
description: 'Install kustomize for manifest management'
required: false
default: 'false'
kustomize-version:
description: 'Kustomize version to install'
required: false
default: '4.5.4'
runs:
using: 'composite'
steps:
# ========================================================================
# Environment Setup
# ========================================================================
- name: Install system dependencies
shell: bash
run: |
# Update package manager and install essential tools
sudo apt-get update
sudo apt-get install -y \
make \
gcc \
jq \
ca-certificates \
curl \
gnupg
- name: Install kubectl and helm
shell: bash
run: |
# Detect architecture
ARCH=$(uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')
# Install kubectl using a known stable version to avoid network issues
# The dl.k8s.io/release/stable.txt endpoint can return garbage due to CDN issues
KUBECTL_VERSION="v1.31.0"
echo "Installing kubectl version: $KUBECTL_VERSION for architecture: $ARCH"
curl -LO --retry 3 --fail "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
# Install helm using the official script
echo "Installing Helm using official script..."
curl -fsSL --retry 3 -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
rm get_helm.sh
# Verify installations
echo "Verifying installations..."
kubectl version --client
helm version
- name: Setup Go environment
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: ${{ inputs.go-version }}
cache: true
- name: Download Go dependencies
shell: bash
run: |
# Download and cache Go module dependencies
go mod download
go mod verify
- name: Install Ginkgo testing framework
if: ${{ inputs.install-ginkgo == 'true' }}
shell: bash
run: |
echo "Installing Ginkgo testing framework..."
go install github.com/onsi/ginkgo/v2/ginkgo@v2.14.0
echo "Ginkgo installed successfully"
- name: Install setup-envtest
if: ${{ inputs.install-setup-envtest == 'true' }}
shell: bash
run: |
echo "Installing setup-envtest for integration testing..."
mkdir -p ./bin
GOBIN=$(pwd)/bin go install sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20240522175850-2e9781e9fc60
echo "setup-envtest installed successfully at ./bin/setup-envtest"
ls -la ./bin/setup-envtest
# Download and cache the Kubernetes binaries for envtest
echo "Downloading Kubernetes binaries for envtest..."
KUBEBUILDER_ASSETS=$(./bin/setup-envtest use 1.31.0 --bin-dir ./bin -p path)
echo "Kubernetes binaries downloaded successfully"
echo "KUBEBUILDER_ASSETS=${KUBEBUILDER_ASSETS}"
# Export for subsequent steps
echo "KUBEBUILDER_ASSETS=${KUBEBUILDER_ASSETS}" >> $GITHUB_ENV
- name: Install kustomize
if: ${{ inputs.install-kustomize == 'true' }}
shell: bash
run: |
echo "Installing kustomize version ${{ inputs.kustomize-version }}..."
mkdir -p ./bin
curl -sS https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh | bash -s ${{ inputs.kustomize-version }} $(pwd)/bin
echo "kustomize installed successfully at ./bin/kustomize"
./bin/kustomize version

View File

@@ -0,0 +1,35 @@
# Kubevela K8s Upgrade Multicluster E2E Test Action
A comprehensive GitHub Actions composite action for running Kubevela Kubernetes upgrade multicluster end-to-end tests with automated coverage reporting and failure diagnostics.
## Usage
```yaml
name: Kubevela Multicluster E2E Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
multicluster-e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Multicluster E2E Tests
uses: ./.github/actions/multicluster-test
with:
codecov-enable: 'true'
codecov-token: ${{ secrets.CODECOV_TOKEN }}
```
## Inputs
| Input | Description | Required | Default | Type |
|-------|-------------|----------|---------|------|
| `codecov-token` | Codecov token for uploading coverage reports | No | `''` | string |
| `codecov-enable` | Enable codecov coverage upload | No | `'false'` | string |

View File

@@ -0,0 +1,80 @@
name: 'Kubevela K8s Upgrade Multicluster E2E Test'
description: 'Runs Kubevela Kubernetes upgrade multicluster end-to-end tests, uploads coverage, and collects diagnostics on failure.'
author: 'viskumar_gwre'
inputs:
codecov-token:
description: 'Codecov token for uploading coverage reports'
required: false
default: ''
codecov-enable:
description: 'Enable codecov coverage upload'
required: false
default: 'false'
runs:
using: 'composite'
steps:
# ========================================================================
# Environment Setup
# ========================================================================
- name: Configure environment setup
uses: ./.github/actions/env-setup
with:
install-ginkgo: 'true'
install-setup-envtest: 'false'
install-kustomize: 'false'
# ========================================================================
# E2E Test Execution
# ========================================================================
- name: Prepare e2e test environment
shell: bash
run: |
# Build CLI tools and prepare test environment
echo "Building KubeVela CLI..."
make vela-cli
echo "Cleaning up previous test artifacts..."
make e2e-cleanup
echo "Setting up core authentication for e2e tests..."
make e2e-setup-core-auth
- name: Execute multicluster upgrade e2e tests
shell: bash
run: |
# Add built CLI to PATH and run multicluster tests
export PATH=$(pwd)/bin:$PATH
echo "Running e2e multicluster upgrade tests..."
make e2e-multicluster-test
- name: Upload coverage report
if: ${{ inputs.codecov-enable == 'true' }}
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24
with:
token: ${{ inputs.codecov-token }}
files: /tmp/e2e-profile.out,/tmp/e2e_multicluster_test.out
flags: e2e-multicluster-test
name: codecov-umbrella
# ========================================================================
# Failure Diagnostics
# ========================================================================
- name: Collect failure diagnostics
if: failure()
shell: bash
run: |
echo "=== FAILURE DIAGNOSTICS ==="
echo "Collecting diagnostic information for debugging..."
echo "--- Cluster Status ---"
kubectl get nodes -o wide || true
kubectl get pods -A || true
echo "--- KubeVela System Logs ---"
kubectl logs -n vela-system -l app.kubernetes.io/name=vela-core --tail=100 || true
echo "--- Recent Events ---"
kubectl get events -A --sort-by='.lastTimestamp' --field-selector type!=Normal || true

View File

@@ -0,0 +1,78 @@
# Setup Kind Cluster Action
A GitHub Action that sets up a Kubernetes testing environment using Kind (Kubernetes in Docker) for E2E testing.
## Inputs
| Input | Description | Required | Default |
|-------|-------------|----------|---------|
| `k8s-version` | Kubernetes version for the kind cluster | No | `v1.31.9` |
## Quick Start
```yaml
name: E2E Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Setup Kind Cluster
uses: ./.github/actions/setup-kind-cluster
with:
k8s-version: 'v1.31.9'
- name: Run tests
run: |
kubectl cluster-info
make test-e2e
```
## What it does
1. **Installs Kind CLI** - Downloads Kind v0.29.0 using Go
2. **Cleans up** - Removes any existing Kind clusters
3. **Creates cluster** - Spins up Kubernetes v1.31.9 cluster
4. **Sets up environment** - Configures KUBECONFIG for kubectl access
5. **Loads images** - Builds and loads Docker images using `make image-load`
## File Structure
Save as `.github/actions/setup-kind-cluster/action.yaml`:
```yaml
name: 'SetUp kind cluster'
description: 'Sets up complete testing environment for Kubevela with Go, Kubernetes tools, and Ginkgo framework for E2E testing.'
inputs:
k8s-version:
description: 'Kubernetes version for the kind cluster'
required: false
default: 'v1.31.9'
runs:
using: 'composite'
steps:
# ========================================================================
# Kind cluster Setup
# ========================================================================
- name: Setup KinD
run: |
go install sigs.k8s.io/kind@v0.29.0
kind delete cluster || true
kind create cluster --image=kindest/node:${{ inputs.k8s-version }}
shell: bash
- name: Load image
run: |
mkdir -p $HOME/tmp/
TMPDIR=$HOME/tmp/ make image-load
shell: bash
```

View File

@@ -0,0 +1,36 @@
name: 'SetUp kind cluster'
description: 'Sets up a KinD (Kubernetes in Docker) cluster with configurable Kubernetes version and optional cluster naming for testing and development workflows.'
inputs:
k8s-version:
description: 'Kubernetes version for the kind cluster'
required: false
default: 'v1.31.9'
name:
description: 'Name of the kind cluster'
required: false
runs:
using: 'composite'
steps:
# ========================================================================
# Kind cluster Setup
# ========================================================================
- name: Setup KinD
run: |
go install sigs.k8s.io/kind@v0.29.0
if [ -n "${{ inputs.name }}" ]; then
kind delete cluster --name="${{ inputs.name }}" || true
kind create cluster --name="${{ inputs.name }}" --image=kindest/node:${{ inputs.k8s-version }}
kind export kubeconfig --internal --name="${{ inputs.name }}" --kubeconfig /tmp/${{ inputs.name }}.kubeconfig
else
kind delete cluster || true
kind create cluster --image=kindest/node:${{ inputs.k8s-version }}
fi
shell: bash
- name: Load image
run: |
if [ -z "${{ inputs.name }}" ]; then
mkdir -p $HOME/tmp/
TMPDIR=$HOME/tmp/ make image-load
fi
shell: bash

34
.github/actions/unit-test/README.md vendored Normal file
View File

@@ -0,0 +1,34 @@
# Kubevela K8s Upgrade Unit Test Action
A comprehensive GitHub composite action for running KubeVela Kubernetes upgrade unit tests with coverage reporting and failure diagnostics.
## Inputs
| Input | Description | Required | Default |
|-------|-------------|----------|---------|
| `codecov-token` | Codecov token for uploading coverage reports | ❌ | `''` |
| `codecov-enable` | Enable Codecov coverage upload (`'true'` or `'false'`) | ❌ | `'false'` |
| `go-version` | Go version to use for testing | ❌ | `'1.23.8'` |
## Quick Start
### Basic Usage
```yaml
name: Unit Tests with Coverage
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run KubeVela Unit Tests
uses: viskumar_gwre/kubevela-k8s-upgrade-unit-test-action@v1
with:
codecov-enable: 'true'
codecov-token: ${{ secrets.CODECOV_TOKEN }}
go-version: '1.23.8'
```

71
.github/actions/unit-test/action.yaml vendored Normal file
View File

@@ -0,0 +1,71 @@
name: 'Kubevela K8s Upgrade Unit Test'
description: 'Runs Kubevela K8s upgrade unit tests, uploads coverage, and collects diagnostics on failure.'
inputs:
codecov-token:
description: 'Codecov token for uploading coverage reports'
required: false
default: ''
codecov-enable:
description: 'Enable codecov coverage upload'
required: false
default: 'false'
runs:
using: "composite"
steps:
# ========================================================================
# Environment Setup
# ========================================================================
- name: Configure environment setup
uses: ./.github/actions/env-setup
with:
install-ginkgo: 'true'
install-setup-envtest: 'true'
install-kustomize: 'true'
# ========================================================================
# Unit Test Execution
# ========================================================================
- name: Run unit tests
shell: bash
run: |
echo "Running unit tests..."
make test
- name: Upload coverage report
if: ${{ inputs.codecov-enable == 'true' }}
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24
with:
token: ${{ inputs.codecov-token }}
files: ./coverage.txt
flags: core-unittests
name: codecov-umbrella
fail_ci_if_error: false
# ========================================================================
# Failure Diagnostics
# ========================================================================
- name: Collect failure diagnostics
if: failure()
shell: bash
run: |
echo "=== FAILURE DIAGNOSTICS ==="
echo "Collecting diagnostic information for debugging..."
echo "--- Go Environment ---"
go version || true
go env || true
echo "--- Cluster Status ---"
kubectl get nodes -o wide || true
kubectl get pods -A || true
echo "--- KubeVela System Logs ---"
kubectl logs -n vela-system -l app.kubernetes.io/name=vela-core --tail=100 || true
echo "--- Recent Events ---"
kubectl get events -A --sort-by='.lastTimestamp' --field-selector type!=Normal || true
echo "--- Test Artifacts ---"
find . -name "*.log" -o -name "*test*.xml" -o -name "coverage.*" | head -20 || true

View File

@@ -11,4 +11,7 @@ wangyuan249
chivalryq
FogDong
leejanee
barnettZQG
barnettZQG
anoop2811
briankane
jguionnet

View File

@@ -8,10 +8,12 @@ updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
interval: "weekly"
commit-message:
prefix: "Chore: "
include: "scope"
ignore:
- dependency-name: k8s.io/*
- package-ecosystem: "github-actions"
directory: "/"
schedule:

View File

@@ -10,19 +10,19 @@ permissions:
jobs:
# align with crossplane's choice https://github.com/crossplane/crossplane/blob/master/.github/workflows/backport.yml
open-pr:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
if: github.event.pull_request.merged
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
fetch-depth: 0
- name: Open Backport PR
uses: zeebe-io/backport-action@a759fd2d7d3314c9bb57d97a0350a12e878d3c7a
uses: zeebe-io/backport-action@0193454f0c5947491d348f33a275c119f30eb736
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}

View File

@@ -9,29 +9,15 @@ on:
permissions:
contents: read
env:
BUCKET: ${{ secrets.OSS_BUCKET }}
ENDPOINT: ${{ secrets.OSS_ENDPOINT }}
ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
ARTIFACT_HUB_REPOSITORY_ID: ${{ secrets.ARTIFACT_HUB_REPOSITORY_ID }}
jobs:
publish-charts:
env:
HELM_CHARTS_DIR: charts
HELM_CHART: charts/vela-core
MINIMAL_HELM_CHART: charts/vela-minimal
LEGACY_HELM_CHART: legacy/charts/vela-core-legacy
VELA_ROLLOUT_HELM_CHART: runtime/rollout/charts
LOCAL_OSS_DIRECTORY: .oss
HELM_CHART_NAME: vela-core
MINIMAL_HELM_CHART_NAME: vela-minimal
LEGACY_HELM_CHART_NAME: vela-core-legacy
VELA_ROLLOUT_HELM_CHART_NAME: vela-rollout
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Get git revision
id: vars
shell: bash
@@ -42,19 +28,12 @@ jobs:
with:
version: v3.4.0
- name: Setup node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: '14'
- name: Generate helm doc
run: |
make helm-doc-gen
- name: Prepare legacy chart
run: |
rsync -r $LEGACY_HELM_CHART $HELM_CHARTS_DIR
rsync -r $HELM_CHART/* $LEGACY_HELM_CHART --exclude=Chart.yaml --exclude=crds
- name: Prepare vela chart
run: |
rsync -r $VELA_ROLLOUT_HELM_CHART $HELM_CHARTS_DIR
- name: Get the version
id: get_version
run: |
@@ -65,39 +44,24 @@ jobs:
image_tag=${{ steps.get_version.outputs.VERSION }}
chart_version=${{ steps.get_version.outputs.VERSION }}
sed -i "s/latest/${image_tag}/g" $HELM_CHART/values.yaml
sed -i "s/latest/${image_tag}/g" $MINIMAL_HELM_CHART/values.yaml
sed -i "s/latest/${image_tag}/g" $LEGACY_HELM_CHART/values.yaml
sed -i "s/latest/${image_tag}/g" $VELA_ROLLOUT_HELM_CHART/values.yaml
chart_smever=${chart_version#"v"}
sed -i "s/0.1.0/$chart_smever/g" $HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $MINIMAL_HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $LEGACY_HELM_CHART/Chart.yaml
sed -i "s/0.1.0/$chart_smever/g" $VELA_ROLLOUT_HELM_CHART/Chart.yaml
- name: Install ossutil
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
- name: Configure Alibaba Cloud OSSUTIL
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT} -c .ossutilconfig
- name: sync cloud to local
run: ./ossutil --config-file .ossutilconfig sync oss://$BUCKET/core $LOCAL_OSS_DIRECTORY
- name: add artifacthub stuff to the repo
- uses: jnwng/github-app-installation-token-action@c54add4c02866dc41e106745ac6dcf5cdd6339e5 # v2
id: get_app_token
with:
appId: 340472
installationId: 38064967
privateKey: ${{ secrets.GH_KUBEVELA_APP_PRIVATE_KEY }}
- name: Sync Chart Repo
run: |
rsync $HELM_CHART/README.md $LEGACY_HELM_CHART/README.md
rsync $HELM_CHART/README.md $VELA_ROLLOUT_HELM_CHART/README.md
sed -i "s/ARTIFACT_HUB_REPOSITORY_ID/$ARTIFACT_HUB_REPOSITORY_ID/g" hack/artifacthub/artifacthub-repo.yml
rsync hack/artifacthub/artifacthub-repo.yml $LOCAL_OSS_DIRECTORY
- name: Package helm charts
run: |
helm package $HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $MINIMAL_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $LEGACY_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm package $VELA_ROLLOUT_HELM_CHART --destination $LOCAL_OSS_DIRECTORY
helm repo index --url https://$BUCKET.$ENDPOINT/core $LOCAL_OSS_DIRECTORY
- name: sync local to cloud
run: |
image_tag=${{ steps.get_version.outputs.VERSION }}
chart_semver=${image_tag#"v"}
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/index.yaml oss://$BUCKET/core/index.yaml
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/$HELM_CHART_NAME-${chart_semver}.tgz oss://$BUCKET/core/$HELM_CHART_NAME-${chart_semver}.tgz
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/$MINIMAL_HELM_CHART_NAME-${chart_semver}.tgz oss://$BUCKET/core/$MINIMAL_HELM_CHART_NAME-${chart_semver}.tgz
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/$LEGACY_HELM_CHART_NAME-${chart_semver}.tgz oss://$BUCKET/core/$LEGACY_HELM_CHART_NAME-${chart_semver}.tgz
./ossutil --config-file .ossutilconfig cp -f $LOCAL_OSS_DIRECTORY/$VELA_ROLLOUT_HELM_CHART_NAME-${chart_semver}.tgz oss://$BUCKET/core/$VELA_ROLLOUT_HELM_CHART_NAME-${chart_semver}.tgz
git config --global user.email "135009839+kubevela[bot]@users.noreply.github.com"
git config --global user.name "kubevela[bot]"
git clone https://x-access-token:${{ steps.get_app_token.outputs.token }}@github.com/kubevela/charts.git kubevela-charts
helm package $HELM_CHART --destination ./kubevela-charts/docs/
helm repo index --url https://kubevela.github.io/charts ./kubevela-charts/docs/
cd kubevela-charts/
git add docs/
chart_version=${{ steps.get_version.outputs.VERSION }}
git commit -m "update vela-core chart ${chart_version}"
git push https://x-access-token:${{ steps.get_app_token.outputs.token }}@github.com/kubevela/charts.git

View File

@@ -10,7 +10,7 @@ permissions:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
actions: read # for github/codeql-action/init to get workflow details
@@ -23,15 +23,15 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Initialize CodeQL
uses: github/codeql-action/init@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
uses: github/codeql-action/autobuild@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5

View File

@@ -13,9 +13,9 @@ permissions:
jobs:
check:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: thehanimo/pr-title-checker@v1.3.7
- uses: thehanimo/pr-title-checker@5652588c80c479af803eabfbdb5a3895a77c1388 # v1.4.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pass_on_octokit_error: true

View File

@@ -14,18 +14,18 @@ permissions:
jobs:
core-api-test:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Set up Go 1.19
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- name: Set up Go 1.23.8
uses: actions/setup-go@v5
env:
GO_VERSION: '1.19'
GO_VERSION: '1.23.8'
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Get the version
id: get_version

View File

@@ -16,27 +16,26 @@ permissions:
env:
# Common versions
GO_VERSION: '1.19'
GO_VERSION: '1.23.8'
jobs:
definition-doc:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Setup Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
submodules: true
- name: Setup K3d
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
- name: Setup KinD
uses: ./.github/actions/setup-kind-cluster
with:
version: v1.20
github-token: ${{ secrets.GITHUB_TOKEN }}
name: linter
- name: Definition Doc generate check
run: |

View File

@@ -18,20 +18,20 @@ permissions:
env:
# Common versions
GO_VERSION: '1.19'
GO_VERSION: '1.23.8'
jobs:
detect-noop:
permissions:
actions: write
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
@@ -39,102 +39,48 @@ jobs:
continue-on-error: true
e2e-multi-cluster-tests:
runs-on: self-hosted
runs-on: ubuntu-22.04
needs: [ detect-noop ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ["v1.20","v1.24"]
k8s-version: ["v1.31.9"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Install tools
run: |
sudo apt-get update
sudo apt-get install make gcc jq ca-certificates curl gnupg -y
snap install docker
snap install kubectl --classic
snap install helm --classic
- name: Setup Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
- name: Setup worker cluster kinD
uses: ./.github/actions/setup-kind-cluster
with:
go-version: ${{ env.GO_VERSION }}
name: worker
k8s-version: ${{ matrix.k8s-version }}
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Tear down K3d if exist
run: |
k3d cluster delete || true
k3d cluster delete worker || true
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Setup K3d (Hub)
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
- name: Setup master cluster kinD
uses: ./.github/actions/setup-kind-cluster
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
k8s-version: ${{ matrix.k8s-version }}
- name: Setup K3d (Worker)
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
- name: Run upgrade multicluster tests
uses: ./.github/actions/multicluster-test
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-name: worker
k3d-args: --kubeconfig-update-default=false --network=k3d-k3s-default ${{ env.EGRESS_ARG }}
- name: Generating internal worker kubeconfig
run: |
internal_ip=$(docker network inspect k3d-k3s-default|jq ".[0].Containers"| jq -r '.[]| select(.Name=="k3d-worker-server-0")|.IPv4Address' | cut -d/ -f1)
k3d kubeconfig get worker > /tmp/worker.client.kubeconfig
cp /tmp/worker.client.kubeconfig /tmp/worker.kubeconfig
sed -i "s/0.0.0.0:[0-9]\+/$internal_ip:6443/" /tmp/worker.kubeconfig
- name: Load image to k3d cluster (hub and worker)
run: make image-load image-load-runtime-cluster
- name: Cleanup for e2e tests
run: |
make vela-cli
make e2e-cleanup
make e2e-setup-core-auth
make setup-runtime-e2e-cluster
- name: Run e2e multicluster tests
run: |
export PATH=$(pwd)/bin:$PATH
make e2e-multicluster-test
- name: Stop kubevela, get profile
run: |
make end-e2e-core-shards
- name: Upload coverage report
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/e2e-profile.out,/tmp/e2e_multicluster_test.out
flags: e2e-multicluster-test
name: codecov-umbrella
codecov-enable: true
codecov-token: ${{ secrets.CODECOV_TOKEN }}
- name: Clean e2e profile
run: rm /tmp/e2e-profile.out
run: |
if [ -f /tmp/e2e-profile.out ]; then
rm /tmp/e2e-profile.out
echo "E2E profile cleaned"
else
echo "E2E profile not found, skipping cleanup"
fi
- name: Cleanup image
if: ${{ always() }}
run: make image-cleanup
run: |
make image-cleanup
docker image prune -f --filter "until=24h"

View File

@@ -1,118 +0,0 @@
name: E2E Rollout Test
on:
push:
branches:
- master
- release-*
tags:
- v*
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
permissions:
contents: read
env:
# Common versions
GO_VERSION: '1.19'
jobs:
detect-noop:
permissions:
actions: write
runs-on: ubuntu-20.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
continue-on-error: true
e2e-rollout-tests:
runs-on: self-hosted
needs: [ detect-noop ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ["v1.20","v1.24"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
- name: Setup Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
with:
go-version: ${{ env.GO_VERSION }}
- name: Get dependencies
run: |
go get -v -t -d ./...
go install github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/gomega/...
- name: Tear down K3d if exist
run: |
k3d cluster delete || true
k3d cluster delete worker || true
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Setup K3d
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
- name: Load image to k3d cluster
run: make image-load image-load-runtime-cluster
- name: Prepare for e2e tests
run: |
make vela-cli
make e2e-cleanup
make e2e-setup-core
make setup-runtime-e2e-cluster
helm test -n vela-system kubevela --timeout 5m
- name: Run e2e tests
run: make e2e-rollout-test
- name: Stop kubevela, get profile
run: make end-e2e
- name: Upload coverage report
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/e2e-profile.out
flags: e2e-rollout-tests
name: codecov-umbrella
- name: Clean e2e profile
run: rm /tmp/e2e-profile.out
- name: Cleanup image
if: ${{ always() }}
run: make image-cleanup

View File

@@ -18,20 +18,20 @@ permissions:
env:
# Common versions
GO_VERSION: '1.19'
GO_VERSION: '1.23.8'
jobs:
detect-noop:
permissions:
actions: write
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
@@ -39,95 +39,43 @@ jobs:
continue-on-error: true
e2e-tests:
runs-on: self-hosted
runs-on: ubuntu-22.04
needs: [ detect-noop ]
if: needs.detect-noop.outputs.noop != 'true'
strategy:
matrix:
k8s-version: ["v1.20","v1.24"]
k8s-version: ["v1.31"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Install tools
run: |
sudo apt-get update
sudo apt-get install make gcc jq ca-certificates curl gnupg -y
snap install docker
snap install kubectl --classic
snap install helm --classic
- name: Setup KinD
uses: ./.github/actions/setup-kind-cluster
- name: Setup Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
# ========================================================================
# E2E Test Execution
# ========================================================================
- name: Run upgrade e2e tests
uses: ./.github/actions/e2e-test
with:
go-version: ${{ env.GO_VERSION }}
- name: Get dependencies
run: |
go get -v -t -d ./...
go install github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/gomega/...
- name: Tear down K3d if exist
run: |
k3d cluster delete || true
k3d cluster delete worker || true
- name: Calculate K3d args
run: |
EGRESS_ARG=""
if [[ "${{ matrix.k8s-version }}" == v1.24 ]]; then
EGRESS_ARG="--k3s-arg --egress-selector-mode=disabled@server:0"
fi
echo "EGRESS_ARG=${EGRESS_ARG}" >> $GITHUB_ENV
- name: Setup K3d
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
with:
version: ${{ matrix.k8s-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
k3d-args: ${{ env.EGRESS_ARG }}
- name: Load image to k3d cluster
run: make image-load
- name: Run Make
run: make
- name: Prepare for e2e tests
run: |
make e2e-cleanup
make e2e-setup-core
helm test -n vela-system kubevela --timeout 5m
- name: Run api e2e tests
run: make e2e-api-test
- name: Run addons e2e tests
run: make e2e-addon-test
- name: Run e2e tests
run: make e2e-test
- name: Stop kubevela, get profile
run: make end-e2e
- name: Upload coverage report
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: /tmp/e2e-profile.out
flags: e2etests
name: codecov-umbrella
codecov-enable: true
codecov-token: ${{ secrets.CODECOV_TOKEN }}
- name: Clean e2e profile
run: rm /tmp/e2e-profile.out
run: |
if [ -f /tmp/e2e-profile.out ]; then
rm /tmp/e2e-profile.out
echo "E2E profile cleaned"
else
echo "E2E profile not found, skipping cleanup"
fi
- name: Cleanup image
if: ${{ always() }}
run: make image-cleanup
run: |
make image-cleanup
docker image prune -f --filter "until=24h"

View File

@@ -11,18 +11,17 @@ on:
- master
- release-*
permissions: # added using https://github.com/step-security/secure-workflows
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
env:
# Common versions
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
GO_VERSION: "1.23.8"
GOLANGCI_VERSION: "v1.60.1"
jobs:
detect-noop:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
permissions:
@@ -30,7 +29,7 @@ jobs:
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
@@ -38,18 +37,18 @@ jobs:
continue-on-error: true
staticcheck:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Setup Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
submodules: true
@@ -60,21 +59,21 @@ jobs:
run: make check-license-header
lint:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
steps:
- name: Setup Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
submodules: true
@@ -83,46 +82,73 @@ jobs:
# version, but we prefer this action because it leaves 'annotations' (i.e.
# it comments on PRs to point out linter violations).
- name: Lint
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
uses: golangci/golangci-lint-action@v6
with:
version: ${{ env.GOLANGCI_VERSION }}
check-diff:
runs-on: self-hosted
runs-on: ubuntu-22.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
with:
go-version: ${{ env.GO_VERSION }}
- name: Free Disk Space
run: |
echo "Disk space before cleanup:"
df -h
# Remove unnecessary software to free up disk space
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
echo "Disk space after cleanup:"
df -h
- name: Setup Env
uses: ./.github/actions/env-setup
- name: Setup node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: '14'
node-version: "14"
- name: Cache Go Dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Setup kinD
uses: ./.github/actions/setup-kind-cluster
- name: Run cross-build
run: make cross-build
- name: Free Disk Space After Cross-Build
run: |
echo "Disk space before cleanup:"
df -h
# Remove cross-build artifacts to free up space
# (make build will rebuild binaries for current platform)
rm -rf _bin
# Clean Go build cache and test cache
go clean -cache -testcache
# Remove Docker build cache
sudo docker builder prune --all --force || true
echo "Disk space after cleanup:"
df -h
- name: Check Diff
run: |
export PATH=$(pwd)/bin/:$PATH
make check-diff
- name: Cleanup binary
run: make build-cleanup
@@ -133,17 +159,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
with:
go-version: ${{ env.GO_VERSION }}
- name: Cache Go Dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
uses: actions/cache@v4
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
@@ -159,40 +185,40 @@ jobs:
.\bin\vela.exe version
check-core-image-build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # v2.4.1
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
- name: Build Test for vela core
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
check-cli-image-build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # v2.4.1
- name: Build Test for CLI
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
- name: Build Test for CLI
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
context: .
file: Dockerfile.cli
file: Dockerfile.cli

View File

@@ -1,4 +1,4 @@
name: Run commands when issues are labeled or comments added
name: Run commands for issues and pull requests
on:
issues:
types: [labeled, opened]
@@ -7,29 +7,33 @@ on:
permissions:
contents: read
issues: write
jobs:
bot:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
pull-requests: write
issues: write
steps:
- name: Checkout Actions
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
repository: "oam-dev/kubevela-github-actions"
path: ./actions
ref: v0.4.2
- name: Setup Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version: '14'
cache: 'npm'
node-version: "14"
cache: "npm"
cache-dependency-path: ./actions/package-lock.json
- name: Install Dependencies
run: npm ci --production --prefix ./actions
- name: Run Commands
uses: ./actions/commands
with:
token: ${{secrets.VELA_BOT_TOKEN}}
token: ${{ secrets.GH_KUBEVELA_COMMAND_WORKFLOW }}
configPath: issue-commands
backport:
@@ -44,14 +48,14 @@ jobs:
id: command
uses: xt0rted/slash-command-action@bf51f8f5f4ea3d58abc7eca58f77104182b23e88
with:
repo-token: ${{ secrets.VELA_BOT_TOKEN }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
command: backport
reaction: "true"
reaction-type: "eyes"
allow-edits: "false"
permission-level: read
- name: Handle Command
uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
env:
VERSION: ${{ steps.command.outputs.command-arguments }}
with:
@@ -72,11 +76,68 @@ jobs:
})
console.log("Added '" + label + "' label.")
- name: Checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
fetch-depth: 0
- name: Open Backport PR
uses: zeebe-io/backport-action@a759fd2d7d3314c9bb57d97a0350a12e878d3c7a
uses: zeebe-io/backport-action@0193454f0c5947491d348f33a275c119f30eb736
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}
retest:
runs-on: ubuntu-22.04
if: github.event.issue.pull_request && contains(github.event.comment.body, '/retest')
permissions:
actions: write
pull-requests: write
issues: write
steps:
- name: Retest the current pull request
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
env:
PULL_REQUEST_ID: ${{ github.event.issue.number }}
COMMENT_ID: ${{ github.event.comment.id }}
COMMENT_BODY: ${{ github.event.comment.body }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pull_request_id = process.env.PULL_REQUEST_ID
const comment_id = process.env.COMMENT_ID
const comment_body = process.env.COMMENT_BODY
console.log("retest pr: #" + pull_request_id + " comment: " + comment_body)
const {data: pr} = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pull_request_id,
})
console.log("pr: " + JSON.stringify(pr))
const action = comment_body.split(" ")[0]
let workflow_ids = comment_body.split(" ").slice(1).filter(line => line.length > 0).map(line => line + ".yml")
if (workflow_ids.length == 0) workflow_ids = ["go.yml", "unit-test.yml", "e2e-test.yml", "e2e-multicluster-test.yml"]
for (let i = 0; i < workflow_ids.length; i++) {
const workflow_id = workflow_ids[i]
const {data: runs} = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: workflow_id,
head_sha: pr.head.sha,
})
console.log("runs for " + workflow_id + ": ", JSON.stringify(runs))
runs.workflow_runs.forEach((workflow_run) => {
if (workflow_run.status === "in_progress") return
let handler = github.rest.actions.reRunWorkflow
if (action === "/retest-failed") handler = github.rest.actions.reRunWorkflowFailedJobs
handler({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: workflow_run.id
})
})
}
github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment_id,
content: "eyes",
});

View File

@@ -9,18 +9,17 @@ on:
branches:
- master
- release-*
-
permissions:
contents: read
jobs:
license_check:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: Check for unapproved licenses
steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Set up Ruby
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0
with:
ruby-version: 2.6
- name: Install dependencies

View File

@@ -1,27 +1,45 @@
name: Registry
on:
push:
branches:
- master
tags:
- "v*"
- 'v*'
workflow_dispatch: {}
env:
ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
permissions:
contents: read
jobs:
publish-core-images:
publish-vela-images:
name: Build and Push Vela Images
permissions:
packages: write
runs-on: ubuntu-latest
id-token: write
attestations: write
contents: write
runs-on: ubuntu-22.04
outputs:
vela_core_image: ${{ steps.meta-vela-core.outputs.image }}
vela_core_digest: ${{ steps.meta-vela-core.outputs.digest }}
vela_core_dockerhub_image: ${{ steps.meta-vela-core.outputs.dockerhub_image }}
vela_cli_image: ${{ steps.meta-vela-cli.outputs.image }}
vela_cli_digest: ${{ steps.meta-vela-cli.outputs.digest }}
vela_cli_dockerhub_image: ${{ steps.meta-vela-cli.outputs.dockerhub_image }}
steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
- name: Get the version
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.1
- name: Install Crane
uses: imjasonh/setup-crane@00c9e93efa4e1138c9a7a5c594acd6c75a2fbf0c # v0.1
- name: Install Cosign
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # main
with:
cosign-release: 'v2.5.0'
- name: Get the image version
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
@@ -29,40 +47,41 @@ jobs:
VERSION=latest
fi
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
- name: Get git revision
id: vars
shell: bash
run: |
echo "git_revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Login ghcr.io
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
- name: Login to GHCR
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login docker.io
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
- name: Login to DockerHub
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login Alibaba Cloud ACR
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: ${{ secrets.ACR_DOMAIN }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
- uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # v2.4.1
- name: Setup QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
with:
driver-opts: image=moby/buildkit:master
- uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
name: Build & Pushing vela-core for Dockerhub, GHCR and ACR
- name: Build & Push Vela Core for Dockerhub, GHCR
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
with:
context: .
file: Dockerfile
labels: |-
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
platforms: linux/amd64,linux/arm64
@@ -71,17 +90,55 @@ jobs:
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
GOPROXY=https://proxy.golang.org
tags: |-
tags: |
docker.io/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository_owner }}/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
- uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
name: Build & Pushing CLI for Dockerhub, GHCR and ACR
- name: Get Vela Core Image Digest
id: meta-vela-core
run: |
GHCR_IMAGE=ghcr.io/${{ github.repository_owner }}/oamdev/vela-core
DOCKER_IMAGE=docker.io/oamdev/vela-core
TAG=${{ steps.get_version.outputs.VERSION }}
DIGEST=$(crane digest $GHCR_IMAGE:$TAG)
echo "image=$GHCR_IMAGE" >> $GITHUB_OUTPUT
echo "dockerhub_image=$DOCKER_IMAGE" >> $GITHUB_OUTPUT
echo "digest=$DIGEST" >> $GITHUB_OUTPUT
- name: Generate SBOM for Vela Core Image
id: generate_vela_core_sbom
uses: anchore/sbom-action@v0.17.0
with:
image: ghcr.io/${{ github.repository_owner }}/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
format: spdx-json
artifact-name: sbom-vela-core.spdx.json
output-file: ${{ github.workspace }}/sbom-vela-core.spdx.json
- name: Sign Vela Core Image and Attest SBOM
env:
COSIGN_EXPERIMENTAL: 'true'
run: |
echo "signing vela core images..."
cosign sign --yes ghcr.io/${{ github.repository_owner }}/oamdev/vela-core@${{ steps.meta-vela-core.outputs.digest }}
cosign sign --yes docker.io/oamdev/vela-core@${{ steps.meta-vela-core.outputs.digest }}
echo "attesting SBOM against the vela core image..."
cosign attest --yes --predicate ${{ github.workspace }}/sbom-vela-core.spdx.json --type spdx \
ghcr.io/${{ github.repository_owner }}/oamdev/vela-core@${{ steps.meta-vela-core.outputs.digest }}
cosign attest --yes --predicate ${{ github.workspace }}/sbom-vela-core.spdx.json --type spdx \
docker.io/oamdev/vela-core@${{ steps.meta-vela-core.outputs.digest }}
- name: Build & Push Vela CLI for Dockerhub, GHCR
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
with:
context: .
file: Dockerfile.cli
labels: |-
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
platforms: linux/amd64,linux/arm64
@@ -90,87 +147,100 @@ jobs:
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
GOPROXY=https://proxy.golang.org
tags: |-
tags: |
docker.io/oamdev/vela-cli:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository_owner }}/oamdev/vela-cli:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/vela-cli:${{ steps.get_version.outputs.VERSION }}
publish-addon-images:
- name: Get Vela CLI Image Digest
id: meta-vela-cli
run: |
GHCR_IMAGE=ghcr.io/${{ github.repository_owner }}/oamdev/vela-cli
DOCKER_IMAGE=docker.io/oamdev/vela-cli
TAG=${{ steps.get_version.outputs.VERSION }}
DIGEST=$(crane digest $GHCR_IMAGE:$TAG)
echo "image=$GHCR_IMAGE" >> $GITHUB_OUTPUT
echo "dockerhub_image=$DOCKER_IMAGE" >> $GITHUB_OUTPUT
echo "digest=$DIGEST" >> $GITHUB_OUTPUT
- name: Generate SBOM for Vela CLI Image
id: generate_sbom
uses: anchore/sbom-action@v0.17.0
with:
image: ghcr.io/${{ github.repository_owner }}/oamdev/vela-cli:${{ steps.get_version.outputs.VERSION }}
registry-username: ${{ github.actor }}
registry-password: ${{ secrets.GITHUB_TOKEN }}
format: spdx-json
artifact-name: sbom-vela-cli.spdx.json
output-file: ${{ github.workspace }}/sbom-vela-cli.spdx.json
- name: Sign Vela CLI Image and Attest SBOM
env:
COSIGN_EXPERIMENTAL: 'true'
run: |
echo "signing vela CLI images..."
cosign sign --yes ghcr.io/${{ github.repository_owner }}/oamdev/vela-cli@${{ steps.meta-vela-cli.outputs.digest }}
cosign sign --yes docker.io/oamdev/vela-cli@${{ steps.meta-vela-cli.outputs.digest }}
echo "attesting SBOM against the vela cli image..."
cosign attest --yes --predicate ${{ github.workspace }}/sbom-vela-cli.spdx.json --type spdx \
ghcr.io/${{ github.repository_owner }}/oamdev/vela-cli@${{ steps.meta-vela-cli.outputs.digest }}
cosign attest --yes --predicate ${{ github.workspace }}/sbom-vela-cli.spdx.json --type spdx \
docker.io/oamdev/vela-cli@${{ steps.meta-vela-cli.outputs.digest }}
- name: Publish SBOMs as release artifacts
uses: anchore/sbom-action/publish-sbom@v0.17.0
provenance-ghcr:
name: Generate and Push Provenance to GCHR
needs: publish-vela-images
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
include:
- name: 'Vela Core Image'
image: ${{ needs.publish-vela-images.outputs.vela_core_image }}
digest: ${{ needs.publish-vela-images.outputs.vela_core_digest }}
- name: 'Vela CLI Image'
image: ${{ needs.publish-vela-images.outputs.vela_cli_image }}
digest: ${{ needs.publish-vela-images.outputs.vela_cli_digest }}
permissions:
id-token: write
contents: write
actions: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
- name: Get the version
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
VERSION=latest
fi
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
- name: Get git revision
id: vars
shell: bash
run: |
echo "git_revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Login ghcr.io
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login docker.io
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login Alibaba Cloud ACR
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: ${{ secrets.ACR_DOMAIN }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
- uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # v2.4.1
with:
driver-opts: image=moby/buildkit:master
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0 # has to be sem var
with:
image: ${{ matrix.image }}
digest: ${{ matrix.digest }}
registry-username: ${{ github.actor }}
secrets:
registry-password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
name: Build & Pushing runtime rollout Dockerhub, GHCR and ACR
with:
context: .
file: runtime/rollout/Dockerfile
labels: |-
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
build-args: |
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
VERSION=${{ steps.get_version.outputs.VERSION }}
GOPROXY=https://proxy.golang.org
tags: |-
docker.io/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ github.repository_owner }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
${{ secrets.ACR_DOMAIN }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
publish-capabilities:
env:
CAPABILITY_BUCKET: kubevela-registry
CAPABILITY_DIR: capabilities
CAPABILITY_ENDPOINT: oss-cn-beijing.aliyuncs.com
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
- name: Install ossutil
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
- name: Configure Alibaba Cloud OSSUTIL
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${CAPABILITY_ENDPOINT} -c .ossutilconfig
- name: sync capabilities bucket to local
run: ./ossutil --config-file .ossutilconfig sync oss://$CAPABILITY_BUCKET $CAPABILITY_DIR
- name: rsync all capabilites
run: rsync vela-templates/registry/auto-gen/* $CAPABILITY_DIR
- name: sync local to cloud
run: ./ossutil --config-file .ossutilconfig sync $CAPABILITY_DIR oss://$CAPABILITY_BUCKET -f
provenance-dockerhub:
name: Generate and Push Provenance to DockerHub
needs: publish-vela-images
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
include:
- name: 'Vela Core Image'
image: ${{ needs.publish-vela-images.outputs.vela_core_dockerhub_image }}
digest: ${{ needs.publish-vela-images.outputs.vela_core_digest }}
- name: 'Vela CLI Image'
image: ${{ needs.publish-vela-images.outputs.vela_cli_dockerhub_image }}
digest: ${{ needs.publish-vela-images.outputs.vela_cli_digest }}
permissions:
id-token: write
contents: write
packages: write
actions: read
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0
with:
image: ${{ matrix.image }}
digest: ${{ matrix.digest }}
secrets:
registry-username: ${{ secrets.DOCKER_USERNAME }}
registry-password: ${{ secrets.DOCKER_PASSWORD }}

View File

@@ -4,19 +4,15 @@ on:
push:
tags:
- "v*"
workflow_dispatch: { }
env:
BUCKET: ${{ secrets.CLI_OSS_BUCKET }}
ENDPOINT: ${{ secrets.CLI_OSS_ENDPOINT }}
ACCESS_KEY: ${{ secrets.CLI_OSS_ACCESS_KEY }}
ACCESS_KEY_SECRET: ${{ secrets.CLI_OSS_ACCESS_KEY_SECRET }}
workflow_dispatch: {}
permissions:
contents: read
jobs:
build:
goreleaser:
name: goreleaser
runs-on: ubuntu-22.04
permissions:
contents: write
actions: read
@@ -26,48 +22,83 @@ jobs:
pull-requests: read
repository-projects: read
statuses: read
runs-on: ubuntu-latest
name: goreleaser
id-token: write
outputs:
hashes: ${{ steps.hash.outputs.hashes }}
steps:
- name: Check disk (before)
run: |
df -h
sudo du -sh /usr/local/lib/android /usr/share/dotnet /opt/ghc || true
- name: Free Disk Space (Ubuntu)
uses: insightsengineering/disk-space-reclaimer@v1
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tools-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
docker-images: true
# Extra prune in case your job builds/pulls images
- name: Deep Docker prune
run: |
docker system prune -af || true
docker builder prune -af || true
- name: Checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Get Git tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
with:
go-version: 1.19
go-version: 1.23.8
cache: true
- uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v4.2.0
- name: Install Cosign
uses: sigstore/cosign-installer@main
with:
cosign-release: "v2.5.0"
- name: Install syft
uses: anchore/sbom-action/download-syft@f325610c9f50a54015d37c8d16cb3b0e2c8f4de0 # v0.18.0
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
with:
distribution: goreleaser
version: 1.14.1
args: release --rm-dist --timeout 60m
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Since goreleaser haven't supported aliyun OSS, we need to upload the release manually
- name: Get version
run: echo "VELA_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Install ossutil
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
- name: Configure Alibaba Cloud OSSUTIL
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${ENDPOINT}
- name: split files to be upload
run: mkdir -p ./dist/files_upload && mv ./dist/*.tar.gz ./dist/files_upload && mv ./dist/*.zip ./dist/files_upload
- name: sync local to cloud
run: ./ossutil --config-file .ossutilconfig sync ./dist/files_upload oss://$BUCKET/binary/vela/${{ env.VELA_VERSION }}
- name: sync the latest version file
if: ${{ !contains(env.VELA_VERSION,'alpha') && !contains(env.VELA_VERSION,'beta') && !contains(env.VELA_VERSION,'rc') }}
- name: Generate hashes
id: hash
if: startsWith(github.ref, 'refs/tags/')
run: |
LATEST_VERSION=$(curl -fsSl https://static.kubevela.net/binary/vela/latest_version)
verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}
verlte ${{ env.VELA_VERSION }} $LATEST_VERSION && echo "${{ env.VELA_VERSION }} <= $LATEST_VERSION, skip update" && exit 0
echo ${{ env.VELA_VERSION }} > ./latest_version
./ossutil --config-file .ossutilconfig cp -u ./latest_version oss://$BUCKET/binary/vela/latest_version
set -euo pipefail
HASHES=$(find dist -type f -exec sha256sum {} \; | base64 -w0)
echo "hashes=$HASHES" >> "$GITHUB_OUTPUT"
- name: Check disk (after)
run: df -h
upload-plugin-homebrew:
name: upload-sha256sums
needs: goreleaser
runs-on: ubuntu-22.04
if: ${{ !contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'rc') }}
permissions:
contents: write
actions: read
@@ -77,20 +108,22 @@ jobs:
pull-requests: read
repository-projects: read
statuses: read
needs: build
runs-on: ubuntu-latest
if: ${{ !contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'rc') }}
name: upload-sha256sums
steps:
- name: Checkout
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Update kubectl plugin version in krew-index
uses: rajatjindal/krew-release-bot@92da038bbf995803124a8e50ebd438b2f37bbbb0 # v0.0.43
- name: Update Homebrew formula
uses: dawidd6/action-homebrew-bump-formula@e9b43cd30eec6ea80777e7e22e1526beb1675c18 # v3.9.0
with:
token: ${{ secrets.HOMEBREW_TOKEN }}
formula: kubevela
tag: ${{ github.ref }}
revision: ${{ github.sha }}
force: false
uses: rajatjindal/krew-release-bot@df3eb197549e3568be8b4767eec31c5e8e8e6ad8 # v0.0.46
provenance-vela-bins:
name: generate provenance for binaries
needs: [goreleaser]
if: startsWith(github.ref, 'refs/tags/')
permissions:
id-token: write
contents: write
actions: read
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0 # has to be sem var
with:
base64-subjects: "${{ needs.goreleaser.outputs.hashes }}"
upload-assets: true

View File

@@ -12,7 +12,7 @@ permissions: read-all
jobs:
analysis:
name: Scorecards analysis
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
@@ -23,12 +23,12 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # tag=v2.1.2
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # tag=v2.4.1
with:
results_file: results.sarif
results_format: sarif
@@ -47,7 +47,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@134dcf33c0b9454c4b17a936843d7e21dccdc335 # v4.3.6
with:
name: SARIF file
path: results.sarif
@@ -55,6 +55,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
with:
sarif_file: results.sarif

View File

@@ -16,28 +16,26 @@ on:
permissions:
contents: read
env:
# Common versions
GO_VERSION: '1.19'
GOLANGCI_VERSION: 'v1.49'
jobs:
sdk-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Setup Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
with:
go-version: ${{ env.GO_VERSION }}
- name: Setup Env
uses: ./.github/actions/env-setup
- name: Install Go tools
run: |
make goimports
make golangci
- name: Setup KinD
uses: ./.github/actions/setup-kind-cluster
with:
name: sdk-test
- name: Build CLI
run: make vela-cli

View File

@@ -10,20 +10,15 @@ on:
permissions:
contents: read
env:
GO_VERSION: '1.19'
jobs:
sync-core-api:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Set up Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Setup Env
uses: ./.github/actions/env-setup
- name: Get the version
id: get_version

View File

@@ -14,36 +14,33 @@ on:
permissions:
contents: read
env:
GO_VERSION: '1.19'
jobs:
sync_sdk:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Set up Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Env setup
uses: ./.github/actions/env-setup
- name: Install Go tools
run: |
make goimports
- name: Build CLI
run: make vela-cli
- name: Setup KinD
uses: ./.github/actions/setup-kind-cluster
with:
name: sync-sdk
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF}" >> $GITHUB_OUTPUT
- name: Sync SDK to kubevela/kubevela-go-sdk
run: bash ./hack/sdk/sync.sh
env:

View File

@@ -1,14 +0,0 @@
name: Timed Task
on:
schedule:
- cron: '* * * * *'
permissions:
contents: read
jobs:
clean-image:
runs-on: self-hosted
steps:
- name: Cleanup image
run: docker image prune -f

View File

@@ -10,24 +10,24 @@ permissions:
jobs:
images:
name: Image Scan
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Build Vela Core image from Dockerfile
run: |
docker build --build-arg GOPROXY=https://proxy.golang.org -t docker.io/oamdev/vela-core:${{ github.sha }} .
- name: Run Trivy vulnerability scanner for vela core
uses: aquasecurity/trivy-action@master
uses: aquasecurity/trivy-action@d9cd5b1c23aaf8cb31bb09141028215828364bbb # master
with:
image-ref: 'docker.io/oamdev/vela-core:${{ github.sha }}'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
if: always()
with:
sarif_file: 'trivy-results.sarif'

View File

@@ -5,7 +5,7 @@ on:
branches:
- master
- release-*
workflow_dispatch: { }
workflow_dispatch: {}
pull_request:
branches:
- master
@@ -14,22 +14,17 @@ on:
permissions:
contents: read
env:
# Common versions
GO_VERSION: '1.19'
jobs:
detect-noop:
permissions:
actions: write # for fkirc/skip-duplicate-actions to skip or stop workflow runs
runs-on: ubuntu-20.04
actions: write # for fkirc/skip-duplicate-actions to skip or stop workflow runs
runs-on: ubuntu-22.04
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
@@ -37,55 +32,24 @@ jobs:
continue-on-error: true
unit-tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
submodules: true
- name: Cache Go Dependencies
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
- name: Setup Env
uses: ./.github/actions/env-setup
- name: Setup KinD with Kubernetes
uses: ./.github/actions/setup-kind-cluster
- name: Run unit tests
uses: ./.github/actions/unit-test
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-pkg-
- name: Install ginkgo
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y golang-ginkgo-dev
- name: Setup K3d
uses: nolar/setup-k3d-k3s@293b8e5822a20bc0d5bcdd4826f1a665e72aba96
with:
version: v1.20
github-token: ${{ secrets.GITHUB_TOKEN }}
# TODO need update action version to resolve node 12 deprecated.
- name: install Kubebuilder
uses: RyanSiu1995/kubebuilder-action@ff52bff1bae252239223476e5ab0d71d6ba02343
with:
version: 3.1.0
kubebuilderOnly: false
kubernetesVersion: v1.21.2
- name: Run Make test
run: make test
- name: Upload coverage report
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: core-unittests
name: codecov-umbrella
codecov-enable: true
codecov-token: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -0,0 +1,98 @@
# =============================================================================
# E2E Upgrade Multicluster Test Workflow
# =============================================================================
# This workflow performs end-to-end testing for KubeVela multicluster upgrades.
# It tests the upgrade path from the latest released version to the current
# development branch across multiple Kubernetes versions.
#
# Test Flow:
# 1. Install latest KubeVela release
# 2. Build and upgrade to current development version
# 3. Run multicluster e2e tests to verify functionality
# =============================================================================
name: E2E Upgrade Multicluster Test
# =============================================================================
# Trigger Configuration
# =============================================================================
on:
# Trigger on pull requests targeting main branches
pull_request:
branches:
- master
- release-*
# Allow manual workflow execution
workflow_dispatch: {}
# =============================================================================
# Security Configuration
# =============================================================================
permissions:
contents: read # Read-only access to repository contents
# =============================================================================
# Global Environment Variables
# =============================================================================
env:
GO_VERSION: '1.23.8' # Go version for building and testing
# =============================================================================
# Job Definitions
# =============================================================================
jobs:
upgrade-multicluster-tests:
name: Upgrade Multicluster Tests
runs-on: ubuntu-22.04
if: startsWith(github.head_ref, 'chore/upgrade-k8s-')
timeout-minutes: 60 # Prevent hanging jobs
# ==========================================================================
# Matrix Strategy - Test against multiple Kubernetes versions
# ==========================================================================
strategy:
fail-fast: false # Continue testing other versions if one fails
matrix:
k8s-version: ['v1.31.9']
# ==========================================================================
# Concurrency Control - Prevent overlapping runs
# ==========================================================================
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
# ========================================================================
# Environment Setup
# ========================================================================
- name: Check out repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
# ========================================================================
# Kubernetes Cluster Setup
# ========================================================================
- name: Setup worker cluster kinD
uses: ./.github/actions/setup-kind-cluster
with:
name: worker
- name: Setup KinD master clusters for multicluster testing
uses: ./.github/actions/setup-kind-cluster
with:
k8s-version: ${{ matrix.k8s-version }}
- name: Deploy latest release
uses: ./.github/actions/deploy-latest-release
- name: Upgrade from current branch
uses: ./.github/actions/deploy-current-branch
- name: Run upgarde multicluster tests
uses: ./.github/actions/multicluster-test
with:
codecov-enable: false
codecov-token: ''

102
.github/workflows/upgrade-e2e-test.yml vendored Normal file
View File

@@ -0,0 +1,102 @@
# =============================================================================
# Upgrade E2E Test Workflow
# =============================================================================
# This workflow performs comprehensive end-to-end testing for KubeVela upgrades.
# It validates the upgrade path from the latest stable release to the current
# development version by running multiple test suites including API, addon,
# and general e2e tests.
#
# Test Flow:
# 1. Install latest KubeVela release
# 2. Build and upgrade to current development version
# 3. Run comprehensive e2e test suites (API, addon, general)
# 4. Validate upgrade functionality and compatibility
# =============================================================================
name: Upgrade E2E Test
# =============================================================================
# Trigger Configuration
# =============================================================================
on:
# Trigger on pull requests targeting main branches
pull_request:
branches:
- master
- release-*
# Allow manual workflow execution
workflow_dispatch: {}
# =============================================================================
# Environment Variables
# =============================================================================
env:
GO_VERSION: '1.23.8'
# =============================================================================
# Security Configuration
# =============================================================================
permissions:
contents: read # Read-only access to repository contents
# =============================================================================
# Job Definitions
# =============================================================================
jobs:
upgrade-tests:
name: Upgrade E2E Tests
runs-on: ubuntu-22.04
if: startsWith(github.head_ref, 'chore/upgrade-k8s-')
timeout-minutes: 90 # Extended timeout for comprehensive e2e testing
# ==========================================================================
# Matrix Strategy - Test against multiple Kubernetes versions
# ==========================================================================
strategy:
fail-fast: false # Continue testing other versions if one fails
matrix:
k8s-version: ['v1.31.9']
# ==========================================================================
# Concurrency Control - Prevent overlapping runs
# ==========================================================================
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
# ========================================================================
# Repository Setup
# ========================================================================
- name: Check out code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
# ========================================================================
# Kubernetes Cluster Setup
# ========================================================================
- name: Setup KinD with Kubernetes ${{ matrix.k8s-version }}
uses: ./.github/actions/setup-kind-cluster
with:
k8s-version: ${{ matrix.k8s-version }}
- name: Build vela CLI
run: make vela-cli
- name: Build kubectl-vela plugin
run: make kubectl-vela
- name: Install kustomize
run: make kustomize
- name: Deploy latest release
uses: ./.github/actions/deploy-latest-release
- name: Upgrade from current branch
uses: ./.github/actions/deploy-current-branch
# ========================================================================
# E2E Test Execution
# ========================================================================
- name: Run upgrade e2e tests
uses: ./.github/actions/e2e-test

83
.github/workflows/upgrade-unit-test.yml vendored Normal file
View File

@@ -0,0 +1,83 @@
# =============================================================================
# Upgrade Unit Test Workflow
# =============================================================================
# This workflow performs unit testing for KubeVela upgrades by:
# 1. Installing the latest stable KubeVela release
# 2. Building and upgrading to the current development version
# 3. Running unit tests to validate the upgrade functionality
# =============================================================================
name: Upgrade Unit Test
# =============================================================================
# Trigger Configuration
# =============================================================================
on:
# Trigger on pull requests targeting main and release branches
pull_request:
branches:
- master
- release-*
# Allow manual workflow execution
workflow_dispatch: {}
# =============================================================================
# Security Configuration
# =============================================================================
permissions:
contents: read # Read-only access to repository contents
# =============================================================================
# Job Definitions
# =============================================================================
jobs:
upgrade-tests:
name: Upgrade Unit Tests
runs-on: ubuntu-22.04
if: startsWith(github.head_ref, 'chore/upgrade-k8s-')
timeout-minutes: 45 # Prevent hanging jobs
# ==========================================================================
# Matrix Strategy - Test against multiple Kubernetes versions
# ==========================================================================
strategy:
fail-fast: false # Continue testing other versions if one fails
matrix:
k8s-version: ['v1.31.9']
# ==========================================================================
# Concurrency Control - Prevent overlapping runs
# ==========================================================================
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.k8s-version }}
cancel-in-progress: true
steps:
# ========================================================================
# Environment Setup
# ========================================================================
- name: Check out code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
# ========================================================================
# Kubernetes Cluster Setup
# ========================================================================
- name: Setup KinD with Kubernetes ${{ matrix.k8s-version }}
uses: ./.github/actions/setup-kind-cluster
with:
k8s-version: ${{ matrix.k8s-version }}
- name: Deploy latest release
uses: ./.github/actions/deploy-latest-release
- name: Upgrade from current branch
uses: ./.github/actions/deploy-current-branch
- name: Run unit tests
uses: ./.github/actions/unit-test
with:
codecov-enable: false
codecov-token: ''

View File

@@ -0,0 +1,165 @@
name: Webhook Upgrade Validation
on:
push:
branches:
- master
- release-*
tags:
- v*
workflow_dispatch: {}
pull_request:
branches:
- master
- release-*
permissions:
contents: read
env:
GO_VERSION: '1.23.8'
jobs:
webhook-upgrade-check:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Setup Env
uses: ./.github/actions/env-setup
- name: Setup KinD
run: |
go install sigs.k8s.io/kind@v0.29.0
kind delete cluster || true
kind create cluster --image=kindest/node:v1.31.9
- name: Install KubeVela CLI
run: curl -fsSL https://kubevela.io/script/install.sh | bash
- name: Install KubeVela baseline
run: |
vela install --set featureGates.enableCueValidation=true
kubectl wait --namespace vela-system --for=condition=Available deployment/kubevela-vela-core --timeout=300s
- name: Prepare failing chart changes
run: |
cat <<'CHART' > charts/vela-core/templates/defwithtemplate/resource.yaml
# Code generated by KubeVela templates. DO NOT EDIT. Please edit the original cue file.
# Definition source cue file: vela-templates/definitions/internal/resource.cue
apiVersion: core.oam.dev/v1beta1
kind: TraitDefinition
metadata:
annotations:
definition.oam.dev/description: Add resource requests and limits on K8s pod for your workload which follows the pod spec in path 'spec.template.'
name: resource
namespace: {{ include "systemDefinitionNamespace" . }}
spec:
appliesToWorkloads:
- deployments.apps
- statefulsets.apps
- daemonsets.apps
- jobs.batch
- cronjobs.batch
podDisruptive: true
schematic:
cue:
template: |2
let resourceContent = {
resources: {
if parameter.cpu != _|_ if parameter.memory != _|_ if parameter.requests == _|_ if parameter.limits == _|_ {
// +patchStrategy=retainKeys
requests: {
cpu: parameter.cpu
memory: parameter.memory
}
// +patchStrategy=retainKeys
limits: {
cpu: parameter.cpu
memory: parameter.memory
}
}
if parameter.requests != _|_ {
// +patchStrategy=retainKeys
requests: {
cpu: parameter.requests.cpu
memory: parameter.requests.memory
}
}
if parameter.limits != _|_ {
// +patchStrategy=retainKeys
limits: {
cpu: parameter.limits.cpu
memory: parameter.limits.memory
}
}
}
}
if context.output.spec != _|_ if context.output.spec.template != _|_ {
patch: spec: template: spec: {
// +patchKey=name
containers: [resourceContent]
}
}
if context.output.spec != _|_ if context.output.spec.jobTemplate != _|_ {
patch: spec: jobTemplate: spec: template: spec: {
// +patchKey=name
containers: [resourceContent]
}
}
parameter: {
// +usage=Specify the amount of cpu for requests and limits
cpu?: *1 | number | string
// +usage=Specify the amount of memory for requests and limits
memory?: *"2048Mi" | =~"^([1-9][0-9]{0,63})(E|P|T|G|M|K|Ei|Pi|Ti|Gi|Mi|Ki)$"
// +usage=Specify the resources in requests
requests?: {
// +usage=Specify the amount of cpu for requests
cpu: *1 | number | string
// +usage=Specify the amount of memory for requests
memory: *"2048Mi" | =~"^([1-9][0-9]{0,63})(E|P|T|G|M|K|Ei|Pi|Ti|Gi|Mi|Ki)$"
}
// +usage=Specify the resources in limits
limits?: {
// +usage=Specify the amount of cpu for limits
cpu: *1 | number | string
// +usage=Specify the amount of memory for limits
memory: *"2048Mi" | =~"^([1-9][0-9]{0,63})(E|P|T|G|M|K|Ei|Pi|Ti|Gi|Mi|Ki)$"
}
}
- name: Load image
run: |
mkdir -p $HOME/tmp/
TMPDIR=$HOME/tmp/ make image-load
- name: Run Helm upgrade (expected to fail)
run: |
set +e
helm upgrade \
--set image.repository=vela-core-test \
--set image.tag=$(git rev-parse --short HEAD) \
--set featureGates.enableCueValidation=true \
--wait kubevela ./charts/vela-core --debug -n vela-system
status=$?
echo "Helm upgrade exit code: ${status}"
if [ $status -eq 0 ]; then
echo "Expected helm upgrade to fail" >&2
exit 1
fi
echo "Helm upgrade failed as expected"
- name: Dump webhook configurations
if: ${{ always() }}
run: |
kubectl get mutatingwebhookconfiguration kubevela-vela-core-admission -o yaml
kubectl get validatingwebhookconfiguration kubevela-vela-core-admission -o yaml
- name: Verify webhook validation remains active
run: ginkgo -v --focus-file requiredparam_validation_test.go ./test/e2e-test
- name: Cleanup kind cluster
if: ${{ always() }}
run: kind delete cluster --name kind

11
.gitignore vendored
View File

@@ -35,12 +35,21 @@ vendor/
.vscode
.history
# Debug binaries generated by VS Code/Delve
__debug_bin*
*/__debug_bin*
# Webhook certificates generated at runtime
k8s-webhook-server/
options.go.bak
pkg/test/vela
config/crd/bases
_tmp/
references/cmd/cli/fake/source.go
references/cmd/cli/fake/chart_source.go
references/vela-sdk-gen/*
charts/vela-core/crds/_.yaml
.test_vela
tmp/
@@ -50,8 +59,6 @@ tmp/
# check docs
git-page/
# e2e rollout runtime image build
runtime/rollout/e2e/tmp
vela.json
dist/

View File

@@ -1,18 +1,6 @@
run:
timeout: 10m
skip-files:
- "zz_generated\\..+\\.go$"
- ".*_test.go$"
skip-dirs:
- "hack"
- "e2e"
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
format: colored-line-number
linters-settings:
errcheck:
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
@@ -23,24 +11,12 @@ linters-settings:
# default is false: such cases aren't reported by default.
check-blank: false
# [deprecated] comma-separated list of pairs of the form pkg:regex
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
ignore: fmt:.*,io/ioutil:^Read.*
exhaustive:
# indicates that switch statements are to be considered exhaustive if a
# 'default' case is present, even if all enum members aren't listed in the
# switch
default-signifies-exhaustive: true
govet:
# report about shadowed variables
check-shadowing: false
revive:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
gofmt:
# simplify code: gofmt with `-s` option, true by default
@@ -53,11 +29,8 @@ linters-settings:
gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 30
min-complexity: 35
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
dupl:
# tokens count to trigger issue, 150 by default
@@ -73,13 +46,6 @@ linters-settings:
# tab width in spaces. Default to 1.
tab-width: 1
unused:
# treat code as a program (not a library) and report unused exported identifiers; default is false.
# XXX: if you enable this setting, unused will report a lot of false-positives in text editors:
# if it's called for subdir of a project it can't find funcs usages. All text editor integrations
# with golangci-lint call it on a directory with the changed file.
check-exported: false
unparam:
# Inspect exported functions, default is false. Set to true if no external program/library imports your code.
# XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
@@ -107,9 +73,13 @@ linters-settings:
# Allow only slices initialized with a length of zero. Default is false.
always: false
revive:
rules:
- name: unused-parameter
disabled: true
linters:
enable:
- megacheck
- govet
- gocyclo
- gocritic
@@ -121,11 +91,10 @@ linters:
- misspell
- nakedret
- exportloopref
- unused
- gosimple
- staticcheck
disable:
- deadcode
- scopelint
- structcheck
- varcheck
- rowserrcheck
- sqlclosecheck
- errchkjson
@@ -137,8 +106,28 @@ linters:
issues:
exclude-files:
- "zz_generated\\..+\\.go$"
- ".*_test.go$"
exclude-dirs:
- "hack"
- "e2e"
# Excluding configuration per-path and per-linter
exclude-rules:
- path: .*\.go
linters:
- errcheck
text: "fmt\\."
# Ignore unchecked errors from io/ioutil functions starting with Read
- path: .*\.go
linters:
- errcheck
text: "io/ioutil.*Read"
# Exclude some linters from running on tests files.
- path: _test(ing)?\.go
linters:
@@ -155,6 +144,21 @@ issues:
linters:
- gocritic
# The preferFprint suggestion (sb.WriteString(fmt.Sprintf(...)) -> fmt.Fprintf(sb, ...))
# is a micro-optimization. The defkit package generates CUE code infrequently,
# so the performance difference is negligible and the current style is more readable.
- path: pkg/definition/defkit/
text: "preferFprint"
linters:
- gocritic
# Gosmopolitan complains of internationalization issues on the file that actually defines
# the translation.
- path: i18n\.go
text: "Han"
linters:
- gosmopolitan
# These are performance optimisations rather than style issues per se.
# They warn when function arguments or range values copy a lot of memory
# rather than using a pointer.
@@ -220,7 +224,7 @@ issues:
new: false
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-per-linter: 0
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
max-same-issues: 0

View File

@@ -31,6 +31,28 @@ builds:
ldflags:
- -s -w -X github.com/oam-dev/kubevela/version.VelaVersion={{ .Version }} -X github.com/oam-dev/kubevela/version.GitRevision=git-{{.ShortCommit}}
sboms:
- id: kubevela-binaries-sboms
artifacts: binary
documents:
- "${artifact}-{{ .Version }}-{{ .Os }}-{{ .Arch }}.spdx.sbom.json"
signs:
- id: kubevela-cosign-keyless
artifacts: checksum # sign the checksum file over individual artifacts
signature: "${artifact}-keyless.sig"
certificate: "${artifact}-keyless.pem"
cmd: cosign
args:
- "sign-blob"
- "--yes"
- "--output-signature"
- "${artifact}-keyless.sig"
- "--output-certificate"
- "${artifact}-keyless.pem"
- "${artifact}"
output: true
archives:
- format: tar.gz
id: vela-cli-tgz

View File

@@ -230,7 +230,7 @@ spec:
1. Workflow support specify Order Steps by Field Tag (#2022)
2. support application policy (#2011)
3. add OCM multi cluster demo (#1992)
4. Fix(volume): seperate volume to trait (#2027)
4. Fix(volume): separate volume to trait (#2027)
5. allow application skip gc resource and leave workload ownerReference controlled by rollout(#2024)
6. Store component parameters in context (#2030)
7. Allow specify chart values for helm trait(#2033)

View File

@@ -1,3 +1,3 @@
# CONTRIBUTING Guide
Please refer to https://kubevela.io/docs/contributor/overview for details.
Please refer to https://kubevela.io/docs/contributor/overview for details.

View File

@@ -1,6 +1,6 @@
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine@sha256:2381c1e5f8350a901597d633b2e517775eeac7a6682be39225a93b22cfd0f8bb as builder
FROM golang:1.23.8-alpine@sha256:b7486658b87d34ecf95125e5b97e8dfe86c21f712aa36fc0c702e5dc41dc63e1 AS builder
WORKDIR /workspace
# Copy the Go Modules manifests
@@ -9,7 +9,7 @@ COPY go.sum go.sum
# It's a proxy for CN developer, please unblock it if you have network issue
ARG GOPROXY
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
ENV GOPROXY=${GOPROXY:-https://proxy.golang.org}
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
@@ -34,7 +34,7 @@ RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} \
# You can replace distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
# Overwrite `BASE_IMAGE` by passing `--build-arg=BASE_IMAGE=gcr.io/distroless/static:nonroot`
FROM ${BASE_IMAGE:-alpine@sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501}
FROM ${BASE_IMAGE:-alpine:3.18}
# This is required by daemon connecting with cri
RUN apk add --no-cache ca-certificates bash expat

View File

@@ -1,8 +1,8 @@
ARG BASE_IMAGE
# Build the cli binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine@sha256:2381c1e5f8350a901597d633b2e517775eeac7a6682be39225a93b22cfd0f8bb as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.23.8-alpine@sha256:b7486658b87d34ecf95125e5b97e8dfe86c21f712aa36fc0c702e5dc41dc63e1 AS builder
ARG GOPROXY
ENV GOPROXY=${GOPROXY:-https://goproxy.cn}
ENV GOPROXY=${GOPROXY:-https://proxy.golang.org}
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod

View File

@@ -1,6 +1,6 @@
ARG BASE_IMAGE
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.19-alpine@sha256:2381c1e5f8350a901597d633b2e517775eeac7a6682be39225a93b22cfd0f8bb as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.23.8-alpine@sha256:b7486658b87d34ecf95125e5b97e8dfe86c21f712aa36fc0c702e5dc41dc63e1 AS builder
WORKDIR /workspace
# Copy the Go Modules manifests

102
Makefile
View File

@@ -8,66 +8,77 @@ include makefiles/e2e.mk
.DEFAULT_GOAL := all
all: build
# Run tests
test: unit-test-core test-cli-gen
# ==============================================================================
# Targets
## test: Run tests
test: envtest unit-test-core test-cli-gen
@$(OK) unit-tests pass
## test-cli-gen: Run the unit tests for cli gen
test-cli-gen:
mkdir -p ./bin/doc
go run ./hack/docgen/cli/gen.go ./bin/doc
unit-test-core:
go test -coverprofile=coverage.txt $(shell go list ./pkg/... ./cmd/... ./apis/... | grep -v apiserver | grep -v applicationconfiguration)
go test $(shell go list ./references/... | grep -v apiserver)
@mkdir -p ./bin/doc
@go run ./hack/docgen/cli/gen.go ./bin/doc
# Build vela cli binary
## unit-test-core: Run the unit tests for core
unit-test-core:
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test -coverprofile=coverage.txt $(shell go list ./pkg/... ./cmd/... ./apis/... | grep -v apiserver | grep -v applicationconfiguration)
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test $(shell go list ./references/... | grep -v apiserver)
## build: Build vela cli binary
build: vela-cli kubectl-vela
@$(OK) build succeed
## build-cli: Clean build
build-cleanup:
rm -rf _bin
@echo "===========> Cleaning all build output"
@rm -rf _bin
# Run go fmt against code
## fmt: Run go fmt against code
fmt: goimports installcue
go fmt ./...
$(GOIMPORTS) -local github.com/oam-dev/kubevela -w $$(go list -f {{.Dir}} ./...)
$(CUE) fmt ./vela-templates/definitions/internal/*
$(CUE) fmt ./vela-templates/definitions/deprecated/*
$(CUE) fmt ./vela-templates/definitions/registry/*
$(CUE) fmt ./pkg/stdlib/pkgs/*
$(CUE) fmt ./pkg/stdlib/op.cue
$(CUE) fmt ./pkg/workflow/tasks/template/static/*
# Run go vet against code
$(CUE) fmt ./pkg/workflow/template/static/*
$(CUE) fmt ./pkg/workflow/providers/...
## sdk_fmt: Run go fmt against code
sdk_fmt:
./hack/sdk/reviewable.sh
## vet: Run go vet against code
vet:
@$(INFO) go vet
@go vet $(shell go list ./...|grep -v scaffold)
## staticcheck: Run the staticcheck
staticcheck: staticchecktool
@$(INFO) staticcheck
@$(STATICCHECK) $(shell go list ./...|grep -v scaffold)
## lint: Run the golangci-lint
lint: golangci
@$(INFO) lint
@$(GOLANGCILINT) run --skip-dirs 'scaffold'
@GOLANGCILINT=$(GOLANGCILINT) ./hack/utils/golangci-lint-wrapper.sh
reviewable: manifests fmt vet lint staticcheck helm-doc-gen sdk_fmt
go mod tidy
## reviewable: Run the reviewable
## Run make build to compile vela binary before running this target to ensure all generated definitions are up to date.
reviewable: build manifests fmt vet lint staticcheck helm-doc-gen sdk_fmt
# Execute auto-gen code commands and ensure branch is clean.
# check-diff: Execute auto-gen code commands and ensure branch is clean.
check-diff: reviewable
git --no-pager diff
git diff --quiet || ($(ERR) please run 'make reviewable' to include all changes && false)
@$(OK) branch is clean
# Push the docker image
## docker-push: Push the docker image
docker-push:
docker push $(VELA_CORE_IMAGE)
@echo "===========> Pushing docker image"
@docker push $(VELA_CORE_IMAGE)
## image-cleanup: Delete Docker images
image-cleanup:
ifneq (, $(shell which docker))
# Delete Docker images
@@ -76,44 +87,27 @@ ifneq ($(shell docker images -q $(VELA_CORE_TEST_IMAGE)),)
docker rmi -f $(VELA_CORE_TEST_IMAGE)
endif
ifneq ($(shell docker images -q $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE)),)
docker rmi -f $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE)
endif
endif
# load docker image to the k3d cluster
## image-load: load docker image to the kind cluster
image-load:
docker build -t $(VELA_CORE_TEST_IMAGE) -f Dockerfile.e2e .
k3d image import $(VELA_CORE_TEST_IMAGE) || { echo >&2 "kind not installed or error loading image: $(VELA_CORE_TEST_IMAGE)"; exit 1; }
kind load docker-image $(VELA_CORE_TEST_IMAGE) || { echo >&2 "kind not installed or error loading image: $(VELA_CORE_TEST_IMAGE)"; exit 1; }
image-load-runtime-cluster:
/bin/sh hack/e2e/build_runtime_rollout.sh
docker build -t $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE) -f runtime/rollout/e2e/Dockerfile.e2e runtime/rollout/e2e/
rm -rf runtime/rollout/e2e/tmp
k3d image import $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE) || { echo >&2 "kind not installed or error loading image: $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE)"; exit 1; }
k3d cluster get $(RUNTIME_CLUSTER_NAME) && k3d image import $(VELA_RUNTIME_ROLLOUT_TEST_IMAGE) --cluster=$(RUNTIME_CLUSTER_NAME) || echo "no worker cluster"
# Run tests
## core-test: Run tests
core-test:
go test ./pkg/... -coverprofile cover.out
# Build vela core manager binary
## manager: Build vela core manager binary
manager:
$(GOBUILD_ENV) go build -o bin/manager -a -ldflags $(LDFLAGS) ./cmd/core/main.go
vela-runtime-rollout-manager:
$(GOBUILD_ENV) go build -o ./runtime/rollout/bin/manager -a -ldflags $(LDFLAGS) ./runtime/rollout/cmd/main.go
# Generate manifests e.g. CRD, RBAC etc.
manifests: installcue kustomize
## manifests: Generate manifests e.g. CRD, RBAC etc.
manifests: tidy installcue kustomize sync-crds
go generate $(foreach t,pkg apis,./$(t)/...)
# TODO(yangsoon): kustomize will merge all CRD into a whole file, it may not work if we want patch more than one CRD in this way
$(KUSTOMIZE) build config/crd -o config/crd/base/core.oam.dev_applications.yaml
./hack/crd/cleanup.sh
go run ./hack/crd/dispatch/dispatch.go config/crd/base charts/vela-core/crds runtime/ charts/vela-minimal/crds
go run ./hack/crd/dispatch/dispatch.go config/crd/base charts/vela-core/crds
rm -f config/crd/base/*
./vela-templates/gen_definitions.sh
@@ -125,12 +119,26 @@ HOSTARCH := amd64
endif
## check-license-header: Check license header
check-license-header:
./hack/licence/header-check.sh
## def-gen: Install definitions
def-install:
./hack/utils/installdefinition.sh
## helm-doc-gen: Generate helm chart README.md
helm-doc-gen: helmdoc
readme-generator -v charts/vela-core/values.yaml -r charts/vela-core/README.md
readme-generator -v charts/vela-minimal/values.yaml -r charts/vela-minimal/README.md
## help: Display help information
help: Makefile
@echo ""
@echo "Usage:"
@echo ""
@echo " make [target]"
@echo ""
@echo "Targets:"
@echo ""
@awk -F ':|##' '/^[^\.%\t][^\t]*:.*##/{printf " \033[36m%-20s\033[0m %s\n", $$1, $$NF}' $(MAKEFILE_LIST) | sort
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'

View File

@@ -17,7 +17,7 @@
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kubevela)](https://artifacthub.io/packages/search?repo=kubevela)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/4602/badge)](https://bestpractices.coreinfrastructure.org/projects/4602)
![E2E status](https://github.com/kubevela/kubevela/workflows/E2E%20Test/badge.svg)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/kubevela/kubevela/badge)](https://api.securityscorecards.dev/projects/github.com/kubevela/kubevela)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/kubevela/kubevela/badge)](https://scorecard.dev/viewer/?uri=github.com/kubevela/kubevela)
[![](https://img.shields.io/badge/KubeVela-Check%20Your%20Contribution-orange)](https://opensource.alibaba.com/contribution_leaderboard/details?projectValue=kubevela)
## Introduction
@@ -38,7 +38,7 @@ No ad-hoc scripts, no dirty glue code, just deploy. The deployment workflow in K
#### **Built-in observability, multi-tenancy and security support**
Choose from the wide range of LDAP integrations we provided out-of-box, enjoy enhanced [multi-tenancy and multi-cluster authorization and authentication](https://kubevela.net/docs/platform-engineers/auth/advance),
pick and apply fine-grained RBAC modules and customize them per your own supply chain requirements.
pick and apply fine-grained RBAC modules and customize them as per your own supply chain requirements.
All delivery process has fully [automated observability dashboards](https://kubevela.net/docs/platform-engineers/operations/observability).
#### **Multi-cloud/hybrid-environments app delivery as first-class citizen**
@@ -59,6 +59,14 @@ and share the large growing community [addons](https://kubevela.net/docs/referen
* [Installation](https://kubevela.io/docs/install)
* [Deploy Your Application](https://kubevela.io/docs/quick-start)
### Get Your Own Demo with Alibaba Cloud
- install KubeVela on a Serverless K8S cluster in 3 minutes, try:
<a href="https://acs.console.aliyun.com/quick-deploy?repo=kubevela/kubevela&branch=master" target="_blank">
<img src="https://img.alicdn.com/imgextra/i1/O1CN01aiPSuA1Wiz7wkgF5u_!!6000000002823-55-tps-399-70.svg" width="200" alt="Deploy on Alibaba Cloud">
</a>
## Documentation
Full documentation is available on the [KubeVela website](https://kubevela.io/).
@@ -99,7 +107,7 @@ Check out [KubeVela videos](https://kubevela.io/videos/talks/en/oam-dapr) for th
## Contributing
Check out [CONTRIBUTING](https://kubevela.io/docs/contributor/overview) to see how to develop with KubeVela.
Check out [CONTRIBUTING](https://kubevela.io/docs/contributor/overview) to see how to develop with KubeVela
## Report Vulnerability
@@ -107,4 +115,4 @@ Security is a first priority thing for us at KubeVela. If you come across a rela
## Code of Conduct
KubeVela adopts [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
KubeVela adopts [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).

View File

@@ -26,23 +26,13 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
wfTypesv1alpha1 "github.com/kubevela/pkg/apis/oam/v1alpha1"
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
"github.com/oam-dev/kubevela/pkg/oam"
)
// Kube defines the encapsulation in raw Kubernetes resource format
type Kube struct {
// Template defines the raw Kubernetes resource
// +kubebuilder:pruning:PreserveUnknownFields
Template runtime.RawExtension `json:"template"`
// Parameters defines configurable parameters
Parameters []KubeParameter `json:"parameters,omitempty"`
}
// ParameterValueType refers to a data type of parameter
type ParameterValueType string
@@ -53,31 +43,6 @@ const (
BooleanType ParameterValueType = "boolean"
)
// A KubeParameter defines a configurable parameter of a component.
type KubeParameter struct {
// Name of this parameter
Name string `json:"name"`
// +kubebuilder:validation:Enum:=string;number;boolean
// ValueType indicates the type of the parameter value, and
// only supports basic data types: string, number, boolean.
ValueType ParameterValueType `json:"type"`
// FieldPaths specifies an array of fields within this workload that will be
// overwritten by the value of this parameter. All fields must be of the
// same type. Fields are specified as JSON field paths without a leading
// dot, for example 'spec.replicas'.
FieldPaths []string `json:"fieldPaths"`
// +kubebuilder:default:=false
// Required specifies whether or not a value for this parameter must be
// supplied when authoring an Application.
Required *bool `json:"required,omitempty"`
// Description of this parameter.
Description *string `json:"description,omitempty"`
}
// CUE defines the encapsulation in CUE format
type CUE struct {
// Template defines the abstraction template data of the capability, it will replace the old CUE template in extension field.
@@ -88,26 +53,11 @@ type CUE struct {
// Schematic defines the encapsulation of this capability(workload/trait/scope),
// the encapsulation can be defined in different ways, e.g. CUE/HCL(terraform)/KUBE(K8s Object)/HELM, etc...
type Schematic struct {
KUBE *Kube `json:"kube,omitempty"`
CUE *CUE `json:"cue,omitempty"`
HELM *Helm `json:"helm,omitempty"`
Terraform *Terraform `json:"terraform,omitempty"`
}
// A Helm represents resources used by a Helm module
type Helm struct {
// Release records a Helm release used by a Helm module workload.
// +kubebuilder:pruning:PreserveUnknownFields
Release runtime.RawExtension `json:"release"`
// HelmRelease records a Helm repository used by a Helm module workload.
// +kubebuilder:pruning:PreserveUnknownFields
Repository runtime.RawExtension `json:"repository"`
}
// Terraform is the struct to describe cloud resources managed by Hashicorp Terraform
type Terraform struct {
// Configuration is Terraform Configuration
@@ -186,6 +136,9 @@ type Status struct {
// HealthPolicy defines the health check policy for the abstraction
// +optional
HealthPolicy string `json:"healthPolicy,omitempty"`
// Details stores a string representation of a CUE status map to be evaluated at runtime for display
// +optional
Details string `json:"details,omitempty"`
}
// ApplicationPhase is a label for the condition of an application at the current time
@@ -214,26 +167,6 @@ const (
ApplicationDeleting ApplicationPhase = "deleting"
)
// WorkflowState is a string that mark the workflow state
type WorkflowState string
const (
// WorkflowStateInitializing means the workflow is in initial state
WorkflowStateInitializing WorkflowState = "Initializing"
// WorkflowStateTerminated means workflow is terminated manually, and it won't be started unless the spec changed.
WorkflowStateTerminated WorkflowState = "Terminated"
// WorkflowStateSuspended means workflow is suspended manually, and it can be resumed.
WorkflowStateSuspended WorkflowState = "Suspended"
// WorkflowStateSucceeded means workflow is running successfully, all steps finished.
WorkflowStateSucceeded WorkflowState = "Succeeded"
// WorkflowStateFinished means workflow is end.
WorkflowStateFinished WorkflowState = "Finished"
// WorkflowStateExecuting means workflow is still running or waiting some steps.
WorkflowStateExecuting WorkflowState = "Executing"
// WorkflowStateSkipping means it will skip this reconcile and let next reconcile to handle it.
WorkflowStateSkipping WorkflowState = "Skipping"
)
// ApplicationComponentStatus record the health status of App component
type ApplicationComponentStatus struct {
Name string `json:"name"`
@@ -241,11 +174,15 @@ type ApplicationComponentStatus struct {
Cluster string `json:"cluster,omitempty"`
Env string `json:"env,omitempty"`
// WorkloadDefinition is the definition of a WorkloadDefinition, such as deployments/apps.v1
WorkloadDefinition WorkloadGVK `json:"workloadDefinition,omitempty"`
Healthy bool `json:"healthy"`
Message string `json:"message,omitempty"`
Traits []ApplicationTraitStatus `json:"traits,omitempty"`
Scopes []corev1.ObjectReference `json:"scopes,omitempty"`
WorkloadDefinition WorkloadGVK `json:"workloadDefinition,omitempty"`
Healthy bool `json:"healthy"`
// WorkloadHealthy indicates the workload health without considering trait health.
// +optional
WorkloadHealthy bool `json:"workloadHealthy,omitempty"`
Details map[string]string `json:"details,omitempty"`
Message string `json:"message,omitempty"`
Traits []ApplicationTraitStatus `json:"traits,omitempty"`
Scopes []corev1.ObjectReference `json:"scopes,omitempty"`
}
// Equal check if two ApplicationComponentStatus are equal
@@ -256,9 +193,11 @@ func (in ApplicationComponentStatus) Equal(r ApplicationComponentStatus) bool {
// ApplicationTraitStatus records the trait health status
type ApplicationTraitStatus struct {
Type string `json:"type"`
Healthy bool `json:"healthy"`
Message string `json:"message,omitempty"`
Type string `json:"type"`
Healthy bool `json:"healthy"`
Pending bool `json:"pending,omitempty"`
Details map[string]string `json:"details,omitempty"`
Message string `json:"message,omitempty"`
}
// Revision has name and revision number
@@ -270,13 +209,6 @@ type Revision struct {
RevisionHash string `json:"revisionHash,omitempty"`
}
// RawComponent record raw component
type RawComponent struct {
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
Raw runtime.RawExtension `json:"raw"`
}
// AppStatus defines the observed state of Application
type AppStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
@@ -298,6 +230,12 @@ type AppStatus struct {
// Workflow record the status of workflow
Workflow *WorkflowStatus `json:"workflow,omitempty"`
// WorkflowRestartScheduledAt schedules a workflow restart at the specified time.
// This field is automatically set when the app.oam.dev/restart-workflow annotation is present,
// and is cleared after the restart is triggered. Use RFC3339 format or set to current time for immediate restart.
// +optional
WorkflowRestartScheduledAt *metav1.Time `json:"workflowRestartScheduledAt,omitempty"`
// LatestRevision of the application configuration it generates
// +optional
LatestRevision *Revision `json:"latestRevision,omitempty"`
@@ -358,19 +296,6 @@ const (
WorkflowStepType DefinitionType = "WorkflowStep"
)
// AppRolloutStatus defines the observed state of AppRollout
type AppRolloutStatus struct {
v1alpha1.RolloutStatus `json:",inline"`
// LastUpgradedTargetAppRevision contains the name of the app that we upgraded to
// We will restart the rollout if this is not the same as the spec
LastUpgradedTargetAppRevision string `json:"lastTargetAppRevision"`
// LastSourceAppRevision contains the name of the app that we need to upgrade from.
// We will restart the rollout if this is not the same as the spec
LastSourceAppRevision string `json:"LastSourceAppRevision,omitempty"`
}
// ApplicationTrait defines the trait of application
type ApplicationTrait struct {
Type string `json:"type"`
@@ -387,9 +312,9 @@ type ApplicationComponent struct {
// +kubebuilder:pruning:PreserveUnknownFields
Properties *runtime.RawExtension `json:"properties,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs workflowv1alpha1.StepInputs `json:"inputs,omitempty"`
Outputs workflowv1alpha1.StepOutputs `json:"outputs,omitempty"`
DependsOn []string `json:"dependsOn,omitempty"`
Inputs wfTypesv1alpha1.StepInputs `json:"inputs,omitempty"`
Outputs wfTypesv1alpha1.StepOutputs `json:"outputs,omitempty"`
// Traits define the trait of one component, the type must be array to keep the order.
Traits []ApplicationTrait `json:"traits,omitempty"`
@@ -414,41 +339,22 @@ type ClusterSelector struct {
Labels map[string]string `json:"labels,omitempty"`
}
// Distribution defines the replica distribution of an AppRevision to a cluster.
type Distribution struct {
// Replicas is the replica number.
Replicas int `json:"replicas,omitempty"`
}
// ClusterPlacement defines the cluster placement rules for an app revision.
type ClusterPlacement struct {
// ClusterSelector selects the cluster to deploy apps to.
// If not specified, it indicates the host cluster per se.
ClusterSelector *ClusterSelector `json:"clusterSelector,omitempty"`
// Distribution defines the replica distribution of an AppRevision to a cluster.
Distribution Distribution `json:"distribution,omitempty"`
}
const (
// PolicyResourceCreator create the policy resource.
PolicyResourceCreator string = "policy"
// WorkflowResourceCreator create the resource in workflow.
WorkflowResourceCreator string = "workflow"
// DebugResourceCreator create the debug resource.
DebugResourceCreator string = "debug"
)
// OAMObjectReference defines the object reference for an oam resource
type OAMObjectReference struct {
Component string `json:"component,omitempty"`
Trait string `json:"trait,omitempty"`
Env string `json:"env,omitempty"`
}
// Equal check if two references are equal
func (in OAMObjectReference) Equal(r OAMObjectReference) bool {
return in.Component == r.Component && in.Trait == r.Trait && in.Env == r.Env
return in.Component == r.Component && in.Trait == r.Trait
}
// AddLabelsToObject add labels to object if properties are not empty
@@ -463,9 +369,6 @@ func (in OAMObjectReference) AddLabelsToObject(obj client.Object) {
if in.Trait != "" {
labels[oam.TraitTypeLabel] = in.Trait
}
if in.Env != "" {
labels[oam.LabelAppEnv] = in.Env
}
obj.SetLabels(labels)
}
@@ -475,7 +378,6 @@ func NewOAMObjectReferenceFromObject(obj client.Object) OAMObjectReference {
return OAMObjectReference{
Component: labels[oam.LabelAppComponent],
Trait: labels[oam.TraitTypeLabel],
Env: labels[oam.LabelAppEnv],
}
}
return OAMObjectReference{}
@@ -533,8 +435,6 @@ const (
RenderCondition
// WorkflowCondition indicates whether workflow processing is successful.
WorkflowCondition
// RolloutCondition indicates whether rollout processing is successful.
RolloutCondition
// ReadyCondition indicates whether whole application processing is successful.
ReadyCondition
)
@@ -545,7 +445,6 @@ var conditions = map[ApplicationConditionType]string{
PolicyCondition: "Policy",
RenderCondition: "Render",
WorkflowCondition: "Workflow",
RolloutCondition: "Rollout",
ReadyCondition: "Ready",
}

View File

@@ -29,13 +29,12 @@ func TestOAMObjectReference(t *testing.T) {
o1 := OAMObjectReference{
Component: "component",
Trait: "trait",
Env: "env",
}
obj := &unstructured.Unstructured{}
o2 := NewOAMObjectReferenceFromObject(obj)
r.False(o2.Equal(o1))
o1.AddLabelsToObject(obj)
r.Equal(3, len(obj.GetLabels()))
r.Equal(2, len(obj.GetLabels()))
o3 := NewOAMObjectReferenceFromObject(obj)
r.True(o1.Equal(o3))
o3.Component = "comp"

View File

@@ -1,8 +1,7 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 2021 The KubeVela Authors.
Copyright 2023 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -22,28 +21,13 @@ limitations under the License.
package common
import (
oamv1alpha1 "github.com/kubevela/pkg/apis/oam/v1alpha1"
"github.com/kubevela/workflow/api/v1alpha1"
crossplane_runtime "github.com/oam-dev/terraform-controller/api/types/crossplane-runtime"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppRolloutStatus) DeepCopyInto(out *AppRolloutStatus) {
*out = *in
in.RolloutStatus.DeepCopyInto(&out.RolloutStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppRolloutStatus.
func (in *AppRolloutStatus) DeepCopy() *AppRolloutStatus {
if in == nil {
return nil
}
out := new(AppRolloutStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AppStatus) DeepCopyInto(out *AppStatus) {
*out = *in
@@ -65,6 +49,10 @@ func (in *AppStatus) DeepCopyInto(out *AppStatus) {
*out = new(WorkflowStatus)
(*in).DeepCopyInto(*out)
}
if in.WorkflowRestartScheduledAt != nil {
in, out := &in.WorkflowRestartScheduledAt, &out.WorkflowRestartScheduledAt
*out = (*in).DeepCopy()
}
if in.LatestRevision != nil {
in, out := &in.LatestRevision, &out.LatestRevision
*out = new(Revision)
@@ -109,12 +97,12 @@ func (in *ApplicationComponent) DeepCopyInto(out *ApplicationComponent) {
}
if in.Inputs != nil {
in, out := &in.Inputs, &out.Inputs
*out = make(v1alpha1.StepInputs, len(*in))
*out = make(oamv1alpha1.StepInputs, len(*in))
copy(*out, *in)
}
if in.Outputs != nil {
in, out := &in.Outputs, &out.Outputs
*out = make(v1alpha1.StepOutputs, len(*in))
*out = make(oamv1alpha1.StepOutputs, len(*in))
copy(*out, *in)
}
if in.Traits != nil {
@@ -147,10 +135,19 @@ func (in *ApplicationComponent) DeepCopy() *ApplicationComponent {
func (in *ApplicationComponentStatus) DeepCopyInto(out *ApplicationComponentStatus) {
*out = *in
out.WorkloadDefinition = in.WorkloadDefinition
if in.Details != nil {
in, out := &in.Details, &out.Details
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.Traits != nil {
in, out := &in.Traits, &out.Traits
*out = make([]ApplicationTraitStatus, len(*in))
copy(*out, *in)
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Scopes != nil {
in, out := &in.Scopes, &out.Scopes
@@ -192,6 +189,13 @@ func (in *ApplicationTrait) DeepCopy() *ApplicationTrait {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApplicationTraitStatus) DeepCopyInto(out *ApplicationTraitStatus) {
*out = *in
if in.Details != nil {
in, out := &in.Details, &out.Details
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationTraitStatus.
@@ -257,27 +261,6 @@ func (in *ClusterObjectReference) DeepCopy() *ClusterObjectReference {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterPlacement) DeepCopyInto(out *ClusterPlacement) {
*out = *in
if in.ClusterSelector != nil {
in, out := &in.ClusterSelector, &out.ClusterSelector
*out = new(ClusterSelector)
(*in).DeepCopyInto(*out)
}
out.Distribution = in.Distribution
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterPlacement.
func (in *ClusterPlacement) DeepCopy() *ClusterPlacement {
if in == nil {
return nil
}
out := new(ClusterPlacement)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterSelector) DeepCopyInto(out *ClusterSelector) {
*out = *in
@@ -315,91 +298,6 @@ func (in *DefinitionReference) DeepCopy() *DefinitionReference {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Distribution) DeepCopyInto(out *Distribution) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Distribution.
func (in *Distribution) DeepCopy() *Distribution {
if in == nil {
return nil
}
out := new(Distribution)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Helm) DeepCopyInto(out *Helm) {
*out = *in
in.Release.DeepCopyInto(&out.Release)
in.Repository.DeepCopyInto(&out.Repository)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Helm.
func (in *Helm) DeepCopy() *Helm {
if in == nil {
return nil
}
out := new(Helm)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Kube) DeepCopyInto(out *Kube) {
*out = *in
in.Template.DeepCopyInto(&out.Template)
if in.Parameters != nil {
in, out := &in.Parameters, &out.Parameters
*out = make([]KubeParameter, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kube.
func (in *Kube) DeepCopy() *Kube {
if in == nil {
return nil
}
out := new(Kube)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubeParameter) DeepCopyInto(out *KubeParameter) {
*out = *in
if in.FieldPaths != nil {
in, out := &in.FieldPaths, &out.FieldPaths
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Required != nil {
in, out := &in.Required, &out.Required
*out = new(bool)
**out = **in
}
if in.Description != nil {
in, out := &in.Description, &out.Description
*out = new(string)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeParameter.
func (in *KubeParameter) DeepCopy() *KubeParameter {
if in == nil {
return nil
}
out := new(KubeParameter)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *OAMObjectReference) DeepCopyInto(out *OAMObjectReference) {
*out = *in
@@ -435,22 +333,6 @@ func (in *PolicyStatus) DeepCopy() *PolicyStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RawComponent) DeepCopyInto(out *RawComponent) {
*out = *in
in.Raw.DeepCopyInto(&out.Raw)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawComponent.
func (in *RawComponent) DeepCopy() *RawComponent {
if in == nil {
return nil
}
out := new(RawComponent)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RawExtensionPointer) DeepCopyInto(out *RawExtensionPointer) {
*out = *in
@@ -527,21 +409,11 @@ func (in *Revision) DeepCopy() *Revision {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Schematic) DeepCopyInto(out *Schematic) {
*out = *in
if in.KUBE != nil {
in, out := &in.KUBE, &out.KUBE
*out = new(Kube)
(*in).DeepCopyInto(*out)
}
if in.CUE != nil {
in, out := &in.CUE, &out.CUE
*out = new(CUE)
**out = **in
}
if in.HELM != nil {
in, out := &in.HELM, &out.HELM
*out = new(Helm)
(*in).DeepCopyInto(*out)
}
if in.Terraform != nil {
in, out := &in.Terraform, &out.Terraform
*out = new(Terraform)

View File

@@ -1,8 +1,7 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 2021 The KubeVela Authors.
Copyright 2023 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -21,13 +21,12 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1alpha2"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1"
)
func init() {
// Register the types with the Scheme so the resources can map objects to GroupVersionKinds and back
AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme, v1alpha2.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme)
AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme)
}
// AddToSchemes may be used to add all resources defined in the project to a Scheme

View File

@@ -17,7 +17,9 @@ limitations under the License.
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"sigs.k8s.io/controller-runtime/pkg/client"
)
const (
@@ -27,10 +29,17 @@ const (
// GarbageCollectPolicySpec defines the spec of configuration drift
type GarbageCollectPolicySpec struct {
// ApplicationRevisionLimit if set, this application will use this number for application revision instead of
// the global configuration
ApplicationRevisionLimit *int `json:"applicationRevisionLimit,omitempty"`
// KeepLegacyResource if is set, outdated versioned resourcetracker will not be recycled automatically
// outdated resources will be kept until resourcetracker be deleted manually
KeepLegacyResource bool `json:"keepLegacyResource,omitempty"`
// ContinueOnFailure if is set, continue to execute gc when the workflow fails, by default gc will be executed only after the workflow succeeds
ContinueOnFailure bool `json:"continueOnFailure,omitempty"`
// Order defines the order of garbage collect
Order GarbageCollectOrder `json:"order,omitempty"`
@@ -49,8 +58,9 @@ const (
// GarbageCollectPolicyRule defines a single garbage-collect policy rule
type GarbageCollectPolicyRule struct {
Selector ResourcePolicyRuleSelector `json:"selector"`
Strategy GarbageCollectStrategy `json:"strategy"`
Selector ResourcePolicyRuleSelector `json:"selector"`
Strategy GarbageCollectStrategy `json:"strategy"`
Propagation *GarbageCollectPropagation `json:"propagation"`
}
// GarbageCollectStrategy the strategy for target resource to recycle
@@ -66,6 +76,16 @@ const (
GarbageCollectStrategyOnAppUpdate GarbageCollectStrategy = "onAppUpdate"
)
// GarbageCollectPropagation the deletion propagation setting similar to metav1.DeletionPropagation
type GarbageCollectPropagation string
const (
// GarbageCollectPropagationOrphan orphan child resources while deleting target resources
GarbageCollectPropagationOrphan = "orphan"
// GarbageCollectPropagationCascading delete child resources in background while deleting target resources
GarbageCollectPropagationCascading = "cascading"
)
// Type the type name of the policy
func (in *GarbageCollectPolicySpec) Type() string {
return GarbageCollectPolicyType
@@ -80,3 +100,18 @@ func (in *GarbageCollectPolicySpec) FindStrategy(manifest *unstructured.Unstruct
}
return nil
}
// FindDeleteOption find delete option for target resource
func (in *GarbageCollectPolicySpec) FindDeleteOption(manifest *unstructured.Unstructured) (bool, []client.DeleteOption) {
for _, rule := range in.Rules {
if rule.Selector.Match(manifest) && rule.Propagation != nil {
switch *rule.Propagation {
case GarbageCollectPropagationOrphan:
return true, []client.DeleteOption{client.PropagationPolicy(metav1.DeletePropagationOrphan)}
case GarbageCollectPropagationCascading:
return false, []client.DeleteOption{client.PropagationPolicy(metav1.DeletePropagationBackground)}
}
}
}
return false, nil
}

View File

@@ -21,7 +21,7 @@ import (
k8sscheme "k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/scheme"
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
wfTypesv1alpha1 "github.com/kubevela/pkg/apis/oam/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
@@ -57,6 +57,11 @@ var (
func init() {
SchemeBuilder.Register(&Policy{}, &PolicyList{})
SchemeBuilder.Register(&workflowv1alpha1.Workflow{}, &workflowv1alpha1.WorkflowList{})
SchemeBuilder.Register(&wfTypesv1alpha1.Workflow{}, &wfTypesv1alpha1.WorkflowList{})
_ = SchemeBuilder.AddToScheme(k8sscheme.Scheme)
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}

View File

@@ -18,7 +18,7 @@ package v1alpha1
import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
stringslices "k8s.io/utils/strings/slices"
"github.com/oam-dev/kubevela/pkg/oam"
@@ -52,7 +52,7 @@ func (in *ResourcePolicyRuleSelector) Match(manifest *unstructured.Unstructured)
if len(src) == 0 {
return nil
}
return pointer.Bool(val != "" && stringslices.Contains(src, val))
return ptr.To(val != "" && stringslices.Contains(src, val))
}
conditions := []*bool{
match(in.CompNames, compName),

View File

@@ -0,0 +1,70 @@
/*
Copyright 2023 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
const (
// ResourceUpdatePolicyType refers to the type of resource-update policy
ResourceUpdatePolicyType = "resource-update"
)
// ResourceUpdatePolicySpec defines the spec of resource-update policy
type ResourceUpdatePolicySpec struct {
Rules []ResourceUpdatePolicyRule `json:"rules"`
}
// Type the type name of the policy
func (in *ResourceUpdatePolicySpec) Type() string {
return ResourceUpdatePolicyType
}
// ResourceUpdatePolicyRule defines the rule for resource-update resources
type ResourceUpdatePolicyRule struct {
// Selector picks which resources should be affected
Selector ResourcePolicyRuleSelector `json:"selector"`
// Strategy the strategy for updating resources
Strategy ResourceUpdateStrategy `json:"strategy,omitempty"`
}
// ResourceUpdateStrategy the update strategy for resource
type ResourceUpdateStrategy struct {
// Op the update op for selected resources
Op ResourceUpdateOp `json:"op,omitempty"`
// RecreateFields the field path which will trigger recreate if changed
RecreateFields []string `json:"recreateFields,omitempty"`
}
// ResourceUpdateOp update op for resource
type ResourceUpdateOp string
const (
// ResourceUpdateStrategyPatch patch the target resource (three-way patch)
ResourceUpdateStrategyPatch ResourceUpdateOp = "patch"
// ResourceUpdateStrategyReplace update the target resource
ResourceUpdateStrategyReplace ResourceUpdateOp = "replace"
)
// FindStrategy return if the target resource is read-only
func (in *ResourceUpdatePolicySpec) FindStrategy(manifest *unstructured.Unstructured) *ResourceUpdateStrategy {
for _, rule := range in.Rules {
if rule.Selector.Match(manifest) {
return &rule.Strategy
}
}
return nil
}

View File

@@ -1,8 +1,7 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 2021 The KubeVela Authors.
Copyright 2023 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -314,6 +313,11 @@ func (in *EnvTraitPatch) DeepCopy() *EnvTraitPatch {
func (in *GarbageCollectPolicyRule) DeepCopyInto(out *GarbageCollectPolicyRule) {
*out = *in
in.Selector.DeepCopyInto(&out.Selector)
if in.Propagation != nil {
in, out := &in.Propagation, &out.Propagation
*out = new(GarbageCollectPropagation)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GarbageCollectPolicyRule.
@@ -329,6 +333,11 @@ func (in *GarbageCollectPolicyRule) DeepCopy() *GarbageCollectPolicyRule {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GarbageCollectPolicySpec) DeepCopyInto(out *GarbageCollectPolicySpec) {
*out = *in
if in.ApplicationRevisionLimit != nil {
in, out := &in.ApplicationRevisionLimit, &out.ApplicationRevisionLimit
*out = new(int)
**out = **in
}
if in.Rules != nil {
in, out := &in.Rules, &out.Rules
*out = make([]GarbageCollectPolicyRule, len(*in))
@@ -720,6 +729,65 @@ func (in *ResourcePolicyRuleSelector) DeepCopy() *ResourcePolicyRuleSelector {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceUpdatePolicyRule) DeepCopyInto(out *ResourceUpdatePolicyRule) {
*out = *in
in.Selector.DeepCopyInto(&out.Selector)
in.Strategy.DeepCopyInto(&out.Strategy)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceUpdatePolicyRule.
func (in *ResourceUpdatePolicyRule) DeepCopy() *ResourceUpdatePolicyRule {
if in == nil {
return nil
}
out := new(ResourceUpdatePolicyRule)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceUpdatePolicySpec) DeepCopyInto(out *ResourceUpdatePolicySpec) {
*out = *in
if in.Rules != nil {
in, out := &in.Rules, &out.Rules
*out = make([]ResourceUpdatePolicyRule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceUpdatePolicySpec.
func (in *ResourceUpdatePolicySpec) DeepCopy() *ResourceUpdatePolicySpec {
if in == nil {
return nil
}
out := new(ResourceUpdatePolicySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceUpdateStrategy) DeepCopyInto(out *ResourceUpdateStrategy) {
*out = *in
if in.RecreateFields != nil {
in, out := &in.RecreateFields, &out.RecreateFields
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceUpdateStrategy.
func (in *ResourceUpdateStrategy) DeepCopy() *ResourceUpdateStrategy {
if in == nil {
return nil
}
out := new(ResourceUpdateStrategy)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SharedResourcePolicyRule) DeepCopyInto(out *SharedResourcePolicyRule) {
*out = *in

View File

@@ -1,123 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha2
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/standard.oam.dev/v1alpha1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// AppStatus defines the observed state of Application
type AppStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
v1alpha1.RolloutStatus `json:",inline"`
Phase common.ApplicationPhase `json:"status,omitempty"`
// Components record the related Components created by Application Controller
Components []corev1.ObjectReference `json:"components,omitempty"`
// Services record the status of the application services
Services []common.ApplicationComponentStatus `json:"services,omitempty"`
// ResourceTracker record the status of the ResourceTracker
ResourceTracker *corev1.ObjectReference `json:"resourceTracker,omitempty"`
// LatestRevision of the application configuration it generates
// +optional
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
}
// ApplicationTrait defines the trait of application
type ApplicationTrait struct {
Name string `json:"name"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties *runtime.RawExtension `json:"properties,omitempty"`
}
// ApplicationComponent describe the component of application
type ApplicationComponent struct {
Name string `json:"name"`
WorkloadType string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Settings runtime.RawExtension `json:"settings,omitempty"`
// Traits define the trait of one component, the type must be array to keep the order.
Traits []ApplicationTrait `json:"traits,omitempty"`
// +kubebuilder:pruning:PreserveUnknownFields
// scopes in ApplicationComponent defines the component-level scopes
// the format is <scope-type:scope-instance-name> pairs, the key represents type of `ScopeDefinition` while the value represent the name of scope instance.
Scopes map[string]string `json:"scopes,omitempty"`
}
// ApplicationSpec is the spec of Application
type ApplicationSpec struct {
Components []ApplicationComponent `json:"components"`
// TODO(wonderflow): we should have application level scopes supported here
// RolloutPlan is the details on how to rollout the resources
// The controller simply replace the old resources with the new one if there is no rollout plan involved
// +optional
RolloutPlan *v1alpha1.RolloutPlan `json:"rolloutPlan,omitempty"`
}
// Application is the Schema for the applications API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName={app,velaapp}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="COMPONENT",type=string,JSONPath=`.spec.components[*].name`
// +kubebuilder:printcolumn:name="TYPE",type=string,JSONPath=`.spec.components[*].type`
// +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.status`
// +kubebuilder:printcolumn:name="HEALTHY",type=boolean,JSONPath=`.status.services[*].healthy`
// +kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.services[*].message`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type Application struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ApplicationSpec `json:"spec,omitempty"`
Status common.AppStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ApplicationList contains a list of Application
type ApplicationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Application `json:"items"`
}
// GetComponent get the component from the application based on its workload type
func (app *Application) GetComponent(workloadType string) *ApplicationComponent {
for _, c := range app.Spec.Components {
if c.WorkloadType == workloadType {
return &c
}
}
return nil
}

View File

@@ -1,68 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha2
import (
"reflect"
"testing"
)
func TestApplicationGetComponent(t *testing.T) {
ac1 := ApplicationComponent{
Name: "ac1",
WorkloadType: "type1",
}
ac2 := ApplicationComponent{
Name: "ac2",
WorkloadType: "type2",
}
tests := map[string]struct {
app *Application
componentName string
want *ApplicationComponent
}{
"test get one": {
app: &Application{
Spec: ApplicationSpec{
Components: []ApplicationComponent{
ac1, ac2,
},
},
},
componentName: ac1.WorkloadType,
want: &ac1,
},
"test get none": {
app: &Application{
Spec: ApplicationSpec{
Components: []ApplicationComponent{
ac2,
},
},
},
componentName: ac1.WorkloadType,
want: nil,
},
}
for name, tt := range tests {
t.Run(name, func(t *testing.T) {
if got := tt.app.GetComponent(tt.componentName); !reflect.DeepEqual(got, tt.want) {
t.Errorf("GetComponent() = %v, want %v", got, tt.want)
}
})
}
}

View File

@@ -1,73 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// ApplicationRevisionSpec is the spec of ApplicationRevision
type ApplicationRevisionSpec struct {
// Application records the snapshot of the created/modified Application
Application Application `json:"application"`
// ComponentDefinitions records the snapshot of the componentDefinitions related with the created/modified Application
ComponentDefinitions map[string]ComponentDefinition `json:"componentDefinitions,omitempty"`
// WorkloadDefinitions records the snapshot of the workloadDefinitions related with the created/modified Application
WorkloadDefinitions map[string]WorkloadDefinition `json:"workloadDefinitions,omitempty"`
// TraitDefinitions records the snapshot of the traitDefinitions related with the created/modified Application
TraitDefinitions map[string]TraitDefinition `json:"traitDefinitions,omitempty"`
// ScopeDefinitions records the snapshot of the scopeDefinitions related with the created/modified Application
ScopeDefinitions map[string]ScopeDefinition `json:"scopeDefinitions,omitempty"`
// Components records the rendered components from Application, it will contains the whole K8s CR of workload in it.
Components []common.RawComponent `json:"components,omitempty"`
// ApplicationConfiguration records the rendered applicationConfiguration from Application,
// it will contains the whole K8s CR of trait and the reference component in it.
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
ApplicationConfiguration runtime.RawExtension `json:"applicationConfiguration"`
}
// ApplicationRevision is the Schema for the ApplicationRevision API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=apprev
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type ApplicationRevision struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ApplicationRevisionSpec `json:"spec,omitempty"`
}
// ApplicationRevisionList contains a list of ApplicationRevision
// +kubebuilder:object:root=true
type ApplicationRevisionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ApplicationRevision `json:"items"`
}

View File

@@ -1,103 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// ComponentDefinitionSpec defines the desired state of ComponentDefinition
type ComponentDefinitionSpec struct {
// Workload is a workload type descriptor
Workload common.WorkloadTypeDescriptor `json:"workload"`
// ChildResourceKinds are the list of GVK of the child resources this workload generates
ChildResourceKinds []common.ChildResourceKind `json:"childResourceKinds,omitempty"`
// RevisionLabel indicates which label for underlying resources(e.g. pods) of this workload
// can be used by trait to create resource selectors(e.g. label selector for pods).
// +optional
RevisionLabel string `json:"revisionLabel,omitempty"`
// PodSpecPath indicates where/if this workload has K8s podSpec field
// if one workload has podSpec, trait can do lot's of assumption such as port, env, volume fields.
// +optional
PodSpecPath string `json:"podSpecPath,omitempty"`
// Status defines the custom health policy and status message for workload
// +optional
Status *common.Status `json:"status,omitempty"`
// Schematic defines the data format and template of the encapsulation of the workload
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
// Extension is used for extension needs by OAM platform builders
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
// ComponentDefinitionStatus is the status of ComponentDefinition
type ComponentDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
condition.ConditionedStatus `json:",inline"`
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
ConfigMapRef string `json:"configMapRef,omitempty"`
// LatestRevision of the component definition
// +optional
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
}
// +kubebuilder:object:root=true
// ComponentDefinition is the Schema for the componentdefinitions API
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=comp
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="WORKLOAD-KIND",type=string,JSONPath=".spec.workload.definition.kind"
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
type ComponentDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ComponentDefinitionSpec `json:"spec,omitempty"`
Status ComponentDefinitionStatus `json:"status,omitempty"`
}
// SetConditions set condition for WorkloadDefinition
func (cd *ComponentDefinition) SetConditions(c ...condition.Condition) {
cd.Status.SetConditions(c...)
}
// GetCondition gets condition from WorkloadDefinition
func (cd *ComponentDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
return cd.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// ComponentDefinitionList contains a list of ComponentDefinition
type ComponentDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ComponentDefinition `json:"items"`
}

View File

@@ -1,139 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha2
import (
"fmt"
"reflect"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/conversion"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1"
)
// ApplicationV1alpha2ToV1beta1 will convert v1alpha2 to v1beta1
func ApplicationV1alpha2ToV1beta1(v1a2 *Application, v1b1 *v1beta1.Application) {
// 1) convert metav1.TypeMeta
// apiVersion and Kind automatically converted
// 2) convert metav1.ObjectMeta
v1b1.ObjectMeta = *v1a2.ObjectMeta.DeepCopy()
// 3) convert Spec ApplicationSpec
// 3.1) convert Spec.Components
for _, comp := range v1a2.Spec.Components {
// convert trait, especially for `.name` -> `.type`
var traits = make([]common.ApplicationTrait, len(comp.Traits))
for j, trait := range comp.Traits {
traits[j] = common.ApplicationTrait{
Type: trait.Name,
Properties: trait.Properties.DeepCopy(),
}
}
// deep copy scopes
scopes := make(map[string]string)
for k, v := range comp.Scopes {
scopes[k] = v
}
// convert component
// `.settings` -> `.properties`
v1b1.Spec.Components = append(v1b1.Spec.Components, common.ApplicationComponent{
Name: comp.Name,
Type: comp.WorkloadType,
Properties: comp.Settings.DeepCopy(),
Traits: traits,
Scopes: scopes,
})
}
// 4) convert Status common.AppStatus
v1b1.Status = *v1a2.Status.DeepCopy()
}
// ConvertTo converts this Application to the Hub version (v1beta1 only for now).
func (app *Application) ConvertTo(dst conversion.Hub) error {
switch convertedApp := dst.(type) {
case *v1beta1.Application:
klog.Infof("convert *v1alpha2.Application [%s] to *v1beta1.Application", app.Name)
ApplicationV1alpha2ToV1beta1(app, convertedApp)
return nil
default:
}
return fmt.Errorf("unsupported convertTo object %v", reflect.TypeOf(dst))
}
// ConvertFrom converts from the Hub version (v1beta1) to this version (v1alpha2).
func (app *Application) ConvertFrom(src conversion.Hub) error {
switch sourceApp := src.(type) {
case *v1beta1.Application:
klog.Infof("convert *v1alpha2.Application from *v1beta1.Application [%s]", sourceApp.Name)
// 1) convert metav1.TypeMeta
// apiVersion and Kind automatically converted
// 2) convert metav1.ObjectMeta
app.ObjectMeta = *sourceApp.ObjectMeta.DeepCopy()
// 3) convert Spec ApplicationSpec
// 3.1) convert Spec.Components
for _, comp := range sourceApp.Spec.Components {
// convert trait, especially for `.type` -> `.name`
var traits = make([]ApplicationTrait, len(comp.Traits))
for j, trait := range comp.Traits {
traits[j] = ApplicationTrait{
Name: trait.Type,
Properties: trait.Properties.DeepCopy(),
}
}
// deep copy scopes
scopes := make(map[string]string)
for k, v := range comp.Scopes {
scopes[k] = v
}
// convert component
// `.properties` -> `.settings`
var compProperties runtime.RawExtension
if comp.Properties != nil {
compProperties = *comp.Properties.DeepCopy()
}
app.Spec.Components = append(app.Spec.Components, ApplicationComponent{
Name: comp.Name,
WorkloadType: comp.Type,
Settings: compProperties,
Traits: traits,
Scopes: scopes,
})
}
// 4) convert Status common.AppStatus
app.Status = *sourceApp.Status.DeepCopy()
return nil
default:
}
return fmt.Errorf("unsupported ConvertFrom object %v", reflect.TypeOf(src))
}

View File

@@ -1,117 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha2
import (
"fmt"
"testing"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/stretchr/testify/require"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/v1beta1"
)
var app = Application{
Spec: ApplicationSpec{
Components: []ApplicationComponent{{
Name: "test-component",
WorkloadType: "worker",
Traits: []ApplicationTrait{},
Scopes: map[string]string{},
}},
},
}
type errType struct {
}
func (*errType) Hub() {}
func (*errType) DeepCopyObject() runtime.Object {
return nil
}
func (*errType) GetObjectKind() schema.ObjectKind {
return nil
}
func TestApplicationV1alpha2ToV1beta1(t *testing.T) {
r := require.New(t)
expected := &v1beta1.Application{}
ApplicationV1alpha2ToV1beta1(&app, expected)
r.Equal(expected, &v1beta1.Application{
Spec: v1beta1.ApplicationSpec{
Components: []common.ApplicationComponent{{
Name: "test-component",
Type: "worker",
Properties: &runtime.RawExtension{},
Traits: []common.ApplicationTrait{},
Scopes: map[string]string{},
}},
},
})
}
func TestConvertTo(t *testing.T) {
r := require.New(t)
expected := &v1beta1.Application{}
err := app.ConvertTo(expected)
r.NoError(err)
r.Equal(expected, &v1beta1.Application{
Spec: v1beta1.ApplicationSpec{
Components: []common.ApplicationComponent{{
Name: "test-component",
Type: "worker",
Properties: &runtime.RawExtension{},
Traits: []common.ApplicationTrait{},
Scopes: map[string]string{},
}},
},
})
errCase := &errType{}
err = app.ConvertTo(errCase)
r.Equal(err, fmt.Errorf("unsupported convertTo object *v1alpha2.errType"))
}
func TestConvertFrom(t *testing.T) {
r := require.New(t)
to := &Application{}
from := &v1beta1.Application{
Spec: v1beta1.ApplicationSpec{
Components: []common.ApplicationComponent{{
Name: "test-component",
Type: "worker",
Properties: &runtime.RawExtension{},
Traits: []common.ApplicationTrait{},
Scopes: map[string]string{},
}},
},
}
err := to.ConvertFrom(from)
r.NoError(err)
r.Equal(to.Spec, app.Spec)
errCase := &errType{}
err = app.ConvertFrom(errCase)
r.Equal(err, fmt.Errorf("unsupported ConvertFrom object *v1alpha2.errType"))
}

View File

@@ -1,146 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha2
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/pkg/oam"
)
// HealthStatus represents health status strings.
type HealthStatus string
const (
// StatusHealthy represents healthy status.
StatusHealthy HealthStatus = "HEALTHY"
// StatusUnhealthy represents unhealthy status.
StatusUnhealthy = "UNHEALTHY"
// StatusUnknown represents unknown status.
StatusUnknown = "UNKNOWN"
)
var _ oam.Scope = &HealthScope{}
// A HealthScopeSpec defines the desired state of a HealthScope.
type HealthScopeSpec struct {
// ProbeTimeout is the amount of time in seconds to wait when receiving a response before marked failure.
ProbeTimeout *int32 `json:"probe-timeout,omitempty"`
// ProbeInterval is the amount of time in seconds between probing tries.
ProbeInterval *int32 `json:"probe-interval,omitempty"`
// AppRefs records references of applications' components
AppRefs []AppReference `json:"appReferences,omitempty"`
// WorkloadReferences to the workloads that are in this scope.
// +deprecated
WorkloadReferences []corev1.ObjectReference `json:"workloadRefs"`
}
// AppReference records references of an application's components
type AppReference struct {
AppName string `json:"appName,omitempty"`
CompReferences []CompReference `json:"compReferences,omitempty"`
}
// CompReference records references of a component's resources
type CompReference struct {
CompName string `json:"compName,omitempty"`
Workload corev1.ObjectReference `json:"workload,omitempty"`
Traits []corev1.ObjectReference `json:"traits,omitempty"`
}
// A HealthScopeStatus represents the observed state of a HealthScope.
type HealthScopeStatus struct {
condition.ConditionedStatus `json:",inline"`
// ScopeHealthCondition represents health condition summary of the scope
ScopeHealthCondition ScopeHealthCondition `json:"scopeHealthCondition"`
// AppHealthConditions represents health condition of applications in the scope
AppHealthConditions []*AppHealthCondition `json:"appHealthConditions,omitempty"`
// WorkloadHealthConditions represents health condition of workloads in the scope
// Use AppHealthConditions to provide app level status
// +deprecated
WorkloadHealthConditions []*WorkloadHealthCondition `json:"healthConditions,omitempty"`
}
// AppHealthCondition represents health condition of an application
type AppHealthCondition struct {
AppName string `json:"appName"`
EnvName string `json:"envName,omitempty"`
Components []*WorkloadHealthCondition `json:"components,omitempty"`
}
// ScopeHealthCondition represents health condition summary of a scope.
type ScopeHealthCondition struct {
HealthStatus HealthStatus `json:"healthStatus"`
Total int64 `json:"total,omitempty"`
HealthyWorkloads int64 `json:"healthyWorkloads,omitempty"`
UnhealthyWorkloads int64 `json:"unhealthyWorkloads,omitempty"`
UnknownWorkloads int64 `json:"unknownWorkloads,omitempty"`
}
// WorkloadHealthCondition represents informative health condition of a workload.
type WorkloadHealthCondition struct {
// ComponentName represents the component name if target is a workload
ComponentName string `json:"componentName,omitempty"`
TargetWorkload corev1.ObjectReference `json:"targetWorkload,omitempty"`
HealthStatus HealthStatus `json:"healthStatus"`
Diagnosis string `json:"diagnosis,omitempty"`
// WorkloadStatus represents status of workloads whose HealthStatus is UNKNOWN.
WorkloadStatus string `json:"workloadStatus,omitempty"`
CustomStatusMsg string `json:"customStatusMsg,omitempty"`
Traits []*TraitHealthCondition `json:"traits,omitempty"`
}
// TraitHealthCondition represents informative health condition of a trait.
type TraitHealthCondition struct {
Type string `json:"type"`
Resource string `json:"resource"`
HealthStatus HealthStatus `json:"healthStatus"`
Diagnosis string `json:"diagnosis,omitempty"`
CustomStatusMsg string `json:"customStatusMsg,omitempty"`
}
// +kubebuilder:object:root=true
// A HealthScope determines an aggregate health status based of the health of components.
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:JSONPath=".status.health",name=HEALTH,type=string
type HealthScope struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec HealthScopeSpec `json:"spec,omitempty"`
Status HealthScopeStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// HealthScopeList contains a list of HealthScope.
type HealthScopeList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []HealthScope `json:"items"`
}

View File

@@ -1,673 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha2
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/types"
)
// A WorkloadDefinitionSpec defines the desired state of a WorkloadDefinition.
type WorkloadDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this workload kind.
Reference common.DefinitionReference `json:"definitionRef"`
// ChildResourceKinds are the list of GVK of the child resources this workload generates
ChildResourceKinds []common.ChildResourceKind `json:"childResourceKinds,omitempty"`
// RevisionLabel indicates which label for underlying resources(e.g. pods) of this workload
// can be used by trait to create resource selectors(e.g. label selector for pods).
// +optional
RevisionLabel string `json:"revisionLabel,omitempty"`
// PodSpecPath indicates where/if this workload has K8s podSpec field
// if one workload has podSpec, trait can do lot's of assumption such as port, env, volume fields.
// +optional
PodSpecPath string `json:"podSpecPath,omitempty"`
// Status defines the custom health policy and status message for workload
// +optional
Status *common.Status `json:"status,omitempty"`
// Schematic defines the data format and template of the encapsulation of the workload
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
// Extension is used for extension needs by OAM platform builders
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
// WorkloadDefinitionStatus is the status of WorkloadDefinition
type WorkloadDefinitionStatus struct {
condition.ConditionedStatus `json:",inline"`
}
// +kubebuilder:object:root=true
// A WorkloadDefinition registers a kind of Kubernetes custom resource as a
// valid OAM workload kind by referencing its CustomResourceDefinition. The CRD
// is used to validate the schema of the workload when it is embedded in an OAM
// Component.
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=workload
// +kubebuilder:printcolumn:name="DEFINITION-NAME",type=string,JSONPath=".spec.definitionRef.name"
type WorkloadDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec WorkloadDefinitionSpec `json:"spec,omitempty"`
Status WorkloadDefinitionStatus `json:"status,omitempty"`
}
// SetConditions set condition for WorkloadDefinition
func (wd *WorkloadDefinition) SetConditions(c ...condition.Condition) {
wd.Status.SetConditions(c...)
}
// GetCondition gets condition from WorkloadDefinition
func (wd *WorkloadDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
return wd.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// WorkloadDefinitionList contains a list of WorkloadDefinition.
type WorkloadDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []WorkloadDefinition `json:"items"`
}
// A TraitDefinitionSpec defines the desired state of a TraitDefinition.
type TraitDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this trait kind.
Reference common.DefinitionReference `json:"definitionRef,omitempty"`
// Revision indicates whether a trait is aware of component revision
// +optional
RevisionEnabled bool `json:"revisionEnabled,omitempty"`
// WorkloadRefPath indicates where/if a trait accepts a workloadRef object
// +optional
WorkloadRefPath string `json:"workloadRefPath,omitempty"`
// PodDisruptive specifies whether using the trait will cause the pod to restart or not.
// +optional
PodDisruptive bool `json:"podDisruptive,omitempty"`
// AppliesToWorkloads specifies the list of workload kinds this trait
// applies to. Workload kinds are specified in kind.group/version format,
// e.g. server.core.oam.dev/v1alpha2. Traits that omit this field apply to
// all workload kinds.
// +optional
AppliesToWorkloads []string `json:"appliesToWorkloads,omitempty"`
// ConflictsWith specifies the list of traits(CRD name, Definition name, CRD group)
// which could not apply to the same workloads with this trait.
// Traits that omit this field can work with any other traits.
// Example rules:
// "service" # Trait definition name
// "services.k8s.io" # API resource/crd name
// "*.networking.k8s.io" # API group
// "labelSelector:foo=bar" # label selector
// labelSelector format: https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse
// +optional
ConflictsWith []string `json:"conflictsWith,omitempty"`
// Schematic defines the data format and template of the encapsulation of the trait
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
// Status defines the custom health policy and status message for trait
// +optional
Status *common.Status `json:"status,omitempty"`
// Extension is used for extension needs by OAM platform builders
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
// TraitDefinitionStatus is the status of TraitDefinition
type TraitDefinitionStatus struct {
// ConditionedStatus reflects the observed status of a resource
condition.ConditionedStatus `json:",inline"`
// ConfigMapRef refer to a ConfigMap which contains OpenAPI V3 JSON schema of Component parameters.
ConfigMapRef string `json:"configMapRef,omitempty"`
// LatestRevision of the trait definition
// +optional
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
}
// +kubebuilder:object:root=true
// A TraitDefinition registers a kind of Kubernetes custom resource as a valid
// OAM trait kind by referencing its CustomResourceDefinition. The CRD is used
// to validate the schema of the trait when it is embedded in an OAM
// ApplicationConfiguration.
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=trait
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="APPLIES-TO",type=string,JSONPath=".spec.appliesToWorkloads"
// +kubebuilder:printcolumn:name="DESCRIPTION",type=string,JSONPath=".metadata.annotations.definition\\.oam\\.dev/description"
type TraitDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec TraitDefinitionSpec `json:"spec,omitempty"`
Status TraitDefinitionStatus `json:"status,omitempty"`
}
// SetConditions set condition for TraitDefinition
func (td *TraitDefinition) SetConditions(c ...condition.Condition) {
td.Status.SetConditions(c...)
}
// GetCondition gets condition from TraitDefinition
func (td *TraitDefinition) GetCondition(conditionType condition.ConditionType) condition.Condition {
return td.Status.GetCondition(conditionType)
}
// +kubebuilder:object:root=true
// TraitDefinitionList contains a list of TraitDefinition.
type TraitDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []TraitDefinition `json:"items"`
}
// A ScopeDefinitionSpec defines the desired state of a ScopeDefinition.
type ScopeDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this scope kind.
Reference common.DefinitionReference `json:"definitionRef"`
// WorkloadRefsPath indicates if/where a scope accepts workloadRef objects
WorkloadRefsPath string `json:"workloadRefsPath,omitempty"`
// AllowComponentOverlap specifies whether an OAM component may exist in
// multiple instances of this kind of scope.
AllowComponentOverlap bool `json:"allowComponentOverlap"`
// Extension is used for extension needs by OAM platform builders
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
// +kubebuilder:object:root=true
// A ScopeDefinition registers a kind of Kubernetes custom resource as a valid
// OAM scope kind by referencing its CustomResourceDefinition. The CRD is used
// to validate the schema of the scope when it is embedded in an OAM
// ApplicationConfiguration.
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=scope
type ScopeDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ScopeDefinitionSpec `json:"spec,omitempty"`
}
// +kubebuilder:object:root=true
// ScopeDefinitionList contains a list of ScopeDefinition.
type ScopeDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ScopeDefinition `json:"items"`
}
// A ComponentParameter defines a configurable parameter of a component.
type ComponentParameter struct {
// Name of this parameter. OAM ApplicationConfigurations will specify
// parameter values using this name.
Name string `json:"name"`
// FieldPaths specifies an array of fields within this Component's workload
// that will be overwritten by the value of this parameter. The type of the
// parameter (e.g. int, string) is inferred from the type of these fields;
// All fields must be of the same type. Fields are specified as JSON field
// paths without a leading dot, for example 'spec.replicas'.
FieldPaths []string `json:"fieldPaths"`
// +kubebuilder:default:=false
// Required specifies whether or not a value for this parameter must be
// supplied when authoring an ApplicationConfiguration.
// +optional
Required *bool `json:"required,omitempty"`
// Description of this parameter.
// +optional
Description *string `json:"description,omitempty"`
}
// A ComponentSpec defines the desired state of a Component.
type ComponentSpec struct {
// A Workload that will be created for each ApplicationConfiguration that
// includes this Component. Workload is an instance of a workloadDefinition.
// We either use the GVK info or a special "type" field in the workload to associate
// the content of the workload with its workloadDefinition
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
Workload runtime.RawExtension `json:"workload"`
// HelmRelease records a Helm release used by a Helm module workload.
// +optional
Helm *common.Helm `json:"helm,omitempty"`
// Parameters exposed by this component. ApplicationConfigurations that
// reference this component may specify values for these parameters, which
// will in turn be injected into the embedded workload.
// +optional
Parameters []ComponentParameter `json:"parameters,omitempty"`
}
// A ComponentStatus represents the observed state of a Component.
type ComponentStatus struct {
// The generation observed by the component controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration"`
condition.ConditionedStatus `json:",inline"`
// LatestRevision of component
// +optional
LatestRevision *common.Revision `json:"latestRevision,omitempty"`
// One Component should only be used by one AppConfig
}
// +kubebuilder:object:root=true
// A Component describes how an OAM workload kind may be instantiated.
// +kubebuilder:resource:categories={oam}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:JSONPath=".spec.workload.kind",name=WORKLOAD-KIND,type=string
// +kubebuilder:printcolumn:name="age",type="date",JSONPath=".metadata.creationTimestamp"
type Component struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ComponentSpec `json:"spec,omitempty"`
Status ComponentStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ComponentList contains a list of Component.
type ComponentList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Component `json:"items"`
}
// A ComponentParameterValue specifies a value for a named parameter. The
// associated component must publish a parameter with this name.
type ComponentParameterValue struct {
// Name of the component parameter to set.
Name string `json:"name"`
// Value to set.
Value intstr.IntOrString `json:"value"`
}
// A ComponentTrait specifies a trait that should be applied to a component.
type ComponentTrait struct {
// A Trait that will be created for the component
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
Trait runtime.RawExtension `json:"trait"`
// DataOutputs specify the data output sources from this trait.
// +optional
DataOutputs []DataOutput `json:"dataOutputs,omitempty"`
// DataInputs specify the data input sinks into this trait.
// +optional
DataInputs []DataInput `json:"dataInputs,omitempty"`
}
// A ComponentScope specifies a scope in which a component should exist.
type ComponentScope struct {
// A ScopeReference must refer to an OAM scope resource.
ScopeReference corev1.ObjectReference `json:"scopeRef"`
}
// An ApplicationConfigurationComponent specifies a component of an
// ApplicationConfiguration. Each component is used to instantiate a workload.
type ApplicationConfigurationComponent struct {
// ComponentName specifies a component whose latest revision will be bind
// with ApplicationConfiguration. When the spec of the referenced component
// changes, ApplicationConfiguration will automatically migrate all trait
// affect from the prior revision to the new one. This is mutually exclusive
// with RevisionName.
// +optional
ComponentName string `json:"componentName,omitempty"`
// RevisionName of a specific component revision to which to bind
// ApplicationConfiguration. This is mutually exclusive with componentName.
// +optional
RevisionName string `json:"revisionName,omitempty"`
// DataOutputs specify the data output sources from this component.
DataOutputs []DataOutput `json:"dataOutputs,omitempty"`
// DataInputs specify the data input sinks into this component.
DataInputs []DataInput `json:"dataInputs,omitempty"`
// ParameterValues specify values for the the specified component's
// parameters. Any parameter required by the component must be specified.
// +optional
ParameterValues []ComponentParameterValue `json:"parameterValues,omitempty"`
// Traits of the specified component.
// +optional
Traits []ComponentTrait `json:"traits,omitempty"`
// Scopes in which the specified component should exist.
// +optional
Scopes []ComponentScope `json:"scopes,omitempty"`
}
// An ApplicationConfigurationSpec defines the desired state of a
// ApplicationConfiguration.
type ApplicationConfigurationSpec struct {
// Components of which this ApplicationConfiguration consists. Each
// component will be used to instantiate a workload.
Components []ApplicationConfigurationComponent `json:"components"`
}
// A TraitStatus represents the state of a trait.
type TraitStatus string
// A WorkloadTrait represents a trait associated with a workload and its status
type WorkloadTrait struct {
// Status is a place holder for a customized controller to fill
// if it needs a single place to summarize the status of the trait
Status TraitStatus `json:"status,omitempty"`
// Reference to a trait created by an ApplicationConfiguration.
Reference corev1.ObjectReference `json:"traitRef"`
// Message will allow controller to leave some additional information for this trait
Message string `json:"message,omitempty"`
// AppliedGeneration indicates the generation observed by the appConfig controller.
// The same field is also recorded in the annotations of traits.
// A trait is possible to be deleted from cluster after created.
// This field is useful to track the observed generation of traits after they are
// deleted.
AppliedGeneration int64 `json:"appliedGeneration,omitempty"`
// DependencyUnsatisfied notify does the trait has dependency unsatisfied
DependencyUnsatisfied bool `json:"dependencyUnsatisfied,omitempty"`
}
// A ScopeStatus represents the state of a scope.
type ScopeStatus string
// A WorkloadScope represents a scope associated with a workload and its status
type WorkloadScope struct {
// Status is a place holder for a customized controller to fill
// if it needs a single place to summarize the status of the scope
Status ScopeStatus `json:"status,omitempty"`
// Reference to a scope created by an ApplicationConfiguration.
Reference corev1.ObjectReference `json:"scopeRef"`
}
// A WorkloadStatus represents the status of a workload.
type WorkloadStatus struct {
// Status is a place holder for a customized controller to fill
// if it needs a single place to summarize the entire status of the workload
Status string `json:"status,omitempty"`
// ComponentName that produced this workload.
ComponentName string `json:"componentName,omitempty"`
// ComponentRevisionName of current component
ComponentRevisionName string `json:"componentRevisionName,omitempty"`
// DependencyUnsatisfied notify does the workload has dependency unsatisfied
DependencyUnsatisfied bool `json:"dependencyUnsatisfied,omitempty"`
// AppliedComponentRevision indicates the applied component revision name of this workload
AppliedComponentRevision string `json:"appliedComponentRevision,omitempty"`
// Reference to a workload created by an ApplicationConfiguration.
Reference corev1.ObjectReference `json:"workloadRef,omitempty"`
// Traits associated with this workload.
Traits []WorkloadTrait `json:"traits,omitempty"`
// Scopes associated with this workload.
Scopes []WorkloadScope `json:"scopes,omitempty"`
}
// HistoryWorkload contain the old component revision that are still running
type HistoryWorkload struct {
// Revision of this workload
Revision string `json:"revision,omitempty"`
// Reference to running workload.
Reference corev1.ObjectReference `json:"workloadRef,omitempty"`
}
// A ApplicationStatus represents the state of the entire application.
type ApplicationStatus string
// An ApplicationConfigurationStatus represents the observed state of a
// ApplicationConfiguration.
type ApplicationConfigurationStatus struct {
condition.ConditionedStatus `json:",inline"`
// Status is a place holder for a customized controller to fill
// if it needs a single place to summarize the status of the entire application
Status ApplicationStatus `json:"status,omitempty"`
Dependency DependencyStatus `json:"dependency,omitempty"`
// RollingStatus indicates what phase are we in the rollout phase
RollingStatus types.RollingStatus `json:"rollingStatus,omitempty"`
// Workloads created by this ApplicationConfiguration.
Workloads []WorkloadStatus `json:"workloads,omitempty"`
// The generation observed by the appConfig controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration"`
// HistoryWorkloads will record history but still working revision workloads.
HistoryWorkloads []HistoryWorkload `json:"historyWorkloads,omitempty"`
}
// DependencyStatus represents the observed state of the dependency of
// an ApplicationConfiguration.
type DependencyStatus struct {
Unsatisfied []UnstaifiedDependency `json:"unsatisfied,omitempty"`
}
// UnstaifiedDependency describes unsatisfied dependency flow between
// one pair of objects.
type UnstaifiedDependency struct {
Reason string `json:"reason"`
From DependencyFromObject `json:"from"`
To DependencyToObject `json:"to"`
}
// DependencyFromObject represents the object that dependency data comes from.
type DependencyFromObject struct {
corev1.ObjectReference `json:",inline"`
FieldPath string `json:"fieldPath,omitempty"`
}
// DependencyToObject represents the object that dependency data goes to.
type DependencyToObject struct {
corev1.ObjectReference `json:",inline"`
FieldPaths []string `json:"fieldPaths,omitempty"`
}
// +kubebuilder:object:root=true
// An ApplicationConfiguration represents an OAM application.
// +kubebuilder:resource:shortName=appconfig,categories={oam}
// +kubebuilder:subresource:status
type ApplicationConfiguration struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ApplicationConfigurationSpec `json:"spec,omitempty"`
Status ApplicationConfigurationStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// ApplicationConfigurationList contains a list of ApplicationConfiguration.
type ApplicationConfigurationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ApplicationConfiguration `json:"items"`
}
// DataOutput specifies a data output source from an object.
type DataOutput struct {
// Name is the unique name of a DataOutput in an ApplicationConfiguration.
Name string `json:"name,omitempty"`
// FieldPath refers to the value of an object's field.
FieldPath string `json:"fieldPath,omitempty"`
// Conditions specify the conditions that should be satisfied before emitting a data output.
// Different conditions are AND-ed together.
// If no conditions is specified, it is by default to check output value not empty.
// +optional
Conditions []ConditionRequirement `json:"conditions,omitempty"`
// OutputStore specifies the object used to store intermediate data generated by Operations
OutputStore StoreReference `json:"outputStore,omitempty"`
}
// StoreReference specifies the referenced object in DataOutput or DataInput
type StoreReference struct {
corev1.ObjectReference `json:",inline"`
// Operations specify the data processing operations
Operations []DataOperation `json:"operations,omitempty"`
}
// DataOperation defines the specific operation for data
type DataOperation struct {
// Type specifies the type of DataOperation
Type string `json:"type"`
// Operator specifies the operation under this DataOperation type
Operator DataOperator `json:"op"`
// ToFieldPath refers to the value of an object's field
ToFieldPath string `json:"toFieldPath"`
// ToDataPath refers to the value of an object's specfied by ToDataPath. For example the ToDataPath "redis" specifies "redis info" in '{"redis":"redis info"}'
ToDataPath string `json:"toDataPath,omitempty"`
// +optional
// Value specifies an expected value
// This is mutually exclusive with ValueFrom
Value string `json:"value,omitempty"`
// +optional
// ValueFrom specifies expected value from object such as workload and trait
// This is mutually exclusive with Value
ValueFrom ValueFrom `json:"valueFrom,omitempty"`
Conditions []ConditionRequirement `json:"conditions,omitempty"`
}
// DataOperator defines the type of Operator in DataOperation
type DataOperator string
const (
// AddOperator specifies the add operation for data passing
AddOperator DataOperator = "add"
// DeleteOperator specifies the delete operation for data passing
DeleteOperator DataOperator = "delete"
// ReplaceOperator specifies the replace operation for data passing
ReplaceOperator DataOperator = "replace"
)
// DataInput specifies a data input sink to an object.
// If input is array, it will be appended to the target field paths.
type DataInput struct {
// ValueFrom specifies the value source.
ValueFrom DataInputValueFrom `json:"valueFrom,omitempty"`
// ToFieldPaths specifies the field paths of an object to fill passed value.
ToFieldPaths []string `json:"toFieldPaths,omitempty"`
// StrategyMergeKeys specifies the merge key if the toFieldPaths target is an array.
// The StrategyMergeKeys is optional, by default, if the toFieldPaths target is an array, we will append.
// If StrategyMergeKeys specified, we will check the key in the target array.
// If any key exist, do update; if no key exist, append.
StrategyMergeKeys []string `json:"strategyMergeKeys,omitempty"`
// When the Conditions is satified, ToFieldPaths will be filled with passed value
Conditions []ConditionRequirement `json:"conditions,omitempty"`
// InputStore specifies the object used to read intermediate data genereted by DataOutput
InputStore StoreReference `json:"inputStore,omitempty"`
}
// DataInputValueFrom specifies the value source for a data input.
type DataInputValueFrom struct {
// DataOutputName matches a name of a DataOutput in the same AppConfig.
DataOutputName string `json:"dataOutputName"`
}
// ConditionRequirement specifies the requirement to match a value.
type ConditionRequirement struct {
Operator ConditionOperator `json:"op"`
// +optional
// Value specifies an expected value
// This is mutually exclusive with ValueFrom
Value string `json:"value,omitempty"`
// +optional
// ValueFrom specifies expected value from AppConfig
// This is mutually exclusive with Value
ValueFrom ValueFrom `json:"valueFrom,omitempty"`
// +optional
// FieldPath specifies got value from workload/trait object
FieldPath string `json:"fieldPath,omitempty"`
}
// ValueFrom gets value from AppConfig object by specifying a path
type ValueFrom struct {
FieldPath string `json:"fieldPath"`
}
// ConditionOperator specifies the operator to match a value.
type ConditionOperator string
const (
// ConditionEqual indicates equal to given value
ConditionEqual ConditionOperator = "eq"
// ConditionNotEqual indicates not equal to given value
ConditionNotEqual ConditionOperator = "notEq"
// ConditionNotEmpty indicates given value not empty
ConditionNotEmpty ConditionOperator = "notEmpty"
)

View File

@@ -1,355 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1alpha2
package v1alpha2
import (
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/util/intstr"
)
// An OperatingSystem required by a containerised workload.
type OperatingSystem string
// Supported operating system types.
const (
OperatingSystemLinux OperatingSystem = "linux"
OperatingSystemWindows OperatingSystem = "windows"
)
// A CPUArchitecture required by a containerised workload.
type CPUArchitecture string
// Supported architectures
const (
CPUArchitectureI386 CPUArchitecture = "i386"
CPUArchitectureAMD64 CPUArchitecture = "amd64"
CPUArchitectureARM CPUArchitecture = "arm"
CPUArchitectureARM64 CPUArchitecture = "arm64"
)
// A SecretKeySelector is a reference to a secret key in an arbitrary namespace.
type SecretKeySelector struct {
// The name of the secret.
Name string `json:"name"`
// The key to select.
Key string `json:"key"`
}
// TODO(negz): The OAM spec calls for float64 quantities in some cases, but this
// is incompatible with controller-gen and Kubernetes API conventions. We should
// reassess whether resource.Quantity is appropriate after resolving
// https://github.com/oam-dev/spec/issues/313
// CPUResources required by a container.
type CPUResources struct {
// Required CPU count. 1.0 represents one CPU core.
Required resource.Quantity `json:"required"`
}
// MemoryResources required by a container.
type MemoryResources struct {
// Required memory.
Required resource.Quantity `json:"required"`
}
// GPUResources required by a container.
type GPUResources struct {
// Required GPU count.
Required resource.Quantity `json:"required"`
}
// DiskResource required by a container.
type DiskResource struct {
// Required disk space.
Required resource.Quantity `json:"required"`
// Ephemeral specifies whether an external disk needs to be mounted.
// +optional
Ephemeral *bool `json:"ephemeral,omitempty"`
}
// A VolumeAccessMode determines how a volume may be accessed.
type VolumeAccessMode string
// Volume access modes.
const (
VolumeAccessModeRO VolumeAccessMode = "RO"
VolumeAccessModeRW VolumeAccessMode = "RW"
)
// A VolumeSharingPolicy determines how a volume may be shared.
type VolumeSharingPolicy string
// Volume sharing policies.
const (
VolumeSharingPolicyExclusive VolumeSharingPolicy = "Exclusive"
VolumeSharingPolicyShared VolumeSharingPolicy = "Shared"
)
// VolumeResource required by a container.
type VolumeResource struct {
// Name of this volume. Must be unique within its container.
Name string `json:"name"`
// MountPath at which this volume will be mounted within its container.
MountPath string `json:"mountPath"`
// TODO(negz): Use +kubebuilder:default marker to default AccessMode to RW
// and SharingPolicy to Exclusive once we're generating v1 CRDs.
// AccessMode of this volume; RO (read only) or RW (read and write).
// +optional
// +kubebuilder:validation:Enum=RO;RW
AccessMode *VolumeAccessMode `json:"accessMode,omitempty"`
// SharingPolicy of this volume; Exclusive or Shared.
// +optional
// +kubebuilder:validation:Enum=Exclusive;Shared
SharingPolicy *VolumeSharingPolicy `json:"sharingPolicy,omitempty"`
// Disk requirements of this volume.
// +optional
Disk *DiskResource `json:"disk,omitempty"`
}
// ExtendedResource required by a container.
type ExtendedResource struct {
// Name of the external resource. Resource names are specified in
// kind.group/version format, e.g. motionsensor.ext.example.com/v1.
Name string `json:"name"`
// Required extended resource(s), e.g. 8 or "very-cool-widget"
Required intstr.IntOrString `json:"required"`
}
// ContainerResources specifies a container's required compute resources.
type ContainerResources struct {
// CPU required by this container.
CPU CPUResources `json:"cpu"`
// Memory required by this container.
Memory MemoryResources `json:"memory"`
// GPU required by this container.
// +optional
GPU *GPUResources `json:"gpu,omitempty"`
// Volumes required by this container.
// +optional
Volumes []VolumeResource `json:"volumes,omitempty"`
// Extended resources required by this container.
// +optional
Extended []ExtendedResource `json:"extended,omitempty"`
}
// A ContainerEnvVar specifies an environment variable that should be set within
// a container.
type ContainerEnvVar struct {
// Name of the environment variable. Must be composed of valid Unicode
// letter and number characters, as well as _ and -.
// +kubebuilder:validation:Pattern=^[-_a-zA-Z0-9]+$
Name string `json:"name"`
// Value of the environment variable.
// +optional
Value *string `json:"value,omitempty"`
// FromSecret is a secret key reference which can be used to assign a value
// to the environment variable.
// +optional
FromSecret *SecretKeySelector `json:"fromSecret,omitempty"`
}
// A ContainerConfigFile specifies a configuration file that should be written
// within a container.
type ContainerConfigFile struct {
// Path within the container at which the configuration file should be
// written.
Path string `json:"path"`
// Value that should be written to the configuration file.
// +optional
Value *string `json:"value,omitempty"`
// FromSecret is a secret key reference which can be used to assign a value
// to be written to the configuration file at the given path in the
// container.
// +optional
FromSecret *SecretKeySelector `json:"fromSecret,omitempty"`
}
// A TransportProtocol represents a transport layer protocol.
type TransportProtocol string
// Transport protocols.
const (
TransportProtocolTCP TransportProtocol = "TCP"
TransportProtocolUDP TransportProtocol = "UDP"
)
// A ContainerPort specifies a port that is exposed by a container.
type ContainerPort struct {
// Name of this port. Must be unique within its container. Must be lowercase
// alphabetical characters.
// +kubebuilder:validation:Pattern=^[a-z]+$
Name string `json:"name"`
// Port number. Must be unique within its container.
Port int32 `json:"containerPort"`
// TODO(negz): Use +kubebuilder:default marker to default Protocol to TCP
// once we're generating v1 CRDs.
// Protocol used by the server listening on this port.
// +kubebuilder:validation:Enum=TCP;UDP
// +optional
Protocol *TransportProtocol `json:"protocol,omitempty"`
}
// An ExecProbe probes a container's health by executing a command.
type ExecProbe struct {
// Command to be run by this probe.
Command []string `json:"command"`
}
// A HTTPHeader to be passed when probing a container.
type HTTPHeader struct {
// Name of this HTTP header. Must be unique per probe.
Name string `json:"name"`
// Value of this HTTP header.
Value string `json:"value"`
}
// A HTTPGetProbe probes a container's health by sending an HTTP GET request.
type HTTPGetProbe struct {
// Path to probe, e.g. '/healthz'.
Path string `json:"path"`
// Port to probe.
Port int32 `json:"port"`
// HTTPHeaders to send with the GET request.
// +optional
HTTPHeaders []HTTPHeader `json:"httpHeaders,omitempty"`
}
// A TCPSocketProbe probes a container's health by connecting to a TCP socket.
type TCPSocketProbe struct {
// Port this probe should connect to.
Port int32 `json:"port"`
}
// A ContainerHealthProbe specifies how to probe the health of a container.
// Exactly one of Exec, HTTPGet, or TCPSocket must be specified.
type ContainerHealthProbe struct {
// Exec probes a container's health by executing a command.
// +optional
Exec *ExecProbe `json:"exec,omitempty"`
// HTTPGet probes a container's health by sending an HTTP GET request.
// +optional
HTTPGet *HTTPGetProbe `json:"httpGet,omitempty"`
// TCPSocketProbe probes a container's health by connecting to a TCP socket.
// +optional
TCPSocket *TCPSocketProbe `json:"tcpSocket,omitempty"`
// InitialDelaySeconds after a container starts before the first probe.
// +optional
InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"`
// TODO(negz): Use +kubebuilder:default marker to default PeriodSeconds,
// TimeoutSeconds, SuccessThreshold, and FailureThreshold to 10, 1, 1, and 3
// respectively once we're generating v1 CRDs.
// PeriodSeconds between probes.
// +optional
PeriodSeconds *int32 `json:"periodSeconds,omitempty"`
// TimeoutSeconds after which the probe times out.
// +optional
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"`
// SuccessThreshold specifies how many consecutive probes must success in
// order for the container to be considered healthy.
// +optional
SuccessThreshold *int32 `json:"successThreshold,omitempty"`
// FailureThreshold specifies how many consecutive probes must fail in order
// for the container to be considered healthy.
// +optional
FailureThreshold *int32 `json:"failureThreshold,omitempty"`
}
// A Container represents an Open Containers Initiative (OCI) container.
type Container struct {
// Name of this container. Must be unique within its workload.
Name string `json:"name"`
// Image this container should run. Must be a path-like or URI-like
// representation of an OCI image. May be prefixed with a registry address
// and should be suffixed with a tag.
Image string `json:"image"`
// Resources required by this container
// +optional
Resources *ContainerResources `json:"resources,omitempty"`
// Command to be run by this container.
// +optional
Command []string `json:"command,omitempty"`
// Arguments to be passed to the command run by this container.
// +optional
Arguments []string `json:"args,omitempty"`
// Environment variables that should be set within this container.
// +optional
Environment []ContainerEnvVar `json:"env,omitempty"`
// ConfigFiles that should be written within this container.
// +optional
ConfigFiles []ContainerConfigFile `json:"config,omitempty"`
// Ports exposed by this container.
// +optional
Ports []ContainerPort `json:"ports,omitempty"`
// A LivenessProbe assesses whether this container is alive. Containers that
// fail liveness probes will be restarted.
// +optional
LivenessProbe *ContainerHealthProbe `json:"livenessProbe,omitempty"`
// A ReadinessProbe assesses whether this container is ready to serve
// requests. Containers that fail readiness probes will be withdrawn from
// service.
// +optional
ReadinessProbe *ContainerHealthProbe `json:"readinessProbe,omitempty"`
// TODO(negz): Ideally the key within this secret would be configurable, but
// the current OAM spec allows only a secret name.
// ImagePullSecret specifies the name of a Secret from which the
// credentials required to pull this container's image can be loaded.
// +optional
ImagePullSecret *string `json:"imagePullSecret,omitempty"`
}

View File

@@ -1,22 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1alpha2 contains resources relating to the Open Application Model.
// See https://github.com/oam-dev/spec for more details.
// +kubebuilder:object:generate=true
// +groupName=core.oam.dev
// +versionName=v1alpha2
package v1alpha2

View File

@@ -1,65 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// This code is manually implemented, but should be generated in the future.
package v1alpha2
import (
corev1 "k8s.io/api/core/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// GetCondition of this ApplicationConfiguration.
func (ac *ApplicationConfiguration) GetCondition(ct condition.ConditionType) condition.Condition {
return ac.Status.GetCondition(ct)
}
// SetConditions of this ApplicationConfiguration.
func (ac *ApplicationConfiguration) SetConditions(c ...condition.Condition) {
ac.Status.SetConditions(c...)
}
// GetCondition of this Component.
func (cm *Component) GetCondition(ct condition.ConditionType) condition.Condition {
return cm.Status.GetCondition(ct)
}
// SetConditions of this Component.
func (cm *Component) SetConditions(c ...condition.Condition) {
cm.Status.SetConditions(c...)
}
// GetCondition of this HealthScope.
func (hs *HealthScope) GetCondition(ct condition.ConditionType) condition.Condition {
return hs.Status.GetCondition(ct)
}
// SetConditions of this HealthScope.
func (hs *HealthScope) SetConditions(c ...condition.Condition) {
hs.Status.SetConditions(c...)
}
// GetWorkloadReferences to get all workload references for scope.
func (hs *HealthScope) GetWorkloadReferences() []corev1.ObjectReference {
return hs.Spec.WorkloadReferences
}
// AddWorkloadReference to add a workload reference to this scope.
func (hs *HealthScope) AddWorkloadReference(r corev1.ObjectReference) {
hs.Spec.WorkloadReferences = append(hs.Spec.WorkloadReferences, r)
}

View File

@@ -1,124 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha2
import (
"reflect"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// Package type metadata.
const (
Group = common.Group
Version = "v1alpha2"
)
var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
)
// ComponentDefinition type metadata.
var (
ComponentDefinitionKind = reflect.TypeOf(ComponentDefinition{}).Name()
ComponentDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: ComponentDefinitionKind}.String()
ComponentDefinitionKindAPIVersion = ComponentDefinitionKind + "." + SchemeGroupVersion.String()
ComponentDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(ComponentDefinitionKind)
)
// WorkloadDefinition type metadata.
var (
WorkloadDefinitionKind = reflect.TypeOf(WorkloadDefinition{}).Name()
WorkloadDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: WorkloadDefinitionKind}.String()
WorkloadDefinitionKindAPIVersion = WorkloadDefinitionKind + "." + SchemeGroupVersion.String()
WorkloadDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(WorkloadDefinitionKind)
)
// TraitDefinition type metadata.
var (
TraitDefinitionKind = reflect.TypeOf(TraitDefinition{}).Name()
TraitDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: TraitDefinitionKind}.String()
TraitDefinitionKindAPIVersion = TraitDefinitionKind + "." + SchemeGroupVersion.String()
TraitDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(TraitDefinitionKind)
)
// ScopeDefinition type metadata.
var (
ScopeDefinitionKind = reflect.TypeOf(ScopeDefinition{}).Name()
ScopeDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: ScopeDefinitionKind}.String()
ScopeDefinitionKindAPIVersion = ScopeDefinitionKind + "." + SchemeGroupVersion.String()
ScopeDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(ScopeDefinitionKind)
)
// Component type metadata.
var (
ComponentKind = reflect.TypeOf(Component{}).Name()
ComponentGroupKind = schema.GroupKind{Group: Group, Kind: ComponentKind}.String()
ComponentKindAPIVersion = ComponentKind + "." + SchemeGroupVersion.String()
ComponentGroupVersionKind = SchemeGroupVersion.WithKind(ComponentKind)
)
// ApplicationConfiguration type metadata.
var (
ApplicationConfigurationKind = reflect.TypeOf(ApplicationConfiguration{}).Name()
ApplicationConfigurationGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationConfigurationKind}.String()
ApplicationConfigurationKindAPIVersion = ApplicationConfigurationKind + "." + SchemeGroupVersion.String()
ApplicationConfigurationGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationConfigurationKind)
)
// HealthScope type metadata.
var (
HealthScopeKind = reflect.TypeOf(HealthScope{}).Name()
HealthScopeGroupKind = schema.GroupKind{Group: Group, Kind: HealthScopeKind}.String()
HealthScopeKindAPIVersion = HealthScopeKind + "." + SchemeGroupVersion.String()
HealthScopeGroupVersionKind = SchemeGroupVersion.WithKind(HealthScopeKind)
)
// Application type metadata.
var (
ApplicationKind = reflect.TypeOf(Application{}).Name()
ApplicationGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationKind}.String()
ApplicationKindAPIVersion = ApplicationKind + "." + SchemeGroupVersion.String()
ApplicationKindVersionKind = SchemeGroupVersion.WithKind(ApplicationKind)
)
// ApplicationRevision type metadata
var (
ApplicationRevisionKind = reflect.TypeOf(ApplicationRevision{}).Name()
ApplicationRevisionGroupKind = schema.GroupKind{Group: Group, Kind: ApplicationRevisionKind}.String()
ApplicationRevisionKindAPIVersion = ApplicationRevisionKind + "." + SchemeGroupVersion.String()
ApplicationRevisionGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationRevisionKind)
)
func init() {
SchemeBuilder.Register(&ComponentDefinition{}, &ComponentDefinitionList{})
SchemeBuilder.Register(&WorkloadDefinition{}, &WorkloadDefinitionList{})
SchemeBuilder.Register(&TraitDefinition{}, &TraitDefinitionList{})
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
SchemeBuilder.Register(&Component{}, &ComponentList{})
SchemeBuilder.Register(&ApplicationConfiguration{}, &ApplicationConfigurationList{})
SchemeBuilder.Register(&HealthScope{}, &HealthScopeList{})
SchemeBuilder.Register(&Application{}, &ApplicationList{})
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})
}

File diff suppressed because it is too large Load Diff

View File

@@ -23,29 +23,18 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
wfTypesv1alpha1 "github.com/kubevela/pkg/apis/oam/v1alpha1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
const (
// TypeHealthy application are believed to be determined as healthy by a health scope.
TypeHealthy condition.ConditionType = "Healthy"
)
// Reasons an application is or is not healthy
const (
ReasonHealthy condition.ConditionReason = "AllComponentsHealthy"
ReasonUnhealthy condition.ConditionReason = "UnhealthyOrUnknownComponents"
ReasonHealthCheckErr condition.ConditionReason = "HealthCheckeError"
)
// AppPolicy defines a global policy for all components in the app.
type AppPolicy struct {
// Name is the unique name of the policy.
Name string `json:"name"`
// +optional
Name string `json:"name,omitempty"`
// Type is the type of the policy
Type string `json:"type"`
// +kubebuilder:pruning:PreserveUnknownFields
Properties *runtime.RawExtension `json:"properties,omitempty"`
@@ -53,9 +42,9 @@ type AppPolicy struct {
// Workflow defines workflow steps and other attributes
type Workflow struct {
Ref string `json:"ref,omitempty"`
Mode *workflowv1alpha1.WorkflowExecuteMode `json:"mode,omitempty"`
Steps []workflowv1alpha1.WorkflowStep `json:"steps,omitempty"`
Ref string `json:"ref,omitempty"`
Mode *wfTypesv1alpha1.WorkflowExecuteMode `json:"mode,omitempty"`
Steps []wfTypesv1alpha1.WorkflowStep `json:"steps,omitempty"`
}
// ApplicationSpec is the spec of Application
@@ -73,8 +62,6 @@ type ApplicationSpec struct {
// - will have a context in annotation.
// - should mark "finish" phase in status.conditions.
Workflow *Workflow `json:"workflow,omitempty"`
// TODO(wonderflow): we should have application level scopes supported here
}
// +kubebuilder:object:root=true

View File

@@ -19,8 +19,8 @@ package v1beta1
import (
"encoding/json"
wfTypesv1alpha1 "github.com/kubevela/pkg/apis/oam/v1alpha1"
"github.com/kubevela/pkg/util/compression"
workflowv1alpha1 "github.com/kubevela/workflow/api/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
@@ -53,23 +53,17 @@ type ApplicationRevisionCompressibleFields struct {
// TraitDefinitions records the snapshot of the traitDefinitions related with the created/modified Application
TraitDefinitions map[string]*TraitDefinition `json:"traitDefinitions,omitempty"`
// ScopeDefinitions records the snapshot of the scopeDefinitions related with the created/modified Application
ScopeDefinitions map[string]ScopeDefinition `json:"scopeDefinitions,omitempty"`
// PolicyDefinitions records the snapshot of the PolicyDefinitions related with the created/modified Application
PolicyDefinitions map[string]PolicyDefinition `json:"policyDefinitions,omitempty"`
// WorkflowStepDefinitions records the snapshot of the WorkflowStepDefinitions related with the created/modified Application
WorkflowStepDefinitions map[string]*WorkflowStepDefinition `json:"workflowStepDefinitions,omitempty"`
// ScopeGVK records the apiVersion to GVK mapping
ScopeGVK map[string]metav1.GroupVersionKind `json:"scopeGVK,omitempty"`
// Policies records the external policies
Policies map[string]v1alpha1.Policy `json:"policies,omitempty"`
// Workflow records the external workflow
Workflow *workflowv1alpha1.Workflow `json:"workflow,omitempty"`
Workflow *wfTypesv1alpha1.Workflow `json:"workflow,omitempty"`
// ReferredObjects records the referred objects used in the ref-object typed components
// +kubebuilder:pruning:PreserveUnknownFields

View File

@@ -38,8 +38,6 @@ func TestApplicationRevisionCompression(t *testing.T) {
spec.WorkloadDefinitions["def"] = WorkloadDefinition{Spec: WorkloadDefinitionSpec{Reference: common.DefinitionReference{Name: "testdef"}}}
spec.TraitDefinitions = make(map[string]*TraitDefinition)
spec.TraitDefinitions["def"] = &TraitDefinition{Spec: TraitDefinitionSpec{ControlPlaneOnly: true}}
spec.ScopeDefinitions = make(map[string]ScopeDefinition)
spec.ScopeDefinitions["def"] = ScopeDefinition{Spec: ScopeDefinitionSpec{AllowComponentOverlap: true}}
spec.PolicyDefinitions = make(map[string]PolicyDefinition)
spec.PolicyDefinitions["def"] = PolicyDefinition{Spec: PolicyDefinitionSpec{ManageHealthCheck: true}}
spec.WorkflowStepDefinitions = make(map[string]*WorkflowStepDefinition)

View File

@@ -27,6 +27,9 @@ import (
// ComponentDefinitionSpec defines the desired state of ComponentDefinition
type ComponentDefinitionSpec struct {
// +optional
Version string `json:"version,omitempty"`
// Workload is a workload type descriptor
Workload common.WorkloadTypeDescriptor `json:"workload"`

View File

@@ -164,6 +164,9 @@ type TraitDefinitionSpec struct {
// pre-process and post-process respectively.
// +optional
Stage StageType `json:"stage,omitempty"`
// +optional
Version string `json:"version,omitempty"`
}
// StageType describes how the manifests should be dispatched.
@@ -232,49 +235,3 @@ type TraitDefinitionList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []TraitDefinition `json:"items"`
}
// A ScopeDefinitionSpec defines the desired state of a ScopeDefinition.
type ScopeDefinitionSpec struct {
// Reference to the CustomResourceDefinition that defines this scope kind.
Reference common.DefinitionReference `json:"definitionRef"`
// WorkloadRefsPath indicates if/where a scope accepts workloadRef objects
WorkloadRefsPath string `json:"workloadRefsPath,omitempty"`
// AllowComponentOverlap specifies whether an OAM component may exist in
// multiple instances of this kind of scope.
AllowComponentOverlap bool `json:"allowComponentOverlap"`
// Extension is used for extension needs by OAM platform builders
// +optional
// +kubebuilder:pruning:PreserveUnknownFields
Extension *runtime.RawExtension `json:"extension,omitempty"`
}
// +kubebuilder:object:root=true
// A ScopeDefinition registers a kind of Kubernetes custom resource as a valid
// OAM scope kind by referencing its CustomResourceDefinition. The CRD is used
// to validate the schema of the scope when it is embedded in an OAM
// ApplicationConfiguration.
// +kubebuilder:printcolumn:JSONPath=".spec.definitionRef.name",name=DEFINITION-NAME,type=string
// +kubebuilder:resource:scope=Namespaced,categories={oam},shortName=scope
// +kubebuilder:storageversion
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type ScopeDefinition struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ScopeDefinitionSpec `json:"spec,omitempty"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ScopeDefinitionList contains a list of ScopeDefinition.
type ScopeDefinitionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ScopeDefinition `json:"items"`
}

View File

@@ -37,6 +37,9 @@ type PolicyDefinitionSpec struct {
// ManageHealthCheck means the policy will handle health checking and skip application controller
// built-in health checking.
ManageHealthCheck bool `json:"manageHealthCheck,omitempty"`
//+optional
Version string `json:"version,omitempty"`
}
// PolicyDefinitionStatus is the status of PolicyDefinition

View File

@@ -49,6 +49,7 @@ var (
ComponentDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: ComponentDefinitionKind}.String()
ComponentDefinitionKindAPIVersion = ComponentDefinitionKind + "." + SchemeGroupVersion.String()
ComponentDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(ComponentDefinitionKind)
ComponentDefinitionGVR = SchemeGroupVersion.WithResource("componentdefinitions")
)
// WorkloadDefinition type metadata.
@@ -65,6 +66,7 @@ var (
TraitDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: TraitDefinitionKind}.String()
TraitDefinitionKindAPIVersion = TraitDefinitionKind + "." + SchemeGroupVersion.String()
TraitDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(TraitDefinitionKind)
TraitDefinitionGVR = SchemeGroupVersion.WithResource("traitdefinitions")
)
// PolicyDefinition type metadata.
@@ -73,6 +75,7 @@ var (
PolicyDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: PolicyDefinitionKind}.String()
PolicyDefinitionKindAPIVersion = PolicyDefinitionKind + "." + SchemeGroupVersion.String()
PolicyDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(PolicyDefinitionKind)
PolicyDefinitionGVR = SchemeGroupVersion.WithResource("policydefinitions")
)
// WorkflowStepDefinition type metadata.
@@ -81,6 +84,7 @@ var (
WorkflowStepDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: WorkflowStepDefinitionKind}.String()
WorkflowStepDefinitionKindAPIVersion = WorkflowStepDefinitionKind + "." + SchemeGroupVersion.String()
WorkflowStepDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(WorkflowStepDefinitionKind)
WorkflowStepDefinitionGVR = SchemeGroupVersion.WithResource("workflowstepdefinitions")
)
// DefinitionRevision type metadata.
@@ -107,14 +111,6 @@ var (
ApplicationRevisionGroupVersionKind = SchemeGroupVersion.WithKind(ApplicationRevisionKind)
)
// ScopeDefinition type metadata.
var (
ScopeDefinitionKind = reflect.TypeOf(ScopeDefinition{}).Name()
ScopeDefinitionGroupKind = schema.GroupKind{Group: Group, Kind: ScopeDefinitionKind}.String()
ScopeDefinitionKindAPIVersion = ScopeDefinitionKind + "." + SchemeGroupVersion.String()
ScopeDefinitionGroupVersionKind = SchemeGroupVersion.WithKind(ScopeDefinitionKind)
)
// ResourceTracker type metadata.
var (
ResourceTrackerKind = reflect.TypeOf(ResourceTracker{}).Name()
@@ -123,6 +119,20 @@ var (
ResourceTrackerKindVersionKind = SchemeGroupVersion.WithKind(ResourceTrackerKind)
)
// DefinitionTypeInfo contains the mapping information for a definition type
type DefinitionTypeInfo struct {
GVR schema.GroupVersionResource
Kind string
}
// DefinitionTypeMap maps definition types to their corresponding GVR and Kind
var DefinitionTypeMap = map[reflect.Type]DefinitionTypeInfo{
reflect.TypeOf(ComponentDefinition{}): {GVR: ComponentDefinitionGVR, Kind: ComponentDefinitionKind},
reflect.TypeOf(TraitDefinition{}): {GVR: TraitDefinitionGVR, Kind: TraitDefinitionKind},
reflect.TypeOf(PolicyDefinition{}): {GVR: PolicyDefinitionGVR, Kind: PolicyDefinitionKind},
reflect.TypeOf(WorkflowStepDefinition{}): {GVR: WorkflowStepDefinitionGVR, Kind: WorkflowStepDefinitionKind},
}
func init() {
SchemeBuilder.Register(&ComponentDefinition{}, &ComponentDefinitionList{})
SchemeBuilder.Register(&WorkloadDefinition{}, &WorkloadDefinitionList{})
@@ -130,7 +140,6 @@ func init() {
SchemeBuilder.Register(&PolicyDefinition{}, &PolicyDefinitionList{})
SchemeBuilder.Register(&WorkflowStepDefinition{}, &WorkflowStepDefinitionList{})
SchemeBuilder.Register(&DefinitionRevision{}, &DefinitionRevisionList{})
SchemeBuilder.Register(&ScopeDefinition{}, &ScopeDefinitionList{})
SchemeBuilder.Register(&Application{}, &ApplicationList{})
SchemeBuilder.Register(&ApplicationRevision{}, &ApplicationRevisionList{})
SchemeBuilder.Register(&ResourceTracker{}, &ResourceTrackerList{})

View File

@@ -0,0 +1,117 @@
/*
Copyright 2025 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
"reflect"
"strings"
"testing"
"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/runtime/schema"
)
func TestDefinitionTypeMap(t *testing.T) {
tests := []struct {
name string
defType reflect.Type
expectedGVR schema.GroupVersionResource
expectedKind string
}{
{
name: "ComponentDefinition",
defType: reflect.TypeOf(ComponentDefinition{}),
expectedGVR: ComponentDefinitionGVR,
expectedKind: ComponentDefinitionKind,
},
{
name: "TraitDefinition",
defType: reflect.TypeOf(TraitDefinition{}),
expectedGVR: TraitDefinitionGVR,
expectedKind: TraitDefinitionKind,
},
{
name: "PolicyDefinition",
defType: reflect.TypeOf(PolicyDefinition{}),
expectedGVR: PolicyDefinitionGVR,
expectedKind: PolicyDefinitionKind,
},
{
name: "WorkflowStepDefinition",
defType: reflect.TypeOf(WorkflowStepDefinition{}),
expectedGVR: WorkflowStepDefinitionGVR,
expectedKind: WorkflowStepDefinitionKind,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
info, ok := DefinitionTypeMap[tt.defType]
assert.Truef(t, ok, "Type %v should exist in DefinitionTypeMap", tt.defType)
assert.Equal(t, tt.expectedGVR, info.GVR)
assert.Equal(t, tt.expectedKind, info.Kind)
// Verify GVR follows Kubernetes conventions
assert.Equal(t, Group, info.GVR.Group)
assert.Equal(t, Version, info.GVR.Version)
// Resource should be lowercase plural of Kind
assert.Equal(t, strings.ToLower(info.Kind)+"s", info.GVR.Resource)
})
}
}
func TestDefinitionTypeMapCompleteness(t *testing.T) {
// Ensure all expected definition types are in the map
expectedTypes := []reflect.Type{
reflect.TypeOf(ComponentDefinition{}),
reflect.TypeOf(TraitDefinition{}),
reflect.TypeOf(PolicyDefinition{}),
reflect.TypeOf(WorkflowStepDefinition{}),
}
assert.Equal(t, len(expectedTypes), len(DefinitionTypeMap), "DefinitionTypeMap should contain exactly %d entries", len(expectedTypes))
for _, expectedType := range expectedTypes {
_, ok := DefinitionTypeMap[expectedType]
assert.Truef(t, ok, "DefinitionTypeMap should contain %v", expectedType)
}
}
func TestDefinitionKindValues(t *testing.T) {
// Verify that the Kind values match the actual type names
tests := []struct {
defType interface{}
expectedKind string
}{
{ComponentDefinition{}, "ComponentDefinition"},
{TraitDefinition{}, "TraitDefinition"},
{PolicyDefinition{}, "PolicyDefinition"},
{WorkflowStepDefinition{}, "WorkflowStepDefinition"},
}
for _, tt := range tests {
t.Run(tt.expectedKind, func(t *testing.T) {
actualKind := reflect.TypeOf(tt.defType).Name()
assert.Equal(t, tt.expectedKind, actualKind)
// Also verify it matches what's in the map
info, ok := DefinitionTypeMap[reflect.TypeOf(tt.defType)]
assert.True(t, ok)
assert.Equal(t, tt.expectedKind, info.Kind)
})
}
}

View File

@@ -32,7 +32,6 @@ import (
"github.com/kubevela/pkg/util/compression"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/apis/interfaces"
velatypes "github.com/oam-dev/kubevela/apis/types"
"github.com/oam-dev/kubevela/pkg/oam"
velaerr "github.com/oam-dev/kubevela/pkg/utils/errors"
@@ -53,8 +52,7 @@ type ResourceTracker struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ResourceTrackerSpec `json:"spec,omitempty"`
Status ResourceTrackerStatus `json:"status,omitempty"`
Spec ResourceTrackerSpec `json:"spec,omitempty"`
}
// ResourceTrackerType defines the type of resourceTracker
@@ -140,7 +138,7 @@ type ManagedResource struct {
}
// Equal check if two managed resource equals
func (in ManagedResource) Equal(r ManagedResource) bool {
func (in *ManagedResource) Equal(r ManagedResource) bool {
if !in.ClusterObjectReference.Equal(r.ClusterObjectReference) {
return false
}
@@ -151,7 +149,7 @@ func (in ManagedResource) Equal(r ManagedResource) bool {
}
// DisplayName readable name for locating resource
func (in ManagedResource) DisplayName() string {
func (in *ManagedResource) DisplayName() string {
s := in.Kind + " " + in.Name
if in.Namespace != "" || in.Cluster != "" {
s += " ("
@@ -170,12 +168,12 @@ func (in ManagedResource) DisplayName() string {
}
// NamespacedName namespacedName
func (in ManagedResource) NamespacedName() types.NamespacedName {
func (in *ManagedResource) NamespacedName() types.NamespacedName {
return types.NamespacedName{Namespace: in.Namespace, Name: in.Name}
}
// ResourceKey computes the key for managed resource, resources with the same key points to the same resource
func (in ManagedResource) ResourceKey() string {
func (in *ManagedResource) ResourceKey() string {
group := in.GroupVersionKind().Group
kind := in.GroupVersionKind().Kind
cluster := in.Cluster
@@ -186,12 +184,12 @@ func (in ManagedResource) ResourceKey() string {
}
// ComponentKey computes the key for the component which managed resource belongs to
func (in ManagedResource) ComponentKey() string {
return strings.Join([]string{in.Env, in.Component}, "/")
func (in *ManagedResource) ComponentKey() string {
return strings.Join([]string{in.Cluster, in.Component}, "/")
}
// UnmarshalTo unmarshal ManagedResource into target object
func (in ManagedResource) UnmarshalTo(obj interface{}) error {
func (in *ManagedResource) UnmarshalTo(obj interface{}) error {
if in.Data == nil || in.Data.Raw == nil {
return velaerr.ManagedResourceHasNoDataError{}
}
@@ -199,7 +197,7 @@ func (in ManagedResource) UnmarshalTo(obj interface{}) error {
}
// ToUnstructured converts managed resource into unstructured
func (in ManagedResource) ToUnstructured() *unstructured.Unstructured {
func (in *ManagedResource) ToUnstructured() *unstructured.Unstructured {
obj := &unstructured.Unstructured{}
obj.SetGroupVersionKind(in.GroupVersionKind())
obj.SetName(in.Name)
@@ -211,7 +209,7 @@ func (in ManagedResource) ToUnstructured() *unstructured.Unstructured {
}
// ToUnstructuredWithData converts managed resource into unstructured and unmarshal data
func (in ManagedResource) ToUnstructuredWithData() (*unstructured.Unstructured, error) {
func (in *ManagedResource) ToUnstructuredWithData() (*unstructured.Unstructured, error) {
obj := in.ToUnstructured()
if err := in.UnmarshalTo(obj); err != nil {
if errors.Is(err, velaerr.ManagedResourceHasNoDataError{}) {
@@ -221,13 +219,6 @@ func (in ManagedResource) ToUnstructuredWithData() (*unstructured.Unstructured,
return obj, nil
}
// ResourceTrackerStatus define the status of resourceTracker
// For backward-compatibility
type ResourceTrackerStatus struct {
// Deprecated
TrackedResources []common.ClusterObjectReference `json:"trackedResources,omitempty"`
}
// +kubebuilder:object:root=true
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
@@ -325,29 +316,3 @@ func (in *ResourceTracker) DeleteManagedResource(rsc client.Object, remove bool)
}
return true
}
// addClusterObjectReference
// Deprecated
func (in *ResourceTracker) addClusterObjectReference(ref common.ClusterObjectReference) bool {
for _, _rsc := range in.Status.TrackedResources {
if _rsc.Equal(ref) {
return true
}
}
in.Status.TrackedResources = append(in.Status.TrackedResources, ref)
return false
}
// AddTrackedResource add new object reference into tracked resources, return if already exists
// Deprecated
func (in *ResourceTracker) AddTrackedResource(rsc interfaces.TrackableResource) bool {
return in.addClusterObjectReference(common.ClusterObjectReference{
ObjectReference: corev1.ObjectReference{
APIVersion: rsc.GetAPIVersion(),
Kind: rsc.GetKind(),
Name: rsc.GetName(),
Namespace: rsc.GetNamespace(),
UID: rsc.GetUID(),
},
})
}

View File

@@ -31,7 +31,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
"github.com/oam-dev/kubevela/pkg/oam"
@@ -124,17 +124,16 @@ func TestManagedResourceKeys(t *testing.T) {
},
},
OAMObjectReference: common.OAMObjectReference{
Env: "env",
Component: "component",
Trait: "trait",
},
}
r.Equal("namespace/name", input.NamespacedName().String())
r.Equal("apps/Deployment/cluster/namespace/name", input.ResourceKey())
r.Equal("env/component", input.ComponentKey())
r.Equal("cluster/component", input.ComponentKey())
r.Equal("Deployment name (Cluster: cluster, Namespace: namespace)", input.DisplayName())
var deploy1, deploy2 appsv1.Deployment
deploy1.Spec.Replicas = pointer.Int32(5)
deploy1.Spec.Replicas = ptr.To(int32(5))
bs, err := json.Marshal(deploy1)
r.NoError(err)
r.ErrorIs(input.UnmarshalTo(&deploy2), errors.ManagedResourceHasNoDataError{})
@@ -169,7 +168,7 @@ func TestResourceTracker_ManagedResource(t *testing.T) {
pod3 := corev1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "pod3"}}
input.AddManagedResource(&pod3, false, false, "")
r.Equal(3, len(input.Spec.ManagedResources))
deploy1.Spec.Replicas = pointer.Int32(5)
deploy1.Spec.Replicas = ptr.To(int32(5))
input.AddManagedResource(&deploy1, false, false, "")
r.Equal(3, len(input.Spec.ManagedResources))
input.DeleteManagedResource(&cm2, false)
@@ -200,15 +199,11 @@ func TestResourceTrackerCompression(t *testing.T) {
"../../../charts/vela-core/crds/core.oam.dev_applicationrevisions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_applications.yaml",
"../../../charts/vela-core/crds/core.oam.dev_definitionrevisions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_healthscopes.yaml",
"../../../charts/vela-core/crds/core.oam.dev_traitdefinitions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_componentdefinitions.yaml",
"../../../charts/vela-core/crds/core.oam.dev_workloaddefinitions.yaml",
"../../../charts/vela-core/crds/standard.oam.dev_rollouts.yaml",
"../../../charts/vela-core/templates/kubevela-controller.yaml",
"../../../charts/vela-core/README.md",
"../../../pkg/velaql/providers/query/testdata/machinelearning.seldon.io_seldondeployments.yaml",
"../../../legacy/charts/vela-core-legacy/crds/standard.oam.dev_podspecworkloads.yaml",
"../../../pkg/workflow/providers/legacy/query/testdata/machinelearning.seldon.io_seldondeployments.yaml",
}
for _, p := range paths {
b, err := os.ReadFile(p)

View File

@@ -33,6 +33,9 @@ type WorkflowStepDefinitionSpec struct {
// Only CUE schematic is supported for now.
// +optional
Schematic *common.Schematic `json:"schematic,omitempty"`
// +optional
Version string `json:"version,omitempty"`
}
// WorkflowStepDefinitionStatus is the status of WorkflowStepDefinition

View File

@@ -1,8 +1,7 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 2021 The KubeVela Authors.
Copyright 2023 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -22,8 +21,7 @@ limitations under the License.
package v1beta1
import (
"github.com/kubevela/workflow/api/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/kubevela/pkg/apis/oam/v1alpha1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
@@ -148,7 +146,8 @@ func (in *ApplicationRevisionCompressibleFields) DeepCopyInto(out *ApplicationRe
if val == nil {
(*out)[key] = nil
} else {
in, out := &val, &outVal
inVal := (*in)[key]
in, out := &inVal, &outVal
*out = new(ComponentDefinition)
(*in).DeepCopyInto(*out)
}
@@ -170,20 +169,14 @@ func (in *ApplicationRevisionCompressibleFields) DeepCopyInto(out *ApplicationRe
if val == nil {
(*out)[key] = nil
} else {
in, out := &val, &outVal
inVal := (*in)[key]
in, out := &inVal, &outVal
*out = new(TraitDefinition)
(*in).DeepCopyInto(*out)
}
(*out)[key] = outVal
}
}
if in.ScopeDefinitions != nil {
in, out := &in.ScopeDefinitions, &out.ScopeDefinitions
*out = make(map[string]ScopeDefinition, len(*in))
for key, val := range *in {
(*out)[key] = *val.DeepCopy()
}
}
if in.PolicyDefinitions != nil {
in, out := &in.PolicyDefinitions, &out.PolicyDefinitions
*out = make(map[string]PolicyDefinition, len(*in))
@@ -199,20 +192,14 @@ func (in *ApplicationRevisionCompressibleFields) DeepCopyInto(out *ApplicationRe
if val == nil {
(*out)[key] = nil
} else {
in, out := &val, &outVal
inVal := (*in)[key]
in, out := &inVal, &outVal
*out = new(WorkflowStepDefinition)
(*in).DeepCopyInto(*out)
}
(*out)[key] = outVal
}
}
if in.ScopeGVK != nil {
in, out := &in.ScopeGVK, &out.ScopeGVK
*out = make(map[string]v1.GroupVersionKind, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.Policies != nil {
in, out := &in.Policies, &out.Policies
*out = make(map[string]core_oam_devv1alpha1.Policy, len(*in))
@@ -565,6 +552,22 @@ func (in *DefinitionRevisionSpec) DeepCopy() *DefinitionRevisionSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DefinitionTypeInfo) DeepCopyInto(out *DefinitionTypeInfo) {
*out = *in
out.GVR = in.GVR
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DefinitionTypeInfo.
func (in *DefinitionTypeInfo) DeepCopy() *DefinitionTypeInfo {
if in == nil {
return nil
}
out := new(DefinitionTypeInfo)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ManagedResource) DeepCopyInto(out *ManagedResource) {
*out = *in
@@ -694,7 +697,6 @@ func (in *ResourceTracker) DeepCopyInto(out *ResourceTracker) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceTracker.
@@ -786,105 +788,6 @@ func (in *ResourceTrackerSpec) DeepCopy() *ResourceTrackerSpec {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceTrackerStatus) DeepCopyInto(out *ResourceTrackerStatus) {
*out = *in
if in.TrackedResources != nil {
in, out := &in.TrackedResources, &out.TrackedResources
*out = make([]common.ClusterObjectReference, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceTrackerStatus.
func (in *ResourceTrackerStatus) DeepCopy() *ResourceTrackerStatus {
if in == nil {
return nil
}
out := new(ResourceTrackerStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ScopeDefinition) DeepCopyInto(out *ScopeDefinition) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScopeDefinition.
func (in *ScopeDefinition) DeepCopy() *ScopeDefinition {
if in == nil {
return nil
}
out := new(ScopeDefinition)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ScopeDefinition) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ScopeDefinitionList) DeepCopyInto(out *ScopeDefinitionList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ScopeDefinition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScopeDefinitionList.
func (in *ScopeDefinitionList) DeepCopy() *ScopeDefinitionList {
if in == nil {
return nil
}
out := new(ScopeDefinitionList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ScopeDefinitionList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ScopeDefinitionSpec) DeepCopyInto(out *ScopeDefinitionSpec) {
*out = *in
out.Reference = in.Reference
if in.Extension != nil {
in, out := &in.Extension, &out.Extension
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScopeDefinitionSpec.
func (in *ScopeDefinitionSpec) DeepCopy() *ScopeDefinitionSpec {
if in == nil {
return nil
}
out := new(ScopeDefinitionSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TraitDefinition) DeepCopyInto(out *TraitDefinition) {
*out = *in

View File

@@ -25,10 +25,6 @@ limitations under the License.
// Generate deepcopy methodsets and CRD manifests
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:crdVersions=v1,generateEmbeddedObjectMeta=true output:artifacts:config=../config/crd/base
// Generate legacy_support for K8s 1.12~1.15 versions CRD manifests
//go:generate go run -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen object:headerFile=../hack/boilerplate.go.txt paths=./... crd:generateEmbeddedObjectMeta=true output:artifacts:config=../legacy/charts/vela-core-legacy/crds
//go:generate go run ../legacy/convert/main.go ../legacy/charts/vela-core-legacy/crds
package apis
import (

View File

@@ -1,35 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package interfaces
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)
// ObjectOwner is the interface for get and set ownerReference
type ObjectOwner interface {
GetOwnerReferences() []metav1.OwnerReference
SetOwnerReferences([]metav1.OwnerReference)
}
// TrackableResource is the interface for resources to be tracked by resourcetracker
type TrackableResource interface {
client.Object
metav1.Type
ObjectOwner
}

View File

@@ -1,43 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package v1alpha1 contains API Schema definitions for the standard v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=standard.oam.dev
package v1alpha1
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)
const (
// GroupName of the CRDs
GroupName = "standard.oam.dev"
// Version of the group of CRDs
Version = "v1alpha1"
)
var (
// SchemeGroupVersion is group version used to register these objects
SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version}
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)

View File

@@ -1,285 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/intstr"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
)
// RolloutStrategyType defines strategies for pods rollout
type RolloutStrategyType string
const (
// IncreaseFirstRolloutStrategyType indicates that we increase the target resources first
IncreaseFirstRolloutStrategyType RolloutStrategyType = "IncreaseFirst"
// DecreaseFirstRolloutStrategyType indicates that we decrease the source resources first
DecreaseFirstRolloutStrategyType RolloutStrategyType = "DecreaseFirst"
)
// HookType can be pre, post or during rollout
type HookType string
const (
// InitializeRolloutHook execute webhook during the rollout initializing phase
InitializeRolloutHook HookType = "initialize-rollout"
// PreBatchRolloutHook execute webhook before each batch rollout
PreBatchRolloutHook HookType = "pre-batch-rollout"
// PostBatchRolloutHook execute webhook after each batch rollout
PostBatchRolloutHook HookType = "post-batch-rollout"
// FinalizeRolloutHook execute the webhook during the rollout finalizing phase
FinalizeRolloutHook HookType = "finalize-rollout"
)
// RollingState is the overall rollout state
type RollingState string
const (
// LocatingTargetAppState indicates that the rollout is in the stage of locating target app
// we use this state to make sure we special handle the target app successfully only once
LocatingTargetAppState RollingState = "locatingTargetApp"
// VerifyingSpecState indicates that the rollout is in the stage of verifying the rollout settings
// and the controller can locate both the target and the source
VerifyingSpecState RollingState = "verifyingSpec"
// InitializingState indicates that the rollout is initializing all the new resources
InitializingState RollingState = "initializing"
// RollingInBatchesState indicates that the rollout starts rolling
RollingInBatchesState RollingState = "rollingInBatches"
// FinalisingState indicates that the rollout is finalizing, possibly clean up the old resources, adjust traffic
FinalisingState RollingState = "finalising"
// RolloutFailingState indicates that the rollout is failing
// one needs to finalize it before mark it as failed by cleaning up the old resources, adjust traffic
RolloutFailingState RollingState = "rolloutFailing"
// RolloutSucceedState indicates that rollout successfully completed to match the desired target state
RolloutSucceedState RollingState = "rolloutSucceed"
// RolloutAbandoningState indicates that the rollout is being abandoned
// we need to finalize it by cleaning up the old resources, adjust traffic and return control back to its owner
RolloutAbandoningState RollingState = "rolloutAbandoning"
// RolloutDeletingState indicates that the rollout is being deleted
// we need to finalize it by cleaning up the old resources, adjust traffic and return control back to its owner
RolloutDeletingState RollingState = "RolloutDeletingState"
// RolloutFailedState indicates that rollout is failed, the target replica is not reached
// we can not move forward anymore, we will let the client to decide when or whether to revert.
RolloutFailedState RollingState = "rolloutFailed"
)
// BatchRollingState is the sub state when the rollout is on the fly
type BatchRollingState string
const (
// BatchInitializingState still rolling the batch, the batch rolling is not completed yet
BatchInitializingState BatchRollingState = "batchInitializing"
// BatchInRollingState still rolling the batch, the batch rolling is not completed yet
BatchInRollingState BatchRollingState = "batchInRolling"
// BatchVerifyingState verifying if the application is ready to roll.
BatchVerifyingState BatchRollingState = "batchVerifying"
// BatchRolloutFailedState indicates that the batch didn't get the manual or automatic approval
BatchRolloutFailedState BatchRollingState = "batchVerifyFailed"
// BatchFinalizingState indicates that all the pods in the are available, we can move on to the next batch
BatchFinalizingState BatchRollingState = "batchFinalizing"
// BatchReadyState indicates that all the pods in the are upgraded and its state is ready
BatchReadyState BatchRollingState = "batchReady"
)
// RolloutPlan fines the details of the rollout plan
type RolloutPlan struct {
// RolloutStrategy defines strategies for the rollout plan
// The default is IncreaseFirstRolloutStrategyType
// +optional
RolloutStrategy RolloutStrategyType `json:"rolloutStrategy,omitempty"`
// The size of the target resource. The default is the same
// as the size of the source resource.
// +optional
TargetSize *int32 `json:"targetSize,omitempty"`
// The number of batches, default = 1
// +optional
NumBatches *int32 `json:"numBatches,omitempty"`
// The exact distribution among batches.
// its size has to be exactly the same as the NumBatches (if set)
// The total number cannot exceed the targetSize or the size of the source resource
// We will IGNORE the last batch's replica field if it's a percentage since round errors can lead to inaccurate sum
// We highly recommend to leave the last batch's replica field empty
// +optional
RolloutBatches []RolloutBatch `json:"rolloutBatches,omitempty"`
// All pods in the batches up to the batchPartition (included) will have
// the target resource specification while the rest still have the source resource
// This is designed for the operators to manually rollout
// Default is the the number of batches which will rollout all the batches
// +optional
BatchPartition *int32 `json:"batchPartition,omitempty"`
// Paused the rollout, default is false
// +optional
Paused bool `json:"paused,omitempty"`
// RolloutWebhooks provide a way for the rollout to interact with an external process
// +optional
RolloutWebhooks []RolloutWebhook `json:"rolloutWebhooks,omitempty"`
// CanaryMetric provides a way for the rollout process to automatically check certain metrics
// before complete the process
// +optional
CanaryMetric []CanaryMetric `json:"canaryMetric,omitempty"`
}
// RolloutBatch is used to describe how the each batch rollout should be
type RolloutBatch struct {
// Replicas is the number of pods to upgrade in this batch
// it can be an absolute number (ex: 5) or a percentage of total pods
// we will ignore the percentage of the last batch to just fill the gap
// +optional
// it is mutually exclusive with the PodList field
Replicas intstr.IntOrString `json:"replicas,omitempty"`
// The list of Pods to get upgraded
// +optional
// it is mutually exclusive with the Replicas field
PodList []string `json:"podList,omitempty"`
// MaxUnavailable is the max allowed number of pods that is unavailable
// during the upgrade. We will mark the batch as ready as long as there are less
// or equal number of pods unavailable than this number.
// default = 0
// +optional
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
// The wait time, in seconds, between instances upgrades, default = 0
// +optional
InstanceInterval *int32 `json:"instanceInterval,omitempty"`
// RolloutWebhooks provides a way for the batch rollout to interact with an external process
// +optional
BatchRolloutWebhooks []RolloutWebhook `json:"batchRolloutWebhooks,omitempty"`
// CanaryMetric provides a way for the batch rollout process to automatically check certain metrics
// before moving to the next batch
// +optional
CanaryMetric []CanaryMetric `json:"canaryMetric,omitempty"`
}
// RolloutWebhook holds the reference to external checks used for canary analysis
type RolloutWebhook struct {
// Type of this webhook
Type HookType `json:"type"`
// Name of this webhook
Name string `json:"name"`
// URL address of this webhook
URL string `json:"url"`
// Method the HTTP call method, default is POST
Method string `json:"method,omitempty"`
// ExpectedStatus contains all the expected http status code that we will accept as success
ExpectedStatus []int `json:"expectedStatus,omitempty"`
// Metadata (key-value pairs) for this webhook
// +optional
Metadata *map[string]string `json:"metadata,omitempty"`
}
// RolloutWebhookPayload holds the info and metadata sent to webhooks
type RolloutWebhookPayload struct {
// Name of the upgrading resource
Name string `json:"name"`
// Namespace of the upgrading resource
Namespace string `json:"namespace"`
// Phase of the rollout
Phase string `json:"phase"`
// Metadata (key-value pairs) are the extra data send to this webhook
Metadata map[string]string `json:"metadata,omitempty"`
}
// CanaryMetric holds the reference to metrics used for canary analysis
type CanaryMetric struct {
// Name of the metric
Name string `json:"name"`
// Interval represents the windows size
Interval string `json:"interval,omitempty"`
// Range value accepted for this metric
// +optional
MetricsRange *MetricsExpectedRange `json:"metricsRange,omitempty"`
// TemplateRef references a metric template object
// +optional
TemplateRef *corev1.ObjectReference `json:"templateRef,omitempty"`
}
// MetricsExpectedRange defines the range used for metrics validation
type MetricsExpectedRange struct {
// Minimum value
// +optional
Min *intstr.IntOrString `json:"min,omitempty"`
// Maximum value
// +optional
Max *intstr.IntOrString `json:"max,omitempty"`
}
// RolloutStatus defines the observed state of a rollout plan
type RolloutStatus struct {
// Conditions represents the latest available observations of a CloneSet's current state.
condition.ConditionedStatus `json:",inline"`
// RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification
// and does not change until the rollout is restarted
RolloutOriginalSize int32 `json:"rolloutOriginalSize,omitempty"`
// RolloutTargetSize is the size of the target resources. This is determined once the initial spec verification
// and does not change until the rollout is restarted
RolloutTargetSize int32 `json:"rolloutTargetSize,omitempty"`
// NewPodTemplateIdentifier is a string that uniquely represent the new pod template
// each workload type could use different ways to identify that so we cannot compare between resources
NewPodTemplateIdentifier string `json:"targetGeneration,omitempty"`
// lastAppliedPodTemplateIdentifier is a string that uniquely represent the last pod template
// each workload type could use different ways to identify that so we cannot compare between resources
// We update this field only after a successful rollout
LastAppliedPodTemplateIdentifier string `json:"lastAppliedPodTemplateIdentifier,omitempty"`
// RollingState is the Rollout State
RollingState RollingState `json:"rollingState"`
// BatchRollingState only meaningful when the Status is rolling
// +optional
BatchRollingState BatchRollingState `json:"batchRollingState"`
// The current batch the rollout is working on/blocked
// it starts from 0
CurrentBatch int32 `json:"currentBatch"`
// UpgradedReplicas is the number of Pods upgraded by the rollout controller
UpgradedReplicas int32 `json:"upgradedReplicas"`
// UpgradedReadyReplicas is the number of Pods upgraded by the rollout controller that have a Ready Condition.
UpgradedReadyReplicas int32 `json:"upgradedReadyReplicas"`
}

View File

@@ -1,430 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
"fmt"
"time"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
)
// RolloutEvent is used to describe the events during rollout
type RolloutEvent string
const (
// RollingFailedEvent indicates that we encountered an unexpected error during upgrading and can't be retried
RollingFailedEvent RolloutEvent = "RollingFailedEvent"
// RollingRetriableFailureEvent indicates that we encountered an unexpected but retriable error
RollingRetriableFailureEvent RolloutEvent = "RollingRetriableFailureEvent"
// AppLocatedEvent indicates that apps are located successfully
AppLocatedEvent RolloutEvent = "AppLocatedEvent"
// RollingModifiedEvent indicates that the rolling target or source has changed
RollingModifiedEvent RolloutEvent = "RollingModifiedEvent"
// RollingDeletedEvent indicates that the rolling is being deleted
RollingDeletedEvent RolloutEvent = "RollingDeletedEvent"
// RollingSpecVerifiedEvent indicates that we have successfully verified that the rollout spec
RollingSpecVerifiedEvent RolloutEvent = "RollingSpecVerifiedEvent"
// RollingInitializedEvent indicates that we have finished initializing all the workload resources
RollingInitializedEvent RolloutEvent = "RollingInitializedEvent"
// AllBatchFinishedEvent indicates that all batches are upgraded
AllBatchFinishedEvent RolloutEvent = "AllBatchFinishedEvent"
// RollingFinalizedEvent indicates that we have finalized the rollout which includes but not
// limited to the resource garbage collection
RollingFinalizedEvent RolloutEvent = "AllBatchFinishedEvent"
// InitializedOneBatchEvent indicates that we have successfully rolled out one batch
InitializedOneBatchEvent RolloutEvent = "InitializedOneBatchEvent"
// FinishedOneBatchEvent indicates that we have successfully rolled out one batch
FinishedOneBatchEvent RolloutEvent = "FinishedOneBatchEvent"
// RolloutOneBatchEvent indicates that we have rollout one batch
RolloutOneBatchEvent RolloutEvent = "RolloutOneBatchEvent"
// OneBatchAvailableEvent indicates that the batch resource is considered available
// this events comes after we have examine the pod readiness check and traffic shifting if needed
OneBatchAvailableEvent RolloutEvent = "OneBatchAvailable"
// BatchRolloutApprovedEvent indicates that we got the approval manually
BatchRolloutApprovedEvent RolloutEvent = "BatchRolloutApprovedEvent"
// BatchRolloutFailedEvent indicates that we are waiting for the approval of the
BatchRolloutFailedEvent RolloutEvent = "BatchRolloutFailedEvent"
)
// These are valid conditions of the rollout.
const (
// RolloutSpecVerifying indicates that the rollout just started with verification
RolloutSpecVerifying condition.ConditionType = "RolloutSpecVerifying"
// RolloutInitializing means we start to initialize the cluster
RolloutInitializing condition.ConditionType = "RolloutInitializing"
// RolloutInProgress means we are upgrading resources.
RolloutInProgress condition.ConditionType = "RolloutInProgress"
// RolloutFinalizing means the rollout is finalizing
RolloutFinalizing condition.ConditionType = "RolloutFinalizing"
// RolloutFailing means the rollout is failing
RolloutFailing condition.ConditionType = "RolloutFailing"
// RolloutAbandoning means that the rollout is being abandoned.
RolloutAbandoning condition.ConditionType = "RolloutAbandoning"
// RolloutDeleting means that the rollout is being deleted.
RolloutDeleting condition.ConditionType = "RolloutDeleting"
// RolloutFailed means that the rollout failed.
RolloutFailed condition.ConditionType = "RolloutFailed"
// RolloutSucceed means that the rollout is done.
RolloutSucceed condition.ConditionType = "RolloutSucceed"
// BatchInitializing
BatchInitializing condition.ConditionType = "BatchInitializing"
// BatchPaused
BatchPaused condition.ConditionType = "BatchPaused"
// BatchVerifying
BatchVerifying condition.ConditionType = "BatchVerifying"
// BatchRolloutFailed
BatchRolloutFailed condition.ConditionType = "BatchRolloutFailed"
// BatchFinalizing
BatchFinalizing condition.ConditionType = "BatchFinalizing"
// BatchReady
BatchReady condition.ConditionType = "BatchReady"
)
// NewPositiveCondition creates a positive condition type
func NewPositiveCondition(condType condition.ConditionType) condition.Condition {
return condition.Condition{
Type: condType,
Status: v1.ConditionTrue,
LastTransitionTime: metav1.NewTime(time.Now()),
}
}
// NewNegativeCondition creates a false condition type
func NewNegativeCondition(condType condition.ConditionType, message string) condition.Condition {
return condition.Condition{
Type: condType,
Status: v1.ConditionFalse,
LastTransitionTime: metav1.NewTime(time.Now()),
Message: message,
}
}
const invalidRollingStateTransition = "the rollout state transition from `%s` state with `%s` is invalid"
const invalidBatchRollingStateTransition = "the batch rolling state transition from `%s` state with `%s` is invalid"
func (r *RolloutStatus) getRolloutConditionType() condition.ConditionType {
// figure out which condition type should we put in the condition depends on its state
switch r.RollingState {
case VerifyingSpecState:
return RolloutSpecVerifying
case InitializingState:
return RolloutInitializing
case RollingInBatchesState:
switch r.BatchRollingState {
case BatchInitializingState:
return BatchInitializing
case BatchVerifyingState:
return BatchVerifying
case BatchFinalizingState:
return BatchFinalizing
case BatchRolloutFailedState:
return BatchRolloutFailed
case BatchReadyState:
return BatchReady
default:
return RolloutInProgress
}
case FinalisingState:
return RolloutFinalizing
case RolloutFailingState:
return RolloutFailing
case RolloutAbandoningState:
return RolloutAbandoning
case RolloutDeletingState:
return RolloutDeleting
case RolloutSucceedState:
return RolloutSucceed
default:
return RolloutFailed
}
}
// RolloutRetry is a special state transition since we need an error message
func (r *RolloutStatus) RolloutRetry(reason string) {
// we can still retry, no change on the state
r.SetConditions(NewNegativeCondition(r.getRolloutConditionType(), reason))
}
// RolloutFailed is a special state transition since we need an error message
func (r *RolloutStatus) RolloutFailed(reason string) {
// set the condition first which depends on the state
r.SetConditions(NewNegativeCondition(r.getRolloutConditionType(), reason))
r.RollingState = RolloutFailedState
}
// RolloutFailing is a special state transition that always moves the rollout state to the failing state
func (r *RolloutStatus) RolloutFailing(reason string) {
// set the condition first which depends on the state
r.SetConditions(NewNegativeCondition(r.getRolloutConditionType(), reason))
r.RollingState = RolloutFailingState
r.BatchRollingState = BatchInitializingState
}
// ResetStatus resets the status of the rollout to start from beginning
func (r *RolloutStatus) ResetStatus() {
r.NewPodTemplateIdentifier = ""
r.RolloutTargetSize = -1
r.LastAppliedPodTemplateIdentifier = ""
r.RollingState = LocatingTargetAppState
r.BatchRollingState = BatchInitializingState
r.CurrentBatch = 0
r.UpgradedReplicas = 0
r.UpgradedReadyReplicas = 0
}
// SetRolloutCondition sets the supplied condition, replacing any existing condition
// of the same type unless they are identical.
func (r *RolloutStatus) SetRolloutCondition(new condition.Condition) {
exists := false
for i, existing := range r.Conditions {
if existing.Type != new.Type {
continue
}
// we want to update the condition when the LTT changes
if existing.Type == new.Type &&
existing.Status == new.Status &&
existing.Reason == new.Reason &&
existing.Message == new.Message &&
existing.LastTransitionTime == new.LastTransitionTime {
exists = true
continue
}
r.Conditions[i] = new
exists = true
}
if !exists {
r.Conditions = append(r.Conditions, new)
}
}
// we can't panic since it will crash the other controllers
func (r *RolloutStatus) illegalStateTransition(err error) {
r.RolloutFailed(err.Error())
}
// StateTransition is the center place to do rollout state transition
// it returns an error if the transition is invalid
// it changes the coming rollout state if it's valid
func (r *RolloutStatus) StateTransition(event RolloutEvent) {
rollingState := r.RollingState
batchRollingState := r.BatchRollingState
defer func() {
klog.InfoS("try to execute a rollout state transition",
"pre rolling state", rollingState,
"pre batch rolling state", batchRollingState,
"post rolling state", r.RollingState,
"post batch rolling state", r.BatchRollingState)
}()
// we have special transition for these types of event since they require additional info
if event == RollingFailedEvent || event == RollingRetriableFailureEvent {
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
return
}
// special handle modified event here
if event == RollingModifiedEvent {
if r.RollingState == RolloutDeletingState {
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
return
}
if r.RollingState == RolloutFailedState || r.RollingState == RolloutSucceedState {
r.ResetStatus()
} else {
r.SetRolloutCondition(NewNegativeCondition(r.getRolloutConditionType(), "Rollout Spec is modified"))
r.RollingState = RolloutAbandoningState
r.BatchRollingState = BatchInitializingState
}
return
}
// special handle deleted event here, it can happen at many states
if event == RollingDeletedEvent {
if r.RollingState == RolloutFailedState || r.RollingState == RolloutSucceedState {
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
return
}
r.SetRolloutCondition(NewNegativeCondition(r.getRolloutConditionType(), "Rollout is being deleted"))
r.RollingState = RolloutDeletingState
r.BatchRollingState = BatchInitializingState
return
}
// special handle appLocatedEvent event here, it only applies to one state but it's legal to happen at other states
if event == AppLocatedEvent {
if r.RollingState == LocatingTargetAppState {
r.RollingState = VerifyingSpecState
}
return
}
switch rollingState {
case VerifyingSpecState:
if event == RollingSpecVerifiedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.RollingState = InitializingState
return
}
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case InitializingState:
if event == RollingInitializedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.RollingState = RollingInBatchesState
r.BatchRollingState = BatchInitializingState
return
}
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RollingInBatchesState:
r.batchStateTransition(event)
return
case RolloutAbandoningState:
if event == RollingFinalizedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.ResetStatus()
return
}
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RolloutDeletingState:
if event == RollingFinalizedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.RollingState = RolloutFailedState
return
}
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case FinalisingState:
if event == RollingFinalizedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.RollingState = RolloutSucceedState
return
}
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RolloutFailingState:
if event == RollingFinalizedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.RollingState = RolloutFailedState
return
}
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
case RolloutSucceedState, RolloutFailedState:
r.illegalStateTransition(fmt.Errorf(invalidRollingStateTransition, rollingState, event))
default:
r.illegalStateTransition(fmt.Errorf("invalid rolling state %s before transition", rollingState))
}
}
// batchStateTransition handles the state transition when the rollout is in action
func (r *RolloutStatus) batchStateTransition(event RolloutEvent) {
batchRollingState := r.BatchRollingState
if event == BatchRolloutFailedEvent {
r.BatchRollingState = BatchRolloutFailedState
r.RollingState = RolloutFailedState
r.SetConditions(NewNegativeCondition(r.getRolloutConditionType(), "failed"))
return
}
switch batchRollingState {
case BatchInitializingState:
if event == InitializedOneBatchEvent {
r.BatchRollingState = BatchInRollingState
return
}
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
case BatchInRollingState:
if event == RolloutOneBatchEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.BatchRollingState = BatchVerifyingState
return
}
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
case BatchVerifyingState:
if event == OneBatchAvailableEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.BatchRollingState = BatchFinalizingState
return
}
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
case BatchFinalizingState:
if event == FinishedOneBatchEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.BatchRollingState = BatchReadyState
return
}
if event == AllBatchFinishedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
// transition out of the batch loop
r.BatchRollingState = BatchReadyState
r.RollingState = FinalisingState
return
}
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
case BatchReadyState:
if event == BatchRolloutApprovedEvent {
r.SetRolloutCondition(NewPositiveCondition(r.getRolloutConditionType()))
r.BatchRollingState = BatchInitializingState
r.CurrentBatch++
return
}
r.illegalStateTransition(fmt.Errorf(invalidBatchRollingStateTransition, batchRollingState, event))
default:
r.illegalStateTransition(fmt.Errorf("invalid batch rolling state %s", batchRollingState))
}
}

View File

@@ -1,77 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// Rollout is the Schema for the Rollout API
// +kubebuilder:object:root=true
// +kubebuilder:resource:categories={oam},shortName=rollout
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="TARGET",type=string,JSONPath=`.status.rolloutTargetSize`
// +kubebuilder:printcolumn:name="UPGRADED",type=string,JSONPath=`.status.upgradedReplicas`
// +kubebuilder:printcolumn:name="READY",type=string,JSONPath=`.status.upgradedReadyReplicas`
// +kubebuilder:printcolumn:name="BATCH-STATE",type=string,JSONPath=`.status.batchRollingState`
// +kubebuilder:printcolumn:name="ROLLING-STATE",type=string,JSONPath=`.status.rollingState`
// +kubebuilder:printcolumn:name="AGE",type=date,JSONPath=".metadata.creationTimestamp"
type Rollout struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec RolloutSpec `json:"spec,omitempty"`
Status CompRolloutStatus `json:"status,omitempty"`
}
// RolloutSpec defines how to describe an update between different compRevision
type RolloutSpec struct {
// TargetRevisionName contains the name of the componentRevisionName that we need to upgrade to.
TargetRevisionName string `json:"targetRevisionName"`
// SourceRevisionName contains the name of the componentRevisionName that we need to upgrade from.
// it can be empty only when it's the first time to deploy the application
SourceRevisionName string `json:"sourceRevisionName,omitempty"`
// ComponentName specify the component name
ComponentName string `json:"componentName"`
// RolloutPlan is the details on how to rollout the resources
RolloutPlan RolloutPlan `json:"rolloutPlan"`
}
// CompRolloutStatus defines the observed state of rollout
type CompRolloutStatus struct {
RolloutStatus `json:",inline"`
// LastUpgradedTargetRevision contains the name of the componentRevisionName that we upgraded to
// We will restart the rollout if this is not the same as the spec
LastUpgradedTargetRevision string `json:"lastTargetRevision"`
// LastSourceRevision contains the name of the componentRevisionName that we need to upgrade from.
// We will restart the rollout if this is not the same as the spec
LastSourceRevision string `json:"LastSourceRevision,omitempty"`
}
// RolloutList contains a list of Rollout
// +kubebuilder:object:root=true
type RolloutList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Rollout `json:"items"`
}

View File

@@ -1,334 +0,0 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by controller-gen. DO NOT EDIT.
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CanaryMetric) DeepCopyInto(out *CanaryMetric) {
*out = *in
if in.MetricsRange != nil {
in, out := &in.MetricsRange, &out.MetricsRange
*out = new(MetricsExpectedRange)
(*in).DeepCopyInto(*out)
}
if in.TemplateRef != nil {
in, out := &in.TemplateRef, &out.TemplateRef
*out = new(v1.ObjectReference)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CanaryMetric.
func (in *CanaryMetric) DeepCopy() *CanaryMetric {
if in == nil {
return nil
}
out := new(CanaryMetric)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CompRolloutStatus) DeepCopyInto(out *CompRolloutStatus) {
*out = *in
in.RolloutStatus.DeepCopyInto(&out.RolloutStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CompRolloutStatus.
func (in *CompRolloutStatus) DeepCopy() *CompRolloutStatus {
if in == nil {
return nil
}
out := new(CompRolloutStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MetricsExpectedRange) DeepCopyInto(out *MetricsExpectedRange) {
*out = *in
if in.Min != nil {
in, out := &in.Min, &out.Min
*out = new(intstr.IntOrString)
**out = **in
}
if in.Max != nil {
in, out := &in.Max, &out.Max
*out = new(intstr.IntOrString)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricsExpectedRange.
func (in *MetricsExpectedRange) DeepCopy() *MetricsExpectedRange {
if in == nil {
return nil
}
out := new(MetricsExpectedRange)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Rollout) DeepCopyInto(out *Rollout) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rollout.
func (in *Rollout) DeepCopy() *Rollout {
if in == nil {
return nil
}
out := new(Rollout)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Rollout) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RolloutBatch) DeepCopyInto(out *RolloutBatch) {
*out = *in
out.Replicas = in.Replicas
if in.PodList != nil {
in, out := &in.PodList, &out.PodList
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.MaxUnavailable != nil {
in, out := &in.MaxUnavailable, &out.MaxUnavailable
*out = new(intstr.IntOrString)
**out = **in
}
if in.InstanceInterval != nil {
in, out := &in.InstanceInterval, &out.InstanceInterval
*out = new(int32)
**out = **in
}
if in.BatchRolloutWebhooks != nil {
in, out := &in.BatchRolloutWebhooks, &out.BatchRolloutWebhooks
*out = make([]RolloutWebhook, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.CanaryMetric != nil {
in, out := &in.CanaryMetric, &out.CanaryMetric
*out = make([]CanaryMetric, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutBatch.
func (in *RolloutBatch) DeepCopy() *RolloutBatch {
if in == nil {
return nil
}
out := new(RolloutBatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RolloutList) DeepCopyInto(out *RolloutList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Rollout, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutList.
func (in *RolloutList) DeepCopy() *RolloutList {
if in == nil {
return nil
}
out := new(RolloutList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *RolloutList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RolloutPlan) DeepCopyInto(out *RolloutPlan) {
*out = *in
if in.TargetSize != nil {
in, out := &in.TargetSize, &out.TargetSize
*out = new(int32)
**out = **in
}
if in.NumBatches != nil {
in, out := &in.NumBatches, &out.NumBatches
*out = new(int32)
**out = **in
}
if in.RolloutBatches != nil {
in, out := &in.RolloutBatches, &out.RolloutBatches
*out = make([]RolloutBatch, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.BatchPartition != nil {
in, out := &in.BatchPartition, &out.BatchPartition
*out = new(int32)
**out = **in
}
if in.RolloutWebhooks != nil {
in, out := &in.RolloutWebhooks, &out.RolloutWebhooks
*out = make([]RolloutWebhook, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.CanaryMetric != nil {
in, out := &in.CanaryMetric, &out.CanaryMetric
*out = make([]CanaryMetric, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutPlan.
func (in *RolloutPlan) DeepCopy() *RolloutPlan {
if in == nil {
return nil
}
out := new(RolloutPlan)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RolloutSpec) DeepCopyInto(out *RolloutSpec) {
*out = *in
in.RolloutPlan.DeepCopyInto(&out.RolloutPlan)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutSpec.
func (in *RolloutSpec) DeepCopy() *RolloutSpec {
if in == nil {
return nil
}
out := new(RolloutSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RolloutStatus) DeepCopyInto(out *RolloutStatus) {
*out = *in
in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutStatus.
func (in *RolloutStatus) DeepCopy() *RolloutStatus {
if in == nil {
return nil
}
out := new(RolloutStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RolloutWebhook) DeepCopyInto(out *RolloutWebhook) {
*out = *in
if in.ExpectedStatus != nil {
in, out := &in.ExpectedStatus, &out.ExpectedStatus
*out = make([]int, len(*in))
copy(*out, *in)
}
if in.Metadata != nil {
in, out := &in.Metadata, &out.Metadata
*out = new(map[string]string)
if **in != nil {
in, out := *in, *out
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutWebhook.
func (in *RolloutWebhook) DeepCopy() *RolloutWebhook {
if in == nil {
return nil
}
out := new(RolloutWebhook)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RolloutWebhookPayload) DeepCopyInto(out *RolloutWebhookPayload) {
*out = *in
if in.Metadata != nil {
in, out := &in.Metadata, &out.Metadata
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutWebhookPayload.
func (in *RolloutWebhookPayload) DeepCopy() *RolloutWebhookPayload {
if in == nil {
return nil
}
out := new(RolloutWebhookPayload)
in.DeepCopyInto(out)
return out
}

View File

@@ -17,13 +17,7 @@ limitations under the License.
package types
import (
"encoding/json"
"cuelang.org/go/cue"
"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/runtime"
"github.com/oam-dev/kubevela/apis/core.oam.dev/common"
)
// Source record the source of Capability
@@ -38,22 +32,6 @@ type CRDInfo struct {
Kind string `json:"kind"`
}
// Chart defines all necessary information to install a whole chart
type Chart struct {
Repo string `json:"repo"`
URL string `json:"url"`
Name string `json:"name"`
Namespace string `json:"namespace,omitempty"`
Version string `json:"version"`
Values map[string]interface{} `json:"values"`
}
// Installation defines the installation method for this Capability, currently only helm is supported
type Installation struct {
Helm Chart `json:"helm"`
// TODO(wonderflow) add raw yaml file support for install capability
}
// CapType defines the type of capability
type CapType string
@@ -64,8 +42,6 @@ const (
TypeWorkload CapType = "workload"
// TypeTrait represents OAM Trait
TypeTrait CapType = "trait"
// TypeScope represent OAM Scope
TypeScope CapType = "scope"
// TypeWorkflowStep represent OAM Workflow
TypeWorkflowStep CapType = "workflowstep"
// TypePolicy represent OAM Policy
@@ -91,10 +67,6 @@ type CapabilityCategory string
const (
TerraformCategory CapabilityCategory = "terraform"
HelmCategory CapabilityCategory = "helm"
KubeCategory CapabilityCategory = "kube"
CUECategory CapabilityCategory = "cue"
)
@@ -111,49 +83,6 @@ type Parameter struct {
JSONType string `json:"jsonType,omitempty"`
}
// SetFlagBy set cli flag from Parameter
func SetFlagBy(flags *pflag.FlagSet, v Parameter) {
name := v.Name
if v.Alias != "" {
name = v.Alias
}
// nolint:exhaustive
switch v.Type {
case cue.IntKind:
var vv int64
switch val := v.Default.(type) {
case int64:
vv = val
case json.Number:
vv, _ = val.Int64()
case int:
vv = int64(val)
case float64:
vv = int64(val)
}
flags.Int64P(name, v.Short, vv, v.Usage)
case cue.StringKind:
flags.StringP(name, v.Short, v.Default.(string), v.Usage)
case cue.BoolKind:
flags.BoolP(name, v.Short, v.Default.(bool), v.Usage)
case cue.NumberKind, cue.FloatKind:
var vv float64
switch val := v.Default.(type) {
case int64:
vv = float64(val)
case json.Number:
vv, _ = val.Float64()
case int:
vv = float64(val)
case float64:
vv = val
}
flags.Float64P(name, v.Short, vv, v.Usage)
default:
// other types not supported yet
}
}
// Capability defines the content of a capability
type Capability struct {
Name string `json:"name"`
@@ -162,7 +91,6 @@ type Capability struct {
CueTemplateURI string `json:"templateURI,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
CrdName string `json:"crdName,omitempty"`
Center string `json:"center,omitempty"`
Status string `json:"status,omitempty"`
Description string `json:"description,omitempty"`
Example string `json:"example,omitempty"`
@@ -176,15 +104,10 @@ type Capability struct {
Namespace string `json:"namespace,omitempty"`
// Plugin Source
Source *Source `json:"source,omitempty"`
CrdInfo *CRDInfo `json:"crdInfo,omitempty"`
Source *Source `json:"source,omitempty"`
// Terraform
TerraformConfiguration string `json:"terraformConfiguration,omitempty"`
ConfigurationType string `json:"configurationType,omitempty"`
Path string `json:"path,omitempty"`
// KubeTemplate
KubeTemplate runtime.RawExtension `json:"kubetemplate,omitempty"`
KubeParameter []common.KubeParameter `json:"kubeparameter,omitempty"`
}

View File

@@ -17,25 +17,17 @@ limitations under the License.
package types
import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)
// ComponentManifest contains resources rendered from an application component.
type ComponentManifest struct {
Name string
Namespace string
RevisionName string
RevisionHash string
ExternalRevision string
// StandardWorkload contains K8s resource generated from "output" block of ComponentDefinition
StandardWorkload *unstructured.Unstructured
// Traits contains both resources generated from "outputs" block of ComponentDefinition and resources generated from TraitDefinition
Traits []*unstructured.Unstructured
Scopes []*corev1.ObjectReference
// PackagedWorkloadResources contain all the workload related resources. It could be a Helm
// Release, Git Repo or anything that can package and run a workload.
PackagedWorkloadResources []*unstructured.Unstructured
PackagedTraitResources map[string][]*unstructured.Unstructured
Name string
Namespace string
RevisionName string
RevisionHash string
// ComponentOutput contains K8s resource generated from "output" block of ComponentDefinition
ComponentOutput *unstructured.Unstructured
// ComponentOutputsAndTraits contains both resources generated from "outputs" block of ComponentDefinition and resources generated from TraitDefinition
ComponentOutputsAndTraits []*unstructured.Unstructured
}

View File

@@ -23,19 +23,14 @@ const (
ReasonPolicyGenerated = "PolicyGenerated"
ReasonRevisoned = "Revisioned"
ReasonApplied = "Applied"
ReasonHealthCheck = "HealthChecked"
ReasonDeployed = "Deployed"
ReasonRollout = "Rollout"
ReasonFailedParse = "FailedParse"
ReasonFailedRender = "FailedRender"
ReasonFailedRevision = "FailedRevision"
ReasonFailedWorkflow = "FailedWorkflow"
ReasonFailedApply = "FailedApply"
ReasonFailedHealthCheck = "FailedHealthCheck"
ReasonFailedStateKeep = "FailedStateKeep"
ReasonFailedGC = "FailedGC"
ReasonFailedRollout = "FailedRollout"
ReasonFailedParse = "FailedParse"
ReasonFailedRevision = "FailedRevision"
ReasonFailedWorkflow = "FailedWorkflow"
ReasonFailedApply = "FailedApply"
ReasonFailedStateKeep = "FailedStateKeep"
ReasonFailedGC = "FailedGC"
)
// event message for Application
@@ -44,16 +39,6 @@ const (
MessageRendered = "Rendered successfully"
MessagePolicyGenerated = "Policy generated successfully"
MessageRevisioned = "Revisioned successfully"
MessageApplied = "Applied successfully"
MessageWorkflowFinished = "Workflow finished"
MessageHealthCheck = "Health checked healthy"
MessageDeployed = "Deployed successfully"
MessageRollout = "Rollout successfully"
MessageFailedParse = "fail to parse application, err: %v"
MessageFailedRender = "fail to render application, err: %v"
MessageFailedRevision = "fail to handle application revision, err: %v"
MessageFailedApply = "fail to apply component, err: %v"
MessageFailedHealthCheck = "fail to health check, err: %v"
MessageFailedGC = "fail to garbage collection, err: %v"
)

View File

@@ -37,9 +37,6 @@ const (
)
var (
// AnnotationClusterAlias the annotation key for cluster alias
AnnotationClusterAlias = config.MetaApiGroupName + "/cluster-alias"
// AnnotationClusterVersion the annotation key for cluster version
AnnotationClusterVersion = config.MetaApiGroupName + "/cluster-version"
)

View File

@@ -1,31 +0,0 @@
/*
Copyright 2021 The KubeVela Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package types
// RollingStatus represents the rollout phases
type RollingStatus string
const (
// RollingTemplating means that the AC is rolling and need template
RollingTemplating RollingStatus = "RollingTemplating"
// RollingTemplated means that the AC is rolling and it already templated
RollingTemplated RollingStatus = "RollingTemplated"
// RollingCompleted means that the AC is the new active revision of the application
RollingCompleted RollingStatus = "RollingCompleted"
// InactiveAfterRollingCompleted means that the AC is the inactive revision after the rolling is finished
InactiveAfterRollingCompleted RollingStatus = "InactiveAfterRollingCompleted"
)

Some files were not shown because too many files have changed in this diff Show More