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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[teleport-update] Add enable command #47565

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 0 additions & 132 deletions lib/autoupdate/agent.go
sclevine marked this conversation as resolved.
Outdated
Show resolved Hide resolved

This file was deleted.

26 changes: 26 additions & 0 deletions lib/autoupdate/agent/feature_ent.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//go:build webassets_ent
// +build webassets_ent

/*
* Teleport
* Copyright (C) 2024 Gravitational, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package agent

func init() {
featureFlag |= flagEnt
Copy link
Contributor

Choose a reason for hiding this comment

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

It's the first time I see something like this. How exactly does it work? Is there some sort of conditional compilation built into our makefiles?

Copy link
Member Author

Choose a reason for hiding this comment

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

I copied this from #47466. Both the client and agent packages will use the same flag set from lib/autoupdate in an upcoming PR. The build flags should be set when compiled via teleport.e. See the top of the file:

//go:build webassets_ent
// +build webassets_ent

@vapopov I'm noticing now that this flag is only used in webassets_embed_ent.go, and the webassets prefix is confusing in this non-web-asset context. Would it make sense to look into making this flag more generic?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, I previously mentioned about this one #46587 (comment) since we don't have proper build flag for ent

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use the modules package for this instead of making new flags? This package can already tell you if the binary is OSS, Enterprise, FIPS, etc.

Copy link
Member Author

@sclevine sclevine Oct 18, 2024

Choose a reason for hiding this comment

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

Maybe we open a separate PR that renames the build flag so that it can be used in a wider context? (race condition on the Github comments)

Copy link
Member Author

@sclevine sclevine Oct 18, 2024

Choose a reason for hiding this comment

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

I don't think modules.GetModules().IsEnterpriseBuild() will work as-is for teleport-update, since it doesn't have a separate tool/teleport-update target in teleport.e that runs modules.SetModules().

That said, we actually want the edition of the agent download to come from the cluster via /webapi/find before this ships, so I'll just default it to false and add a TODO for now.

@vapopov you should be able to modules for tsh and tctl, but tbot may not work for the reason mentioned.

}
26 changes: 26 additions & 0 deletions lib/autoupdate/agent/feature_fips.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//go:build fips
// +build fips

/*
* Teleport
* Copyright (C) 2024 Gravitational, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package agent

func init() {
featureFlag |= flagFIPS
}
Loading
Loading