-
Notifications
You must be signed in to change notification settings - Fork 2.2k
(PUP-9025) Remove filebucket type server/port defaults #7384
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
(PUP-9025) Remove filebucket type server/port defaults #7384
Conversation
So, Josh is right. Before this change, if both In this test, here are what
with the change in this pr:
without this change:
|
The fileucket type should not have a default set for server or port. We have logic built in to find both of those pieces of information if they aren't explicitely set in the resource manifest. We should be using that default logic rather than arbitrarily setting these defaults for the user. This wouldn't be in such a compicated state currently if it weren't for the confusion between `server` and `server_list`. Right now, `puppet agent` and friends prefer `server_list` over server. The filebucket application also prefers `server_list` over `server`. If `server_list` is not set, we should use `server`. Removing these defaults, we get closer parity between how the filebucket application and the filebucket resource behave when picking what server to hit.
751599d
to
cdb9dba
Compare
jenkins please test this |
This may not be the most ideal thing to merge into a z release, as @joshcooper mentioned. Let's make sure this is what we want to do. |
Since finding a default server is logic that happens elsewhere, I wasn't sure if we need/want tests for which server is picked up |
CLA signed by all contributors. |
desc "The server providing the remote filebucket service. Defaults to the | ||
value of the `server` setting (that is, the currently configured | ||
puppet master server). | ||
desc "The server providing the remote filebucket service. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if I should add any indication of the logic the indirector goes through to return a server to use
030b444
to
ce788a6
Compare
ce788a6
to
7926e3e
Compare
jenkins please test this with servertests |
This is unrelated to this PR, but this output is unexpected to me:
I'd expect the setting to be printed as it would appear in
I'd expect the def print(value)
vals = super(value)
vals.join(',')
end And for def print(value)
vals = munge(value)
super(vals.map { |v| v.join(':') })
end Could you file a new ticket for that and add it to the epic? |
Maybe I defined
Otherwise, I'm definitely happy to open a ticket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified if an explicit server
is omitted from the filebucket
resource, then the agent will use the "currently selected" server when backing up files during catalog application. The "currently selected" server is either the first available server from server_list
or server
, in that order.
filebucket { 'main':
path => false, # This is required for remote filebuckets.
}
File { backup => main, }
file { '/tmp/filebucket':
ensure => file,
content => $facts['content']
}
On the other hand, if an explicit server
is specified in the filebucket resource, then the agent will use that always:
...
filebucket { 'main':
path => false, # This is required for remote filebuckets.
server => 'puppet.example.com', # Optional; defaults to the configured puppet master.
}
The fileucket type should not have a default set for server or port. We
have logic built in to find both of those pieces of information if they
aren't explicitely set in the resource manifest. We should be using that
default logic rather than arbitrarily setting these defaults for the user.
This wouldn't be in such a compicated state currently if it weren't for
the confusion between
server
andserver_list
. Right now,puppet agent
and friends prefer
server_list
over server. The filebucket applicationalso prefers
server_list
overserver
. Ifserver_list
is not set,we should use
server
.Removing these defaults, we get closer parity between how the filebucket
application and the filebucket resource behave when picking what server
to hit.