-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow configuring user namespaces with OpenShift template (#1925)
* feat: Allow configuring user namespaces with OpenShift template Signed-off-by: Anatolii Bazko <[email protected]>
- Loading branch information
Showing
177 changed files
with
23,878 additions
and
2,153 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -466,7 +466,7 @@ | |
| [go.etcd.io/etcd@dd1b699fc4895de8cc23c3cac5a428c37eee384a](https://github.com/etcd-io/etcd.git) | Apache-2.0 | [CQ](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=23592) | | ||
| [github.com/remyoudompheng/bigfft@6a916e37a237384e18eefa3270c09247db1ecf50](https://github.com/remyoudompheng/bigfft.git) | BSD-3-Clause | [CQ](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=23591) | | ||
| [github.com/operator-framework/[email protected]](https://github.com/operator-framework/operator-registry.git) | Apache-2.0 | [CQ](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=23590) | | ||
| [github.com/openshift/api@32369d4db2ada1c1cdb95b99b568a9925e2a4480](https://github.com/openshift/api.git) | Apache-2.0 | [CQ](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=23586) | | ||
| [github.com/openshift/api@88b476f987ed90f7b0e1fdc851859c35161b1ff5](https://github.com/openshift/api.git) | Apache-2.0 | [clearlydefined](https://clearlydefined.io/definitions/git/github/openshift/api/88b476f987ed90f7b0e1fdc851859c35161b1ff5) | | ||
| [github.com/chai2010/gettext-go@c6fed771bfd517099caf0f7a961671fa8ed08723](https://github.com/chai2010/gettext-go.git) | BSD-3-Clause | [CQ](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=23551) | | ||
| [github.com/cloudflare/golz4@ef862a3cdc58a6f1fee4e3af3d44fbe279194cde](https://github.com/cloudflare/golz4.git) | BSD-3-Clause | [CQ](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=23552) | | ||
| [github.com/coreos/go-systemd@fd7a80b32e1fc73e890fde45604ed5009dc817a3](https://github.com/coreos/go-systemd.git) | Apache-2.0 | [CQ](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=23553) | | ||
|
@@ -589,3 +589,4 @@ | |
| [sigs.k8s.io/[email protected]](https://github.com/kubernetes-sigs/json) | Apache-2.0 AND BSD-3-Clause AND NOASSERTION | [clearlydefined](https://clearlydefined.io/definitions/git/github/kubernetes-sigs/json/f223a00ba0e27f539157f69f9c919c204ea7f40b) | | ||
| [github.com/google/[email protected]](https://github.com/kubernetes-sigs/json) | Apache-2.0 | [clearlydefined](https://clearlydefined.io/definitions/go/golang/github.com%2Fgoogle/gnostic/v0.5.7-v3refs) | | ||
| [github.com/go-task/[email protected]](https://github.com/go-task/slim-sprig.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/git/github/go-task/slim-sprig/52ccab3ef572c7e1a2c258be183f9a9296d60152) | | ||
| [github.com/josharian/[email protected]](https://github.com/josharian/intern.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/git/github/josharian/intern/8e6ff32b3e7c0b018c43953085fe2ac330fe9acd) | |
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,66 @@ | ||
// | ||
// Copyright (c) 2019-2024 Red Hat, Inc. | ||
// This program and the accompanying materials are made | ||
// available under the terms of the Eclipse Public License 2.0 | ||
// which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
// | ||
// SPDX-License-Identifier: EPL-2.0 | ||
// | ||
// Contributors: | ||
// Red Hat, Inc. - initial API and implementation | ||
// | ||
|
||
package usernamespace | ||
|
||
import ( | ||
dwconstants "github.com/devfile/devworkspace-operator/pkg/constants" | ||
"github.com/eclipse-che/che-operator/pkg/common/utils" | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
) | ||
|
||
type configMap2Sync struct { | ||
Object2Sync | ||
|
||
cm *corev1.ConfigMap | ||
version string | ||
} | ||
|
||
func (p *configMap2Sync) getSrcObject() client.Object { | ||
return p.cm | ||
} | ||
|
||
func (p *configMap2Sync) getGKV() schema.GroupVersionKind { | ||
return v1ConfigMapGKV | ||
} | ||
|
||
func (p *configMap2Sync) newDstObject() client.Object { | ||
dst := p.cm.DeepCopyObject() | ||
// We have to set the ObjectMeta fields explicitly, because | ||
// existed object contains unnecessary fields that we don't want to copy | ||
dst.(*corev1.ConfigMap).ObjectMeta = metav1.ObjectMeta{ | ||
Name: p.cm.GetName(), | ||
Annotations: p.cm.GetAnnotations(), | ||
Labels: utils.MergeMaps([]map[string]string{ | ||
p.cm.GetLabels(), | ||
{ | ||
dwconstants.DevWorkspaceWatchConfigMapLabel: "true", | ||
dwconstants.DevWorkspaceMountLabel: "true", | ||
}}), | ||
} | ||
|
||
return dst.(client.Object) | ||
} | ||
|
||
func (p *configMap2Sync) getSrcObjectVersion() string { | ||
if len(p.version) == 0 { | ||
return p.cm.GetResourceVersion() | ||
} | ||
return p.version | ||
} | ||
|
||
func (p *configMap2Sync) hasROSpec() bool { | ||
return false | ||
} |
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.