-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade Kanister CRDs to v1 from v1beta1 (#927)
* Add CRDs generated by kubebuilder We tried to use kubebuilder to generate the CRDs for go types but that is also not able to process some of the types, for example `BlueprintPhase.Args`, `Phase.Output` becauaes of `interface{}` and `Blueprint.Actions` because of pointer type value. * Correct CRDs * Have CRDs in the go source files as strings * Remove `phases.output` from required fields * Resolve import cycle, refactor PR - Remove required fields from CRDs - Move CR resource names to consts package to resolve import cycle issue - Remove un-nec logging * Fix integration test failure by changing types.go Even though e2e tests were running on my local cluster tests were failing on the kanister CI, and the reason was, when we read blueprint to create blueprint type if a field is not specified in the blueprint, we initialized the type with null for that field and in that case CRD validation failed. This commit tries to fix that by settign `omitemtpy` for those fields. I am thinking if we should add `omitempty` for every field in types.go * Fix unit tests by adding omitemtpy in types.go * Change actionset CRD to have kopiaSnapshot field * Change kopiaSnapshot type to string in actionset crd * Fix integration test failure * Fix controller unit test by adding `KopiaSnapshot` in actionset status * Fix resource unit test failure In the test `ResourceSuite.TestBlueprintClient` we tried to create blueprint with empty actions struct and then tried to make sure that we are able to update the blueprint. And checked actions after update that its not nil. Since we are omitting empty field we are not going to get actions if we pass empty actions, that why I have changed the action to have some values. * Remove un nec CRD manifest * Update CRDs if CRDs are already present in the cluster Per current implementation we were not silently ignoring the error if the CRDs are already present in the cluster. Since we are significantly changing the CRD that wouldn't work for, so this PR updates the CRDs if they are already avaialable. * Address review comments * Correct permissions of controller Dockerfile Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
f33c70c
commit ea5ff6a
Showing
10 changed files
with
579 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.