-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- generalize installation for all embedded resources - enable blocking on verification - use secrets and https for gitea deployment Signed-off-by: Nima Kaviani <[email protected]>
- Loading branch information
1 parent
1fb23f0
commit 55c3130
Showing
14 changed files
with
987 additions
and
208 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package localbuild | ||
|
||
import ( | ||
"context" | ||
"embed" | ||
|
||
"github.com/cnoe-io/idpbuilder/api/v1alpha1" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
ctrl "sigs.k8s.io/controller-runtime" | ||
) | ||
|
||
const ( | ||
giteaNamespace = "gitea" | ||
) | ||
|
||
//go:embed resources/gitea/k8s/* | ||
var installGiteaFS embed.FS | ||
|
||
func (r LocalbuildReconciler) ReconcileGitea(ctx context.Context, req ctrl.Request, resource *v1alpha1.Localbuild) (ctrl.Result, error) { | ||
gitea := EmbeddedInstallation{ | ||
name: "Gitea", | ||
resourcePath: "resources/gitea/k8s", | ||
resourceFS: installGiteaFS, | ||
namespace: giteaNamespace, | ||
expectedResources: map[string]schema.GroupVersionKind{ | ||
"my-gitea": { | ||
Group: "apps", | ||
Version: "v1", | ||
Kind: "Deployment", | ||
}, | ||
}, | ||
} | ||
|
||
if result, err := gitea.Install(ctx, req, resource, r.Client, r.Scheme); err != nil { | ||
return result, err | ||
} | ||
|
||
resource.Status.GiteaAvailable = true | ||
return ctrl.Result{}, nil | ||
} |
Oops, something went wrong.