Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Check App CR creation when CreateInstalledPackage #3970

Merged
merged 1 commit into from Dec 17, 2021

Conversation

antgamdia
Copy link
Contributor

Description of the change

This PR simply adds a polling mechanism (interval/timeouts are harcoded, but could be split out into separate params if required) before sending OK when creating an installed package.

Benefits

Since the App CR has to be created by kapp automatically before something can be considered as "installed", this active wait will ensure the App is present in the cluster; that is, no more UI errors after accessing to the installed view.

Possible drawbacks

Can't think of; I mean, if the App CR is not created... that means something is wrong, so we better catch this error when executing the creation operation.

Applicable issues

Additional information

I want to DRY the tests up. Now we have the whole test suite and know what we need, we can refactor it and reduce the number of lines for creating the data. But it should be a follow-up PR (I've added it as a pending thing in the parent task).

It is possibly my last PR of the year before going on PTO 馃尨 馃槃

Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
@@ -526,6 +527,25 @@ func (s *Server) CreateInstalledPackage(ctx context.Context, request *corev1.Cre
return nil, errorByStatus("create", "PackageInstall", newPkgInstall.Name, err)
}

// TODO(agamez): some seconds should be enough, however, make it configurable
err = wait.PollImmediateWithContext(ctx, time.Second*1, time.Second*5, func(ctx context.Context) (bool, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Let's create a new issue to make the seconds configurable.

@castelblanque
Copy link
Collaborator

It is possibly my last PR of the year before going on PTO 馃尨 馃槃

BTW enjoy your well-deserved holidays!!!

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

Successfully merging this pull request may close these issues.

Installed app not found right after installing a Carvel package
2 participants