feat(ui): hide sync option 'replace' if sync with replace is disabled in the server (issue no. #22625) (#22647)

Signed-off-by: jan-mrm <67435696+jan-mrm@users.noreply.github.com>
This commit is contained in:
jan-mrm 2025-10-06 15:48:06 +02:00 committed by GitHub
parent 30abebda3d
commit afaf16b808
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 153 additions and 89 deletions

3
assets/swagger.json generated
View file

@ -5619,6 +5619,9 @@
"statusBadgeRootUrl": {
"type": "string"
},
"syncWithReplaceAllowed": {
"type": "boolean"
},
"trackingMethod": {
"type": "string"
},

View file

@ -105,6 +105,7 @@ type Settings struct {
InstallationID string `protobuf:"bytes,26,opt,name=installationID,proto3" json:"installationID,omitempty"`
AdditionalURLs []string `protobuf:"bytes,27,rep,name=additionalUrls,proto3" json:"additionalUrls,omitempty"`
HydratorEnabled bool `protobuf:"varint,28,opt,name=hydratorEnabled,proto3" json:"hydratorEnabled,omitempty"`
SyncWithReplaceAllowed bool `protobuf:"varint,29,opt,name=syncWithReplaceAllowed,proto3" json:"syncWithReplaceAllowed,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@ -339,6 +340,13 @@ func (m *Settings) GetHydratorEnabled() bool {
return false
}
func (m *Settings) GetSyncWithReplaceAllowed() bool {
if m != nil {
return m.SyncWithReplaceAllowed
}
return false
}
type GoogleAnalyticsConfig struct {
TrackingID string `protobuf:"bytes,1,opt,name=trackingID,proto3" json:"trackingID,omitempty"`
AnonymizeUsers bool `protobuf:"varint,2,opt,name=anonymizeUsers,proto3" json:"anonymizeUsers,omitempty"`
@ -772,88 +780,90 @@ func init() {
func init() { proto.RegisterFile("server/settings/settings.proto", fileDescriptor_a480d494da040caa) }
var fileDescriptor_a480d494da040caa = []byte{
// 1291 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xc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99, 0xcc, 0xf7, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x0b, 0x1a,
0xe6, 0x75, 0x88, 0x0c, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -1027,6 +1037,18 @@ func (m *Settings) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i -= len(m.XXX_unrecognized)
copy(dAtA[i:], m.XXX_unrecognized)
}
if m.SyncWithReplaceAllowed {
i--
if m.SyncWithReplaceAllowed {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x1
i--
dAtA[i] = 0xe8
}
if m.HydratorEnabled {
i--
if m.HydratorEnabled {
@ -1847,6 +1869,9 @@ func (m *Settings) Size() (n int) {
if m.HydratorEnabled {
n += 3
}
if m.SyncWithReplaceAllowed {
n += 3
}
if m.XXX_unrecognized != nil {
n += len(m.XXX_unrecognized)
}
@ -3041,6 +3066,26 @@ func (m *Settings) Unmarshal(dAtA []byte) error {
}
}
m.HydratorEnabled = bool(v != 0)
case 29:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field SyncWithReplaceAllowed", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSettings
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.SyncWithReplaceAllowed = bool(v != 0)
default:
iNdEx = preIndex
skippy, err := skipSettings(dAtA[iNdEx:])

View file

@ -1071,7 +1071,7 @@ func newArgoCDServiceSet(a *ArgoCDServer) *ArgoCDServiceSet {
projectService := project.NewServer(a.Namespace, a.KubeClientset, a.AppClientset, a.enf, projectLock, a.sessionMgr, a.policyEnforcer, a.projInformer, a.settingsMgr, a.db, a.EnableK8sEvent)
appsInAnyNamespaceEnabled := len(a.ApplicationNamespaces) > 0
settingsService := settings.NewServer(a.settingsMgr, a.RepoClientset, a, a.DisableAuth, appsInAnyNamespaceEnabled, a.HydratorEnabled)
settingsService := settings.NewServer(a.settingsMgr, a.RepoClientset, a, a.DisableAuth, appsInAnyNamespaceEnabled, a.HydratorEnabled, a.SyncWithReplaceAllowed)
accountService := account.NewServer(a.sessionMgr, a.settingsMgr, a.enf)
notificationService := notification.NewServer(a.apiFactory)

View file

@ -25,6 +25,7 @@ type Server struct {
disableAuth bool
appsInAnyNamespaceEnabled bool
hydratorEnabled bool
syncWithReplaceAllowed bool
}
type Authenticator interface {
@ -32,8 +33,8 @@ type Authenticator interface {
}
// NewServer returns a new instance of the Settings service
func NewServer(mgr *settings.SettingsManager, repoClient apiclient.Clientset, authenticator Authenticator, disableAuth, appsInAnyNamespaceEnabled bool, hydratorEnabled bool) *Server {
return &Server{mgr: mgr, repoClient: repoClient, authenticator: authenticator, disableAuth: disableAuth, appsInAnyNamespaceEnabled: appsInAnyNamespaceEnabled, hydratorEnabled: hydratorEnabled}
func NewServer(mgr *settings.SettingsManager, repoClient apiclient.Clientset, authenticator Authenticator, disableAuth, appsInAnyNamespaceEnabled bool, hydratorEnabled bool, syncWithReplaceAllowed bool) *Server {
return &Server{mgr: mgr, repoClient: repoClient, authenticator: authenticator, disableAuth: disableAuth, appsInAnyNamespaceEnabled: appsInAnyNamespaceEnabled, hydratorEnabled: hydratorEnabled, syncWithReplaceAllowed: syncWithReplaceAllowed}
}
// Get returns Argo CD settings
@ -122,6 +123,7 @@ func (s *Server) Get(ctx context.Context, _ *settingspkg.SettingsQuery) (*settin
AppsInAnyNamespaceEnabled: s.appsInAnyNamespaceEnabled,
ImpersonationEnabled: argoCDSettings.ImpersonationEnabled,
HydratorEnabled: s.hydratorEnabled,
SyncWithReplaceAllowed: s.syncWithReplaceAllowed,
}
if sessionmgr.LoggedIn(ctx) || s.disableAuth {

View file

@ -46,6 +46,7 @@ message Settings {
string installationID = 26;
repeated string additionalUrls = 27 [(gogoproto.customname) = "AdditionalURLs"];
bool hydratorEnabled = 28;
bool syncWithReplaceAllowed = 29;
}
message GoogleAnalyticsConfig {

View file

@ -1,9 +1,10 @@
import {Checkbox, Select, Tooltip} from 'argo-ui';
import {Checkbox, DataLoader, Select, Tooltip} from 'argo-ui';
import * as classNames from 'classnames';
import * as React from 'react';
import * as ReactForm from 'react-form';
import './application-sync-options.scss';
import {services} from '../../../shared/services';
export const REPLACE_WARNING = `The resources will be synced using 'kubectl replace/create' command that is a potentially destructive action and might cause resources recreation. For example, it might cause a number of pods to be reset to the minimum number of replicas and cause them to become overloaded.`;
export const FORCE_WARNING = `The resources will be synced using '--force' that is a potentially destructive action and will immediately remove resources from the API and bypasses graceful deletion. Immediate deletion of some resources may result in inconsistency or data loss.`;
@ -111,9 +112,20 @@ export const ApplicationSyncOptions = (props: ApplicationSyncOptionProps) => (
{render(props)}
</div>
))}
<div className='small-12' style={optionStyle}>
{booleanOption('Replace', 'Replace', false, props, false, REPLACE_WARNING)}
</div>
<DataLoader
load={async () => {
const settings = await services.authService.settings();
return settings.syncWithReplaceAllowed;
}}>
{syncWithReplaceAllowed =>
(syncWithReplaceAllowed && (
<div className='small-12' style={optionStyle}>
{booleanOption('Replace', 'Replace', false, props, false, REPLACE_WARNING)}
</div>
)) ||
null
}
</DataLoader>
</div>
);

View file

@ -584,6 +584,7 @@ export interface AuthSettings {
execEnabled: boolean;
appsInAnyNamespaceEnabled: boolean;
hydratorEnabled: boolean;
syncWithReplaceAllowed: boolean;
}
export interface UserInfo {